From c2348ebb81ca12b72eee6fbe9eee47925c1a5b07 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 06 九月 2023 12:02:54 +0800
Subject: [PATCH] Merge branch 'wxr-2.1' into wxr-2.0

---
 HDL_ON/UI/UI2/2-Classification/RoomPageBLL.cs |   82 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/RoomPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/RoomPageBLL.cs
index 5323666..5435079 100644
--- a/HDL_ON/UI/UI2/2-Classification/RoomPageBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/RoomPageBLL.cs
@@ -6,13 +6,93 @@
 {
     public partial class RoomPage
     {
+        System.Threading.Thread updateUiThread;
+        object lockObj = new object();
         /// <summary>
         /// 鏇存柊鍔熻兘鐘舵��
         /// </summary>
         /// <param name="function"></param>
         public static void UpdataStates(Function function)
         {
-            new ClassificaitionPublicBLL().UpdataStates(function, bodyView, functionListView,room);
+
+            try
+            {
+                if (bodyView == null)
+                {
+                    return;
+                }
+                //if (SPK.LightSpkList().Contains(function.spk))
+                //{
+                //    {
+                //        var localFunction = FunctionList.List.GetLightList().Find((obj) => obj.sid == function.sid);
+                //        {
+                //            if (localFunction != null)
+                //            {
+                //                if (bodyView.updateUiThread == null)
+                //                {
+                //                    bodyView.updateUiThread = new System.Threading.Thread(() =>
+                //                    {
+                //                        lock (bodyView.lockObj)
+                //                        {
+                //                            try
+                //                            {
+                //                                while (true)
+                //                                {
+                //                                    try
+                //                                    {
+                //                                        System.Threading.Thread.Sleep(1500);
+                //                                        if (bodyView == null)
+                //                                        {
+                //                                            return;
+                //                                        }
+                //                                        if (bodyView.updateUiThread == null)
+                //                                        {
+                //                                            return;
+                //                                        }
+                //                                        if (DateTime.Now.AddMilliseconds(-1500) > localFunction.updateTime)
+                //                                        {
+                //                                            MainPage.Log("娌℃湁鏂版暟鎹紝鏇存柊UI");
+                //                                            break;
+                //                                        }
+                //                                        else
+                //                                        {
+                //                                            MainPage.Log("鏈夋柊鏁版嵁锛岀户缁瓑寰�");
+                //                                        }
+                //                                    }
+                //                                    catch (Exception ex)
+                //                                    {
+                //                                        MainPage.Log("绾跨▼寮傚父:" + ex.Message);
+                //                                    }
+                //                                }
+                //                                new ClassificaitionPublicBLL().UpdataStates(function, bodyView, functionListView, room);
+                //                            }
+                //                            catch (Exception ex)
+                //                            {
+                //                                MainPage.Log("FunctionPage UpdateStates error 2 :" + ex.Message);
+                //                            }
+                //                            finally
+                //                            {
+                //                                //bodyView.updateUiThread = null;
+                //                            }
+                //                        }
+                //                    });
+                //                    bodyView.updateUiThread.IsBackground = true;
+                //                    bodyView.updateUiThread.Start();
+                //                }
+                //            }
+                //        }
+                //    }
+                //}
+                //else
+                {
+                    new ClassificaitionPublicBLL().UpdataStates(function, bodyView, functionListView,room);
+                }
+            }
+            catch (Exception ex)
+            {
+                MainPage.Log("FunctionPage UpdateStates error " + ex.Message);
+            }
+
         }
         public static void UpdataOnline(Function function)
         {

--
Gitblit v1.8.0