From 87e614af0fa31d7fd632136d95c0c7e584c28477 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 26 二月 2021 13:36:10 +0800
Subject: [PATCH] 20210226-1

---
 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs |  229 ++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 145 insertions(+), 84 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index 8464dfc..9dd0b4b 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -98,8 +98,28 @@
                             case SPK.SensorDoorWindow:
                                 btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorDoorIcon.png";
                                 break;
+                            default:
 
+                                break;
                         }
+                        var powerLowTipAttr = function.status.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
+                        if (powerLowTipAttr != null)
+                        {
+                            if (powerLowTipAttr.value.ToLower() == "low")
+                            {
+                                Button btnTipPowerLow = new Button()
+                                {
+                                    X = Application.GetRealWidth(307),
+                                    Y = Application.GetRealHeight(25),
+                                    Width = Application.GetRealWidth(24),
+                                    Height = Application.GetRealWidth(24),
+                                    UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
+                                    SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
+                                };
+                                this.AddChidren(btnTipPowerLow);
+                            }
+                        }
+
                         break;
                     case FunctionCategory.Music:
                         btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png";
@@ -110,98 +130,107 @@
             }
             else
             {
-                #region 鍔犺浇寮�鍏虫寜閽�
-                /// <summary>
-                /// 寮�鍏虫寜閽�
-                /// </summary>
-                Button btnSwitch;
-                if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
+                if (function.spk == SPK.ClothesHanger)
                 {
-                    btnSwitch = new Button()
-                    {
-                        X = Application.GetRealWidth(303),
-                        Y = Application.GetRealHeight(78),
-                        Width = Application.GetMinRealAverage(32),
-                        Height = Application.GetMinRealAverage(32),
-                        UnSelectedImagePath = "Public/PowerClose.png",
-                        SelectedImagePath = "Public/PowerOpen.png",
-                        IsSelected = function.trait_on_off.curValue.ToString() == "on",
-                        Tag = function.sid + "_Switch",
-                    };
-                    bodyDiv.AddChidren(btnSwitch);
-                    //鍔犺浇寮�鍏虫寜閽簨浠�
-                    LoadEvent_SwitchFunction(btnSwitch, function.attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime));
+                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerGrayIcon.png";
+                    ClothesHangerFragment();
                 }
                 else
                 {
-                    btnSwitch = new Button()
-                    {
-                        X = Application.GetRealWidth(303),
-                        Y = Application.GetRealHeight(58),
-                        Width = Application.GetMinRealAverage(32),
-                        Height = Application.GetMinRealAverage(32),
-                        UnSelectedImagePath = "Public/PowerClose.png",
-                        SelectedImagePath = "Public/PowerOpen.png",
-                        IsSelected = function.trait_on_off.curValue.ToString() == "on",
-                        Tag = function.sid + "_Switch",
-                    };
-                    bodyDiv.AddChidren(btnSwitch);
-                    //鍔犺浇寮�鍏虫寜閽簨浠�
-                    LoadEvent_SwitchFunction(btnSwitch);
-                }
+                    #region 鍔犺浇寮�鍏虫寜閽�
 
