From 203c3a3ffde6259413d9743f6a723b95b1e7989c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 06 七月 2023 22:43:05 +0800 Subject: [PATCH] 门锁功能 --- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 154 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 16f5d56..430bd42 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; @@ -407,18 +409,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: @@ -427,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; } @@ -1108,8 +1170,8 @@ if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; + stateStr += set_temp + unit+","; } if (mode != "") @@ -1206,8 +1268,8 @@ } if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; + stateStr += set_temp + unit + ","; } if (mode != "") { @@ -1493,7 +1555,7 @@ //寮�鍏崇伅鍏� case SPK.AirSwitch: case SPK.LightSwitch: - //鏈烘鎵� + //鏈烘鎵� case SPK.MechanicalArm: { foreach (var dic in dicList) @@ -1943,6 +2005,7 @@ } } break; + case SPK.SensorGas: case SPK.SensorSmoke: { @@ -2009,6 +2072,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: @@ -2131,6 +2211,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: { @@ -2149,11 +2250,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> @@ -2620,7 +2738,7 @@ } } /// <summary> - /// 鏌ユ壘鎸囧畾userId + /// 鏌ユ壘鎸囧畾鍙瀵硅userId /// </summary> /// <param name="userId"></param> /// <returns></returns> @@ -2637,6 +2755,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