From 5ec581e5d37b108fc9d59e89afd8e94e21b32080 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 17 十月 2023 17:33:36 +0800
Subject: [PATCH] 2023年10月17日17:33:33

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs |   70 +++++++++++++++++++----------------
 1 files changed, 38 insertions(+), 32 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index a601904..34599ea 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -33,7 +33,7 @@
                                     }
                                     if (btn.Tag.ToString() == function.sid)
                                     {
-                                        if (function.online)
+                                        if (function.isOnline())
                                         {
                                             btn.UnSelectedImagePath = "Collection/Functionbg.png";
                                             btn.IsSelected = false;
@@ -46,7 +46,7 @@
                                     }
                                     else if (btn.Tag.ToString() == "OnlineTag")
                                     {
-                                        btn.Visible = !function.online;
+                                        btn.Visible = !function.isOnline();
                                     }
                                 }
                             }
@@ -269,15 +269,15 @@
 
             if (!Control.Ins.GatewayOnline_Local && !Control.Ins.GatewayOnline_Cloud)
             {
-                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
-                bodyView.btnLinkStateTip.TextID = StringId.NetworkAnomaly;
-                bodyView.environmentalView.Y = Application.GetRealHeight(8) + btnResidenceName.Bottom;
+                bodyView.divLinkStateTip.Visible = true;
             }
+            //else if ()
+            //{
+            //    bodyView.divLinkStateTip.Visible = true;
+            //}
             else
             {
-                bodyView.btnLinkStateTip.BackgroundColor = 0x00000000;
-                bodyView.btnLinkStateTip.Text = "";
-                bodyView.environmentalView.Y = Application.GetRealHeight(1) + btnResidenceName.Bottom;
+                bodyView.divLinkStateTip.Visible = false;
             }
         }
 
@@ -351,11 +351,17 @@
             }
         }
 
+        object lockObj = new object();
+
         /// <summary>
         /// 鏇存柊鏄剧ず鐘舵��
         /// </summary>
         public static void UpdataFunctionStates(Function function)
         {
+            if(bodyView == null)
+            {
+                return;
+            }
             Application.RunOnMainThread(() =>
             {
                 try
@@ -546,7 +552,7 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
-                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                if (!function.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
                 {
                     new Tip()
                     {
@@ -615,7 +621,7 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
-                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                if (!function.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
                 {
                     new Tip()
                     {
@@ -659,16 +665,16 @@
         {
             btnClose.MouseUpEventHandler = (sender, e) =>
             {
-                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
-                {
-                    new Tip()
-                    {
-                        CloseTime = 1,
-                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                        Direction = AMPopTipDirection.None,
-                    }.Show(MainPage.BaseView);
-                    return;
-                }
+                //if (!curtain.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
+                //{
+                //    new Tip()
+                //    {
+                //        CloseTime = 1,
+                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                //        Direction = AMPopTipDirection.None,
+                //    }.Show(MainPage.BaseView);
+                //    return;
+                //}
                 btnClose.IsSelected = true;
                 curtain.trait_on_off.curValue = "off";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
@@ -679,16 +685,16 @@
 
             btnOpen.MouseUpEventHandler = (sender, e) =>
             {
-                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
-                {
-                    new Tip()
-                    {
-                        CloseTime = 1,
-                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                        Direction = AMPopTipDirection.None,
-                    }.Show(MainPage.BaseView);
-                    return;
-                }
+                //if (!curtain.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
+                //{
+                //    new Tip()
+                //    {
+                //        CloseTime = 1,
+                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                //        Direction = AMPopTipDirection.None,
+                //    }.Show(MainPage.BaseView);
+                //    return;
+                //}
                 btnOpen.IsSelected = true;
                 curtain.trait_on_off.curValue = "on";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
@@ -709,7 +715,7 @@
             };
             btnUp.MouseUpEventHandler = (sender, e) =>
             {
-                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                if (!function.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
                 {
                     new Tip()
                     {
@@ -740,7 +746,7 @@
             };
             btnDown.MouseUpEventHandler = (sender, e) =>
             {
-                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                if (!function.isOnline())//绂荤嚎涓嶅厑璁告搷浣�
                 {
                     new Tip()
                     {

--
Gitblit v1.8.0