From ccdff82fac4bcc1067ec806ade5ae897f1214f4d Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 01 四月 2021 14:41:53 +0800
Subject: [PATCH] 异常捕获

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |   63 +++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 63256f0..d23f3b4 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -76,6 +76,7 @@
 
         public void LoadPage()
         {
+            MainPage.CurPageIndex = 1;
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             #region top
             FrameLayout topView = new FrameLayout()
@@ -473,6 +474,11 @@
                         #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
+                        #region 鑳芥簮
+                        functionCount = FunctionList.List.GetElectricals().Count;
+                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        #endregion
+                        functionCount = 1;
                         break;
                     case ShowFunction.Environmental:
                         #region 鐜鏁版嵁
@@ -480,6 +486,7 @@
                         #endregion
                         break;
                     case ShowFunction.FreshAir:
+                        functionCount = FunctionList.List.GetAirFreshList().Count;
                         break;
                     case ShowFunction.Music:
                         functionCount = Music.A31MusicModel.A31MusicModelList.Count;
@@ -488,12 +495,16 @@
                     case ShowFunction.Panel:
                         break;
                     case ShowFunction.SecurityMonitoring:
-                        functionCount = 1;
+                        //functionCount = 1;
                         break;
                     case ShowFunction.Sensor:
                         functionCount = FunctionList.List.GetArmSensorList().Count;
                         break;
                     case ShowFunction.VideoIntercom:
+                        if (FunctionList.List.videoIntercom != null)
+                        {
+                            functionCount = 1;
+                        }
                         break;
 
                 }
@@ -551,7 +562,8 @@
                 functionView.AddChidren(btnName);
 
                 if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom
-                    && item != ShowFunction.SecurityMonitoring
+                    && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir
+                    && item != ShowFunction.EnergyMonitoring
                     && functionCount != 0)
                 {
                     Button btnFunctionCount = new Button()
@@ -721,14 +733,22 @@
                         #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
+                        #region 鑳芥簮鐩戞祴
                         btnName.TextID = StringId.EnergyMonitoring;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new EnergyMainPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.Environmental:
                         #region 鐜鏁版嵁
                         btnName.TextID = StringId.EnvironmentalData;
                         btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                         {
-                            var skipView = new EnvironmentalSciencePage();
+                            var skipView = new EnvironmentalPage();// EnvironmentalSciencePage();
                             MainPage.BasePageView.AddChidren(skipView);
                             skipView.LoadPage();
                             MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -737,6 +757,27 @@
                         break;
                     case ShowFunction.FreshAir:
                         btnName.TextID = StringId.FreshAir;
+                        #region Light
+                        Button btnFreshAirPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionOnCount > 0,
+                            Tag = item + "_AllControl",
+                        };
+                        functionView.AddChidren(btnFreshAirPower);
+
+                        btnFreshAirPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnFreshAirPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.FreshAir;
+
+                        #endregion
                         break;
                     case ShowFunction.Music:
                         btnName.TextID = StringId.Music;
@@ -755,12 +796,7 @@
                         btnName.TextID = StringId.SecurityMonitoring;
                         btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                         {
-                          
-#if __IOS__
-                            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
-#else  //瀹夊崜鎽勫儚澶�
                             HDLCommon.Current.Go2EZvizMonitor(bodyView);
-#endif
                         };
                         break;
                     case ShowFunction.Sensor:
@@ -769,11 +805,20 @@
                         break;
                     case ShowFunction.VideoIntercom:
                         btnName.TextID = StringId.VideoIntercom;
+
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var mainView = new HDL_ON.UI.UI2.FuntionControlView.Video.MainView();
+                            MainPage.BasePageView.AddChidren(mainView);
+                            mainView.Show();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
                         break;
 
                 }
                 //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�
-                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring)
+                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring
+                    && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item)
                 {
                     btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                     {

--
Gitblit v1.8.0