From edfb48fa10b0518311ee46bef4aded0859069d16 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 18 七月 2023 17:51:52 +0800 Subject: [PATCH] 2023年07月18日17:50:46 --- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 138 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 116 insertions(+), 22 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index be9b2c6..52570e4 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -247,7 +247,7 @@ { inputView.btnState.Text = Language.StringByID(StringId.kaiqi); } - + } break; case SPK.SensorUtrasonic: @@ -307,12 +307,14 @@ { string value = this.GetValue(dicList); inputView.btnState.Text = Language.StringByID(StringId.wuren); - if (value == "fall") { + if (value == "fall") + { inputView.btnState.Text = Language.StringByID(StringId.diedao); } } break; - case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin: + case SPK.SensorEnvironment: + case SPK.SensorEnvironmentHailin: case SPK.SensorEnvironment2: case SPK.SensorEnvironment3: { @@ -376,7 +378,7 @@ case SPK.SensorTemperature: { - string str =this.GetText(dicList, "temperature"); + string str = this.GetText(dicList, "temperature"); inputView.btnState.Text = str; } break; @@ -414,12 +416,15 @@ for (int b = 0; b < dicList.Count; b++) { var dic = dicList[b]; - var userId = dic["value"].ToString(); - var FaceItem = this.GetVideoDoorLockUserItem(userId, device); - s += FaceItem.userName; + //var userId = dic["value"].ToString(); + //var FaceItem = this.GetVideoDoorLockUserItem(userId, device); + //s += FaceItem.userName; + //s += ","; + //tag += FaceItem.userId; + //tag += "_"; + var userName = dic["value"].ToString(); + s += userName; s += ","; - tag += FaceItem.userId; - tag += "_"; } inputView.btnState.Text = s; } @@ -445,10 +450,10 @@ var FaceItem = this.GetFaceItem(userId, device.deviceId); s += FaceItem.userName; s += ","; + + } - //string userId = this.GetKeyValue("user_id",dicList); - //var FaceItem = this.GetFaceItem(userId, device.deviceId); - //inputView.btnState.Text = FaceItem.userName; + } inputView.btnState.Text = s; } @@ -459,7 +464,32 @@ { inputView.btnState.Text = Language.StringByID(StringId.quyuruqingaojing); } - + + } + break; + case SPK.SensorPirHold: + { + string value = this.GetKeyValue("people_status", dicList); + if (string.IsNullOrEmpty(value)) + { + inputView.btnState.Text = inputCondition.hold_time + "s"; + break; + + } + + inputView.btnState.Text = Language.StringByID(StringId.wuren); + if (value == "true") + { + inputView.btnState.Text = Language.StringByID(StringId.youren); + + } + if (!string.IsNullOrEmpty(inputCondition.hold_time) && int.Parse(inputCondition.hold_time) > 0) + { + + inputView.btnState.Text += "鎸佺画" + inputCondition.hold_time + "s"; + } + + } break; } @@ -1041,9 +1071,28 @@ stateStr += "," +GetKeyValue("cct", dicList) + "k"; } } + if (device.spk == SPK.LightRGB) + { + string rgb = GetKeyValue("rgb", dicList); + if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6) + { + targetView.btnStateColor.Visible = true; + targetView.btnStateColor.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(rgb); + } + } + if (device.spk == SPK.LightRGBW) + { + string rgb = GetKeyValue("rgbw", dicList); + if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6) + { + targetView.btnStateColor.Visible = true; + targetView.btnStateColor.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(rgb); + } + } } break; + case SPK.CurtainSwitch: { foreach (var dic in dicList) @@ -1140,8 +1189,12 @@ if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "鈩�" : device.GetAttribute("temperature_type").state; + if (string.IsNullOrEmpty(unit)) + { + unit = "鈩�"; + } + stateStr += set_temp + unit + ","; } if (mode != "") @@ -1238,8 +1291,12 @@ } if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "鈩�" : device.GetAttribute("temperature_type").state; + if (string.IsNullOrEmpty(unit)) + { + unit = "鈩�"; + } + stateStr += set_temp + unit + ","; } if (mode != "") { @@ -1584,6 +1641,22 @@ button3.Text = value + "k"; } break; + case "rgb": + case "rgbw": + { + if (button3 == null) + { + //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 + break; + } + if (!string.IsNullOrEmpty(value) && value.Length > 6) + { + button3.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(value); + button3.Tag = value; + } + } + break; + } } @@ -1975,6 +2048,7 @@ } } break; + case SPK.SensorGas: case SPK.SensorSmoke: { @@ -2041,6 +2115,23 @@ button1.Text = Language.StringByID(StringId.wuren); } } + } + break; + case SPK.SensorPirHold: + { + foreach (var dic in dicList) + { + string value = dic["value"]; + if (value == "true") + { + button1.Text = Language.StringByID(StringId.youren); + } + else + { + button1.Text = Language.StringByID(StringId.wuren); + } + } + } break; case SPK.SensorDoorWindow: @@ -2170,12 +2261,15 @@ for (int b = 0; b < dicList.Count; b++) { var dic = dicList[b]; - var userId = dic["value"].ToString(); - var FaceItem = this.GetVideoDoorLockUserItem(userId, device); - s += FaceItem.userName; + //var userId = dic["value"].ToString(); + //var FaceItem = this.GetVideoDoorLockUserItem(userId, device); + //s += FaceItem.userName; + //s += ","; + //tag += FaceItem.userId; + //tag += "_"; + var userName = dic["value"].ToString(); + s += userName; s += ","; - tag += FaceItem.userId; - tag += "_"; } button1.Text = s; button1.Tag = tag; -- Gitblit v1.8.0