From ea285ffe71284f5499e870f89c65b710d2d6a79c Mon Sep 17 00:00:00 2001
From: lss <lsc@hdlchina.com.cn>
Date: 星期一, 27 六月 2022 10:54:32 +0800
Subject: [PATCH] Merge branch 'wxr0114' of http://59.41.255.150:6688/r/~wxr/OnPro into wxr0114

---
 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs |  144 +++++++++++++++++++++++++----------------------
 1 files changed, 76 insertions(+), 68 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index bdc7f95..ca02d57 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -118,7 +118,15 @@
         /// </summary>
         private void InitFrameWhiteContent1()
         {
+            //鑾峰彇娓╁害鍊�
             temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+            if (temp <= 0)
+            {
+                //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
+                temp = 16;
+                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
+            }
+           
             arcBar = new DiyArcSeekBar()
             {
                 Gravity = Gravity.CenterHorizontal,
@@ -147,7 +155,7 @@
             arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off";
             arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min;
             arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max;
-            arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+            arcBar.Progress = temp;
 
             btnTemp = new Button()
             {
@@ -158,7 +166,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 50,
                 IsBold = true,
-                Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(),
+                Text = Convert.ToDouble(temp).ToString(),
                 TextAlignment = TextAlignment.Center,
             };
             FrameWhiteCentet1.AddChidren(btnTemp);
@@ -358,15 +366,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
-                    //if (!device.online)
-                    //{
-                    //    new Tip()
-                    //    {
-                    //        CloseTime = 1,
-                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                    //        Direction = AMPopTipDirection.None,
-                    //    }.Show(MainPage.BaseView);
-                    //}
+                    if (!device.online)
+                    {
+                        new Tip()
+                        {
+                            CloseTime = 1,
+                            Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                            Direction = AMPopTipDirection.None,
+                        }.Show(MainPage.BaseView);
+                    }
                     btnModeIcon.IsSelected = btnModeText.IsSelected = true;
                     device.SetAttrState(FunctionAttributeKey.Mode, m);
                     btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(m);
@@ -494,15 +502,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
-                    //if (!device.online)
-                    //{
-                    //    new Tip()
-                    //    {
-                    //        CloseTime = 1,
-                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                    //        Direction = AMPopTipDirection.None,
-                    //    }.Show(MainPage.BaseView);
-                    //}
+                    if (!device.online)
+                    {
+                        new Tip()
+                        {
+                            CloseTime = 1,
+                            Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                            Direction = AMPopTipDirection.None,
+                        }.Show(MainPage.BaseView);
+                    }
                     btnModeIcon.IsSelected = btnModeText.IsSelected = true;
                     device.SetAttrState(FunctionAttributeKey.Swing, m);
                     btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(m);
@@ -618,15 +626,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
-                    //if (!device.online)
-                    //{
-                    //    new Tip()
-                    //    {
-                    //        CloseTime = 1,
-                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                    //        Direction = AMPopTipDirection.None,
-                    //    }.Show(MainPage.BaseView);
-                    //}
+                    if (!device.online)
+                    {
+                        new Tip()
+                        {
+                            CloseTime = 1,
+                            Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                            Direction = AMPopTipDirection.None,
+                        }.Show(MainPage.BaseView);
+                    }
                     btnFanIcon.IsSelected = btnFanText.IsSelected = true;
                     device.SetAttrState(FunctionAttributeKey.FanSpeed, m);
                     btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(m);
@@ -814,15 +822,15 @@
 
                 btn.MouseUpEventHandler = (sender, e) =>
                 {
-                    //if (!device.online)
-                    //{
-                    //    new Tip()
-                    //    {
-                    //        CloseTime = 1,
-                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                    //        Direction = AMPopTipDirection.None,
-                    //    }.Show(MainPage.BaseView);
-                    //}
+                    if (!device.online)
+                    {
+                        new Tip()
+                        {
+                            CloseTime = 1,
+                            Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                            Direction = AMPopTipDirection.None,
+                        }.Show(MainPage.BaseView);
+                    }
                     Dictionary<string, string> d = new Dictionary<string, string>();
                     d.Add(attr.key, "");
                     Control.Ins.SendWriteCommand(device, d);
@@ -877,15 +885,15 @@
         {
             btnMinus.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!device.online)
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //}
+                if (!device.online)
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                }
                 if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                 {
                     return;
@@ -907,15 +915,15 @@
             };
             btnPlus.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!device.online)
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //}
+                if (!device.online)
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                }
                 if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                 {
                     return;
@@ -933,7 +941,7 @@
                 d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                 Control.Ins.SendWriteCommand(device, d);
             };
-            //if (device.online)
+            if (!device.online)
             {
                 arcBar.OnStopTrackingTouchEvent = (sender, e) =>
                 {
@@ -941,7 +949,7 @@
                     device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                     btnTemp.Text = arcBar.Progress.ToString();
                     controlTime = DateTime.Now;
-                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                     d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                     Control.Ins.SendWriteCommand(device, d);
                 };
@@ -994,15 +1002,15 @@
 
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!device.online)
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //}
+                if (!device.online)
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                }
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
                 device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                 if (device.trait_on_off.curValue.ToString() == "on")
@@ -1049,7 +1057,7 @@
                     btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false);
                     btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false);
                     temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
-
+                   
 
                     arcBar.Progress = temp;
                     btnTemp.Text = temp.ToString() ;

--
Gitblit v1.8.0