示例#1
0
 /// <summary>
 /// 恢复工作流程。
 /// 发送Resume系统事件。
 /// </summary>
 /// <param name="FromThis">执行源</param>
 /// <returns>返回执行结果。成功返回空字符。</returns>
 public string ActionResumeWorkFlow(WFContFrom FromThis)
 {
     CommonFunction.SysPublisher.notifyResumeEventSubscribers(this, new StateEventArgs("恢复", "来自" + FromThis.ToString()));
     return("");
 }
示例#2
0
        /// <summary>
        /// 开始工作流程。
        /// 发送Start系统事件。
        /// </summary>
        /// <param name="FromThis">执行源</param>
        /// <returns>返回执行结果。成功返回空字符。</returns>
        public string ActionStartWorkFlow(WFContFrom FromThis)
        {
            if (ThisInport(EnumInportName.FrameDoorOpen).status /* && ClassWorkFlow.Instance.DebugMode == WFDebugMode.Auto*/)
            {
                ClassErrorHandle.ShowError(this.Name, "不能启动或恢复流程运行:外框门被打开。", ErrorLevel.Alarm);
                return("DoorOpen");
            }
            if (ClassCommonSetting.SysParam.CurrentProduct == CALIBPROD)
            {
                BaseForm.DoInvokeRequired(MainForm.instance, () => MessageBox.Show(MainForm.instance, "当前产品“calibration”是用于标定的虚拟产品,不能启动生产流程。"));
                return("WrongProduct");
            }
            ErrorInfoWithPause err = CheckGeneralAir();

            if (err != null)
            {
                return(err.Message);
            }
            if (ErrorCount > 0)
            {
                BaseForm.DoInvokeRequired(MainForm.instance, () => MessageBox.Show(MainForm.instance, "启动生产流程之前,所有错误和提示必须全部处理完成!"));
                return("ErrorNotHandle");
            }
            bool CanStart = false;

            BaseForm.DoInvokeRequired(MainForm.instance, () =>
                                      CanStart = MessageBox.Show(MainForm.instance, "启动生产流程之前,需手动检查并清除设备内(包括NG盒和可能的掉料)所有物料并确认。确认后按“确定”按钮,否则按“取消”按钮。", "启动流程", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
            if (!CanStart)
            {
                return("NotClear");
            }
            string res = ActionSystemReset();

            if (res == "")
            {
                ClassWorkFlow.Instance.IsGRR = FromThis == WFContFrom.GRR;// true;
                CommonFunction.SysPublisher.notifyStartEventSubscribers(this, new StateEventArgs("启动", "来自" + FromThis.ToString()));
            }
            else
            {
                ClassErrorHandle.ShowError("系统复位", res, ErrorLevel.Error);
            }
            return(res);
        }