private void BtnStop_Click(object sender, EventArgs e)
        {
            _timer.Enabled = false;
            System.Threading.Thread.Sleep(_mainCfg.RealtimeInterval);
            StartFlowmeterCheckParams cmdParams = new StartFlowmeterCheckParams {
                ClientID  = _dynoCmd.ClientID,
                stopCheck = true,
                step      = _step,
                FlowmeterTargetPressure = _mainCfg.Flowmeter.TargetPressure,
                FlowmeterTargetTempe    = _mainCfg.Flowmeter.TargetTempe
            };
            StartFlowmeterCheckAckParams ackParams = new StartFlowmeterCheckAckParams();

            if (!_dynoCmd.StartFlowmeterCheckCmd(cmdParams, ref ackParams, 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;
                }
            }
            lblFlow.Text        = "--";
            lblDiluteO2.Text    = "--";
            lblTemperature.Text = "--";
            lblPressure.Text    = "--";
        }
        private void BtnStart_Click(object sender, EventArgs e)
        {
            _step = 0;
            for (int i = 0; i < _iResults.Length; i++)
            {
                _iResults[i] = 0;
            }
            StartFlowmeterCheckParams cmdParams = new StartFlowmeterCheckParams {
                ClientID  = _dynoCmd.ClientID,
                stopCheck = false,
                step      = _step,
                FlowmeterTargetPressure = _mainCfg.Flowmeter.TargetPressure,
                FlowmeterTargetTempe    = _mainCfg.Flowmeter.TargetTempe
            };
            StartFlowmeterCheckAckParams ackParams = new StartFlowmeterCheckAckParams();

            if (!_dynoCmd.StartFlowmeterCheckCmd(cmdParams, ref ackParams, out string errMsg))
            {
                MessageBox.Show("执行开始流量计预热命令失败", "执行命令出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                _timer.Enabled      = true;
                lblLowFlowSpan.Text = ackParams.FlowmeterLowFlowSpan.ToString("F");
                lblO2Span.Text      = ackParams.FlowmeterO2SpanLow.ToString("F");
                lblO2Span.Text     += "/" + ackParams.FlowmeterO2SpanHight.ToString("F");
            }
        }
        private void DoStep(ref GetFlowmeterCheckRealTimeDataAckParams ackParams)
        {
            if (lblFlowCheck.Text == "成功")
            {
                _iResults[0] = 1;
            }
            else if (lblFlowCheck.Text == "失败")
            {
                _iResults[0] = -1;
            }
            if (lblO2SpanCheck.Text == "成功")
            {
                _iResults[1] = 1;
            }
            else if (lblO2SpanCheck.Text == "失败")
            {
                _iResults[1] = -1;
            }
            if (lblTempeCheck.Text == "成功")
            {
                _iResults[2] = 1;
            }
            else if (lblTempeCheck.Text == "失败")
            {
                _iResults[2] = -1;
            }
            if (lblPressureCheck.Text == "成功")
            {
                _iResults[3] = 1;
            }
            else if (lblPressureCheck.Text == "失败")
            {
                _iResults[3] = -1;
            }

            if (_iResults[_step] == 1)
            {
                _timer.Enabled = false;
                _dynoCmd.GetFlowmeterCheckRealTimeDataCmd(true, ref ackParams, out string errMsg);
                if (_step < _iResults.Length - 1)
                {
                    StartFlowmeterCheckParams cmdParams = new StartFlowmeterCheckParams {
                        ClientID  = _dynoCmd.ClientID,
                        stopCheck = false,
                        step      = ++_step,
                        FlowmeterTargetPressure = _mainCfg.Flowmeter.TargetPressure,
                        FlowmeterTargetTempe    = _mainCfg.Flowmeter.TargetTempe
                    };
                    StartFlowmeterCheckAckParams startAckParams = new StartFlowmeterCheckAckParams();
                    if (!_dynoCmd.StartFlowmeterCheckCmd(cmdParams, ref startAckParams, out errMsg))
                    {
                        MessageBox.Show("执行开始流量计预热命令失败", "执行命令出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        _timer.Enabled = true;
                        Invoke((EventHandler) delegate {
                            lblLowFlowSpan.Text = startAckParams.FlowmeterLowFlowSpan.ToString("F");
                            lblO2Span.Text      = startAckParams.FlowmeterO2SpanLow.ToString("F");
                            lblO2Span.Text     += "/" + startAckParams.FlowmeterO2SpanHight.ToString("F");
                        });
                    }
                }
                else
                {
                    ++_step;
                }
            }
        }