123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- using System;
- using System.Collections.Generic;
- namespace ProjectBase.Util
- {
- /// <summary>
- /// 系统环境
- /// </summary>
- 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&& vin.Length != 11) return false;
- //if (!vin.StartsWith("LHG")) return false;
-
- return true;
- }
- //扫码工位变量
- public static string Global_Scanning_Pointer = "";
- public static string Global_Head_Pointer = "";
- public static string Global_FEM_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_Pointer = "redis_Scanning_HeadCode_Pointer";
- public static string redis_Scanning_FEMCode_Pointer = "redis_Scanning_FEMCode_Pointer";
- 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";//用户操作状态
- #endregion
- #region 系统级属性
- /// <summary>
- /// 当前登录人ID
- /// </summary>
- public static string CurrentLoginID { get; set; }
- /// <summary>
- /// 当前登录人名字
- /// </summary>
- public static string CurrentLoginName { get; set; }
- /// <summary>
- /// 当前登录人所属公司ID
- /// </summary>
- public static string CurrentLoginGroupId { get; set; }
- /// <summary>
- /// 密码(MD5)加密后
- /// </summary>
- public static string passWordMD5 { get; set; }
- /// <summary>
- /// PLC数据点前缀
- /// </summary>
- public static string PlcPointsPrefix = "PlcPoints";
- /// <summary>
- /// PLC连接状态前缀
- /// </summary>
- public static string PlcStatusPrefix = "PlcStatus";
- /// <summary>
- /// 变更订阅后缀
- /// </summary>
- public static string ChannalPostfix = "Channel";
- /// <summary>
- /// PLC数据点前缀
- /// </summary>
- public static string OpcDataChannel = PlcPointsPrefix + ChannalPostfix;
- /// <summary>
- /// PLC连接状态RedisKey
- /// </summary>
- public static string PlcStatusChannel = PlcStatusPrefix + ChannalPostfix;
- /// <summary>
- /// Opc服务器连接状态
- /// </summary>
- public static List<KeyValuePair<int, string>> OpcServerStatus
- {
- get
- {
- List<KeyValuePair<int, string>> status = new List<KeyValuePair<int, string>>();
- status.Add(new KeyValuePair<int, string>(1, "未连接"));
- status.Add(new KeyValuePair<int, string>(2, "已连接"));
- status.Add(new KeyValuePair<int, string>(3, "已断开"));
- return status;
- }
- set
- {
- OpcServerStatus = value;
- }
- }
- /// <summary>
- /// 系统参数的参数类型
- /// </summary>
- public static List<KeyValuePair<int, string>> dirSysParameterType
- {
- get
- {
- List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
- type.Add(new KeyValuePair<int, string>(0, "任何值"));
- type.Add(new KeyValuePair<int, string>(1, "数值"));
- type.Add(new KeyValuePair<int, string>(2, "整型"));
- type.Add(new KeyValuePair<int, string>(3, "时间"));
- type.Add(new KeyValuePair<int, string>(4, "日期"));
- return type;
- }
- set
- {
- dirSysParameterType = value;
- }
- }
- /// <summary>
- /// 系统参数的数据
- /// </summary>
- public static List<KeyValuePair<int, string>> dirSysParameterData
- {
- get
- {
- List<KeyValuePair<int, string>> data = new List<KeyValuePair<int, string>>();
- data.Add(new KeyValuePair<int, string>(1, "介于"));
- data.Add(new KeyValuePair<int, string>(2, "未介于"));
- data.Add(new KeyValuePair<int, string>(3, "等于"));
- data.Add(new KeyValuePair<int, string>(4, "不等于"));
- data.Add(new KeyValuePair<int, string>(5, "大于"));
- data.Add(new KeyValuePair<int, string>(6, "大于等于"));
- data.Add(new KeyValuePair<int, string>(7, "小于"));
- data.Add(new KeyValuePair<int, string>(8, "小于等于"));
- return data;
- }
- set
- {
- dirSysParameterData = value;
- }
- }
- /// <summary>
- /// winform窗体类型
- /// </summary>
- public static List<KeyValuePair<string, string>> dirWinformType
- {
- get
- {
- List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
- type.Add(new KeyValuePair<string, string>("1", "一级"));
- type.Add(new KeyValuePair<string, string>("2", "二级"));
- type.Add(new KeyValuePair<string, string>("3", "三级"));
- return type;
- }
- set
- {
- dirWinformType = value;
- }
- }
- /// <summary>
- /// PLC连接类型
- /// </summary>
- public static List<KeyValuePair<string, string>> dirPlcLinkType
- {
- get
- {
- List<KeyValuePair<string, string>> type = new List<KeyValuePair<string, string>>();
- type.Add(new KeyValuePair<string, string>("6", "OPCUA"));
- type.Add(new KeyValuePair<string, string>("1", "OPCDA"));
- type.Add(new KeyValuePair<string, string>("2", "SiemensPLC"));
- type.Add(new KeyValuePair<string, string>("3", "MX-Compoment"));
- type.Add(new KeyValuePair<string, string>("4", "BeckhoffPLC"));
- type.Add(new KeyValuePair<string, string>("7", "ModbusTCP"));
- type.Add(new KeyValuePair<string, string>("8", "ModbusRTU"));
- type.Add(new KeyValuePair<string, string>("99", "未启用"));
- return type;
- }
- set
- {
- dirPlcLinkType = value;
- }
- }
- /// <summary>
- /// 数据组类型
- /// </summary>
- public static List<KeyValuePair<int, string>> dirDataGroupType
- {
- get
- {
- List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
- type.Add(new KeyValuePair<int, string>(1, "信号"));
- type.Add(new KeyValuePair<int, string>(2, "数据"));
- return type;
- }
- set
- {
- dirDataGroupType = value;
- }
- }
- /// <summary>
- /// 类型
- /// </summary>
- public static List<KeyValuePair<int, string>> dirType
- {
- get
- {
- List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
- type.Add(new KeyValuePair<int, string>(1, "BOOL"));
- type.Add(new KeyValuePair<int, string>(2, "BYTE"));
- type.Add(new KeyValuePair<int, string>(3, "INT16"));
- type.Add(new KeyValuePair<int, string>(4, "UINT16"));
- type.Add(new KeyValuePair<int, string>(5, "INT32"));
- type.Add(new KeyValuePair<int, string>(6, "UINT32"));
- type.Add(new KeyValuePair<int, string>(7, "REAL"));
- type.Add(new KeyValuePair<int, string>(8, "LREAL"));
- type.Add(new KeyValuePair<int, string>(9, "STRING"));
- return type;
- }
- set
- {
- dirType = value;
- }
- }
- /// <summary>
- /// 是否为查询条件
- /// </summary>
- public static List<KeyValuePair<string, string>> dirRuleValueQuery
- {
- get
- {
- List<KeyValuePair<string, string>> query = new List<KeyValuePair<string, string>>();
- query.Add(new KeyValuePair<string, string>("是", "是"));
- query.Add(new KeyValuePair<string, string>("否", "否"));
- return query;
- }
- set
- {
- dirRuleValueQuery = value;
- }
- }
- /// <summary>
- /// 系统信息提示类别
- /// </summary>
- public static List<KeyValuePair<int, string>> dirSystemNoticType
- {
- get
- {
- List<KeyValuePair<int, string>> type = new List<KeyValuePair<int, string>>();
- type.Add(new KeyValuePair<int, string>(1, "提示"));
- type.Add(new KeyValuePair<int, string>(2, "警告"));
- type.Add(new KeyValuePair<int, string>(3, "报警"));
- return type;
- }
- set
- {
- dirSystemNoticType = value;
- }
- }
- /// <summary>
- /// 本机IP地址
- /// </summary>
- public static string Ip { get; set; }
- /// <summary>
- /// 本机Mac地址
- /// </summary>
- public static string Mac { get; set; }
- /// <summary>
- /// 系统提示信息
- /// </summary>
- public static string SystemMessage = "SystemMessage";
- #endregion
- }
- }
|