Beispiel #1
0
        /// <summary>
        /// 单步调试动作流
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btStep_Click(object sender, EventArgs e)
        {
            if (null == _methodFlow)
            {
                MessageBox.Show("无效操作!动作流对象未设置");
                return;
            }
            if (_methodFlow.Count == 0)
            {
                MessageBox.Show("无效操作!流程中没有动作节点");
                return;
            }

            if (_methodFlow.CurrStep == _methodFlow.Count - 1)
            {
                MessageBox.Show("无效操作!当前动作流已执行到结尾");
                return;
            }

            if (_methodFlow.IsWorking())
            {
                if (_methodFlow.RunningMode != JFMethodFlow.RunMode.Step)
                {
                    MessageBox.Show("正在连续运行,不能单步调试");
                    return;
                }
                JFWorkCmdResult ret = _methodFlow.Step();
                if (ret != JFWorkCmdResult.Success)
                {
                    MessageBox.Show("发送单步指令失败,错误代码 = " + ret);
                    return;
                }
            }
            else //当前未运行
            {
                JFWorkCmdResult ret = _methodFlow.Step();
                if (ret != JFWorkCmdResult.Success)
                {
                    MessageBox.Show("启动单步调试失败,错误代码:" + ret);
                    return;
                }
            }
        }