From 1f5d37fbca31293eff043f4a051be6f6876cea09 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 27 六月 2022 09:12:19 +0800
Subject: [PATCH] 跳动优化

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 53 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 1c9b2bc..7f0cc74 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -86,6 +86,22 @@
                         }
                     }
                     break;
+                //绱ф�ュ懠鍙�
+                case SPK.SensorHelp:
+                    {
+                        LogicView.FunTypeView view = new LogicView.FunTypeView();
+                        view.btnText.TextID = StringId.qiujiuandzhengchang;
+                        fLayout.AddChidren(view.FLayoutView());
+                        view.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            DeviceView(device, view.btnState, StringId.qiujiu, StringId.zhengchang);
+                        };
+                        if (edit)
+                        {
+                            GetEditState(device, index, view.btnState, null, null, null);
+                        }
+                    }
+                    break;
                 //姘存蹈浼犳劅鍣�
                 case SPK.SensorWater:
                     {
@@ -361,6 +377,7 @@
                 //tvoc
                 case SPK.SensorTVOC:
                     {
+                        
                         ///tvoc
                         LogicView.FunTypeView tvocView = new LogicView.FunTypeView();
                         tvocView.btnText.TextID = StringId.tvoc;
@@ -387,6 +404,23 @@
                             PmCo2TvocAction(this, device, "hcho", StringId.Formaldehyde, index, edit);
 
                         };
+                    }
+                    break;
+                //闂ㄩ攣
+                case SPK.DoorLock:
+                    {
+
+                        LogicView.FunTypeView view = new LogicView.FunTypeView();
+                        view.btnText.TextID = StringId.shifoukaisuoshi;
+                        fLayout.AddChidren(view.FLayoutView());
+                        view.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            DeviceView(device, view.btnState, StringId.shi, StringId.offLogic,1);
+                        };
+                        if (edit)
+                        {
+                            GetEditState(device, index, view.btnState, null, null, null);
+                        }
                     }
                     break;
             }
@@ -466,12 +500,13 @@
         /// <param name="button">閫変腑鐘舵�佹樉绀烘枃鏈珺tn鎺т欢</param>
         /// <param name="btnText1">灞炴�х姸鎬佸�兼枃鏈�1</param>
         /// <param name="btnText2">灞炴�х姸鎬佸�兼枃鏈�2</param>
-        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2)
+        /// <param name="viewCount">view鏁伴噺</param>
+        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2)
         {
             FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence };
             this.AddChidren(frame);
             LogicView.SwitchView switchView = new LogicView.SwitchView();
-            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, (intValue) =>
+            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, viewCount,(intValue) =>
             {
                 //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�;
                 string keyVlaue = "on_off";
@@ -482,6 +517,7 @@
                     case SPK.SensorGas:
                     case SPK.SensorWater:
                     case SPK.SensorSmoke:
+                    case SPK.SensorHelp:
                         {
                             keyVlaue = "status";
                             if (!Is_SpkAttribute(keyVlaue)) {
@@ -521,6 +557,11 @@
                             {
                                 keyVlaue = "megahealth_state";
                             }
+                        }
+                        break;
+                    case SPK.DoorLock:
+                        {
+                            keyVlaue = "door_status";
                         }
                         break;
 
@@ -566,6 +607,7 @@
                             }
                         }
                         break;
+                    case StringId.shi:
                     case StringId.kaiqi:
                         {
                             value = "open";
@@ -590,6 +632,8 @@
                         {
                             value = "fall";
                         }; break;
+                   
+
                 }
                 //鏄剧ず鏂囨湰
                 button.TextID = intValue;
@@ -666,7 +710,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;
@@ -680,12 +724,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)
                    {
@@ -703,7 +749,7 @@
                            }
                            break;
                    }
-                   AddDictionary(key, value, "integer", "in");
+                   AddDictionary(key, values, "integer", "in");
                    Save(device, index, edit);
                });
         }

--
Gitblit v1.8.0