From 1f2fa3f54d4a7b5a2f601c4c947a06476342e3bd Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期五, 22 一月 2021 09:23:06 +0800 Subject: [PATCH] 1. gocator驱动将system.stop移到system.ReceiveData之后 2. 修改测量完成后状态切换逻辑,避免安全光线等干扰 3. 添加设备异常输出日志记录 4. 产品结果输出时做硬盘文件记录 --- src/Bro.UI.Config/Ctrls/CtrlMethodInvoke.cs | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Bro.UI.Config/Ctrls/CtrlMethodInvoke.cs b/src/Bro.UI.Config/Ctrls/CtrlMethodInvoke.cs index 84b159e..382ce1b 100644 --- a/src/Bro.UI.Config/Ctrls/CtrlMethodInvoke.cs +++ b/src/Bro.UI.Config/Ctrls/CtrlMethodInvoke.cs @@ -38,7 +38,7 @@ } #region ILogoutput - public Action<LogMsg> OnLogMsgOutput { get; set; } + public event Action<LogMsg> OnLogMsgOutput; public void LogDisplay(LogMsg msg) { @@ -157,11 +157,18 @@ { OnLogMsgOutput?.Invoke(new LogMsg(DateTime.Now, $"{_methodCode}璋冪敤寮�濮�", "")); - ProcessResponse response = _method.Invoke(Process, new object[] { opConfig, _invokeDevice, _sourceDevice }) as ProcessResponse; - - if (response != null) + try { - OnLogMsgOutput?.Invoke(new LogMsg(DateTime.Now, $"{_methodCode}璋冪敤瀹屾垚", $"鍙嶉锛歿JsonConvert.SerializeObject(response)}")); + ProcessResponse response = _method.Invoke(Process, new object[] { opConfig, _invokeDevice, _sourceDevice }) as ProcessResponse; + + if (response != null) + { + OnLogMsgOutput?.Invoke(new LogMsg(DateTime.Now, $"{_methodCode}璋冪敤瀹屾垚", $"鍙嶉锛歿JsonConvert.SerializeObject(response)}")); + } + } + catch (Exception ex) + { + OnLogMsgOutput?.Invoke(new LogMsg(DateTime.Now, $"{_methodCode}璋冪敤寮傚父", ex.GetExceptionMessage())); } }); } -- Gitblit v1.8.0