From 35a33afeeb29466c20ee39dc34e0468d687afce9 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 20 十一月 2020 17:47:38 +0800
Subject: [PATCH] 2020-11-20-1

---
 HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs |   49 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
index 363da7c..b2f5478 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -1,4 +1,5 @@
 锘縰sing System;
+using HDL_ON.DriverLayer;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -22,6 +23,7 @@
         Button btnSceneTilte;
 
         #region 鍦烘櫙搴曢儴鍒囨崲鏄剧ず鍖哄煙
+        FrameLayout topView;
         /// <summary>
         /// 鍦烘櫙鍖哄煙锛岄《閮ㄥ尯鍩�
         /// </summary>
@@ -60,7 +62,7 @@
         {
             bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
             #region top
-            FrameLayout topView = new FrameLayout()
+            topView = new FrameLayout()
             {
                 Height = Application.GetRealHeight(64),
                 BackgroundColor = CSS_Color.TopViewColor,
@@ -188,6 +190,8 @@
         /// </summary>
         void LoadSceneFunctionControlZone()
         {
+            //topView.AddChidren(btnAddIcon);
+
             sceneFunctionView.RemoveAll();
             var rowView = new FrameLayout();
             try
@@ -360,6 +364,9 @@
         /// </summary>
         void LoadAutomationPageView()
         {
+            //btnAddIcon.RemoveFromParent();
+            ///娓呴櫎涔嬪墠鐣岄潰鏁版嵁閲嶆柊鍔犺浇鏂版暟鎹紱
+            contentPageView.RemoveAll();
             automationPage = new FrameLayout();
             contentPageView.AddChidren(automationPage);
 
@@ -435,9 +442,9 @@
                 btnSceneTilte.TextSize = CSS_FontSize.HeadlineFontSize;
                 btnAutomationTitle.IsSelected = false;
                 btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize;
-
                 contentPageView.PageIndex = 0;
             };
+            //閫昏緫鐐瑰嚮浜嬩欢
             btnAutomationTitle.MouseUpEventHandler = (sender, e) => {
                 if (btnAutomationTitle.IsSelected)
                 {
@@ -448,6 +455,8 @@
                 btnSceneTilte.IsSelected = false;
                 btnSceneTilte.TextSize = CSS_FontSize.TextFontSize;
                 contentPageView.PageIndex = 1;
+                LoadAutomationPageView();
+
             };
         }
         #endregion
@@ -459,13 +468,22 @@
         {
             btnAddIcon.MouseUpEventHandler = (sender, e) =>
             {
-                Action action = () => {
-                    LoadSceneFunctionControlZone();
-                };
-                var aep = new NewSceneMenuListPage(action);
-                MainPage.BasePageView.AddChidren(aep);
-                aep.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                if (!btnAutomationTitle.IsSelected)
+                {
+                    Action action = () =>
+                    {
+                        LoadSceneFunctionControlZone();
+                    };
+                    var aep = new NewSceneMenuListPage(action);
+                    MainPage.BasePageView.AddChidren(aep);
+                    aep.LoadPage();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
+                else
+                {
+                    //璺宠浆鍒伴�昏緫鐣岄潰
+                    SkipAddLogicPage();
+                }
             };
         }
 
@@ -480,12 +498,23 @@
             {
                 string msg = function.name + Language.StringByID(StringId.AlreadyOpened);
                 new PublicAssmebly().TipMsgAutoClose(msg, true);
-                Control.Send(function);
+                Control.ins.ControlScene(function as Scene);
             };
             btnCoverd.MouseUpEventHandler = eventHandler;
             btnName.MouseUpEventHandler = eventHandler;
             btnZone.MouseUpEventHandler = eventHandler;
         }
+        /// <summary>
+        /// 璺宠浆鍒伴�昏緫鐣岄潰鐨勬柟娉�
+        /// </summary>
+        public void SkipAddLogicPage()
+        {
+            HDL_ON.UI.UI2.Intelligence.Automation.Logic.currlogic = new UI2.Intelligence.Automation.Logic();
+            var addLogic = new UI2.Intelligence.Automation.AddLogic();
+            MainPage.BasePageView.AddChidren(addLogic);
+            addLogic.Show();
+            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+        }
     }
 
 }

--
Gitblit v1.8.0