From 0f2e0147e8990e913d16d99bc1b94fb6bc53abd7 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 03 十二月 2020 15:35:42 +0800 Subject: [PATCH] 2020-12-03-1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs | 69 ++++++++-------------------------- 1 files changed, 16 insertions(+), 53 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs index a06cfa9..a388ffb 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs @@ -7,6 +7,19 @@ /// </summary> public class Logic { + + /// <summary> + /// 閫昏緫鍒楄〃 + /// </summary> + public static List<Logic> LogicList = new List<Logic>(); + /// <summary> + /// 褰撳墠閫昏緫 + /// </summary> + public static Logic currlogic; + /// <summary> + /// 浜戠鍞竴id + /// </summary> + public string userLogicId = ""; /// <summary> /// 閫昏緫鍞竴鏍囪瘑 /// </summary> @@ -35,57 +48,7 @@ /// 閫昏緫杈撳嚭鐩爣鏁扮粍 /// </summary> public List<Output> output = new List<Output>(); - /// <summary> - /// 鐢熸垚閫昏緫sid鏂规硶 - /// </summary> - public string NewSid() - { - string logicId = ""; - try - { - string sOidBeginsWith = "000101";//鍘傚晢 + 閫氳鏂瑰紡 - DateTime dt = DateTime.Now; - DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1)); - long m = (long)((dt - startTime).TotalMilliseconds / 10); - string sTimeSpan = "00000000"; - - byte[] arry = new byte[4]; - arry[0] = (byte)(m & 0xFF); - arry[1] = (byte)((m & 0xFF00) >> 8); - arry[2] = (byte)((m & 0xFF0000) >> 16); - arry[3] = (byte)((m >> 24) & 0xFF); - sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2"); - - - if (sTimeSpan.Length > 8) - { - sTimeSpan = sTimeSpan.Substring(0, 8); - } - else - { - sTimeSpan = "00000000"; - } - - logicId = sOidBeginsWith + sTimeSpan; - - logicId += "0A"; - logicId += "0A01"; - //0A01 鐗╂ā鍨嬩负閫昏緫锛� 0001 琛ㄧず 1 鍙烽�昏緫鍔熻兘 - int iTopLogicId = 1; - - Random random = new Random(); - iTopLogicId = random.Next(0, 255); - iTopLogicId += random.Next(0, 255); - - logicId += iTopLogicId.ToString("X4");//閫昏緫鍙� 涓や釜byte - logicId += "1100"; - } - catch - { - return logicId; - } - return logicId; - } + } /// <summary> @@ -97,7 +60,7 @@ /// 鏃堕棿绫诲瀷 /// (鎵ц涓�娆�:once锛屾瘡澶�:day锛屾瘡鏈�:mon锛屾槦鏈�:week锛屾棩鏈熸:date_to_date) /// </summary> - public string type = ""; + public string type = "day"; public List<string> value = new List<string>(); } /// <summary> @@ -136,7 +99,7 @@ /// 閫昏緫杈撳嚭鐩爣绫诲瀷 /// 璁惧=1; /// 鍦烘櫙=2; - /// 瀹夐槻=3; + /// 寤舵椂=3; /// </summary> public string target_type = ""; public List<Dictionary<string, string>> status = new List<Dictionary<string, string>>(); -- Gitblit v1.8.0