From c7698e163e43cea9e7f8ee45f8e3f91c9265cca4 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 04 十一月 2019 19:11:41 +0800 Subject: [PATCH] 合并了全部的代码 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs index e07eeb3..30dc880 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs @@ -19,6 +19,7 @@ /// <para> 0:鏇存柊鐘舵�佹甯稿彉鍖�,鍚庨潰鐨勫�间负鐘舵�佸彉鏇寸殑鏂囨湰缈昏瘧</para> /// <para> 1:鍗囩骇鎴愬姛</para> /// <para> 2:涓诲姩缁堟鍗囩骇</para> + /// <para> 3:浠庣瓑寰呬腑鍙栨秷(鐩墠杩樻病鏈夌敤)</para> /// </summary> public Action<int, string> UpdateStatuChangedEvent = null; /// <summary> @@ -92,7 +93,9 @@ { FirmwareUpdateResourse.dicDeviceUpdateList.Remove(otaDevice.DeviceAddr); } + //鍙栨秷 this.UpdateStatu = UpdateStatuMode.None; + this.UpdateStatuChangedEvent?.Invoke(3, ""); return; } //濡傛灉瀹冩湁鐘舵�侊紝鍒欒〃绀轰箣鍓嶅畠琚粈涔堥敊璇腑鏂簡 @@ -382,12 +385,11 @@ { this.zbGateway.ReportAction -= this.UpdateDeviceProgress; - new System.Threading.Thread(async () => + HdlThreadLogic.Current.RunThread(async () => { //缁堟鍗囩骇 await this.otaDevice.KillUpdateAsync(this.zbGateway, 200); - }) - { IsBackground = true }.Start(); + }); this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail; return; @@ -556,7 +558,7 @@ //鍗囩骇鎴愬姛 this.UpdateStatu = UpdateStatuMode.UpdateSuccess; - new System.Threading.Thread(() => + HdlThreadLogic.Current.RunThread(() => { System.Threading.Thread.Sleep(3000); @@ -592,8 +594,7 @@ //璁惧鍗囩骇鎴愬姛! this.UpdateStatuChangedEvent?.Invoke(1, Language.StringByID(R.MyInternationalizationString.uDeviceUpdateSuccess)); }); - }) - { IsBackground = true }.Start(); + }); } #endregion @@ -636,7 +637,7 @@ private void StartDownLoadTimeOutThread() { this.downLoadTimeOutCount = 30; - new System.Threading.Thread(() => + HdlThreadLogic.Current.RunThread(() => { while (true) { @@ -665,8 +666,7 @@ break; } } - }) - { IsBackground = true }.Start(); + }); } /// <summary> @@ -691,7 +691,7 @@ private void StartUpdateTimeOutThread() { this.UpdateTimeOutCount = 60; - new System.Threading.Thread(() => + HdlThreadLogic.Current.RunThread(() => { while (true) { @@ -719,8 +719,7 @@ break; } } - }) - { IsBackground = true }.Start(); + }); } /// <summary> -- Gitblit v1.8.0