From 4e7c1dd0767d551ec3194ead9f3de0a219a802c3 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 25 九月 2023 17:24:37 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' into wxr-2.1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 48 ++++++++++++++++++++++++++++++------------------ 1 files changed, 30 insertions(+), 18 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index 803d84e..98000c6 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -48,7 +48,7 @@ { case "1": { - + inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; foreach (var dic in dicList) { @@ -130,7 +130,7 @@ case "2": { inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; - string value= this.GetKeyValue("timesection", dicList); + string value = this.GetKeyValue("timesection", dicList); inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value; } break; @@ -181,7 +181,7 @@ } } break; - //浼犳劅鍣� + //绱ф�ユ眰鍔╀紶鎰熷櫒 case SPK.SensorHelp: { string value = this.GetKeyValue("alarm_status", dicList); @@ -418,7 +418,7 @@ break; case SPK.VideoDoorLock: { - string s = string.Empty; + string userName = string.Empty; string tag = string.Empty; for (int b = 0; b < dicList.Count; b++) { @@ -429,11 +429,9 @@ //s += ","; //tag += FaceItem.userId; //tag += "_"; - var userName = dic["value"].ToString(); - s += userName; - s += ","; + userName = dic["value"].ToString(); } - inputView.btnState.Text = s; + inputView.btnState.Text = RemoveLastStr(userName); } break; case SPK.doorgate: @@ -495,7 +493,7 @@ break; } - + inputView.btnState.Text = Language.StringByID(StringId.wuren); if (value == "true") { @@ -841,7 +839,7 @@ else if (device.spk == SPK.SensorTemperature) { - this.SensorView(thisView, device, "temperature", indexVulae); + this.SensorView(thisView, device, "temperature", indexVulae); } else if (device.spk == SPK.SensorHumidity) @@ -1502,7 +1500,8 @@ if (stateStr.StartsWith(";")) { stateStr = stateStr.Substring(1, stateStr.Length - 1); - } else if (stateStr.EndsWith(Language.StringByID(StringId.volumeMusic))) + } + else if (stateStr.EndsWith(Language.StringByID(StringId.volumeMusic))) { stateStr = stateStr.Substring(0, stateStr.Length - 3); } @@ -2460,7 +2459,7 @@ break; case SPK.VideoDoorLock: { - string s = string.Empty; + string userName = string.Empty; string tag = string.Empty; for (int b = 0; b < dicList.Count; b++) { @@ -2471,11 +2470,10 @@ //s += ","; //tag += FaceItem.userId; //tag += "_"; - var userName = dic["value"].ToString(); - s += userName; - s += ","; + userName = dic["value"].ToString(); + } - button1.Text = s; + button1.Text = RemoveLastStr(userName); button1.Tag = tag; } break; @@ -2542,7 +2540,7 @@ } } break; - + case "set_volume": { if (button2 == null) @@ -3005,7 +3003,7 @@ Input inputedit = Logic.currlogic.input[indexVulae]; ///鐘舵�佸�� string stateValue = ""; - for (int i=0;i<inputedit.condition.Count;i++) + for (int i = 0; i < inputedit.condition.Count; i++) { var dic = inputedit.condition[i]; string comparator = dic["comparator"]; @@ -3106,6 +3104,20 @@ return face; } + /// <summary> + /// 鍒犻櫎鏈�鍚庝竴涓� "," + /// </summary> + /// <param name="s">瀛楃涓�</param> + /// <returns></returns> + public string RemoveLastStr(string s) + { + if (string.IsNullOrEmpty(s)) + { + return string.Empty; + } + return s.Replace("[","").Replace("]","").Replace("\"","").TrimEnd(','); + } + } } -- Gitblit v1.8.0