| | |
| | | /// <summary>
|
| | | /// 网关的升级逻辑
|
| | | /// </summary>
|
| | | public class HdlGatewayUpdateLogic
|
| | | public class HdlGatewayUpdateLogic : HdlDeviceUpdateCommonLogic
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | /// 网关新版本的固件信息
|
| | | /// </summary>
|
| | | public FirmwareVersionInfo gatewayFirmware = null;
|
| | | /// <summary>
|
| | | /// 当前执行状态(出现错误时,它也会变成true)
|
| | | /// </summary>
|
| | | public UpdateStatuMode UpdateStatu = UpdateStatuMode.None;
|
| | | /// <summary>
|
| | | /// 升级是否完成
|
| | | /// </summary>
|
| | | public bool IsFinishUpdate = true;
|
| | |
|
| | | /// <summary>
|
| | | /// 前一次的最终状态
|
| | |
| | | public HdlGatewayUpdateLogic(ZbGateway zbGateway, FirmwareVersionInfo i_virtualFirmware,
|
| | | FirmwareVersionInfo i_coordinatorFirmware, FirmwareVersionInfo i_gatewayFirmware)
|
| | | {
|
| | | this.ClassDiv = 1;
|
| | | this.upDatezbGateway = zbGateway;
|
| | | this.virtualFirmware = i_virtualFirmware;
|
| | | this.coordinatorFirmware = i_coordinatorFirmware;
|
| | |
| | | {
|
| | | //如果是等待模式,再次点击时,移除列表
|
| | | string gwId = HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway);
|
| | | if (FirmwareUpdateResourse.dicGatewayUpdateList.ContainsKey(gwId) == true)
|
| | | if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(gwId) == true)
|
| | | {
|
| | | FirmwareUpdateResourse.dicGatewayUpdateList.Remove(gwId);
|
| | | FirmwareUpdateResourse.dicUpdateList.Remove(gwId);
|
| | | }
|
| | | this.UpdateStatu = UpdateStatuMode.None;
|
| | | //取消
|
| | |
| | | //进入等待模式
|
| | | this.UpdateStatu = UpdateStatuMode.Wait;
|
| | | string gwId2 = HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway);
|
| | | FirmwareUpdateResourse.dicGatewayUpdateList[gwId2] = this;
|
| | | FirmwareUpdateResourse.dicUpdateList[gwId2] = this;
|
| | | //等待中…
|
| | | this.UpdateStatuChangedEvent?.Invoke(0, Language.StringByID(R.MyInternationalizationString.uWaitting));
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 开始执行更新操作(FirmwareUpdateLogic调用)
|
| | | /// </summary>
|
| | | public void DoStartUpdate()
|
| | | public override void DoStartUpdate()
|
| | | {
|
| | | //状态变更
|
| | | this.IsFinishUpdate = false;
|
| | |
| | | /// <summary>
|
| | | /// 释放缓存
|
| | | /// </summary>
|
| | | public void Dispose()
|
| | | public override void Dispose()
|
| | | {
|
| | | this.ProgressEvent = null;
|
| | | this.UpdateStatuChangedEvent = null;
|