From 37c315988c2dc11e4f477233f7a9f87d57bb61aa Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 08 三月 2021 09:17:15 +0800
Subject: [PATCH] 数据结构优化修改

---
 HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
index 800f8a5..89120fe 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -66,7 +66,8 @@
         #endregion
 
         #region 鍖哄煙鍙橀噺
-        AC aC;
+        AC acTemp = new AC();
+        Function function;
         Button btnCollection_Out;
         Button btnFunctionName_Out;
         Button btnFromFloor_Out;
@@ -75,10 +76,10 @@
         /// </summary>
         Action actionRefresh;
         #endregion
-        public ACPage(AC func)
+        public ACPage(Function func)
         {
             bodyView = this;
-            aC = func;
+            function = func;
         }
 
         public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -107,7 +108,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
-                Text = aC.name,
+                Text = function.name,
             };
             controlView.AddChidren(btnFunctionName);
 
@@ -120,7 +121,7 @@
                 TextColor = CSS_Color.PromptingColor1,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = aC.GetRoomListName()
+                Text = function.GetRoomListName()
             };
             controlView.AddChidren(btnFromFoorAndRoom);
 
@@ -132,7 +133,7 @@
                 Height = Application.GetMinRealAverage(40),
                 SelectedImagePath = "Collection/CollectionIcon.png",
                 UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
-                IsSelected = aC.collect
+                IsSelected = function.collect
             };
             //controlView.AddChidren(btnCollection);
             //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
@@ -145,16 +146,16 @@
             {
                 Gravity = Gravity.CenterHorizontal,
                 OpenAngle = 160,
-                ThumbImagePath = aC.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
+                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                 ThumbImageHeight = Application.GetRealWidth(50),
                 ProgressBarColor = CSS_Color.MainColor,
                 OfflineProgressBarColor = CSS_Color.PromptingColor2,
-                IsOffline = aC.trait_on_off.curValue.ToString() == "off",
-                MinValue = aC.GetAttribute(FunctionAttributeKey.SetTemp).min,
-                MaxValue = aC.GetAttribute(FunctionAttributeKey.SetTemp).max,
-                //IsClickable = aC.trait_on_off.curValue.ToString() == "on",
+                IsOffline = function.trait_on_off.curValue.ToString() == "off",
+                MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
+                MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
+                //IsClickable = function.trait_on_off.curValue.ToString() == "on",
                 ArcColor = CSS_Color.BackgroundColor,
-                Progress = Convert.ToInt32(aC.GetAttrState(FunctionAttributeKey.SetTemp)),
+                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)),
 #if __IOS__
                 Y = Application.GetRealHeight(120 + 25),
                 Width = Application.GetRealWidth(260 - 40),
@@ -179,7 +180,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 50,
                 IsBold = true,
-                Text = aC.GetAttrState(FunctionAttributeKey.SetTemp),
+                Text = function.GetAttrState(FunctionAttributeKey.SetTemp),
                 TextAlignment = TextAlignment.Center,
             };
             controlView.AddChidren(btnTemp);
@@ -236,7 +237,7 @@
                 Y = Application.GetRealHeight(334),
                 Width = Application.GetRealWidth(30),
                 Height = Application.GetRealWidth(30),
-                UnSelectedImagePath = aC.GetModeIconPath(),
+                UnSelectedImagePath = acTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode)),
             };
             controlView.AddChidren(btnMode);
 
@@ -246,7 +247,7 @@
                 Y = Application.GetRealHeight(337),
                 Width = Application.GetRealWidth(30),
                 Height = Application.GetRealWidth(30),
-                UnSelectedImagePath = aC.GetFanIconPath(),
+                UnSelectedImagePath = acTemp.GetFanIconPath(function.GetAttrState(FunctionAttributeKey.FanSpeed)),
             };
             controlView.AddChidren(btnWindSpeed);
 
@@ -258,15 +259,15 @@
                 Height = Application.GetRealWidth(32),
                 UnSelectedImagePath = "Public/PowerClose.png",
                 SelectedImagePath = "Public/PowerOpen.png",
-                IsSelected = aC.trait_on_off.curValue.ToString() == "on"
+                IsSelected = function.trait_on_off.curValue.ToString() == "on"
             };
             controlView.AddChidren(btnSwitch);
 
             LoadEventList();
-            new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(aC, actionRefresh);
+            new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(function, actionRefresh);
             new System.Threading.Thread(() =>
             {
-                DriverLayer.Control.Ins.SendReadCommand(aC);
+                DriverLayer.Control.Ins.SendReadCommand(function);
             })
             { IsBackground = true }.Start();
         }
@@ -318,7 +319,7 @@
             };
             modeChangeView.AddChidren(btnLine);
 
-            var modeList = aC.GetAttribute(FunctionAttributeKey.Mode).value;
+            var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value;
             foreach (var m in modeList)
             {
                 Button btnModeIcon = new Button()
@@ -327,7 +328,7 @@
                     Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                     Width = Application.GetRealWidth(24),
                     Height = Application.GetRealWidth(24),
-                    IsSelected = aC.GetAttrState(FunctionAttributeKey.Mode) == m,
+                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                 };
                 modeChangeView.AddChidren(btnModeIcon);
 
@@ -340,7 +341,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     SelectedTextColor = CSS_Color.MainColor,
-                    IsSelected = aC.GetAttrState(FunctionAttributeKey.Mode) == m,
+                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                     TextSize = CSS_FontSize.TextFontSize,
                 };
                 modeChangeView.AddChidren(btnModeText);
@@ -441,7 +442,7 @@
             };
             modeChangeView.AddChidren(btnLine);
 
-            var modeList = aC.GetAttribute(FunctionAttributeKey.FanSpeed).value;
+            var modeList = function.GetAttribute(FunctionAttributeKey.FanSpeed).value;
             foreach (var m in modeList)
             {
                 Button btnFanIcon = new Button()
@@ -450,7 +451,7 @@
                     Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                     Width = Application.GetRealWidth(24),
                     Height = Application.GetRealWidth(24),
-                    IsSelected = aC.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
+                    IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                 };
                 modeChangeView.AddChidren(btnFanIcon);
 
@@ -463,7 +464,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     SelectedTextColor = CSS_Color.MainColor,
-                    IsSelected = aC.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
+                    IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                     TextSize = CSS_FontSize.TextFontSize,
                 };
                 modeChangeView.AddChidren(btnFanText);

--
Gitblit v1.8.0