SysEnvironment.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ProjectBase.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. /// 车辆移动到位置,开始执行测试用例
  44. /// </summary>
  45. public static string Start = "Start";
  46. /// <summary>
  47. /// 当前使用的规则名称
  48. /// </summary>
  49. public static string CurrentRuleName;
  50. /// <summary>
  51. /// Opc服务器连接状态
  52. /// </summary>
  53. public static List<KeyValuePair<int, string>> OpcServerStatus
  54. {
  55. get
  56. {
  57. List<KeyValuePair<int, string>> status = new List<KeyValuePair<int, string>>();
  58. status.Add(new KeyValuePair<int, string>(1, "未连接"));
  59. status.Add(new KeyValuePair<int, string>(2, "已连接"));
  60. status.Add(new KeyValuePair<int, string>(3, "已断开"));
  61. return status;
  62. }
  63. set
  64. {
  65. OpcServerStatus = value;
  66. }
  67. }
  68. /// <summary>
  69. /// 系统参数的参数类型
  70. /// </summary>
  71. public static List<KeyValuePair<int, string>> dirSysParameterType
  72. {
  73. get
  74. {
  75. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  76. type.Add(new KeyValuePair<int, string>(0, "任何值"));
  77. type.Add(new KeyValuePair<int, string>(1, "数值"));
  78. type.Add(new KeyValuePair<int, string>(2, "整型"));
  79. type.Add(new KeyValuePair<int, string>(3, "时间"));
  80. type.Add(new KeyValuePair<int, string>(4, "日期"));
  81. return type;
  82. }
  83. set
  84. {
  85. dirSysParameterType = value;
  86. }
  87. }
  88. /// <summary>
  89. /// 系统参数的数据
  90. /// </summary>
  91. public static List<KeyValuePair<int, string>> dirSysParameterData
  92. {
  93. get
  94. {
  95. List<KeyValuePair<int, string>> data = new List<KeyValuePair<int, string>>();
  96. data.Add(new KeyValuePair<int, string>(1, "介于"));
  97. data.Add(new KeyValuePair<int, string>(2, "未介于"));
  98. data.Add(new KeyValuePair<int, string>(3, "等于"));
  99. data.Add(new KeyValuePair<int, string>(4, "不等于"));
  100. data.Add(new KeyValuePair<int, string>(5, "大于"));
  101. data.Add(new KeyValuePair<int, string>(6, "大于等于"));
  102. data.Add(new KeyValuePair<int, string>(7, "小于"));
  103. data.Add(new KeyValuePair<int, string>(8, "小于等于"));
  104. return data;
  105. }
  106. set
  107. {
  108. dirSysParameterData = value;
  109. }
  110. }
  111. /// <summary>
  112. /// winform窗体类型
  113. /// </summary>
  114. public static List<KeyValuePair<string, string>> dirWinformType
  115. {
  116. get
  117. {
  118. List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
  119. type.Add(new KeyValuePair<string, string>("1", "一级"));
  120. type.Add(new KeyValuePair<string, string>("2", "二级"));
  121. type.Add(new KeyValuePair<string, string>("3", "三级"));
  122. return type;
  123. }
  124. set
  125. {
  126. dirWinformType = value;
  127. }
  128. }
  129. /// <summary>
  130. /// PLC连接类型
  131. /// </summary>
  132. public static List<KeyValuePair<string, string>> dirPlcLinkType
  133. {
  134. get
  135. {
  136. List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
  137. type.Add(new KeyValuePair<string, string>("1", "OPCDA"));
  138. type.Add(new KeyValuePair<string, string>("2", "TCP服务端"));
  139. type.Add(new KeyValuePair<string, string>("3", "TCP客户端"));
  140. type.Add(new KeyValuePair<string, string>("4", "Modelbus"));
  141. type.Add(new KeyValuePair<string, string>("5", "串口"));
  142. type.Add(new KeyValuePair<string, string>("6", "MX-Compoment"));
  143. return type;
  144. }
  145. set
  146. {
  147. dirPlcLinkType = value;
  148. }
  149. }
  150. /// <summary>
  151. /// 数据组类型
  152. /// </summary>
  153. public static List<KeyValuePair<int, string>> dirDataGroupType
  154. {
  155. get
  156. {
  157. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  158. type.Add(new KeyValuePair<int, string>(1, "数据"));
  159. type.Add(new KeyValuePair<int, string>(2, "信号"));
  160. return type;
  161. }
  162. set
  163. {
  164. dirDataGroupType = value;
  165. }
  166. }
  167. /// <summary>
  168. /// 类型
  169. /// </summary>
  170. public static List<KeyValuePair<int, string>> dirType
  171. {
  172. get
  173. {
  174. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  175. type.Add(new KeyValuePair<int, string>(1, "Bool"));
  176. type.Add(new KeyValuePair<int, string>(2, "Short"));
  177. type.Add(new KeyValuePair<int, string>(3, "UShort"));
  178. type.Add(new KeyValuePair<int, string>(4, "Long"));
  179. type.Add(new KeyValuePair<int, string>(5, "ULong"));
  180. type.Add(new KeyValuePair<int, string>(6, "Double"));
  181. type.Add(new KeyValuePair<int, string>(7, "String"));
  182. return type;
  183. }
  184. set
  185. {
  186. dirType = value;
  187. }
  188. }
  189. /// <summary>
  190. /// 是否为查询条件
  191. /// </summary>
  192. public static List<KeyValuePair<string, string>> dirRuleValueQuery
  193. {
  194. get
  195. {
  196. List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
  197. query.Add(new KeyValuePair<string, string>("是", "是"));
  198. query.Add(new KeyValuePair<string, string>("否", "否"));
  199. return query;
  200. }
  201. set
  202. {
  203. dirRuleValueQuery = value;
  204. }
  205. }
  206. /// <summary>
  207. /// 本机IP地址
  208. /// </summary>
  209. public static string Ip { get; set; }
  210. /// <summary>
  211. /// 本机Mac地址
  212. /// </summary>
  213. public static string Mac { get; set; }
  214. #endregion
  215. }
  216. }