终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataTypeEnum.cs 4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BPASmartClient.SCADAControl
  8. {
  9. /// <summary>
  10. /// 数据来源类型
  11. /// </summary>
  12. public enum DataTypeEnum
  13. {
  14. /// <summary>
  15. /// POST接口,GET接口
  16. /// </summary>
  17. API接口,
  18. /// <summary>
  19. /// 接收主题MQTT数据
  20. /// </summary>
  21. MQTT,
  22. /// <summary>
  23. /// Redis拉取数据
  24. /// </summary>
  25. Redis,
  26. /// <summary>
  27. /// 本地数据推送
  28. /// </summary>
  29. 本地源,
  30. /// <summary>
  31. /// 特定服务推送数据
  32. /// </summary>
  33. 服务推送,
  34. /// <summary>
  35. /// 静态数据
  36. /// </summary>
  37. 静态数据
  38. }
  39. /// <summary>
  40. /// 运行状态-枚举
  41. /// </summary>
  42. public enum InterfaceModeEnum
  43. {
  44. POST,
  45. GET,
  46. PUT
  47. }
  48. /// <summary>
  49. /// 数据类型枚举
  50. /// </summary>
  51. public enum EDataType
  52. {
  53. Bool = 1,
  54. Byte = 2,
  55. Int = 3,
  56. Word = 4,
  57. Dint = 5,
  58. Dword = 6,
  59. Float = 7,
  60. Double = 8,
  61. String = 9,
  62. }
  63. public class ReeisDataModel
  64. {
  65. public string VarName { get; set; }
  66. public string VarVaule { get; set; }
  67. public EDataType DataType { get; set; }
  68. }
  69. public class PublishModel
  70. {
  71. /// <summary>
  72. /// 设备名称
  73. /// </summary>
  74. public string DeviceName { get; set; } = string.Empty;
  75. /// <summary>
  76. /// 变量实际地址
  77. /// </summary>
  78. public string RealAddress { get; set; } = string.Empty;
  79. /// <summary>
  80. /// 变量名称
  81. /// </summary>
  82. public string VarName { get; set; } = string.Empty;
  83. /// <summary>
  84. /// 变量长度
  85. /// </summary>
  86. public int Length { get; set; } = 1;
  87. /// <summary>
  88. /// 变量当前值
  89. /// </summary>
  90. public string Value { get; set; } = string.Empty;
  91. /// <summary>
  92. /// 变量数据类型
  93. /// </summary>
  94. public EDataType DataType { get; set; }
  95. }
  96. public class PublishInfo
  97. {
  98. public List<PublishModel> PublishModels { get; set; } = new List<PublishModel>();
  99. }
  100. /// <summary>
  101. /// 通讯参数配置
  102. /// </summary>
  103. public class CommunicationPar
  104. {
  105. public ObservableCollection<CommunicationModel> CommunicationDevices { get; set; } = new ObservableCollection<CommunicationModel>();
  106. }
  107. public class CommunicationModel
  108. {
  109. /// <summary>
  110. /// 是否激活
  111. /// </summary>
  112. public bool IsActive { get { return _mIsActive; } set { _mIsActive = value;} }
  113. private bool _mIsActive = true;
  114. /// <summary>
  115. /// 新增设备名称
  116. /// </summary>
  117. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; } }
  118. private string _mDeviceName;
  119. /// <summary>
  120. /// 通讯模块名称
  121. /// </summary>
  122. public string ModelName { get { return _mModelName; } set { _mModelName = value; } }
  123. private string _mModelName;
  124. /// <summary>
  125. /// 变量表数据
  126. /// </summary>
  127. public ObservableCollection<VariableInfo> VarTableModels { get; set; } = new ObservableCollection<VariableInfo>();
  128. }
  129. public class VariableInfo
  130. {
  131. public VariableInfo(params object[] s)
  132. {
  133. }
  134. public int ID { get { return _mID; } set { _mID = value; } }
  135. private int _mID;
  136. /// <summary>
  137. /// 变量名
  138. /// </summary>
  139. public string VarName
  140. {
  141. get { return _mVarName.Trim()?.Replace(" ", ""); }
  142. set
  143. {
  144. _mVarName = value;
  145. }
  146. }
  147. private string _mVarName = string.Empty;
  148. /// <summary>
  149. /// 地址
  150. /// </summary>
  151. public string Address
  152. {
  153. get { return _mAddress.Trim()?.Replace(" ", "").ToUpper(); }
  154. set
  155. {
  156. _mAddress = value;
  157. }
  158. }
  159. private string _mAddress = string.Empty;
  160. /// <summary>
  161. /// 实际地址
  162. /// </summary>
  163. public string RealAddress { get; set; }
  164. /// <summary>
  165. /// 数据类型
  166. /// </summary>
  167. public string DataType { get { return _mDataType; } set { _mDataType = value; } }
  168. private string _mDataType = string.Empty;
  169. /// <summary>
  170. /// 是否启用报警
  171. /// </summary>
  172. public bool IsEnableAlarm { get { return _mIsEnableAlarm; } set { _mIsEnableAlarm = value; } }
  173. private bool _mIsEnableAlarm;
  174. }
  175. }