WJC
2019-12-30 f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs
@@ -23,7 +23,7 @@
        /// </summary>
        public Action<int, string> UpdateStatuChangedEvent = null;
        /// <summary>
        /// 进度值事件
        /// 进度值事件(已经是百分比的值)
        /// </summary>
        public Action<decimal> ProgressEvent = null;
        /// <summary>
@@ -412,6 +412,7 @@
            //协调器固件下载中
            this.UpdateStatuChangedEvent(0, Language.StringByID(R.MyInternationalizationString.uCoordinatorFirmwareDownLoading));
            this.SetProgressValue(0, 100);
            //下载协调器文件的进度
            this.upDatezbGateway.ReportAction += this.DownLoadCoordinatorFileProgress;
@@ -462,6 +463,7 @@
            //设置进度
            var responData = tempZb.downloadFileProgressResponData;
            this.SetProgressValue(responData.DownloadPercent, 100);
            //协调器固件下载中
            this.UpdateStatuChangedEvent?.Invoke(0, Language.StringByID(R.MyInternationalizationString.uCoordinatorFirmwareDownLoading));
@@ -610,6 +612,7 @@
            //网关固件下载中
            this.UpdateStatuChangedEvent?.Invoke(0, Language.StringByID(R.MyInternationalizationString.uGatewayFirmwareDownLoading));
            this.SetProgressValue(0, 100);
            //下载网关文件的进度
            this.upDatezbGateway.ReportAction += this.DownLoadGatewayFileProgress;
@@ -754,7 +757,10 @@
                //执行下一个升级
                HdlFirmwareUpdateLogic.DoUpdateNextFirmware();
                //网关升级成功!
                this.UpdateStatuChangedEvent?.Invoke(1, "");
                this.SetProgressValue(100, 100);
                System.Threading.Thread.Sleep(1500);
                this.UpdateStatuChangedEvent?.Invoke(1, Language.StringByID(R.MyInternationalizationString.uGatewayUpdateSuccess));
            });
        }
@@ -807,7 +813,7 @@
                return;
            }
            decimal result = value / maxValue;
            this.ProgressEvent?.Invoke(value);
            this.ProgressEvent?.Invoke(result);
        }
        /// <summary>
@@ -980,10 +986,6 @@
        {
            HdlThreadLogic.Current.RunThread(async () =>
            {
                //当前网关的版本
                var oldVersion = HdlGatewayLogic.Current.GetGwInfoAttribute(this.upDatezbGateway, "LinuxFWVersion");
                int oldLinuxVersion = Convert.ToInt32(oldVersion);
                //先等个120秒吧,网关升级和网关完全重启需要很长时间
                int count = 12;
                for (int i = 0; i < count; i++)