using Prism.Mvvm;
using System;
namespace SKMC.Api.Motion.Model
{
///
/// 电机状态模型
///
public class MotionAxisStatus : BindableBase
{
private byte _isEnable;
///
/// 轴是否打开使能
///
public byte IsEnable
{
get { return _isEnable; }
set { _isEnable = value; RaisePropertyChanged(); }
}
private byte _isBusy;
///
/// 轴是否忙(运动)
///
public byte IsBusy
{
get { return _isBusy; }
set { _isBusy = value; RaisePropertyChanged(); }
}
private byte _isOutBound;
///
/// 轴是否越限
///
public byte IsOutBound
{
get { return _isOutBound; }
set { _isOutBound = value; RaisePropertyChanged(); }
}
private byte _isDone;
///
/// 轴是否到位
///
public byte IsDone
{
get { return _isDone; }
set { _isDone = value; RaisePropertyChanged(); }
}
private byte _isAlarm;
///
/// 轴是否报警
///
public byte IsAlarm
{
get { return _isAlarm; }
set { _isAlarm = value; RaisePropertyChanged(); }
}
private byte _isHomed;
///
/// 轴是否已回零
///
public byte IsHomed
{
get { return _isHomed; }
set { _isHomed = value; RaisePropertyChanged(); }
}
private byte _isBreak;
///
/// 轴是否已刹车
///
public byte IsBreak
{
get { return _isBreak; }
set { _isBreak = value; RaisePropertyChanged(); }
}
private byte _isORG;
///
/// 是否触发原点
///
public byte IsORG
{
get { return _isORG; }
set { _isORG = value; RaisePropertyChanged(); }
}
private byte _isPEL;
///
/// 是否触发正限位
///
public byte IsPEL
{
get { return _isPEL; }
set { _isPEL = value; RaisePropertyChanged(); }
}
private byte _isNEL;
///
/// 是否触发负限位
///
public byte IsNEL
{
get { return _isNEL; }
set { _isNEL = value; RaisePropertyChanged(); }
}
private double _prf;
///
/// 运行目标值
///
public double PRF
{
get { return _prf; }
set { _prf = value; RaisePropertyChanged(); }
}
private double _enc;
///
/// 当前反馈值
///
public double ENC
{
get { return _enc; }
set { _enc = value; RaisePropertyChanged(); }
}
#region watch data
public long StartTicks { get; set; }
public long WatchTicks { get => DateTime.Now.Ticks - StartTicks; }
public double StartPos { get; set; }
public double WatchPos { get => _enc - StartPos; }
#endregion
}
}