From bd428f23e1eb103c19ebbf1f0165f9e2e7b0a9d0 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 09 五月 2023 09:11:18 +0800 Subject: [PATCH] Merge branch 'Dev-Wxr' into Dev-Branch --- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 137 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 125 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index 4d994e1..7055171 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -162,6 +162,7 @@ //绌鸿皟 case SPK.AcStandard: case SPK.HvacAC: + case SPK.AcIr: //鍦扮儹 case SPK.HvacFloorHeat: case SPK.FloorHeatStandard: @@ -311,7 +312,7 @@ } } break; - case SPK.SensorEnvironment: + case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin: case SPK.SensorEnvironment2: case SPK.SensorEnvironment3: { @@ -386,6 +387,7 @@ } break; + case SPK.SensorPm10: case SPK.SensorCO2: case SPK.SensorPm25: case SPK.SensorTVOC: @@ -405,18 +407,53 @@ } } break; + case SPK.VideoDoorLock: + { + string s = string.Empty; + string tag = string.Empty; + 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; + //s += ","; + //tag += FaceItem.userId; + //tag += "_"; + var userName = dic["value"].ToString(); + s += userName; + s += ","; + } + inputView.btnState.Text = s; + } + break; case SPK.doorgate: { + string s = string.Empty; if (inputCondition.identifier == "door_call_cloud_event") { - inputView.btnState.Text = Language.StringByID(StringId.shipintonghuahujiao); + s = Language.StringByID(StringId.shipintonghuahujiao); } else { - string userId = this.GetKeyValue("user_id",dicList); - var FaceItem = this.GetFaceItem(userId, device.deviceId); - inputView.btnState.Text = FaceItem.userName; + for (int b = 0; b < dicList.Count; b++) + { + var dic = dicList[b]; + var key = dic["key"].ToString(); + if (key != "user_id") + { + continue; + } + var userId = dic["value"].ToString(); + var FaceItem = this.GetFaceItem(userId, device.deviceId); + s += FaceItem.userName; + s += ","; + + + } + } + inputView.btnState.Text = s; } break; case SPK.IpCam_Imou: @@ -671,7 +708,7 @@ { //鐢╯id鎵惧埌璁惧锛� var device = LogicMethod.Current.GetDevice(inputCondition.sid); - if (device.spk == SPK.SensorEnvironment + if (device.spk == SPK.SensorEnvironment || device.spk == SPK.SensorEnvironmentHailin || device.spk == SPK.SensorEnvironment2 || device.spk == SPK.SensorEnvironment3 ) @@ -756,6 +793,12 @@ { this.SensorView(thisView, device, "co2", indexVulae); + + } + else if (device.spk == SPK.SensorPm10) + { + + this.SensorView(thisView, device, "pm10", indexVulae); } else if (device.spk == SPK.SensorPm25) @@ -1074,6 +1117,7 @@ break; case SPK.AcStandard: case SPK.HvacAC: + case SPK.AcIr: { string on_off = GetKeyValue("on_off", dicList); string set_temp = GetKeyValue("set_temp", dicList); @@ -1484,7 +1528,7 @@ //寮�鍏崇伅鍏� case SPK.AirSwitch: case SPK.LightSwitch: - //鏈烘鎵� + //鏈烘鎵� case SPK.MechanicalArm: { foreach (var dic in dicList) @@ -1655,6 +1699,7 @@ break; case SPK.AcStandard: case SPK.HvacAC: + case SPK.AcIr: { foreach (var dic in dicList) { @@ -2121,6 +2166,27 @@ } } break; + case SPK.VideoDoorLock: + { + string s = string.Empty; + string tag = string.Empty; + 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; + //s += ","; + //tag += FaceItem.userId; + //tag += "_"; + var userName = dic["value"].ToString(); + s += userName; + s += ","; + } + button1.Text = s; + button1.Tag = tag; + } + break; case SPK.MusicStandard: case SPK.AvMusic: { @@ -2139,11 +2205,28 @@ break; case SPK.doorgate: { - string value = this.GetKeyValue("user_id", dicList); - button2.Text = this.GetFaceItem(value, device.deviceId).userName; + string s = string.Empty; + string tag = string.Empty; + for (int b = 0; b < dicList.Count; b++) + { + var dic = dicList[b]; + var key = dic["key"].ToString(); + if (key != "user_id") + { + continue; + } + var userId = dic["value"].ToString(); + var FaceItem = this.GetFaceItem(userId, device.deviceId); + s += FaceItem.userName; + s += ","; + tag += FaceItem.userId; + tag += "_"; + } + button2.Text = s; + button2.Tag = tag; } break; - + } } /// <summary> @@ -2320,6 +2403,7 @@ break; case SPK.AcStandard: case SPK.HvacAC: + case SPK.AcIr: case SPK.FloorHeatStandard: case SPK.HvacFloorHeat: { @@ -2513,6 +2597,11 @@ strtext = Language.StringByID(StringId.co2) + new PublicInterface { }.GetString("co2", value); } break; + case "pm10": + { + strtext = Language.StringByID(StringId.pm10) + new PublicInterface { }.GetString("pm25", value); + } + break; case "pm25": { strtext = Language.StringByID(StringId.pm25) + new PublicInterface { }.GetString("pm25", value); @@ -2539,8 +2628,9 @@ Input inputedit = Logic.currlogic.input[indexVulae]; ///鐘舵�佸�� string stateValue = ""; - foreach (var dic in inputedit.condition) + for (int i=0;i<inputedit.condition.Count;i++) { + var dic = inputedit.condition[i]; string comparator = dic["comparator"]; stateValue = dic["value"]; switch (key) @@ -2579,6 +2669,11 @@ ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); } break; + case "pm10": + { + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "pm10", StringId.pm10, indexVulae, true, stateValue); + } + break; case "pm25": { ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); @@ -2598,7 +2693,7 @@ } } /// <summary> - /// 鏌ユ壘鎸囧畾userId + /// 鏌ユ壘鎸囧畾鍙瀵硅userId /// </summary> /// <param name="userId"></param> /// <returns></returns> @@ -2615,6 +2710,24 @@ } return face; } + /// <summary> + /// 鏌ユ壘鎸囧畾钀ょ煶瑙嗛闂ㄩ攣userId + /// </summary> + /// <param name="userId"></param> + /// <returns></returns> + public Face GetVideoDoorLockUserItem(string userId, Function device) + { + if (Send.Current.VideoDoorLockUserListInfo.Count == 0) + { + Send.Current.GetVideoDoorLockUserListInfo(device); + } + var face = Send.Current.VideoDoorLockUserListInfo.Find((o) => { return o.userId == userId; }); + if (face == null) + { + face = new Face(); + } + return face; + } } } -- Gitblit v1.8.0