From ed9547e90c664739da9d3535bc01f66f24e184db Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 09 六月 2021 17:46:32 +0800
Subject: [PATCH] Merge branch 'tzy2' into wxr6

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   71 +++++++++++++++++++++++++++++------
 1 files changed, 59 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index cd334f8..5e24b64 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -135,13 +135,14 @@
                         }
                     }
                     break;
-                case SPK.SensorDoorWindow: {
+                case SPK.SensorDoorWindow:
+                    {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
                         view.btnText.TextID = StringId.kaiqiandbihe;
                         fLayout.AddChidren(view.FLayoutView());
                         view.btnClick.MouseUpEventHandler += (sender, e) =>
                         {
-                            DeviceView(device, view.btnState, StringId.kaiqi , StringId.bihe);
+                            DeviceView(device, view.btnState, StringId.kaiqi, StringId.bihe);
                         };
                         if (edit)
                         {
@@ -151,7 +152,7 @@
                     break;
                 case SPK.SensoruUtrasonic:
                     {
-                        
+
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
                         view.btnText.TextID = StringId.yourenandwuren;
                         fLayout.AddChidren(view.FLayoutView());
@@ -171,6 +172,21 @@
                         if (edit)
                         {
                             GetEditState(device, index, view.btnState, view1.btnState, null, null);
+                        }
+                    }
+                    break;
+                case SPK.SenesorMegahealth:
+                    {
+                        LogicView.FunTypeView view = new LogicView.FunTypeView();
+                        view.btnText.TextID = StringId.mubiaozhuangtai ;//鐩爣鐘舵��
+                        fLayout.AddChidren(view.FLayoutView());
+                        view.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            DeviceView(device, view.btnState, StringId.wuren, StringId.diedao);
+                        };
+                        if (edit)
+                        {
+                            GetEditState(device, index, view.btnState, null, null, null);
                         }
                     }
                     break;
@@ -214,10 +230,22 @@
                     return;
                 }
                 LogicMethod.RemoveAllView();
-                AddLogic addLogic = new AddLogic();
-                MainPage.BasePageView.AddChidren(addLogic);
-                addLogic.Show();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+                if (MainView.IsGatewayType)
+                { //A缃戝叧
+                    var addLogic = new AddLogic();
+                    MainPage.BasePageView.AddChidren(addLogic);
+                    addLogic.Show();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
+                else
+                {
+                    //涓�绔彛缃戝叧
+                    var onePortAutomation = new OnePortAutomation();
+                    MainPage.BasePageView.AddChidren(onePortAutomation);
+                    onePortAutomation.Show();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
             };
 
             #endregion
@@ -255,6 +283,11 @@
                             keyVlaue = "status";
                         }
                         break;
+                    case SPK.SenesorMegahealth:
+                        {
+                            keyVlaue = "action_state";
+                        }
+                        break;
 
                 }
                 switch (intValue)
@@ -281,12 +314,21 @@
                             value = "off";
                         }
                         break;
-                    case StringId.youren: {
+                    case StringId.youren:
+                        {
                             value = "true";
                         }
                         break;
-                    case StringId.wuren: {
-                            value = "false";
+                    case StringId.wuren:
+                        {
+                            if (device.spk == SPK.SenesorMegahealth)
+                            {
+                                value = "uninhabited";
+                            }
+                            else
+                            {
+                                value = "false";
+                            }
                         }
                         break;
                     case StringId.kaiqi:
@@ -299,15 +341,20 @@
                             value = "close";
                         }
                         break;
-                    case StringId.zaixian: {
+                    case StringId.zaixian:
+                        {
                             keyVlaue = "dismantle";
                             value = "true";
-                        };break;
+                        }; break;
                     case StringId.buzaixian:
                         {
                             keyVlaue = "dismantle";
                             value = "false";
                         }; break;
+                    case StringId.diedao:
+                        {
+                            value = "fall";
+                        }; break;
                 }
                 //鏄剧ず鏂囨湰
                 button.TextID = intValue;

--
Gitblit v1.8.0