领胜LDS 键盘AOI检测项目
wells.liu
2020-07-06 01d2cf934b9c976ce24f28b83f8b6aa68dac921c
src/Bro.M071.Process/M071Process_MotionCard.cs
@@ -16,11 +16,11 @@
{
    public partial class M071Process
    {
        Timer _resetTimer = null;
        public Timer ResetTimer = null;
        const int FULLRESETTIME = 5;
        MachineState machineState = MachineState.Unknown;
        MachineState MachineState
        public MachineState MachineState
        {
            get => machineState;
            set
@@ -40,6 +40,8 @@
                    default:
                        break;
                }
                OnMachineStateChanged?.Invoke(machineState);
            }
        }
@@ -66,21 +68,26 @@
            MotionCardDefaultRun("Reset", ref opConfig, ref invokeDevice);
            if (_resetTimer == null)
            RaisedAlarm("");
            MachineState = MachineState.Ready;
            if (ResetTimer == null)
            {
                _resetTimer = new Timer(FullReset, null, -1, -1);
                ResetTimer = new Timer(FullReset, null, -1, -1);
            }
            if (opConfig.InputPara.Count > 0)
            {
                //大复位信号
                _resetTimer.Change(-1, opConfig.InputPara[0] == 1 ? FULLRESETTIME * 1000 : -1);
                ResetTimer.Change(-1, opConfig.InputPara[0] == 1 ? FULLRESETTIME * 1000 : -1);
            }
            //if (invokeDevice is MotionCardBase motionCard)
            //{
            //    motionCard.Run(opConfig);
            //}
            LogAsync(DateTime.Now, "普通复位动作完成", "");
            return new ProcessResponse(true);
        }
@@ -118,6 +125,12 @@
            MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice);
            productionList.ForEach(u => u.Dispose());
            productionList.Clear();
            OnFullResetDone?.Invoke();
            LogAsync(DateTime.Now, "大复位动作完成", "");
            return new ProcessResponse(true);
        }
@@ -135,14 +148,22 @@
        [ProcessMethod("", "PauseJob", "暂停流程", InvokeType.TestInvoke)]
        public ProcessResponse PauseJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice)
        {
            if (_pauseHandle.WaitResult)
            if (!_pauseHandle.WaitResult)
            {
                #region 板卡暂停动作
                #endregion
                _pauseHandle.WaitHandle.Reset();
            }
            else
            _pauseHandle.WaitResult = !_pauseHandle.WaitResult;
            return new ProcessResponse(_pauseHandle.WaitResult);
        }
        [ProcessMethod("", "ResumeJob", "继续流程", InvokeType.TestInvoke)]
        public ProcessResponse ResumeJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice)
        {
            if (_pauseHandle.WaitResult)
            {
                #region 板卡恢复动作
                #endregion