MotionAxisStatus.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using Prism.Mvvm;
  2. using System;
  3. namespace SKMC.Api.Motion.Model
  4. {
  5. /// <summary>
  6. /// 电机状态模型
  7. /// </summary>
  8. public class MotionAxisStatus : BindableBase
  9. {
  10. private byte _isEnable;
  11. /// <summary>
  12. /// 轴是否打开使能
  13. /// </summary>
  14. public byte IsEnable
  15. {
  16. get { return _isEnable; }
  17. set { _isEnable = value; RaisePropertyChanged(); }
  18. }
  19. private byte _isBusy;
  20. /// <summary>
  21. /// 轴是否忙(运动)
  22. /// </summary>
  23. public byte IsBusy
  24. {
  25. get { return _isBusy; }
  26. set { _isBusy = value; RaisePropertyChanged(); }
  27. }
  28. private byte _isOutBound;
  29. /// <summary>
  30. /// 轴是否越限
  31. /// </summary>
  32. public byte IsOutBound
  33. {
  34. get { return _isOutBound; }
  35. set { _isOutBound = value; RaisePropertyChanged(); }
  36. }
  37. private byte _isDone;
  38. /// <summary>
  39. /// 轴是否到位
  40. /// </summary>
  41. public byte IsDone
  42. {
  43. get { return _isDone; }
  44. set { _isDone = value; RaisePropertyChanged(); }
  45. }
  46. private byte _isAlarm;
  47. /// <summary>
  48. /// 轴是否报警
  49. /// </summary>
  50. public byte IsAlarm
  51. {
  52. get { return _isAlarm; }
  53. set { _isAlarm = value; RaisePropertyChanged(); }
  54. }
  55. private byte _isHomed;
  56. /// <summary>
  57. /// 轴是否已回零
  58. /// </summary>
  59. public byte IsHomed
  60. {
  61. get { return _isHomed; }
  62. set { _isHomed = value; RaisePropertyChanged(); }
  63. }
  64. private byte _isBreak;
  65. /// <summary>
  66. /// 轴是否已刹车
  67. /// </summary>
  68. public byte IsBreak
  69. {
  70. get { return _isBreak; }
  71. set { _isBreak = value; RaisePropertyChanged(); }
  72. }
  73. private byte _isORG;
  74. /// <summary>
  75. /// 是否触发原点
  76. /// </summary>
  77. public byte IsORG
  78. {
  79. get { return _isORG; }
  80. set { _isORG = value; RaisePropertyChanged(); }
  81. }
  82. private byte _isPEL;
  83. /// <summary>
  84. /// 是否触发正限位
  85. /// </summary>
  86. public byte IsPEL
  87. {
  88. get { return _isPEL; }
  89. set { _isPEL = value; RaisePropertyChanged(); }
  90. }
  91. private byte _isNEL;
  92. /// <summary>
  93. /// 是否触发负限位
  94. /// </summary>
  95. public byte IsNEL
  96. {
  97. get { return _isNEL; }
  98. set { _isNEL = value; RaisePropertyChanged(); }
  99. }
  100. private double _prf;
  101. /// <summary>
  102. /// 运行目标值
  103. /// </summary>
  104. public double PRF
  105. {
  106. get { return _prf; }
  107. set { _prf = value; RaisePropertyChanged(); }
  108. }
  109. private double _enc;
  110. /// <summary>
  111. /// 当前反馈值
  112. /// </summary>
  113. public double ENC
  114. {
  115. get { return _enc; }
  116. set { _enc = value; RaisePropertyChanged(); }
  117. }
  118. #region watch data
  119. public long StartTicks { get; set; }
  120. public long WatchTicks { get => DateTime.Now.Ticks - StartTicks; }
  121. public double StartPos { get; set; }
  122. public double WatchPos { get => _enc - StartPos; }
  123. #endregion
  124. }
  125. }