From 330e3ae4cdd1e9facb14b6ea2b3e609166c04fd3 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 12 一月 2021 16:00:27 +0800
Subject: [PATCH] 2021-1-12-1

---
 HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
index 41538e1..c652a45 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -24,26 +24,41 @@
                         return;
                     }
                     updataTime = DateTime.Now;
-                    bodyView.arcBar.IsOffline = bodyView.aC.trait_on_off.curValue.ToString() != "on";
+                    //bodyView.arcBar.IsOffline = bodyView.aC.trait_on_off.curValue.ToString() != "on";
+                    //bodyView.btnSwitch.IsSelected = uAc.trait_on_off.curValue.ToString() == "on";
+                    //if (uAc.refreshTime.AddMilliseconds(500) < DateTime.Now)
+                    //{
+                    //    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue));
+                    //}
+                    //bodyView.arcBar.ThumbImagePath = uAc.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png";
+                    //bodyView.arcBar.IsClickable = uAc.trait_on_off.curValue.ToString() == "on";
                     bodyView.btnTemp.Text = uAc.trait_temp.curValue.ToString();
                     bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(uAc.trait_IndoorTemp.curValue)) + "掳C";
                     bodyView.btnMode.UnSelectedImagePath = uAc.curModeImage;
                     bodyView.btnWindSpeed.UnSelectedImagePath = uAc.curFanImage;
-                    bodyView.btnSwitch.IsSelected = uAc.trait_on_off.curValue.ToString() == "on";
-                    if (uAc.refreshTime.AddMilliseconds(500) < DateTime.Now)
+                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue));
+                    if (uAc.trait_on_off.curValue.ToString() == "on")
                     {
-                        bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue));
-                    }
-                    bodyView.arcBar.ThumbImagePath = uAc.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png";
-                    bodyView.arcBar.IsClickable = uAc.trait_on_off.curValue.ToString() == "on";
-                    if(uAc.trait_mode.curValue.ToString() == "fan")
-                    {
-                        bodyView.arcBar.IsClickable = false;
+                        bodyView.arcBar.IsOffline = false;
+                        bodyView.btnSwitch.IsSelected = true;
+                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
+                        if (uAc.trait_mode.curValue.ToString() == "fan")
+                        {
+                            bodyView.arcBar.IsClickable = false;
+                        }
+                        else
+                        {
+                            bodyView.arcBar.IsClickable = true;
+                        }
                     }
                     else
                     {
-                        bodyView.arcBar.IsClickable = true;
+                        bodyView.arcBar.IsOffline = true;
+                        bodyView.btnSwitch.IsSelected = false;
+                        bodyView.arcBar.IsClickable = false;
+                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                     }
+                   
                 });
             }
             catch (Exception ex)
@@ -197,6 +212,7 @@
                 btnMode.UnSelectedImagePath = aC.curModeImage;
                 //Control.Send(CommandType_A.write, aC);
                 System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+                btnMode.UnSelectedImagePath = btn1.UnSelectedImagePath;
                 d.Add(FunctionAttributeKey.Mode, curMode);
                 Control.Ins.SendWriteCommand(aC, d);
                 dialog.Close();
@@ -218,7 +234,7 @@
         /// </summary>
         void LoadEvent_ChangeFan(Dialog dialog, FrameLayout dialogView, Button btn1, Button btn2, string curFan)
         {
-            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            EventHandler<MouseEventArgs> closeDialogEvent = (sender, e) =>
             {
                 dialog.Close();
             };
@@ -227,15 +243,15 @@
                 btn1.IsSelected = btn2.IsSelected = true;
                 aC.trait_fan.curValue = curFan;
                 btnWindSpeed.UnSelectedImagePath = aC.curFanImage;
-                //Control.Send(CommandType_A.write, aC);
                 System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                 d.Add(FunctionAttributeKey.FanSpeed, curFan);
                 Control.Ins.SendWriteCommand(aC, d);
+                btnWindSpeed.UnSelectedImagePath = btn1.UnSelectedImagePath;
                 dialog.Close();
             };
             btn1.MouseUpEventHandler = eventHandler1;
             btn2.MouseUpEventHandler = eventHandler1;
-            dialogView.MouseUpEventHandler = eventHandler;
+            dialogView.MouseUpEventHandler = closeDialogEvent;
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0