| | |
| | | /// </summary>
|
| | | /// <param name="realGateway">真实物理网关对象</param>
|
| | | /// <param name="backupName">需要创建的备份的名字</param>
|
| | | public async void DoBackupGateway(ZbGateway realGateway, string backupName)
|
| | | public void DoBackupGateway(ZbGateway realGateway, string backupName)
|
| | | {
|
| | | //展开进度条
|
| | | ProgressFormBar.Current.Start();
|
| | | //创建备份文件
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uCreatBackupFile));
|
| | | await System.Threading.Tasks.Task.Delay(1000);
|
| | | System.Threading.Thread.Sleep(1000);
|
| | |
|
| | | //创建一个备份名字
|
| | | string backupClassId = await HdlBackupLogic.Current.CreatNewBackupNameToDB(backupName, 2, realGateway.GwId);
|
| | | string backupClassId = HdlBackupLogic.Current.CreatNewBackupNameToDB(backupName, 2, realGateway.GwId);
|
| | | if (backupClassId == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | if (result == false)
|
| | | {
|
| | | //如果上传失败的话,就把它删除
|
| | | await HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | //关闭进度条
|
| | | ProgressFormBar.Current.Close();
|
| | | return;
|
| | |
| | | //网关已经接收到重启命令,接下来去判断网关是否重启完成
|
| | | bool gatewatAction = false;
|
| | | bool threadAction = true;
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | timeOut = 0;
|
| | | while (gatewatAction == false)
|
| | |
| | | if (timeOut >= 65 && timeOut % 5 == 0)
|
| | | {
|
| | | //5秒一次,去获取版本
|
| | | var data = await HdlGatewayLogic.Current.GetGatewayNewInfoAsync(realGateway, ShowErrorMode.NO);
|
| | | var data = HdlGatewayLogic.Current.GetGatewayInfo(realGateway, ShowErrorMode.NO);
|
| | | if (data != null)
|
| | | {
|
| | | gatewatAction = true;
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | await System.Threading.Tasks.Task.Delay(1000);
|
| | | System.Threading.Thread.Sleep(1000);
|
| | | timeOut++;
|
| | | //设置进度值
|
| | | ProgressFormBar.Current.SetValue(timeOut, 180);
|