From 955d02679c2c22bd3debd40a71510d78a8256cc4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 07 十一月 2023 11:06:31 +0800
Subject: [PATCH] 场景使能自动化优化
---
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