From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 六月 2020 11:14:13 +0800
Subject: [PATCH] 2020-06-16-1

---
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs |   83 +++++++++++++++++++++++++----------------
 1 files changed, 51 insertions(+), 32 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index d53cdaf..e0f7283 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -106,7 +106,7 @@
                     TextColor = CSS.CSS_Color.MainBackgroundColor,
                     TextSize = CSS.CSS_FontSize.EmphasisFontSize_FirstLevel,
                     TextAlignment = TextAlignment.CenterLeft,
-                    Text = DB_ResidenceData.residenceData.residenceName,
+                    Text = DB_ResidenceData.residenceData.residecenInfo.Name,
                     IsBold = true
                 };
                 topView.AddChidren(btnResidenceName);
@@ -424,7 +424,7 @@
                     };
                     rowView.AddChidren(functionView);
 
-                    LoadSceneFunctionDiv(functionView, function);
+                    LoadSceneFunctionDiv( functionView, function);
                     index++;
                 }
             }
@@ -582,6 +582,24 @@
                                     break;
                             }
                             break;
+                        case FunctionCategory.SwitchDevice:
+                            switch (function.functionType)
+                            {
+                                case FunctionType.Socket:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketIcon.png";
+                                    btnIcon.SelectedImagePath = "FunctionIcon/Socket/SocketOnIcon.png";
+                                    break;
+                            }
+                            break;
+                        case FunctionCategory.Electrical:
+                            switch(function.functionType)
+                            {
+                                case FunctionType.Fan:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanIcon.png";
+                                    btnIcon.SelectedImagePath = "FunctionIcon/Electrical/FanOnIcon.png";
+                                    break;
+                            }
+                            break;
                     }
                     LoadEvent_SwitchFunction(function, btnSwitch);
                 }
@@ -606,36 +624,6 @@
         {
             try
             {
-                Button btnCoverd = new Button()
-                {
-                    UnSelectedImagePath = "Collection/SceneCovered.png",
-                };
-                view.AddChidren(btnCoverd);
-                LoadEvent_ControlScene(btnCoverd, function);
-
-                Button btnDelayIcon;
-                btnDelayIcon = new Button()
-                {
-                    X = Application.GetRealWidth(12),
-                    Y = Application.GetRealWidth(12),
-                    Height = Application.GetRealWidth(24),
-                    Width = Application.GetRealWidth(24),
-                    UnSelectedImagePath = "FunctionIcon/Scene/DelayIcon.png"
-                };
-                view.AddChidren(btnDelayIcon);
-
-                Button btnCollection;
-                btnCollection = new Button()
-                {
-                    X = Application.GetRealWidth(116),
-                    Y = Application.GetRealWidth(8),
-                    Width = Application.GetMinRealAverage(32),
-                    Height = Application.GetMinRealAverage(32),
-                    SelectedImagePath = "Collection/CollectionWhiteIcon.png",
-                    UnSelectedImagePath = "Collection/CollectionIcon.png",
-                };
-                view.AddChidren(btnCollection);
-                LoadEvent_FunctionCollection(btnCollection, function, false);
                 Button btnName;
                 btnName = new Button()
                 {
@@ -665,6 +653,37 @@
                 };
                 view.AddChidren(btnZone);
 
+                Button btnCoverd = new Button()
+                {
+                    UnSelectedImagePath = "Collection/SceneCovered.png",
+                };
+                view.AddChidren(btnCoverd);
+
+                Button btnDelayIcon;
+                btnDelayIcon = new Button()
+                {
+                    X = Application.GetRealWidth(12),
+                    Y = Application.GetRealWidth(12),
+                    Height = Application.GetRealWidth(24),
+                    Width = Application.GetRealWidth(24),
+                    UnSelectedImagePath = "FunctionIcon/Scene/DelayIcon.png"
+                };
+                view.AddChidren(btnDelayIcon);
+
+                Button btnCollection;
+                btnCollection = new Button()
+                {
+                    X = Application.GetRealWidth(116),
+                    Y = Application.GetRealWidth(8),
+                    Width = Application.GetMinRealAverage(32),
+                    Height = Application.GetMinRealAverage(32),
+                    SelectedImagePath = "Collection/CollectionWhiteIcon.png",
+                    UnSelectedImagePath = "Collection/CollectionIcon.png",
+                };
+                view.AddChidren(btnCollection);
+                LoadEvent_FunctionCollection(btnCollection, function, false);
+              
+                LoadEvent_ControlScene(btnCoverd, function);
 
             }
             catch (Exception ex)

--
Gitblit v1.8.0