From 7ff70bc7c9460c395b59952d55df6e5d6a12a718 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 15 二月 2023 16:27:32 +0800 Subject: [PATCH] Merge branch 'Dev-Wxr' --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 79 +++++++++++++++++++++++++++++++-------- 1 files changed, 63 insertions(+), 16 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 7554d49..6094f4a 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -466,6 +466,21 @@ }; } break; + //pm10 + case SPK.SensorPm10: + { + ///pm210 + LogicView.FunTypeView pm10View = new LogicView.FunTypeView(); + pm10View.btnText.TextID = StringId.pm10; + fLayout.AddChidren(pm10View.FLayoutView()); + + ///pm10鐐瑰嚮浜嬩欢 + pm10View.btnClick.MouseUpEventHandler += (sender, e) => + { + PmCo2TvocAction(this, device, "pm10", StringId.pm10, index, edit); + }; + } + break; //pm2.5 case SPK.SensorPm25: { @@ -540,8 +555,8 @@ fLayout.AddChidren(view1.FLayoutView()); view1.btnClick.MouseUpEventHandler += (sender, e) => { - identifier = "door_call_cloud_event"; - DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1); + this.identifier = "door_call_cloud_event"; + this.DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1); }; LogicView.FunTypeView view2 = new LogicView.FunTypeView(); @@ -550,7 +565,7 @@ fLayout.AddChidren(view2.FLayoutView()); view2.btnClick.MouseUpEventHandler += (sender, e) => { - identifier = "door_pedestrian_records"; + this.identifier = "door_pedestrian_records"; this.FaceAction(this, device, view2.btnState); }; @@ -580,10 +595,30 @@ } if (edit) { - GetEditState(device, index, view1.btnState, view2.btnState, null, null); + this.GetEditState(device, index, view1.btnState, view2.btnState, null, null); } } break; + //澶у崕鎽勫儚澶� + case SPK.IpCam_Imou: + { + LogicView.FunTypeView view = new LogicView.FunTypeView(); + view.btnText.TextID = StringId.quyuruqingaojing; + view.btnText.Name = Language.StringByID(StringId.shipintonghuahujiao); + fLayout.AddChidren(view.FLayoutView()); + view.btnClick.MouseUpEventHandler += (sender, e) => + { + this.identifier = "ipcam_region_alram_event"; + this.DeviceView(device, view.btnState, StringId.shi, StringId.offLogic, 1); + }; + + if (edit) + { + this.GetEditState(device, index, view.btnState, null, null, null); + } + } + break; + } #region 淇濆瓨 ///淇濆瓨View @@ -593,7 +628,7 @@ this.AddChidren(saveView.FLayoutView()); saveView.btnClick.MouseUpEventHandler += (sen, e) => { - Save(device,index, edit); + this.SaveInput(device,index, edit); }; #endregion @@ -604,7 +639,7 @@ /// </summary> /// <param name="index">绱㈠紩鍊�</param> /// <param name="edit"></param> - private void Save(Entity.Function device,int index, bool edit) + private void SaveInput(Entity.Function device,int index, bool edit) { if (selectedState != "unknown") @@ -612,7 +647,7 @@ Input inputDevice = new Input(); inputDevice.condition_type = "3"; inputDevice.sid = device.sid; - inputDevice.condition = dicSateteList; + inputDevice.condition.AddRange(dicSateteList); if (device.spk == SPK.doorgate) { //鍙瀵硅 @@ -623,8 +658,19 @@ inputDevice.condition = new List<Dictionary<string, string>>(); } } - - + else if (device.spk == SPK.IpCam_Imou) + { + //澶у崕鎽勫儚澶� + inputDevice.condition_type = "9"; + inputDevice.identifier = this.identifier; + if (this.identifier == "ipcam_region_alram_event") + { + //condition榛樿[] + inputDevice.condition = new List<Dictionary<string, string>>(); + } + } + + if (edit) { //绉婚櫎鏃ф暟鎹� @@ -855,11 +901,11 @@ || (button.Name == Language.StringByID(StringId.diedaobaojing))) { //鍙湁姣背娉紶鎰熷櫒(鑷爺) - Save(device, mIndex, mEdit); + SaveInput(device, mIndex, mEdit); } else if (button.Name == Language.StringByID(StringId.shipintonghuahujiao)) { //鍙湁姣背娉紶鎰熷櫒(鑷爺) - Save(device, mIndex, mEdit); + SaveInput(device, mIndex, mEdit); } } @@ -882,7 +928,7 @@ if (inputs.condition.Count != 0) { //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = inputs.condition; + dicSateteList.AddRange(inputs.condition); } } new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => @@ -921,7 +967,7 @@ } selectedState = device.spk + "_" + value; AddDictionary(keyValue, value, data_type, comparator); - Save(device,index, edit); + SaveInput(device,index, edit); }); } /// PM2.5,Co2,Tvoc璁剧疆鍊� @@ -944,7 +990,7 @@ if (inputs.condition.Count != 0) { //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = inputs.condition; + dicSateteList.AddRange(inputs.condition); } } PublicInterface view = new PublicInterface(); @@ -970,6 +1016,7 @@ case SPK.SensorPm25: case SPK.SensorTVOC: case SPK.SensorHcho: + case SPK.SensorPm10: { if (!Is_SpkAttribute(key)) { @@ -979,7 +1026,7 @@ break; } AddDictionary(key, values, "integer", "in"); - Save(device, index, edit); + SaveInput(device, index, edit); }); } /// <summary> @@ -1045,7 +1092,7 @@ if (dicList.Count != 0) { //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = dicList; + dicSateteList.AddRange(dicList); } InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4); } -- Gitblit v1.8.0