SysEnvironment.cs 11 KB

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