SysEnvironment.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ProjectBase.Util
  4. {
  5. /// <summary>
  6. /// 系统环境
  7. /// </summary>
  8. public static class SysEnvironment
  9. {
  10. #region FEM02项目属性
  11. public static bool warn_AS400 = false;//AS400中断报警
  12. //public static bool sign_AutoMode = false;//自动模式
  13. //public static bool sign_OnlineMode = false;//联机模式,在project中更新,在BLL中使用
  14. //public static bool sign_OrderStop = false;//预约停止,在project中更新,在View中使用
  15. public static string[] LastPostResult = new string[10] { "", "", "", "", "", "", "", "", "", "" };//用于记录上次POST返回的数组,避免重复向数据库查,在bll中更新
  16. public static string shareUp_PI_NO = "";//上位接口查询专用车号【在人工调用后GetAS400后,由GetAS400函数完成自动刷新】
  17. public static bool CheckVINRule(string vin)
  18. {
  19. if (vin.Length != 17) return false;
  20. if (!vin.StartsWith("LHG")) return false;
  21. return true;
  22. }
  23. //扫码工位变量
  24. public static string Global_Scanning_Pointer = "";
  25. public static string Global_Scanning_HeadCode = "";
  26. public static string Global_Scanning_FEMCode = "";
  27. //扫码工位订阅
  28. public static string redis_Scanning_Pointer = "redis_Scanning_Pointer";
  29. public static string redis_Scanning_HeadCode = "redis_Scanning_HeadCode";
  30. public static string redis_Scanning_FEMCode = "redis_Scanning_FEMCode";
  31. public static string redis_ScanningMatchRes = "redis_ScanningMatchRes"; //1:匹配成功 0:不匹配 -1:空车架 -2:匹配中(两车间隙、未扫完) -3 未连锁 不匹配
  32. //拧紧工位变量
  33. public static string Global_Tighting_Pointer = "";
  34. public static int Global_Tighting_Model = 0;
  35. public static int Global_Tighting_Color = 0;
  36. public static bool Global_ScannerBlock = false;
  37. //拧紧工位订阅
  38. public static string redis_Tighting_Pointer = "redis_Tighting_Pointer";
  39. public static string redis_Tighting_Model = "redis_Tighting_Model";
  40. public static string redis_Tighting_Color = "redis_Tighting_Color";
  41. public static string UserOperateState = "UserOperateState";//用户操作状态
  42. public static string redis_ScannerBlock = "redis_ScannerBlock";
  43. #endregion
  44. #region 系统级属性
  45. /// <summary>
  46. /// 当前登录人ID
  47. /// </summary>
  48. public static string CurrentLoginID { get; set; }
  49. /// <summary>
  50. /// 当前登录人名字
  51. /// </summary>
  52. public static string CurrentLoginName { get; set; }
  53. /// <summary>
  54. /// 当前登录人所属公司ID
  55. /// </summary>
  56. public static string CurrentLoginGroupId { get; set; }
  57. /// <summary>
  58. /// 密码(MD5)加密后
  59. /// </summary>
  60. public static string passWordMD5 { get; set; }
  61. /// <summary>
  62. /// PLC数据点前缀
  63. /// </summary>
  64. public static string PlcPointsPrefix = "PlcPoints";
  65. /// <summary>
  66. /// PLC连接状态前缀
  67. /// </summary>
  68. public static string PlcStatusPrefix = "PlcStatus";
  69. /// <summary>
  70. /// 变更订阅后缀
  71. /// </summary>
  72. public static string ChannalPostfix = "Channel";
  73. /// <summary>
  74. /// PLC数据点前缀
  75. /// </summary>
  76. public static string OpcDataChannel = PlcPointsPrefix + ChannalPostfix;
  77. /// <summary>
  78. /// PLC连接状态RedisKey
  79. /// </summary>
  80. public static string PlcStatusChannel = PlcStatusPrefix + ChannalPostfix;
  81. /// <summary>
  82. /// Opc服务器连接状态
  83. /// </summary>
  84. public static List<KeyValuePair<int, string>> OpcServerStatus
  85. {
  86. get
  87. {
  88. List<KeyValuePair<int, string>> status = new List<KeyValuePair<int, string>>();
  89. status.Add(new KeyValuePair<int, string>(1, "未连接"));
  90. status.Add(new KeyValuePair<int, string>(2, "已连接"));
  91. status.Add(new KeyValuePair<int, string>(3, "已断开"));
  92. return status;
  93. }
  94. set
  95. {
  96. OpcServerStatus = value;
  97. }
  98. }
  99. /// <summary>
  100. /// 系统参数的参数类型
  101. /// </summary>
  102. public static List<KeyValuePair<int, string>> dirSysParameterType
  103. {
  104. get
  105. {
  106. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  107. type.Add(new KeyValuePair<int, string>(0, "任何值"));
  108. type.Add(new KeyValuePair<int, string>(1, "数值"));
  109. type.Add(new KeyValuePair<int, string>(2, "整型"));
  110. type.Add(new KeyValuePair<int, string>(3, "时间"));
  111. type.Add(new KeyValuePair<int, string>(4, "日期"));
  112. return type;
  113. }
  114. set
  115. {
  116. dirSysParameterType = value;
  117. }
  118. }
  119. /// <summary>
  120. /// 系统参数的数据
  121. /// </summary>
  122. public static List<KeyValuePair<int, string>> dirSysParameterData
  123. {
  124. get
  125. {
  126. List<KeyValuePair<int, string>> data = new List<KeyValuePair<int, string>>();
  127. data.Add(new KeyValuePair<int, string>(1, "介于"));
  128. data.Add(new KeyValuePair<int, string>(2, "未介于"));
  129. data.Add(new KeyValuePair<int, string>(3, "等于"));
  130. data.Add(new KeyValuePair<int, string>(4, "不等于"));
  131. data.Add(new KeyValuePair<int, string>(5, "大于"));
  132. data.Add(new KeyValuePair<int, string>(6, "大于等于"));
  133. data.Add(new KeyValuePair<int, string>(7, "小于"));
  134. data.Add(new KeyValuePair<int, string>(8, "小于等于"));
  135. return data;
  136. }
  137. set
  138. {
  139. dirSysParameterData = value;
  140. }
  141. }
  142. /// <summary>
  143. /// winform窗体类型
  144. /// </summary>
  145. public static List<KeyValuePair<string, string>> dirWinformType
  146. {
  147. get
  148. {
  149. List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
  150. type.Add(new KeyValuePair<string, string>("1", "一级"));
  151. type.Add(new KeyValuePair<string, string>("2", "二级"));
  152. type.Add(new KeyValuePair<string, string>("3", "三级"));
  153. return type;
  154. }
  155. set
  156. {
  157. dirWinformType = value;
  158. }
  159. }
  160. /// <summary>
  161. /// PLC连接类型
  162. /// </summary>
  163. public static List<KeyValuePair<string, string>> dirPlcLinkType
  164. {
  165. get
  166. {
  167. List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
  168. type.Add(new KeyValuePair<string, string>("6", "OPCUA"));
  169. type.Add(new KeyValuePair<string, string>("1", "OPCDA"));
  170. type.Add(new KeyValuePair<string, string>("2", "SiemensPLC"));
  171. type.Add(new KeyValuePair<string, string>("3", "MX-Compoment"));
  172. type.Add(new KeyValuePair<string, string>("4", "BeckhoffPLC"));
  173. type.Add(new KeyValuePair<string, string>("7", "ModbusTCP"));
  174. type.Add(new KeyValuePair<string, string>("8", "ModbusRTU"));
  175. type.Add(new KeyValuePair<string, string>("99", "未启用"));
  176. return type;
  177. }
  178. set
  179. {
  180. dirPlcLinkType = value;
  181. }
  182. }
  183. /// <summary>
  184. /// 数据组类型
  185. /// </summary>
  186. public static List<KeyValuePair<int, string>> dirDataGroupType
  187. {
  188. get
  189. {
  190. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  191. type.Add(new KeyValuePair<int, string>(1, "信号"));
  192. type.Add(new KeyValuePair<int, string>(2, "数据"));
  193. return type;
  194. }
  195. set
  196. {
  197. dirDataGroupType = value;
  198. }
  199. }
  200. /// <summary>
  201. /// 类型
  202. /// </summary>
  203. public static List<KeyValuePair<int, string>> dirType
  204. {
  205. get
  206. {
  207. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  208. type.Add(new KeyValuePair<int, string>(1, "BOOL"));
  209. type.Add(new KeyValuePair<int, string>(2, "BYTE"));
  210. type.Add(new KeyValuePair<int, string>(3, "INT16"));
  211. type.Add(new KeyValuePair<int, string>(4, "UINT16"));
  212. type.Add(new KeyValuePair<int, string>(5, "INT32"));
  213. type.Add(new KeyValuePair<int, string>(6, "UINT32"));
  214. type.Add(new KeyValuePair<int, string>(7, "REAL"));
  215. type.Add(new KeyValuePair<int, string>(8, "LREAL"));
  216. type.Add(new KeyValuePair<int, string>(9, "STRING"));
  217. return type;
  218. }
  219. set
  220. {
  221. dirType = value;
  222. }
  223. }
  224. /// <summary>
  225. /// 是否为查询条件
  226. /// </summary>
  227. public static List<KeyValuePair<string, string>> dirRuleValueQuery
  228. {
  229. get
  230. {
  231. List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
  232. query.Add(new KeyValuePair<string, string>("是", "是"));
  233. query.Add(new KeyValuePair<string, string>("否", "否"));
  234. return query;
  235. }
  236. set
  237. {
  238. dirRuleValueQuery = value;
  239. }
  240. }
  241. /// <summary>
  242. /// 系统信息提示类别
  243. /// </summary>
  244. public static List<KeyValuePair<int, string>> dirSystemNoticType
  245. {
  246. get
  247. {
  248. List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
  249. type.Add(new KeyValuePair<int, string>(1, "提示"));
  250. type.Add(new KeyValuePair<int, string>(2, "警告"));
  251. type.Add(new KeyValuePair<int, string>(3, "报警"));
  252. return type;
  253. }
  254. set
  255. {
  256. dirSystemNoticType = value;
  257. }
  258. }
  259. /// <summary>
  260. /// 本机IP地址
  261. /// </summary>
  262. public static string Ip { get; set; }
  263. /// <summary>
  264. /// 本机Mac地址
  265. /// </summary>
  266. public static string Mac { get; set; }
  267. /// <summary>
  268. /// 系统提示信息
  269. /// </summary>
  270. public static string SystemMessage = "SystemMessage";
  271. #endregion
  272. }
  273. }