CmdBean.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Xml.Serialization;
  7. using Wit;
  8. using Wit.SDK;
  9. using Wit.SDK.Modular;
  10. using Wit.SDK.Modular.Sensor;
  11. using Wit.SDK.Modular.Sensor.Device.Entity;
  12. namespace Wit.SDK.Modular.Sensor.Device.Entity
  13. {
  14. public class CmdBean
  15. {
  16. [XmlIgnore]
  17. private string _sendData = "";
  18. /// <summary>
  19. /// 命令
  20. /// </summary>
  21. public string sendData
  22. {
  23. get
  24. {
  25. return _sendData;
  26. }
  27. set
  28. {
  29. _sendData = value;
  30. //if (!value.Equals(_sendData))
  31. //{
  32. // _sendData = value;
  33. // NotifyPropertyChange(nameof(sendData));
  34. //}
  35. }
  36. }
  37. private int _valueLength = 0;
  38. public int valueLength
  39. {
  40. get
  41. {
  42. return _valueLength;
  43. }
  44. set
  45. {
  46. _valueLength = value;
  47. //NotifyPropertyChange(nameof(valueLength));
  48. }
  49. }
  50. [XmlIgnore]
  51. private bool _sendHex = false;
  52. /// <summary>
  53. /// 是否十六进制处理
  54. /// </summary>
  55. public bool sendHex
  56. {
  57. get
  58. {
  59. return _sendHex;
  60. }
  61. set
  62. {
  63. if (!value.Equals(_sendHex))
  64. {
  65. _sendHex = value;
  66. //NotifyPropertyChange(nameof(sendHex));
  67. }
  68. }
  69. }
  70. [XmlIgnore]
  71. private bool _sendNewLine = false;
  72. /// <summary>
  73. /// 是否添加换行
  74. /// </summary>
  75. public bool sendNewLine
  76. {
  77. get
  78. {
  79. return _sendNewLine;
  80. }
  81. set
  82. {
  83. _sendNewLine = value;
  84. //NotifyPropertyChange(nameof(sendNewLine));
  85. }
  86. }
  87. [XmlIgnore]
  88. private string _sendParseValue = "";
  89. public string sendParseValue
  90. {
  91. get
  92. {
  93. return _sendParseValue;
  94. }
  95. set
  96. {
  97. if (!value.Equals(_sendParseValue))
  98. _sendParseValue = value;
  99. }
  100. }
  101. [XmlIgnore]
  102. private int _delay = 100;
  103. /// <summary>
  104. /// 延时时间
  105. /// </summary>
  106. public int delay
  107. {
  108. get
  109. {
  110. return _delay;
  111. }
  112. set
  113. {
  114. if (!value.Equals(_delay))
  115. {
  116. _delay = value;
  117. //NotifyPropertyChange(nameof(delay));
  118. }
  119. }
  120. }
  121. [XmlIgnore]
  122. private string _statsText = "";
  123. public string statsText
  124. {
  125. get
  126. {
  127. return _statsText;
  128. }
  129. set
  130. {
  131. _statsText = value;
  132. //NotifyPropertyChange(nameof(statsText));
  133. }
  134. }
  135. /// <summary>
  136. /// new Property<string>("", "发送数据完成后对上位机进行调整的指令\r\n" +
  137. // "SetBaud:deviceName:Baud //设置设备波特率\r\n" +
  138. // "SetBaud:modeName //更改上位机模式\r\n" +
  139. // "SearchDevice //让上位机开始搜索\r\n" +
  140. // "SetModbusDeviceId:deviceName:ModbusId:isHex//设置设备ModbusID", "发送数据");
  141. /// </summary>
  142. [XmlIgnore]
  143. private string _sendEndCmd = "";
  144. public string sendEndCmd
  145. {
  146. get
  147. {
  148. return _sendEndCmd;
  149. }
  150. set
  151. {
  152. _sendEndCmd = value;
  153. }
  154. }
  155. [XmlIgnore]
  156. private int _sort = 0;
  157. public int sort
  158. {
  159. get => _sort;
  160. set
  161. {
  162. _sort = value;
  163. }
  164. }
  165. }
  166. }