using System; using System.Collections.Generic; namespace ProjectBase.Util { /// /// 系统环境 /// public static class SysEnvironment { #region FEM02项目属性 public static bool warn_AS400 = false;//AS400中断报警 //public static bool sign_AutoMode = false;//自动模式 //public static bool sign_OnlineMode = false;//联机模式,在project中更新,在BLL中使用 //public static bool sign_OrderStop = false;//预约停止,在project中更新,在View中使用 public static string[] LastPostResult = new string[10] { "", "", "", "", "", "", "", "", "", "" };//用于记录上次POST返回的数组,避免重复向数据库查,在bll中更新 public static string shareUp_PI_NO = "";//上位接口查询专用车号【在人工调用后GetAS400后,由GetAS400函数完成自动刷新】 public static bool CheckVINRule(string vin) { if (vin.Length != 17) return false; if (!vin.StartsWith("LHG")) return false; return true; } //扫码工位变量 public static string Global_Scanning_Pointer = ""; public static string Global_Scanning_HeadCode = ""; public static string Global_Scanning_FEMCode = ""; //扫码工位订阅 public static string redis_Scanning_Pointer = "redis_Scanning_Pointer"; public static string redis_Scanning_HeadCode = "redis_Scanning_HeadCode"; public static string redis_Scanning_FEMCode = "redis_Scanning_FEMCode"; public static string redis_ScanningMatchRes = "redis_ScanningMatchRes"; //1:匹配成功 0:不匹配 -1:空车架 -2:匹配中(两车间隙、未扫完) -3 未连锁 不匹配 //拧紧工位变量 public static string Global_Tighting_Pointer = ""; public static int Global_Tighting_Model = 0; public static int Global_Tighting_Color = 0; public static bool Global_ScannerBlock = false; //拧紧工位订阅 public static string redis_Tighting_Pointer = "redis_Tighting_Pointer"; public static string redis_Tighting_Model = "redis_Tighting_Model"; public static string redis_Tighting_Color = "redis_Tighting_Color"; public static string UserOperateState = "UserOperateState";//用户操作状态 public static string redis_ScannerBlock = "redis_ScannerBlock"; #endregion #region 系统级属性 /// /// 当前登录人ID /// public static string CurrentLoginID { get; set; } /// /// 当前登录人名字 /// public static string CurrentLoginName { get; set; } /// /// 当前登录人所属公司ID /// public static string CurrentLoginGroupId { get; set; } /// /// 密码(MD5)加密后 /// public static string passWordMD5 { get; set; } /// /// PLC数据点前缀 /// public static string PlcPointsPrefix = "PlcPoints"; /// /// PLC连接状态前缀 /// public static string PlcStatusPrefix = "PlcStatus"; /// /// 变更订阅后缀 /// public static string ChannalPostfix = "Channel"; /// /// PLC数据点前缀 /// public static string OpcDataChannel = PlcPointsPrefix + ChannalPostfix; /// /// PLC连接状态RedisKey /// public static string PlcStatusChannel = PlcStatusPrefix + ChannalPostfix; /// /// Opc服务器连接状态 /// public static List> OpcServerStatus { get { List> status = new List>(); status.Add(new KeyValuePair(1, "未连接")); status.Add(new KeyValuePair(2, "已连接")); status.Add(new KeyValuePair(3, "已断开")); return status; } set { OpcServerStatus = value; } } /// /// 系统参数的参数类型 /// public static List> dirSysParameterType { get { List> type = new List>(); type.Add(new KeyValuePair(0, "任何值")); type.Add(new KeyValuePair(1, "数值")); type.Add(new KeyValuePair(2, "整型")); type.Add(new KeyValuePair(3, "时间")); type.Add(new KeyValuePair(4, "日期")); return type; } set { dirSysParameterType = value; } } /// /// 系统参数的数据 /// public static List> dirSysParameterData { get { List> data = new List>(); data.Add(new KeyValuePair(1, "介于")); data.Add(new KeyValuePair(2, "未介于")); data.Add(new KeyValuePair(3, "等于")); data.Add(new KeyValuePair(4, "不等于")); data.Add(new KeyValuePair(5, "大于")); data.Add(new KeyValuePair(6, "大于等于")); data.Add(new KeyValuePair(7, "小于")); data.Add(new KeyValuePair(8, "小于等于")); return data; } set { dirSysParameterData = value; } } /// /// winform窗体类型 /// public static List> dirWinformType { get { List> type = new List>(); type.Add(new KeyValuePair("1", "一级")); type.Add(new KeyValuePair("2", "二级")); type.Add(new KeyValuePair("3", "三级")); return type; } set { dirWinformType = value; } } /// /// PLC连接类型 /// public static List> dirPlcLinkType { get { List> type = new List>(); type.Add(new KeyValuePair("6", "OPCUA")); type.Add(new KeyValuePair("1", "OPCDA")); type.Add(new KeyValuePair("2", "SiemensPLC")); type.Add(new KeyValuePair("3", "MX-Compoment")); type.Add(new KeyValuePair("4", "BeckhoffPLC")); type.Add(new KeyValuePair("7", "ModbusTCP")); type.Add(new KeyValuePair("8", "ModbusRTU")); type.Add(new KeyValuePair("99", "未启用")); return type; } set { dirPlcLinkType = value; } } /// /// 数据组类型 /// public static List> dirDataGroupType { get { List> type = new List>(); type.Add(new KeyValuePair(1, "信号")); type.Add(new KeyValuePair(2, "数据")); return type; } set { dirDataGroupType = value; } } /// /// 类型 /// public static List> dirType { get { List> type = new List>(); type.Add(new KeyValuePair(1, "BOOL")); type.Add(new KeyValuePair(2, "BYTE")); type.Add(new KeyValuePair(3, "INT16")); type.Add(new KeyValuePair(4, "UINT16")); type.Add(new KeyValuePair(5, "INT32")); type.Add(new KeyValuePair(6, "UINT32")); type.Add(new KeyValuePair(7, "REAL")); type.Add(new KeyValuePair(8, "LREAL")); type.Add(new KeyValuePair(9, "STRING")); return type; } set { dirType = value; } } /// /// 是否为查询条件 /// public static List> dirRuleValueQuery { get { List> query = new List>(); query.Add(new KeyValuePair("是", "是")); query.Add(new KeyValuePair("否", "否")); return query; } set { dirRuleValueQuery = value; } } /// /// 系统信息提示类别 /// public static List> dirSystemNoticType { get { List> type = new List>(); type.Add(new KeyValuePair(1, "提示")); type.Add(new KeyValuePair(2, "警告")); type.Add(new KeyValuePair(3, "报警")); return type; } set { dirSystemNoticType = value; } } /// /// 本机IP地址 /// public static string Ip { get; set; } /// /// 本机Mac地址 /// public static string Mac { get; set; } /// /// 系统提示信息 /// public static string SystemMessage = "SystemMessage"; #endregion } }