From f759dc1e6f49c53733eafda82207c85af18f9931 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 28 五月 2020 15:46:54 +0800
Subject: [PATCH] 2020-05-28-1
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs | 524 ++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 363 insertions(+), 161 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
index 4f3dfb9..409fe85 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
@@ -6,36 +6,24 @@
namespace Shared.Phone.UserCenter.GatewayUpdate
{
/// <summary>
- /// 鍥轰欢鍗囩骇鐢婚潰
+ /// 缃戝叧鍥轰欢鍗囩骇鐣岄潰
/// </summary>
- public class GatewayFirmwareUpdateForm : DialogCommonForm
+ public class GatewayFirmwareUpdateForm : EditorCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
- /// 瑕佸崌绾х殑缃戝叧
+ /// 褰撳墠閫夋嫨鐨勭綉鍏�
/// </summary>
- private ZbGateway upDatezbGateway = null;
+ private ZbGateway zbGateway = null;
/// <summary>
- /// 铏氭嫙璁惧鐨勫浐浠朵俊鎭�
+ /// 鍗囩骇鍥轰欢淇℃伅(0:Linux鏂扮増鏈� 1:鍗忚皟鍣ㄦ柊鐗堟湰 2锝瀀:閮芥槸铏氭嫙椹卞姩鐨�)
/// </summary>
- private FirmwareVersionInfo virtualFirmware = null;
- /// <summary>
- /// 鍗忚皟鍣ㄦ柊鐗堟湰鐨勫浐浠朵俊鎭�
- /// </summary>
- private FirmwareVersionInfo coordinatorFirmware = null;
- /// <summary>
- /// 缃戝叧鏂扮増鏈殑鍥轰欢淇℃伅
- /// </summary>
- private FirmwareVersionInfo gatewayFirmware = null;
+ private List<FirmwareVersionInfo> listVersionInfo = null;
/// <summary>
/// 铏氭嫙椹卞姩鍙�
/// </summary>
private List<ZbGatewayData.DriveCodeObj> listVode = null;
- /// <summary>
- /// 璁惧鎴愬姛鍗囩骇瀹屾垚鐨勫洖璋冨嚱鏁�
- /// </summary>
- public Action FinishUpdateEvent = null;
#endregion
@@ -44,174 +32,388 @@
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
- /// <param name="i_zbGateway">缃戝叧</param>
- /// <param name="i_virtualFirmware">铏氭嫙璁惧鐨勫浐浠朵俊鎭�</param>
- /// <param name="i_coordinatorFirmware">鍗忚皟鍣ㄦ柊鐗堟湰鐨勫浐浠朵俊鎭�</param>
- /// <param name="i_gatewayFirmware">缃戝叧鏂扮増鏈殑鍥轰欢淇℃伅</param>
- /// <param name="i_listVode">铏氭嫙椹卞姩</param>
- public void ShowForm(ZbGateway i_zbGateway, FirmwareVersionInfo i_virtualFirmware, FirmwareVersionInfo i_coordinatorFirmware,
- FirmwareVersionInfo i_gatewayFirmware, List<ZbGatewayData.DriveCodeObj> i_listVode)
- {
- this.upDatezbGateway = i_zbGateway;
- this.virtualFirmware = i_virtualFirmware;
- this.coordinatorFirmware = i_coordinatorFirmware;
- this.gatewayFirmware = i_gatewayFirmware;
- this.listVode = i_listVode;
-
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- private void InitMiddleFrame()
+ /// <param name="i_zbGateway">褰撳墠閫夋嫨鐨勭綉鍏�</param>
+ public void ShowForm(ZbGateway i_zbGateway)
{
- var frameBack = new FrameLayout();
- frameBack.Width = Application.GetRealWidth(674);
- frameBack.Height = Application.GetRealHeight(386);
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Gravity = Gravity.CenterHorizontal;
- frameBack.Y = Application.GetRealHeight(683);
- frameBack.Radius = 6;
- bodyFrameLayout.AddChidren(frameBack);
-
- //杩涘害鏄剧ず鏂囨湰
- var btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
- btnText.Y = Application.GetRealHeight(248);
- btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnText.TextAlignment = TextAlignment.Center;
- //btnText.Text = "鍗囩骇涓�";
- frameBack.AddChidren(btnText);
+ this.zbGateway = i_zbGateway;
- //杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xfff5f5f5;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- var btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.Radius = btnProRow.Radius;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
- //杩涘害鍊兼枃鏈�
- var frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(86);
- frameBack.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- var btnProgressView = new NormalViewControl(84, 32, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
+ //鍒濆鍖栧彸涓婅鑿滃崟
+ this.InitTopRightMenu();
- //璁惧鍗囩骇
- this.GatewayUpdateMethod(btnText, btnProgressView, frameProgress, btnProgressBar, btnProRow.Width);
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
+
+ //鑾峰彇缃戝叧鏂扮増鏈俊鎭�
+ this.listVersionInfo = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
+ if (listVersionInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return;
+ }
+ //铏氭嫙椹卞姩鍙�
+ this.listVode = await HdlGatewayLogic.Current.GetListVDDriveCode(this.zbGateway);
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ var yy = this.InitNowVersionControl();
+ if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
+ {
+ //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ this.InitNewVersionControl(yy);
+ }
+ });
+ });
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ /// </summary>
+ private int InitNowVersionControl()
+ {
+ bodyFrameLayout.RemoveAll();
+
+ var frameBack = new FrameLayout();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Height = Application.GetMinReal(800);
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //褰撳墠鍥轰欢鐗堟湰
+ var btnTitle = new NormalViewControl(700, 65, true);
+ btnTitle.X = ControlCommonResourse.XXLeft;
+ btnTitle.Y = Application.GetRealHeight(30);
+ btnTitle.TextID = R.MyInternationalizationString.uNowFirmwareVersion;
+ btnTitle.TextSize = 15;
+ frameBack.AddChidren(btnTitle);
+
+ var listView = new VerticalListControl(12);
+ listView.Y = Application.GetRealHeight(109);
+ listView.Height = Application.GetRealHeight(800);
+ frameBack.AddChidren(listView);
+
+ //Linux
+ var rowLinux = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowLinux);
+ rowLinux.AddLeftCaption("Linux", 300);
+ rowLinux.AddRightArrow();
+ rowLinux.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayLinuxInfoForm();
+ form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ };
+
+ //鍗忚皟鍣�
+ var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowCoordinator);
+ rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
+ rowCoordinator.AddRightArrow();
+ rowCoordinator.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayCoordinatorInfoForm();
+ form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ };
+
+ if (this.listVode != null)
+ {
+ //铏氭嫙椹卞姩
+ var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowVirtual);
+ rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
+ rowVirtual.AddRightArrow();
+ rowVirtual.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayVirtualDriveInfoForm();
+ form.AddForm(listVode);
+ };
+ }
+ //娌℃湁鏂扮増鏈�
+ if (listVersionInfo[0] == null && listVersionInfo[1] == null && listVersionInfo[2] == null)
+ {
+ //鏈�鏂板浐浠剁増鏈�
+ var rowNew = new FrameRowControl();
+ rowNew.UseClickStatu = false;
+ listView.AddChidren(rowNew);
+ rowNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
+ rowNew.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 500);
+ }
+ //鍒掔嚎
+ for (int i = 0; i < listView.ChildrenCount - 1; i++)
+ {
+ ((FrameRowControl)listView.GetChildren(i)).AddBottomLine();
+ }
+
+ //璋冩暣鐪熷疄楂樺害
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ frameBack.Height = listView.Bottom;
+
+ return frameBack.Bottom;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ /// </summary>
+ private void InitNewVersionControl(int YY)
+ {
+ var frameBack = new FrameLayout();
+ frameBack.Y = YY + Application.GetRealHeight(35);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Height = Application.GetMinReal(832);
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //鏈�鏂板浐浠剁増鏈�
+ var btnTitle = new NormalViewControl(700, 65, true);
+ btnTitle.X = ControlCommonResourse.XXLeft;
+ btnTitle.Y = Application.GetRealHeight(30);
+ btnTitle.TextID = R.MyInternationalizationString.uNewFirmwareVersion;
+ btnTitle.TextSize = 15;
+ frameBack.AddChidren(btnTitle);
+
+ var listView = new VerticalListControl(12);
+ listView.Y = Application.GetRealHeight(109);
+ listView.Height = frameBack.Height - Application.GetRealHeight(109);
+ frameBack.AddChidren(listView);
+
+ //Linux
+ if (listVersionInfo[0] != null)
+ {
+ var rowLinux = new FrameRowControl(listView.rowSpace / 2);
+ rowLinux.UseClickStatu = false;
+ listView.AddChidren(rowLinux);
+ rowLinux.AddLeftCaption("Linux", 300);
+ rowLinux.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[0].FirmwareVersion), 300);
+ rowLinux.AddBottomLine();
+ }
+
+ //鍗忚皟鍣�
+ if (listVersionInfo[1] != null)
+ {
+ var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
+ rowCoordinator.UseClickStatu = false;
+ listView.AddChidren(rowCoordinator);
+ rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
+ rowCoordinator.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[1].FirmwareVersion), 300);
+ rowCoordinator.AddBottomLine();
+ }
+
+ //铏氭嫙椹卞姩
+ if (listVersionInfo[2] != null)
+ {
+ var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
+ rowVirtual.UseClickStatu = false;
+ listView.AddChidren(rowVirtual);
+ rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
+ rowVirtual.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[2].FirmwareVersion), 300);
+ rowVirtual.AddBottomLine();
+ }
+
+ //娣诲姞鍥轰欢浠嬬粛琛�
+ this.AddUpdateContent(listView);
+
+ //鍗囩骇
+ var btnUpdate = new BottomClickButton();
+ btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
+ bodyFrameLayout.AddChidren(btnUpdate);
+ btnUpdate.ButtonClickEvent += (sender, e) =>
+ {
+ ZbGateway realway = null;
+ if (HdlGatewayLogic.Current.GetRealGateway(ref realway, zbGateway) == false)
+ {
+ //閿欒:缃戝叧瀵硅薄涓㈠け
+ string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
+ this.ShowMassage(ShowMsgType.Error, msg);
+ return;
+ }
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //缃戝叧鍗囩骇
+ DoGatewayUpdate(realway);
+ });
+ };
}
#endregion
- #region 鈻� 璁惧鍗囩骇___________________________
+ #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧彸涓婅鑿滃崟
+ /// </summary>
+ private void InitTopRightMenu()
+ {
+ if (UserCenterResourse.HideOption.DeviceHistory != 1)
+ {
+ return;
+ }
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/More.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += ((sender, e) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
+ {
+ var frame = new TopRightMenuControl(1, 2);
+ //鍘嗗彶鐗堟湰
+ var deviceMenu = Language.StringByID(R.MyInternationalizationString.uHistoryVersion);
+ frame.AddRowMenu(deviceMenu, "", "", () =>
+ {
+ var form = new GatewayHistoryFirmwareVersionForm();
+ form.AddForm(zbGateway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0], listVode);
+ form.SelectFirmwareInfoEvent += (info1,info2,info3,listCode) =>
+ {
+ listVersionInfo[2] = info1;
+ listVersionInfo[1] = info2;
+ listVersionInfo[0] = info3;
+ listVode = listCode;
+
+ //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ var yy = this.InitNowVersionControl();
+ if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
+ {
+ //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ this.InitNewVersionControl(yy);
+ }
+ };
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鍥轰欢浠嬬粛琛宊____________________
+
+ /// <summary>
+ /// 娣诲姞鍥轰欢浠嬬粛琛�
+ /// </summary>
+ /// <param name="listContent">鍒楄〃鎺т欢</param>
+ private void AddUpdateContent(VerticalListControl listContent)
+ {
+ //淇敼鍐呭
+ var frameContent = new FrameLayout();
+ frameContent.Height = Application.GetRealHeight(87);
+ listContent.AddChidren(frameContent);
+ var btnContent = new NormalViewControl(500, 87, true);
+ btnContent.X = ControlCommonResourse.XXLeft;
+ btnContent.Y = Application.GetRealHeight(28);
+ btnContent.TextID = R.MyInternationalizationString.uEditorContent;
+ btnContent.TextSize = 12;
+ frameContent.AddChidren(btnContent);
+
+ foreach (var info in this.listVersionInfo)
+ {
+ if (info == null)
+ {
+ continue;
+ }
+ foreach (var msg in info.UpdateContent)
+ {
+ var btnRow = new FrameRowControl();
+ btnRow.UseClickStatu = false;
+ btnRow.Height = Application.GetRealHeight(40);
+ listContent.AddChidren(btnRow);
+
+ var btnMsg = btnRow.AddLeftCaption(msg, 965);
+ btnMsg.TextSize = 10;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
+ }
+ }
+ //娣诲姞搴曢儴绌虹櫧闂撮殭
+ var frameSpace3 = new FrameLayout();
+ frameSpace3.Height = Application.GetRealHeight(58);
+ listContent.AddChidren(frameSpace3);
+ }
+
+ #endregion
+
+ #region 鈻� 缃戝叧鍗囩骇___________________________
/// <summary>
/// 缃戝叧鍗囩骇
/// </summary>
- /// <param name="btnText">鏍囬鎺т欢</param>
- /// <param name="btnProgressView">杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢</param>
- /// <param name="frameProgress">杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠�</param>
- /// <param name="btnProgressBar">杩涘害鏉�</param>
- /// <param name="ProRowWidth">杩涘害鏉″鍣ㄧ殑鏈�澶у搴�</param>
- private void GatewayUpdateMethod(NormalViewControl btnText, NormalViewControl btnProgressView,
- FrameLayout frameProgress, FrameLayout btnProgressBar, int ProRowWidth)
+ private void DoGatewayUpdate(ZbGateway realway)
{
- //璁惧鍗囩骇
- var updateLogic = new HdlGatewayUpdateLogic(this.upDatezbGateway, virtualFirmware, coordinatorFirmware, gatewayFirmware);
+ //鎵撳紑杩涘害鏉�
+ ProgressFormBar.Current.Start();
+ //缃戝叧鍗囩骇
+ var updateLogic = new HdlGatewayUpdateLogic(realway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0]);
//鏇存柊鐘舵�佸彉鍖栫殑浜嬩欢
updateLogic.UpdateStatuChangedEvent += (div, msg) =>
{
- if (div == -1)
+ HdlThreadLogic.Current.RunMain(() =>
{
- //寮傚父
- this.ShowMassage(ShowMsgType.Tip, msg);
- this.CloseForm();
- }
- else if (div == 0)
- {
- //涓�鑸俊鎭�
- btnText.Text = msg;
- }
- else if (div == 1)
- {
- //鍗囩骇瀹屾垚
- this.ShowMassage(ShowMsgType.Tip, msg);
- //璋冪敤鍥炶皟鍑芥暟
- this.FinishUpdateEvent?.Invoke();
- this.CloseForm();
- }
- else if (div == 2)
- {
- //涓诲姩缁堟鍗囩骇
- this.CloseForm();
- }
+ if (div == -1)
+ {
+ //寮傚父
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ ProgressFormBar.Current.Close();
+ }
+ else if (div == 0)
+ {
+ //涓�鑸俊鎭�
+ ProgressFormBar.Current.SetMsg(msg);
+ }
+ else if (div == 1)
+ {
+ //鍗囩骇瀹屾垚
+ ProgressFormBar.Current.Close();
+ this.ShowMassage(ShowMsgType.Tip, msg);
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ });
+ }
+ });
};
//杩涘害鍊兼敼鍙樹簨浠�
updateLogic.ProgressEvent += (value) =>
{
- Application.RunOnMainThread(() =>
- {
- //杩涘害鏉�
- decimal result = value / 100;
- int width = (int)(result * ProRowWidth);
- btnProgressBar.Width = width;
-
- //鏂囨湰鏄剧ず
- btnProgressView.Text = value + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
- });
-
+ ProgressFormBar.Current.SetValue(value);
};
//缃戝叧鍗囩骇寮�濮�
updateLogic.StartUpdateReady();
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
- /// <summary>
- /// 鐢婚潰鍏抽棴
- /// </summary>
- public override void CloseForm()
- {
- //瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
- UserView.HomePage.Instance.ScrollEnabled = true;
- Shared.Common.CommonPage.BackKeyCanClick = true;
-
- //鍗囩骇瀵硅薄
- string gwId = HdlGatewayLogic.Current.GetGatewayId(upDatezbGateway);
- if (FirmwareUpdateResourse.dicGatewayUpdateList.ContainsKey(gwId) == true
- && FirmwareUpdateResourse.dicGatewayUpdateList[gwId].IsFinishUpdate == true)
+ //鍏抽棴浜嬩欢
+ ProgressFormBar.Current.CloseEvent += () =>
{
- //濡傛灉缃戝叧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
- FirmwareUpdateResourse.dicGatewayUpdateList[gwId].Dispose();
- FirmwareUpdateResourse.dicGatewayUpdateList.Remove(gwId);
- }
- this.FinishUpdateEvent = null;
-
- base.CloseForm();
+ //鍗囩骇瀵硅薄
+ string gwId = HdlGatewayLogic.Current.GetGatewayId(realway);
+ if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(gwId) == true
+ && FirmwareUpdateResourse.dicUpdateList[gwId].IsFinishUpdate == true)
+ {
+ //濡傛灉缃戝叧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
+ FirmwareUpdateResourse.dicUpdateList[gwId].Dispose();
+ FirmwareUpdateResourse.dicUpdateList.Remove(gwId);
+ }
+ };
}
#endregion
--
Gitblit v1.8.0