From cc37cf55c02da9e49eab9859ed72f146dee6f635 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期一, 11 九月 2023 14:17:55 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' into wjc --- 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