Пример #1
0
 public void StopTask()
 {
     if (mPcuTask.isTaskBusy() || mCcuTask.isTaskBusy())
     {
         mPcuTask.StopTask();
         mCcuTask.StopTask();
         mBroadCastTask.StopTask();
     }
     else
     {
         bTaskRunning = false;
         mBroadCastTask.StopTask();
         mResetEcuParam.cmdCode = 0x02; //升级失败或者其他,恢复同步指令
         mResetEcuTask.Excute();
         Thread.Sleep(10);
         mResetEcuTask.Excute();
         Thread.Sleep(10);
         mResetEcuTask.Excute();
         Thread.Sleep(10);
         mBroadCastTask.ClosePort();
     }
     //
 }
Пример #2
0
 private void bk_CcuCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     mUpgradeStartReqTask.StopTask();
     mUpgradeRequestTask.StopTask();
     mUpgradeProcessReqTask.StopTask();
     mUpgradeMD5ReqTask.StopTask();
     mUpgradeEndReqTask.StopTask();
     if (mCcuStream != null)
     {
         mCcuStream.Dispose();
         if (mCcuStream != null)
         {
             mCcuStream.Close();
         }
         mCcuStream = null;
     }
     TerminateTask(sender, mTaskStatus);
 }
Пример #3
0
 private void bk_PcuCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     mPcuUpgradeStartTask.StopTask();
     mPcuUpgradeProcessTask.StopTask();
     mPcuUpgradeDoneTask.StopTask();
     mPcuUpgradeRunningTask.StopTask();
     mPcuUpgradeRequestTask.StopTask();
     if (mPcuStream != null)
     {
         mPcuStream.Dispose();
         if (mPcuStream != null)
         {
             mPcuStream.Close();
         }
         else
         {
             mPcuStream = null;
         }
     }
     TaskStatusNotify(sender, "", 0, Task_Level.TASK_DONE);
 }