From b079d370b3c23751a5d200dc2d25f6c80977b4d4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 11 三月 2022 15:03:50 +0800
Subject: [PATCH] 代码同步

---
 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs |  113 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 89 insertions(+), 24 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index 83bbe40..cd5aefc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -358,6 +358,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
+                    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);
@@ -485,6 +494,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
+                    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);
@@ -600,6 +618,15 @@
                 };
                 EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                 {
+                    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);
@@ -787,6 +814,15 @@
 
                 btn.MouseUpEventHandler = (sender, e) =>
                 {
+                    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);
@@ -841,11 +877,20 @@
         {
             btnMinus.MouseUpEventHandler = (sender, e) =>
             {
+                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;
                 }
-                
+
                 if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min)
                 {
                     return;
@@ -862,6 +907,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.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                 {
                     return;
@@ -879,31 +933,33 @@
                 d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                 Control.Ins.SendWriteCommand(device, d);
             };
-            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
+            if (!device.online)
             {
-                temp = arcBar.Progress;
-                device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
-                btnTemp.Text = arcBar.Progress.ToString();
-                controlTime = DateTime.Now;
-                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);
-            };
-            arcBar.OnProgressChangedEvent = (sender, e) =>
-            {
-                device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
-                btnTemp.Text = e.ToString();
-            };
-            //arcBar.MouseDownEventHandler = (sender, e) => {
-            //    Console.WriteLine("ddd");
-            //    MainPage.BasePageView.ScrollEnabled =false;
-            //};
-            //arcBar.MouseUpEventHandler = (sender, e) => {
-            //    Console.WriteLine("ddd2");
-            //    MainPage.BasePageView.ScrollEnabled = true;
-            //};
+                arcBar.OnStopTrackingTouchEvent = (sender, e) =>
+                {
+                    temp = arcBar.Progress;
+                    device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
+                    btnTemp.Text = arcBar.Progress.ToString();
+                    controlTime = DateTime.Now;
+                    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);
+                };
+                arcBar.OnProgressChangedEvent = (sender, e) =>
+                {
+                    device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
+                    btnTemp.Text = e.ToString();
+                };
+                //arcBar.MouseDownEventHandler = (sender, e) => {
+                //    Console.WriteLine("ddd");
+                //    MainPage.BasePageView.ScrollEnabled =false;
+                //};
+                //arcBar.MouseUpEventHandler = (sender, e) => {
+                //    Console.WriteLine("ddd2");
+                //    MainPage.BasePageView.ScrollEnabled = true;
+                //};
+            }
         }
-
 
         /// <summary>
         /// 鎺у埗妯″紡浜嬩欢
@@ -938,6 +994,15 @@
 
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
+                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")

--
Gitblit v1.8.0