FeederClearWork.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using TeamAAS_VP.Enums;
  8. namespace TeamAAS_VP.Models.Feeder
  9. {
  10. public class FeederClearWork : BindableBase
  11. {
  12. private Guid _Id;
  13. /// <summary>
  14. /// 唯一任务 Id
  15. /// </summary>
  16. public Guid Id
  17. {
  18. get { return _Id; }
  19. set { SetProperty(ref _Id, value); }
  20. }
  21. private int _TaskCode;
  22. /// <summary>
  23. /// 可用于外部引用的任务代码(可选)
  24. /// </summary>
  25. public int TaskCode
  26. {
  27. get { return _TaskCode; }
  28. set { SetProperty(ref _TaskCode, value); }
  29. }
  30. private Guid _FeederId;
  31. /// <summary>
  32. /// 关联的 Feeder Id(可选)
  33. /// </summary>
  34. public Guid FeederId
  35. {
  36. get { return _FeederId; }
  37. set { SetProperty(ref _FeederId, value); }
  38. }
  39. private string _FeederName;
  40. /// <summary>
  41. /// 关联的 Feeder 名称(可选)
  42. /// </summary>
  43. public string FeederName
  44. {
  45. get { return _FeederName; }
  46. set { SetProperty(ref _FeederName, value); }
  47. }
  48. private string _Name;
  49. public string Name
  50. {
  51. get { return _Name; }
  52. set { SetProperty(ref _Name, value); }
  53. }
  54. private string _Description;
  55. /// <summary>
  56. /// 任务描述
  57. /// </summary>
  58. public string Description
  59. {
  60. get { return _Description; }
  61. set { SetProperty(ref _Description, value); }
  62. }
  63. private DateTime _CreateTime;
  64. public DateTime CreateTime
  65. {
  66. get { return _CreateTime; }
  67. set { SetProperty(ref _CreateTime, value); }
  68. }
  69. private VibrationFunction _BeforeOutput;
  70. /// <summary>
  71. /// 清料前输出信号
  72. /// </summary>
  73. public VibrationFunction BeforeOutput
  74. {
  75. get { return _BeforeOutput; }
  76. set { SetProperty(ref _BeforeOutput, value); }
  77. }
  78. private bool _BeforeScript;
  79. public bool BeforeScript
  80. {
  81. get { return _BeforeScript; }
  82. set { SetProperty(ref _BeforeScript, value); }
  83. }
  84. private VibrationFunction _BackOutput;
  85. /// <summary>
  86. /// 清料后输出信号
  87. /// </summary>
  88. public VibrationFunction BackOutput
  89. {
  90. get { return _BackOutput; }
  91. set { SetProperty(ref _BackOutput, value); }
  92. }
  93. private bool _BackScript;
  94. public bool BackScript
  95. {
  96. get { return _BackScript; }
  97. set { SetProperty(ref _BackScript, value); }
  98. }
  99. private FeederWorks _FeederWorks;
  100. /// <summary>
  101. /// Feeder振动集合
  102. /// </summary>
  103. public FeederWorks FeederWorks
  104. {
  105. get { return _FeederWorks; }
  106. set { SetProperty(ref _FeederWorks, value); }
  107. }
  108. private int _ClearCount;
  109. public int ClearCount
  110. {
  111. get { return _ClearCount; }
  112. set { SetProperty(ref _ClearCount, value); }
  113. }
  114. private int _VibrationCount;
  115. public int VibrationCount
  116. {
  117. get { return _VibrationCount; }
  118. set { SetProperty(ref _VibrationCount, value); }
  119. }
  120. private bool _Enabled = true;
  121. /// <summary>
  122. /// 任务是否启用
  123. /// </summary>
  124. public bool Enabled
  125. {
  126. get { return _Enabled; }
  127. set { SetProperty(ref _Enabled, value); }
  128. }
  129. public FeederClearWork()
  130. {
  131. Id = Guid.NewGuid();
  132. CreateTime = DateTime.Now;
  133. FeederWorks = new FeederWorks();
  134. TaskCode = 0;
  135. Description = string.Empty;
  136. }
  137. public FeederClearWork Copy()
  138. {
  139. return new FeederClearWork
  140. {
  141. Id = this.Id,
  142. FeederId = this.FeederId,
  143. TaskCode = this.TaskCode,
  144. Name = this.Name,
  145. Description = this.Description,
  146. CreateTime = this.CreateTime,
  147. BeforeOutput = this.BeforeOutput,
  148. BeforeScript = this.BeforeScript,
  149. BackOutput = this.BackOutput,
  150. BackScript = this.BackScript,
  151. FeederWorks = this.FeederWorks?.Copy(),
  152. ClearCount = this.ClearCount,
  153. VibrationCount = this.VibrationCount,
  154. Enabled = this.Enabled
  155. };
  156. }
  157. }
  158. }