private void BtnStart_Click(object sender, RoutedEventArgs e) { if (AppCurrent.IsRunning) { OperationHelper.ShowTips("系统已经在运行,请勿重复启动!"); return; } if (Current.App.RunStatus == TengDa.RunStatus.异常) { OperationHelper.ShowTips("请先复位!"); return; } if (CommunicateControl.CommunicateStart()) { AppCurrent.IsRunning = true; Current.App.RunStatus = TengDa.RunStatus.运行; OperationHelper.ShowTips("成功启动运行!"); } else { Current.App.RunStatus = TengDa.RunStatus.异常; } }
private void BtnReset_Click(object sender, RoutedEventArgs e) { if (Current.App.RunStatus == TengDa.RunStatus.运行) { Tip.Alert("系统正在运行,复位无效,请停止运行后再执行复位操作!"); return; } if (Current.App.RunStatus == TengDa.RunStatus.闲置) { Tip.Alert("系统尚未启动,复位操作无效!"); return; } if (CommunicateControl.CommunicateStop()) { OperationHelper.ShowTips("成功复位!"); Current.App.RunStatus = TengDa.RunStatus.闲置; } }