private void BtnStop_Click(object sender, EventArgs e) { _timer.Enabled = false; Thread.Sleep(_mainCfg.RealtimeInterval); StartGasBoxPreheatSelfCheckParams cmdParams = new StartGasBoxPreheatSelfCheckParams() { ClientID = _dynoCmd.ClientID, stopCheck = true, step = -1, isQY = true, isRetry = false }; if (!_dynoCmd.StartGasBoxPreheatSelfCheckCmd(cmdParams, out string errMsg) && errMsg != "ati >= 0") { MessageBox.Show("执行停止分析仪预热命令失败", "执行命令出错", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (errMsg.Length > 0) { if (errMsg == "ati >= 0") { lblMsg.Text = "手动停止尾气分析仪预热"; } else if (errMsg != "OK") { lblMsg.Text = errMsg; } } lblHC.Text = "--"; lblNO.Text = "--"; lblCO.Text = "--"; lblCO2.Text = "--"; lblO2.Text = "--"; lblPEF.Text = "--"; }
private void BtnStart_Click(object sender, EventArgs e) { _step = 0; for (int i = 0; i < _iResults.Length; i++) { _iResults[i] = 0; } StartGasBoxPreheatSelfCheckParams cmdParams = new StartGasBoxPreheatSelfCheckParams { ClientID = _dynoCmd.ClientID, stopCheck = false, step = _step, isQY = true, isRetry = false }; if (!_dynoCmd.StartGasBoxPreheatSelfCheckCmd(cmdParams, out string msg)) { MessageBox.Show("执行开始分析仪预热命令失败", "执行命令出错", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { _timer.Enabled = true; } }
private void DoStep() { if (lblWarmUp.Text == "成功") { _iResults[0] = 1; } else if (lblWarmUp.Text == "失败") { _iResults[0] = -1; } if (lblZero.Text == "成功") { _iResults[1] = 1; } else if (lblZero.Text == "失败") { _iResults[1] = -1; } if (lblLeak.Text == "成功") { _iResults[2] = 1; } else if (lblLeak.Text == "失败") { _iResults[2] = -1; } if (lblLowFlow.Text == "成功") { _iResults[3] = 1; } else if (lblLowFlow.Text == "失败") { _iResults[3] = -1; } if (lblO2Span.Text == "成功") { _iResults[4] = 1; } else if (lblO2Span.Text == "失败") { _iResults[4] = -1; } if (_iResults[_step] == 1) { _timer.Enabled = false; if (_step < _iResults.Length - 1) { StartGasBoxPreheatSelfCheckParams cmdParams = new StartGasBoxPreheatSelfCheckParams() { ClientID = _dynoCmd.ClientID, stopCheck = false, step = ++_step, isQY = true, isRetry = false }; if (!_dynoCmd.StartGasBoxPreheatSelfCheckCmd(cmdParams, out string errMsg)) { MessageBox.Show("执行开始分析仪预热命令失败", "执行命令出错", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { _timer.Enabled = true; } } else { ++_step; } } }