From f9f9b0030fdd2691632569b7dcad9d0ddca5e4cf Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 23 十二月 2020 09:28:54 +0800
Subject: [PATCH] 2020-12-23 1.调整mqtt挤下线,跑ui线程。2.LoadEvent_CheckLinkStatus方法调整

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs |   69 ++++++++++++++++------
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs    |    3 
 HDL_ON/Common/HDLCommon.cs              |   11 ++-
 .vs/HDL_APP_Project/xs/UserPrefs.xml    |   51 +++++++++++------
 HDL_ON/DAL/Mqtt/MqttClient.cs           |    7 ++
 5 files changed, 99 insertions(+), 42 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 298b60e..a60a543 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,43 +1,58 @@
-锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs">
+锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.08FD445C-3EE8-4ED2-BF28-B42ADD0DA92C" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/1-HomePage/HomePage.cs">
     <Files>
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs" Line="1" Column="1" />
-      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="177" Column="52" />
-      <File FileName="HDL_ON/UI/UI1-Login/LoginPageBLL.cs" Line="111" Column="52" />
-      <File FileName="HDL_ON/UI/UI1-Login/RegisterPageBLL.cs" Line="424" Column="52" />
-      <File FileName="HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs" Line="385" Column="52" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs" Line="186" Column="43" />
-      <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" Line="118" Column="22" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs" Line="206" Column="69" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindVerificationCodePage.cs" Line="654" Column="61" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindAccountPage.cs" Line="302" Column="69" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindVerificationCodePage.cs" Line="645" Column="61" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs" Line="586" Column="72" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs" Line="312" Column="46" />
+      <File FileName="HDL_ON/Common/HDLCommon.cs" Line="297" Column="21" />
+      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="563" Column="35" />
+      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="133" Column="20" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
             <Node name="HDL_ON" expanded="True">
+              <Node name="Common" expanded="True" />
               <Node name="DAL" expanded="True">
+                <Node name="DriverLayer" expanded="True" />
+                <Node name="Mqtt" expanded="True" />
                 <Node name="Server" expanded="True" />
+              </Node>
+              <Node name="Entity" expanded="True">
+                <Node name="Function" expanded="True" />
               </Node>
               <Node name="UI" expanded="True">
                 <Node name="BindingResidence" expanded="True" />
                 <Node name="UI1-Login" expanded="True" />
                 <Node name="UI2" expanded="True">
+                  <Node name="1-HomePage" expanded="True">
+                    <Node name="HomePage.cs" selected="True" />
+                  </Node>
+                  <Node name="2-Classification" expanded="True" />
+                  <Node name="3-Intelligence" expanded="True">
+                    <Node name="Automation" expanded="True" />
+                    <Node name="Scene" expanded="True" />
+                  </Node>
                   <Node name="4-PersonalCenter" expanded="True">
                     <Node name="AboutOn" expanded="True" />
                     <Node name="AccountBindInfo" expanded="True" />
                     <Node name="MemberManagement" expanded="True" />
-                    <Node name="ResetAccountPassword" expanded="True">
-                      <Node name="ResetPasswordVerificationCodePage.cs" selected="True" />
+                    <Node name="ResetAccountPassword" expanded="True" />
+                    <Node name="RoomListManage" expanded="True">
+                      <Node name="AddRoom" expanded="True" />
                     </Node>
+                  </Node>
+                  <Node name="FuntionControlView" expanded="True">
+                    <Node name="AC" expanded="True" />
+                    <Node name="Curtain" expanded="True" />
+                    <Node name="Electrical" expanded="True" />
+                    <Node name="Light" expanded="True" />
                   </Node>
                 </Node>
               </Node>
             </Node>
+            <Node name="HDL-ON_Android" expanded="True" />
+            <Node name="HDL-ON_iOS" expanded="True" />
           </Node>
         </State>
       </Pad>
@@ -49,7 +64,7 @@
     <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
   <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore />
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 78e05e0..31e2c5f 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -258,11 +258,11 @@
                 {
                     Shared.Application.RunOnMainThread(() =>
                     {
-                        //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
-                        new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
+                        ////璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+                        //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
                         //閫�鍑虹櫥褰曟搷浣�
                         CheckLogout();
-                     
+
                     });
                     return;
                 }
@@ -290,6 +290,8 @@
         }
 
         /// <summary>
+        /// 璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+        /// 瑕佸湪涓荤嚎绋嬭皟鐢�
         /// 閫�鍑虹櫥褰曟搷浣�
         /// </summary>
         public void CheckLogout()
@@ -297,6 +299,9 @@
             //鏈櫥褰曚笉鐢ㄥ鐞�
             if (!UserInfo.Current.IsLogin) return;
 
+            //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+            new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
+
 #if DEBUG
             return;
 #endif
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 9246240..1ecf619 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -557,7 +557,12 @@
 
             DisConnectRemoteMqttClient("鎸や笅绾�");
 
-            HDLCommon.Current.CheckLogout();
+            Application.RunOnMainThread(() =>
+            {
+                //寮圭獥鎻愮ず琚尋涓嬬嚎
+                HDLCommon.Current.CheckLogout();
+            });
+           
 
             //UserInfo.Current.LastTime = DateTime.MinValue;
             //UserInfo.Current.SaveUserInfo();
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 8511bc3..ff2cb22 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -130,7 +130,8 @@
                 };
                 topView.AddChidren(btnLinkStateTip);
                 //鏇存柊閾炬帴鐘舵�乮con棰滆壊
-                LoadEvent_CheckLinkStatus();
+                CheckLinkStatus()//2020-12-22
+                //LoadEvent_CheckLinkStatus();
 
                 btnResidenceName = new Button()
                 {
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 02efd04..daf89de 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -21,32 +21,63 @@
                 bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25;
             }
         }
+
+        /// <summary>
+        /// 鏇存柊杩炴帴鐘舵�佸浘鏍�
+        /// </summary>
+        void CheckLinkStatus()
+        {
+            if (Control.Ins.GatewayOnline)
+            {
+                if (Control.Ins.IsRemote)
+                {
+                    bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
+                }
+                else
+                {
+                    bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
+                }
+            }
+            else
+            {
+                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
+            }
+        }
+
         /// <summary>
         /// 纭杩炴帴鐘舵��
         /// </summary>
         public static void LoadEvent_CheckLinkStatus()
         {
-            if (bodyView != null)
+            Application.RunOnMainThread(() =>
             {
-                Application.RunOnMainThread(() =>
+                if (bodyView != null)
                 {
-                    if (Control.Ins.GatewayOnline)
-                    {
-                        if (Control.Ins.IsRemote)
-                        {
-                            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
-                        }
-                        else
-                        {
-                            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
-                        }
-                    }
-                    else
-                    {
-                        bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
-                    }
-                });
-            }
+                    bodyView.CheckLinkStatus();
+                }
+            });
+
+            //if (bodyView != null)
+            //{
+            //    Application.RunOnMainThread(() =>
+            //    {
+            //        if (Control.Ins.GatewayOnline)
+            //        {
+            //            if (Control.Ins.IsRemote)
+            //            {
+            //                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
+            //            }
+            //            else
+            //            {
+            //                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
+            //            }
+            //        }
+            //        else
+            //        {
+            //            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
+            //        }
+            //    });
+            //}
         }
 
         /// <summary>

--
Gitblit v1.8.0