SysEnvironment.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace SIMDP.Util
  7. {
  8. /// <summary>
  9. /// 系统环境
  10. /// </summary>
  11. public static class SysEnvironment
  12. {
  13. #region 系统级属性
  14. /// <summary>
  15. /// 当前登录人ID
  16. /// </summary>
  17. public static string CurrentLoginID { get; set; }
  18. /// <summary>
  19. /// 当前登录人名字
  20. /// </summary>
  21. public static string CurrentLoginName { get; set; }
  22. /// <summary>
  23. /// 当前登录人所属公司ID
  24. /// </summary>
  25. public static string CurrentLoginGroupId { get; set; }
  26. /// <summary>
  27. /// 密码(MD5)加密后
  28. /// </summary>
  29. public static string passWordMD5 { get; set; }
  30. /// <summary>
  31. /// Opc数据点频道名称前缀
  32. /// </summary>
  33. public static string OpcDataChannel = "OpcDataChannel";
  34. /// <summary>
  35. /// Opc 连接PLC状态值
  36. /// </summary>
  37. public static string PlcStatusChannel = "PlcStatusChannel";
  38. /// <summary>
  39. /// OPC连接的PLC的状态的当前值
  40. /// </summary>
  41. public static string PlcStatusCurrent = "PlcStatusCurrent_";
  42. /// <summary>
  43. /// Opc服务器连接状态
  44. /// </summary>
  45. public static List<KeyValuePair<int, string>> OpcServerStatus
  46. {
  47. get
  48. {
  49. List<KeyValuePair<int, string>> status = new List<KeyValuePair<int, string>>();
  50. status.Add(new KeyValuePair<int, string>(1, "未连接"));
  51. status.Add(new KeyValuePair<int, string>(2, "已连接"));
  52. status.Add(new KeyValuePair<int, string>(3, "已断开"));
  53. return status;
  54. }
  55. set
  56. {
  57. OpcServerStatus = value;
  58. }
  59. }
  60. /// <summary>
  61. /// 系统参数的参数类型
  62. /// </summary>
  63. public static List<KeyValuePair<int, string>> dirSysParameterType
  64. {
  65. get
  66. {
  67. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  68. type.Add(new KeyValuePair<int, string>(0, "任何值"));
  69. type.Add(new KeyValuePair<int, string>(1, "数值"));
  70. type.Add(new KeyValuePair<int, string>(2, "整型"));
  71. type.Add(new KeyValuePair<int, string>(3, "时间"));
  72. type.Add(new KeyValuePair<int, string>(4, "日期"));
  73. return type;
  74. }
  75. set
  76. {
  77. dirSysParameterType = value;
  78. }
  79. }
  80. /// <summary>
  81. /// 系统参数的数据
  82. /// </summary>
  83. public static List<KeyValuePair<int, string>> dirSysParameterData
  84. {
  85. get
  86. {
  87. List<KeyValuePair<int, string>> data = new List<KeyValuePair<int, string>>();
  88. data.Add(new KeyValuePair<int, string>(1, "介于"));
  89. data.Add(new KeyValuePair<int, string>(2, "未介于"));
  90. data.Add(new KeyValuePair<int, string>(3, "等于"));
  91. data.Add(new KeyValuePair<int, string>(4, "不等于"));
  92. data.Add(new KeyValuePair<int, string>(5, "大于"));
  93. data.Add(new KeyValuePair<int, string>(6, "大于等于"));
  94. data.Add(new KeyValuePair<int, string>(7, "小于"));
  95. data.Add(new KeyValuePair<int, string>(8, "小于等于"));
  96. return data;
  97. }
  98. set
  99. {
  100. dirSysParameterData = value;
  101. }
  102. }
  103. /// <summary>
  104. /// winform窗体类型
  105. /// </summary>
  106. public static List<KeyValuePair<string, string>> dirWinformType
  107. {
  108. get
  109. {
  110. List<KeyValuePair<string,string>> type = new List<KeyValuePair<string, string>>();
  111. type.Add(new KeyValuePair<string, string>("1", "一级"));
  112. type.Add(new KeyValuePair<string, string>("2", "二级"));
  113. type.Add(new KeyValuePair<string, string>("3", "三级"));
  114. return type;
  115. }
  116. set
  117. {
  118. dirWinformType = value;
  119. }
  120. }
  121. /// <summary>
  122. /// PLC连接类型
  123. /// </summary>
  124. public static List<KeyValuePair<string, string>> dirPlcLinkType
  125. {
  126. get
  127. {
  128. List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
  129. type.Add(new KeyValuePair<string, string>("1", "OPCDA"));
  130. type.Add(new KeyValuePair<string, string>("2", "SiemensPLC"));
  131. type.Add(new KeyValuePair<string, string>("3", "MX-Compoment"));
  132. type.Add(new KeyValuePair<string, string>("4", "BeckhoffPLC"));
  133. type.Add(new KeyValuePair<string, string>("5", "ModbusRTU"));
  134. type.Add(new KeyValuePair<string, string>("6", "OPCUA"));
  135. type.Add(new KeyValuePair<string, string>("9", "未启用"));
  136. return type;
  137. }
  138. set
  139. {
  140. dirPlcLinkType = value;
  141. }
  142. }
  143. /// <summary>
  144. /// 数据组类型
  145. /// </summary>
  146. public static List<KeyValuePair<int, string>> dirDataGroupType
  147. {
  148. get
  149. {
  150. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  151. type.Add(new KeyValuePair<int, string>(1, "信号"));
  152. type.Add(new KeyValuePair<int, string>(2, "数据"));
  153. return type;
  154. }
  155. set
  156. {
  157. dirDataGroupType = value;
  158. }
  159. }
  160. /// <summary>
  161. /// 类型
  162. /// </summary>
  163. public static List<KeyValuePair<int, string>> dirType
  164. {
  165. get
  166. {
  167. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  168. type.Add(new KeyValuePair<int, string>(1, "BOOL"));
  169. type.Add(new KeyValuePair<int, string>(2, "BYTE"));
  170. type.Add(new KeyValuePair<int, string>(3, "INT16"));
  171. type.Add(new KeyValuePair<int, string>(4, "UINT16"));
  172. type.Add(new KeyValuePair<int, string>(5, "INT32"));
  173. type.Add(new KeyValuePair<int, string>(6, "UINT32"));
  174. type.Add(new KeyValuePair<int, string>(7, "REAL"));
  175. type.Add(new KeyValuePair<int, string>(9, "STRING"));
  176. return type;
  177. }
  178. set
  179. {
  180. dirType = value;
  181. }
  182. }
  183. /// <summary>
  184. /// 是否为查询条件
  185. /// </summary>
  186. public static List<KeyValuePair<string, string>> dirRuleValueQuery
  187. {
  188. get
  189. {
  190. List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
  191. query.Add(new KeyValuePair<string, string>("是", "是"));
  192. query.Add(new KeyValuePair<string, string>("否", "否"));
  193. return query;
  194. }
  195. set
  196. {
  197. dirRuleValueQuery = value;
  198. }
  199. }
  200. /// <summary>
  201. /// 系统信息提示类别
  202. /// </summary>
  203. public static List<KeyValuePair<int, string>> dirSystemNoticType
  204. {
  205. get
  206. {
  207. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  208. type.Add(new KeyValuePair<int, string>(1, "提示"));
  209. type.Add(new KeyValuePair<int, string>(2, "警告"));
  210. type.Add(new KeyValuePair<int, string>(3, "报警"));
  211. return type;
  212. }
  213. set
  214. {
  215. dirSystemNoticType = value;
  216. }
  217. }
  218. /// <summary>
  219. /// 本机IP地址
  220. /// </summary>
  221. public static string Ip { get; set; }
  222. /// <summary>
  223. /// 本机Mac地址
  224. /// </summary>
  225. public static string Mac { get; set; }
  226. /// <summary>
  227. /// 系统提示信息
  228. /// </summary>
  229. public static string SystemMessage = "SystemMessage";
  230. #endregion
  231. }
  232. }