From 38ee59a8404c1fa9385649f9690c8d671a5d95de Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 31 八月 2023 19:00:22 +0800 Subject: [PATCH] 2023年08月31日19:00:14 --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 8 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 1c1e568..78ef5ab 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -573,6 +573,26 @@ }; } break; + //鐓у害浼犳劅鍣� + case SPK.SensorLight: + { + + ///鐓у害浼犳劅鍣� + LogicView.FunTypeView illuminanceView = new LogicView.FunTypeView(); + illuminanceView.btnText.TextID = StringId.zhaomingdu; + fLayout.AddChidren(illuminanceView.FLayoutView()); + + ///鐐瑰嚮浜嬩欢 + illuminanceView.btnClick.MouseUpEventHandler += (sender, e) => + { + new PublicInterface { }.ViewZuHe(this, StringId.zhaomingdugaoyu, StringId.zhaomingdudiyu, (intText, view) => + { + InputBoxAction(device, intText, index, edit); + }); + + }; + } + break; //鐢查啗 case SPK.SensorHcho: { @@ -1060,6 +1080,7 @@ { if (edit) { + this.function = device; Input inputs = Logic.currlogic.input[index]; //娓呴櫎涔嬪墠鏃ф暟鎹� dicSateteList.Clear(); @@ -1069,44 +1090,63 @@ dicSateteList.AddRange(inputs.condition); } } + int max = 100; + if (device.spk == SPK.SensorLight) + { + //鐓ф槑浼犳劅鍣� + max =int.MaxValue; + } + new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => { - string keyValue = "20"; + string key = "20"; string data_type = "integer"; string comparator = "="; switch (textInt) { case StringId.wendugaoyu: { - keyValue = "temperature"; + key = "temperature"; comparator = ">"; data_type = "float"; } break; case StringId.wendudiyu: { - keyValue = "temperature"; + key = "temperature"; comparator = "<"; data_type = "float"; } break; case StringId.shidugaoyu: { - keyValue = "humidity"; + key = "humidity"; comparator = ">"; } break; case StringId.shidudiyu: { - keyValue = "humidity"; + key = "humidity"; + comparator = "<"; + } + break; + case StringId.zhaomingdugaoyu: + { + key = "illuminance"; + comparator = ">"; + } + break; + case StringId.zhaomingdudiyu: + { + key = "illuminance"; comparator = "<"; } break; } selectedState = device.spk + "_" + value; - AddDictionary(keyValue, value, data_type, comparator); + AddDictionary(key, value, data_type, comparator); SaveInput(device,index, edit); - }); + },1,max); } /// PM2.5,Co2,Tvoc璁剧疆鍊� /// </summary> @@ -1503,6 +1543,10 @@ /// <returns></returns> private bool CheckSpk() { + if (this.function == null) + { + return false; + } if (this.function.spk == SPK.VideoDoorLock || this.function.spk == SPK.doorgate ) @@ -1511,7 +1555,7 @@ } return false; - } + } /// <summary> /// 鍒ゆ柇dictionaryB鏄惁瀹屾暣鍖呭惈鍙︿竴涓猟ictionaryA /// </summary> -- Gitblit v1.8.0