Exemplo n.º 1
0
 /// <summary>
 /// 激发升级完成事件
 /// </summary>
 /// <param name="result"></param>
 private void OnUpgradeCompletedEvent(UpgradeResult result)
 {
     if (upgradeCompleted != null)
     {
         upgradeCompleted.BeginInvoke(result, null, null);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 转换成结果字符串
 /// </summary>
 /// <param name="shareAmount"></param>
 /// <param name="shareUser"></param>
 /// <param name="UpgradeResult"></param>
 protected void ToResult(decimal shareAmount, User shareUser, ref UpgradeResult upgradeResult)
 {
     return(null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Handle after upgrade completed
 /// </summary>
 /// <param name="obj"></param>
 void comCommand_UpgradeCompletedEvent(UpgradeResult result)
 {
     switch (result)
     {
         case UpgradeResult.Success:
             SetLabelText("升级成功");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             SetbtnUpgradeText();
             break;
         case UpgradeResult.Faild:
             SetLabelText("升级失败");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             SetbtnUpgradeText();
             break;
         case UpgradeResult.Stop:
             SetLabelText("升级终止");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             SetbtnUpgradeText();
             break;
         case UpgradeResult.Reset:
             SetLabelText("正在复位...");
             break;
         case UpgradeResult.ClearSector:
             SetLabelText("正在擦除扇区...");
             break;
         case UpgradeResult.WriteData:
             SetLabelText("正在写入数据...");
             break;
         case UpgradeResult.ReSendDataCRC:
             SetLabelText("CRC校验错误,重发命令");
             break;
         case UpgradeResult.ReSendDataError:
             SetLabelText("下位机收到数据错误,重发数据");
             break;
         case UpgradeResult.OverTime:
             SetLabelText("超时,程序中止");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             SetbtnUpgradeText();
             this.Invoke(new MethodInvoker(() =>
             {
                 formWait.Hide();
             }));
             break;
         case UpgradeResult.OverTimeResend:
             SetLabelText("超时重发");
             break;
         case UpgradeResult.RunFactoryApp:
             SetLabelText("运行出厂扇区");
             break;
         case UpgradeResult.RunUpgradeApp:
             SetLabelText("运行升级扇区");
             break;
         case UpgradeResult.RunSuccess:
             SetLabelText("运行扇区成功");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             break;
         case UpgradeResult.RunFaild:
             SetLabelText("运行扇区失败");
             SetControlEnabled(true); //控件可用
             comCommand.ResetAllPara();//升级结束重置所有参数
             break;
         default:
             break;
     }
 }