From 32ad85a377b00bc54ad7f15a45d7631d3e2b10d5 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 13 六月 2022 17:41:12 +0800 Subject: [PATCH] 2022年06月13日17:39:46 --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 100 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 94 insertions(+), 6 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 2b606ad..af47048 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -24,10 +24,20 @@ /// 瀹氫箟涓�涓彉閲忥紝璁板綍閫変腑鐘舵�� /// </summary> private string selectedState = "unknown"; + /// <summary> + /// 鏄笉鏄啀娆$紪杈� + /// </summary> + private bool mEdit; + /// <summary> + /// 杈撳叆鏉′欢鍒楄〃绱㈠紩鍊� + /// </summary> + private int mIndex; public void Show(Entity.Function device, int index, bool edit) { this.function = device; + this.mEdit = edit; + this.mIndex = index; #region 鐣岄潰甯冨眬 this.BackgroundColor = CSS.CSS_Color.viewMiddle; LogicView.TopView topView = new LogicView.TopView(); @@ -217,8 +227,36 @@ } } break; - //姣背娉紶鎰熷櫒 + //姣背娉紶鎰熷櫒(鑷爺鍖楅偖) case SPK.SenesorMegahealth: + { + + LogicView.FunTypeView view1= new LogicView.FunTypeView(); + view1.btnText.TextID = StringId.diedaobaojing; + view1.btnState.Name = Language.StringByID(StringId.diedaobaojing); + fLayout.AddChidren(view1.FLayoutView()); + view1.btnClick.MouseUpEventHandler += (sender, e) => + { + DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1); + }; + + LogicView.FunTypeView view2 = new LogicView.FunTypeView(); + view2.frameLayout.Y = view1.frameLayout.Bottom; + view2.btnText.TextID = StringId.yourenbaojing; + view2.btnState.Name = Language.StringByID(StringId.yourenbaojing); + fLayout.AddChidren(view2.FLayoutView()); + view2.btnClick.MouseUpEventHandler += (sender, e) => + { + DeviceView(device, view2.btnState, StringId.shi, StringId.offLogic, 1); + }; + if (edit) + { + GetEditState(device, index, view1.btnState, view2.btnState, null, null); + } + + } + break; + //姣背娉紶鎰熷櫒(鍏嗚涓撶敤浜戜簯瀵规帴) case SPK.SenesorMegahealth2: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -377,6 +415,7 @@ //tvoc case SPK.SensorTVOC: { + ///tvoc LogicView.FunTypeView tvocView = new LogicView.FunTypeView(); tvocView.btnText.TextID = StringId.tvoc; @@ -549,6 +588,23 @@ } break; case SPK.SenesorMegahealth: + { + if (button != null) + { + + if (button.Name == Language.StringByID(StringId.yourenbaojing)) + { + keyVlaue = "people_status"; + + } + else + { + keyVlaue = "target_status"; + } + } + + } + break; case SPK.SenesorMegahealth2: { keyVlaue = "action_state"; @@ -607,6 +663,25 @@ } break; case StringId.shi: + { + value = "open"; + if (button != null) + { + + if (button.Name == Language.StringByID(StringId.yourenbaojing)) + { + //鐘舵��(鏈変汉) + value = "true"; + + } + else if(button.Name == Language.StringByID(StringId.diedaobaojing)) + { + //璺屽�� + value = "4"; + } + } + } + break; case StringId.kaiqi: { value = "open"; @@ -638,6 +713,17 @@ button.TextID = intValue; selectedState = device.spk + "_" + value; AddDictionary(keyVlaue, value, "string"); + if (button != null) + { + + if (button.Name == Language.StringByID(StringId.yourenbaojing) + || (button.Name == Language.StringByID(StringId.diedaobaojing))) + { + //鍙湁姣背娉紶鎰熷櫒(鑷爺) + Save(device, mIndex, mEdit); + } + } + }); @@ -709,7 +795,7 @@ /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�""</param> public void PmCo2TvocAction(FrameLayout frame, Entity.Function device, string key, int title, int index, bool edit, string stateValue = "") { - if (edit) + if (edit) { /// this.function = device; @@ -723,12 +809,14 @@ } } PublicInterface view = new PublicInterface(); - var listStr = view.GetViewList(key); - view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue) + //var listStr = view.GetViewList(key); + var listStr = view.GetSensorLevelList(device);//2022骞�05鏈�25鏃�10:01:33 浜у搧缁忕悊鍚涚厡瑕佹眰鏀规垚鍔ㄦ�� + view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetSensorLevelText(device, stateValue,true) , (text) => { - var value = view.GetValue(key, text); + //var value = view.GetValue(key, text); + var values = view.GetSensorLevelText(device,text,false); selectedState = device.spk + "_" + key; switch (device.spk) { @@ -746,7 +834,7 @@ } break; } - AddDictionary(key, value, "integer", "in"); + AddDictionary(key, values, "integer", "in"); Save(device, index, edit); }); } -- Gitblit v1.8.0