-                switch (function.Spk_Prefix)
-                {
-                    case FunctionCategory.AC:
-                        switch (function.spk)
+                    /// <summary>
+                    /// 寮�鍏虫寜閽�
+                    /// </summary>
+                    Button btnSwitch;
+                    if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
+                    {
+                        btnSwitch = new Button()
                         {
-                            case SPK.AcStandard:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
-                                LoadLastStatesButton();
-                                break;
-                        }
-                        break;
-                    case FunctionCategory.FloorHeat:
-                        switch (function.spk)
+                            X = Application.GetRealWidth(303),
+                            Y = Application.GetRealHeight(78),
+                            Width = Application.GetMinRealAverage(32),
+                            Height = Application.GetMinRealAverage(32),
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            IsSelected = function.trait_on_off.curValue.ToString() == "on",
+                            Tag = function.sid + "_Switch",
+                        };
+                        bodyDiv.AddChidren(btnSwitch);
+                        //鍔犺浇寮�鍏虫寜閽簨浠�
+                        LoadEvent_SwitchFunction(btnSwitch, function.attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime));
+                    }
+                    else
+                    {
+                        btnSwitch = new Button()
                         {
-                            case SPK.FloorHeatStandard:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
-                                LoadLastStatesButton();
-                                break;
-                        }
-                        break;
-                    case FunctionCategory.Light:
-                        btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
-                        btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
-                        LoadLightControl();
-                        break;
-                    case FunctionCategory.Electric:
-                        switch (function.spk)
-                        {
-                            case SPK.ElectricSocket:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png";
-                                break;
-                            case SPK.ElectricFan:
-                            case SPK.ElectricTuyaFan:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png";
-                                break;
-                            case SPK.ElectricTV:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
-                                break;
-                            case SPK.ElectricTuyaAirCleaner:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png";
-                                break;
-                            case SPK.ElectricTuyaWeepRobot:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png";
-                                break;
-                            case SPK.ElectricTuyaWaterValve:
-                                btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png";
-                                break;
-                        }
-                        btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
-                        break;
+                            X = Application.GetRealWidth(303),
+                            Y = Application.GetRealHeight(58),
+                            Width = Application.GetMinRealAverage(32),
+                            Height = Application.GetMinRealAverage(32),
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            IsSelected = function.trait_on_off.curValue.ToString() == "on",
+                            Tag = function.sid + "_Switch",
+                        };
+                        bodyDiv.AddChidren(btnSwitch);
+                        //鍔犺浇寮�鍏虫寜閽簨浠�
+                        LoadEvent_SwitchFunction(btnSwitch);
+                    }
+
+                    switch (function.Spk_Prefix)
+                    {
+                        case FunctionCategory.AC:
+                            switch (function.spk)
+                            {
+                                case SPK.AcStandard:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
+                                    LoadLastStatesButton();
+                                    break;
+                            }
+                            break;
+                        case FunctionCategory.FloorHeat:
+                            switch (function.spk)
+                            {
+                                case SPK.FloorHeatStandard:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
+                                    LoadLastStatesButton();
+                                    break;
+                            }
+                            break;
+                        case FunctionCategory.Light:
+                            btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
+                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
+                            LoadLightControl();
+                            break;
+                        case FunctionCategory.Electric:
+                            switch (function.spk)
+                            {
+                                case SPK.ElectricSocket:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png";
+                                    break;
+                                case SPK.ElectricFan:
+                                case SPK.ElectricTuyaFan:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png";
+                                    break;
+                                case SPK.ElectricTV:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
+                                    break;
+                                case SPK.ElectricTuyaAirCleaner:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png";
+                                    break;
+                                case SPK.ElectricTuyaWeepRobot:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png";
+                                    break;
+                                case SPK.ElectricTuyaWaterValve:
+                                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png";
+                                    break;
+                            }
+                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
+                            break;
+                    }
+                    #endregion
                 }
-                #endregion
             }
 
             LoadEvent_DivSkipEvent();
@@ -374,6 +403,38 @@
             LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain);
             #endregion
         }
+        /// <summary>
+        /// 鍔犺浇鏅捐。鏋跺姛鑳芥帶鍒跺崱鐗�
+        /// </summary>
+        void ClothesHangerFragment()
+        {
+            #region ClothesHanger
+            var btnClothesHangerUp = new Button()
+            {
+                X = Application.GetRealWidth(163),
+                Y = Application.GetRealHeight(58),
+                Width = Application.GetMinRealAverage(32),
+                Height = Application.GetMinRealAverage(32),
+                UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerUpIcon1.png",
+                SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerUpIcon1On.png",
+            };
+            bodyDiv.AddChidren(btnClothesHangerUp);
+
+            var btnClothesHangerDown = new Button()
+            {
+                X = Application.GetRealWidth(303),
+                Y = Application.GetRealHeight(58),
+                Width = Application.GetMinRealAverage(32),
+                Height = Application.GetMinRealAverage(32),
+                UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1.png",
+                SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1On.png",
+            };
+            bodyDiv.AddChidren(btnClothesHangerDown);
+            LoadEvent_ControlClothesHanger(function, btnClothesHangerDown, btnClothesHangerUp);
+            #endregion
+
+
+        }
 
         /// <summary>
         /// 鍔犺浇闊充箰鍔熻兘鎺у埗鍗$墖

--
Gitblit v1.8.0