From af4101b1d8461331bc3163b738fc75d4bf67c85c Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 28 七月 2020 17:47:44 +0800
Subject: [PATCH] 2020-07-28-1

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |  100 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 85 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 323ee88..8bc0bf6 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -564,25 +564,89 @@
                         #endregion
                         break;
                     case ShowFunction.FloorHeating:
+                        #region 鍦扮儹
                         btnName.TextID = StringId.FloorHeating;
+                        functionCount = DB_ResidenceData.residenceData.functionList.floorHeatings.Count;
+                        functionOnCount = DB_ResidenceData.residenceData.functionList.floorHeatings.FindAll((obj) => obj.on_off == "on").Count;
+                        Button btnFhPower = 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 = functionCount == functionOnCount
+                        };
+                        functionView.AddChidren(btnFhPower);
+                        btnFhPower.MouseUpEventHandler = (sender, e) => {
+                            LoadEvent_SwitchFunction(btnFhPower, item);
+                        };
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new FunctionPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage(StringId.FloorHeating);
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.DoorLock:
                         btnName.TextID = StringId.DoorLock;
                         break;
                     case ShowFunction.Electric:
+                        #region 鐢靛櫒
                         btnName.TextID = StringId.Electric;
+                        functionCount = DB_ResidenceData.residenceData.functionList.electricals.Count;
+                        functionOnCount = DB_ResidenceData.residenceData.functionList.electricals.FindAll((obj) => obj.on_off == "on").Count;
+                        Button btnElectricPower = 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 = functionCount == functionOnCount
+                        };
+                        functionView.AddChidren(btnElectricPower);
+                        btnElectricPower.MouseUpEventHandler = (sender, e) => {
+                            LoadEvent_SwitchFunction(btnElectricPower, item);
+                        };
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new FunctionPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage(StringId.Electric);
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
                         btnName.TextID = StringId.EnergyMonitoring;
                         break;
                     case ShowFunction.Environmental:
-                        btnName.TextID = StringId.Environmental;
+                        #region 鐜鏁版嵁
+                        btnName.TextID = StringId.EnvironmentalData;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new EnvironmentalSciencePage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.FreshAir:
                         btnName.TextID = StringId.FreshAir;
                         break;
                     case ShowFunction.Music:
                         btnName.TextID = StringId.Music;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var musicMain = new HDL_ON.UI.Music.MusicMain();
+                            MainPage.BasePageView.AddChidren(musicMain);
+                            musicMain.Show();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+
                         break;
                     case ShowFunction.Panel:
                         btnName.TextID = StringId.Panel;
@@ -592,26 +656,29 @@
                         break;
                     case ShowFunction.Sensor:
                         btnName.TextID = StringId.Sensor;
+
                         break;
                     case ShowFunction.VideoIntercom:
                         btnName.TextID = StringId.VideoIntercom;
                         break;
 
                 }
-
-                Button btnFunctionCount = new Button()
+                if (item != ShowFunction.Environmental)
                 {
-                    X = Application.GetRealWidth(16),
-                    Y = btnName.Bottom,
-                    Width = Application.GetRealWidth(120),
-                    Height = Application.GetRealHeight(24),
-                    TextColor = CSS_Color.FirstLevelTitleColor,
-                    TextSize = CSS_FontSize.TextFontSize,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    Text = functionOnCount + "/" + functionCount,
-                    Tag = item + "_onCount"
-                };
-                functionView.AddChidren(btnFunctionCount);
+                    Button btnFunctionCount = new Button()
+                    {
+                        X = Application.GetRealWidth(16),
+                        Y = btnName.Bottom,
+                        Width = Application.GetRealWidth(120),
+                        Height = Application.GetRealHeight(24),
+                        TextColor = CSS_Color.FirstLevelTitleColor,
+                        TextSize = CSS_FontSize.TextFontSize,
+                        TextAlignment = TextAlignment.CenterLeft,
+                        Text = functionOnCount + "/" + functionCount,
+                        Tag = item + "_onCount"
+                    };
+                    functionView.AddChidren(btnFunctionCount);
+                }
                 index++;
             }
             #endregion
@@ -652,7 +719,10 @@
 
                 List<string> chooseList = new List<string>();
                 chooseList.Add(Language.StringByID(StringId.All));
-                chooseList.AddRange(DB_ResidenceData.residenceData.floors);
+                foreach (var f in DB_ResidenceData.residenceData.floors)
+                {
+                    chooseList.Add(f.name);
+                }
 
                 foreach (var floor in chooseList)
                 {

--
Gitblit v1.8.0