123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SIMDP.Util
- {
- /// <summary>
- /// 系统环境
- /// </summary>
- public static class SysEnvironment
- {
- #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>
- /// Opc数据点频道名称前缀
- /// </summary>
- public static string OpcDataChannel = "OpcDataChannel";
- /// <summary>
- /// Opc 连接PLC状态值
- /// </summary>
- public static string PlcStatusChannel = "PlcStatusChannel";
- /// <summary>
- /// OPC连接的PLC的状态的当前值
- /// </summary>
- public static string PlcStatusCurrent = "PlcStatusCurrent_";
- /// <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>("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>("5", "ModbusRTU"));
- type.Add(new KeyValuePair<string, string>("6", "OPCUA"));
- type.Add(new KeyValuePair<string, string>("9", "未启用"));
- 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>(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
- }
- }
|