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/FunctionPageBLL.cs |   74 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs
index 8e87e01..0069a00 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs
@@ -4,13 +4,85 @@
 {
     public partial class FunctionPage
     {
+        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);
+            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)
+                //                        {
+                //                            if (bodyView.updateUiThread == null)
+                //                            {
+                //                                MainPage.Log("绾跨▼琚疆绌轰簡锛侊紒");
+                //                                return;
+                //                            }
+                //                            try
+                //                            {
+                //                                while (true)
+                //                                {
+                //                                    System.Threading.Thread.Sleep(1500);
+                //                                    if (bodyView == null)
+                //                                    {
+                //                                        return;
+                //                                    }
+                //                                    if (DateTime.Now.AddMilliseconds(-1500) > localFunction.updateTime)
+                //                                    {
+                //                                        MainPage.Log("娌℃湁鏂版暟鎹紝鏇存柊UI");
+                //                                        break;
+                //                                    }
+                //                                    else
+                //                                    {
+                //                                        MainPage.Log("鏈夋柊鏁版嵁锛岀户缁瓑寰�");
+                //                                    }
+                //                                }
+                //                                new ClassificaitionPublicBLL().UpdataStates(localFunction, bodyView, functionListView);
+                //                            }
+                //                            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);
+                }
+            }catch(Exception ex)
+            {
+                MainPage.Log("FunctionPage UpdateStates error " + ex.Message);
+            }
         }
 
         public static void UpdataOnline(Function function)

--
Gitblit v1.8.0