123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- using MECF.Framework.Common.CommonData;
- using System.Runtime.Serialization;
- namespace MECF.Framework.Common.Simulator
- {
- /// <summary>
- /// 电机运动阶段
- /// </summary>
- public enum MotionPhase
- {
- Accelerating,
- Decelerating,
- ConstantSpeed
- };
- [DataContract]
- public class SimulatorMotionData : NotifiableItem
- {
- #region 属性
- [DataMember]
- public bool SwitchSignal
- {
- get { return _switchSignal; }
- set { _switchSignal = value; InvokePropertyChanged(nameof(SwitchSignal)); }
- }
- [DataMember]
- public byte StopCode
- {
- get { return _stopCode; }
- set { _stopCode = value; InvokePropertyChanged(nameof(StopCode)); }
- }
- [DataMember]
- public int PositionError
- {
- get { return _positionError; }
- set { _positionError = value; InvokePropertyChanged(nameof(StopCode)); }
- }
- [DataMember]
- public int ActualPosition
- {
- get { return _actualPosition; }
- set { _actualPosition = value; InvokePropertyChanged(nameof(ActualPosition)); }
- }
- [DataMember]
- public int ActualVelocity
- {
- get { return _actualVelocity; }
- set { _actualVelocity = value; InvokePropertyChanged(nameof(ActualVelocity)); }
- }
- [DataMember]
- public int ActualAccel
- {
- get { return _actualAccel; }
- set { _actualAccel = value; InvokePropertyChanged(nameof(ActualAccel)); }
- }
- [DataMember]
- public int ActualDecel
- {
- get { return _actualDecel; }
- set { _actualDecel = value; InvokePropertyChanged(nameof(ActualDecel)); }
- }
- [DataMember]
- public short ActualTorque
- {
- get { return _actualTorque; }
- set { _actualTorque = value; InvokePropertyChanged(nameof(ActualTorque)); }
- }
- [DataMember]
- public int TargetPosition
- {
- get { return _targetPosition; }
- set { _targetPosition = value; InvokePropertyChanged(nameof(TargetPosition)); }
- }
- [DataMember]
- public int TargetVelocity
- {
- get { return _targetVelocity; }
- set { _targetVelocity = value; InvokePropertyChanged(nameof(TargetVelocity)); }
- }
- [DataMember]
- public int TargetAccel
- {
- get { return _targetAccel; }
- set { _targetAccel = value; InvokePropertyChanged(nameof(TargetAccel)); }
- }
- [DataMember]
- public int TargetDecel
- {
- get { return _targetDecel; }
- set { _targetDecel = value; InvokePropertyChanged(nameof(TargetDecel)); }
- }
- [DataMember]
- public short TargetTorque
- {
- get { return _targetTorque; }
- set { _targetTorque = value; InvokePropertyChanged(nameof(TargetTorque)); }
- }
- [DataMember]
- public int HomingVelocity
- {
- get { return _homingVelocity; }
- set { _homingVelocity = value; InvokePropertyChanged(nameof(HomingVelocity)); }
- }
- [DataMember]
- public int HomingOffSet
- {
- get { return _homingOffSet; }
- set { _homingOffSet = value; InvokePropertyChanged(nameof(HomingOffSet)); }
- }
- [DataMember]
- public int HomingTimeout
- {
- get { return _homingTimeOut; }
- set { _homingTimeOut = value; InvokePropertyChanged(nameof(HomingTimeout)); }
- }
- [DataMember]
- public int HomingAccel
- {
- get { return _homingAccel; }
- set { _homingAccel = value; InvokePropertyChanged(nameof(HomingAccel)); }
- }
- [DataMember]
- public int HomingDecel
- {
- get { return _homingDecel; }
- set { _homingDecel = value; InvokePropertyChanged(nameof(HomingDecel)); }
- }
- [DataMember]
- public int RevSoftLimit
- {
- get { return _revSoftLimit; }
- set { _revSoftLimit = value; InvokePropertyChanged(nameof(RevSoftLimit)); }
- }
- [DataMember]
- public int FwdSoftLimit
- {
- get { return _fwdSoftLimit; }
- set { _fwdSoftLimit = value; InvokePropertyChanged(nameof(FwdSoftLimit)); }
- }
- [DataMember]
- public int NegativeTorqueLimit
- {
- get { return _negativeTorqueLimit; }
- set { _negativeTorqueLimit = value; InvokePropertyChanged(nameof(NegativeTorqueLimit)); }
- }
- [DataMember]
- public int PositiveTorqueLimit
- {
- get { return _positiveTorqueLimit; }
- set { _positiveTorqueLimit = value; InvokePropertyChanged(nameof(PositiveTorqueLimit)); }
- }
- [DataMember]
- public bool HomingSignal
- {
- get { return _homingSignal; }
- set { _homingSignal = value; InvokePropertyChanged(nameof(HomingSignal)); }
- }
- [DataMember]
- public bool MotionSignal
- {
- get { return _motionSignal; }
- set { _motionSignal = value; InvokePropertyChanged(nameof(MotionSignal)); }
- }
- [DataMember]
- public MotionPhase MotionPhase
- {
- get { return _motionPhase; }
- set { _motionPhase = value; InvokePropertyChanged(nameof(MotionPhase)); }
- }
- [DataMember]
- public bool StopSignal
- {
- get { return _stopSignal; }
- set { _stopSignal = value; InvokePropertyChanged(nameof(StopSignal)); }
- }
- #endregion
- #region 内部变量
- #region Signal
- private bool _switchSignal;
- private bool _homingSignal;
- private bool _motionSignal;
- private bool _stopSignal;
- private MotionPhase _motionPhase;
- #endregion
- private byte _stopCode;
- private int _positionError;
- /// <summary>
- /// 实际参数
- /// </summary>
- private int _actualPosition;
- private int _actualVelocity;
- private int _actualAccel;
- private int _actualDecel;
- private short _actualTorque;
- /// <summary>
- /// 设定参数
- /// </summary>
- private int _targetPosition;
- private int _targetVelocity;
- private int _targetAccel;
- private int _targetDecel;
- private short _targetTorque;
- /// <summary>
- /// Home相关设定参数
- /// </summary>
- private int _homingVelocity;
- private int _homingOffSet;
- private int _homingTimeOut;
- private int _homingAccel;
- private int _homingDecel;
- private int _revSoftLimit;
- private int _fwdSoftLimit;
- private int _negativeTorqueLimit;
- private int _positiveTorqueLimit;
-
- #endregion
- }
- }
|