From 17db44bdab7772f465969bf778d417e08bf8a5f0 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期六, 04 七月 2020 17:58:34 +0800 Subject: [PATCH] 1. 大/小复位,机台状态 2. 板卡操作配置复数化 3. 界面日志输出机制修改 4. M071主界面CT,测量结果,测量状态,机台状态输出 --- src/Bro.M071.Process/M071Process_MotionCard.cs | 37 +++++++++++++++++++++++++++++-------- 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/Bro.M071.Process/M071Process_MotionCard.cs b/src/Bro.M071.Process/M071Process_MotionCard.cs index 514b46d..98ce638 100644 --- a/src/Bro.M071.Process/M071Process_MotionCard.cs +++ b/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); } @@ -116,8 +123,14 @@ // motionCard.Run(opConfig); //} - //MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice); + 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 -- Gitblit v1.8.0