领胜LDS 键盘AOI检测项目
xcd
2020-07-04 753b5add58defa5c09015308efb81bcaea0ebe91
src/Bro.M071.Process/M071Process.cs
@@ -33,7 +33,7 @@
        #region 事件
        public event Action OnMeasureStart;
        public event Action<string> OnBarcodeChanged;
        public event Action OnClearBarcode;
        public event Action<IShapeElement> OnElementUpdated;
        #endregion
@@ -51,7 +51,7 @@
        /// </summary>
        private void CheckMachineState()
        {
            throw new NotImplementedException();
            //throw new NotImplementedException();
        }
        private void InitialSetting()
@@ -110,7 +110,7 @@
                    if (keyRespone.Count == 0)
                        throw new ProcessException($"{u.GetDisplayText()}对应的单键不存在或不可用");
                    if (b.KeyResult == "All")
                    if (b.KeyResultId == "All")
                    {
                        keyRespone.SelectMany(kr => kr.KeyResultList).ToList().ForEach(r =>
                          {
@@ -119,7 +119,7 @@
                    }
                    else
                    {
                        b.MeasureValueDict[b.KeyResult] = null;
                        b.MeasureValueDict[b.KeyResultId] = null;
                    }
                });
            });
@@ -150,19 +150,7 @@
        //}
        #endregion
        private string barCode = "";
        public string BarCode
        {
            get => barCode;
            set
            {
                if (barCode != value)
                {
                    barCode = value;
                    OnBarcodeChanged?.Invoke(value);
                }
            }
        }
        public string BarCode { get; set; }
        List<ProductionMeasurement> productionList = new List<ProductionMeasurement>();
@@ -171,6 +159,7 @@
        {
            if (string.IsNullOrWhiteSpace(BarCode))
            {
                OnClearBarcode?.Invoke();
                throw new ProcessException("未输入产品条码,请勿开始测量");
            }
@@ -236,39 +225,6 @@
            BarCode = "";
            return new ProcessResponse(true);
        }
        /// <summary>
        /// 暂停标志
        /// WaitHandle 暂停句柄  默认为非阻塞 可执行
        /// WaitResult 暂停标志 true 正常执行  false 暂停中
        /// </summary>
        ManualWaitConfirm _pauseHandle = new ManualWaitConfirm()
        {
            WaitHandle = new ManualResetEvent(true),
            WaitResult = true,
        };
        [ProcessMethod("", "PauseJob", "暂停流程", InvokeType.TestInvoke)]
        public ProcessResponse PauseJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice)
        {
            if (_pauseHandle.WaitResult)
            {
                #region 板卡暂停动作
                #endregion
                _pauseHandle.WaitHandle.Reset();
            }
            else
            {
                #region 板卡恢复动作
                #endregion
                _pauseHandle.WaitHandle.Set();
            }
            _pauseHandle.WaitResult = !_pauseHandle.WaitResult;
            return new ProcessResponse(_pauseHandle.WaitResult);
        }
        #region 私有方法