From 1bc2df66bc88a6405df345dccc24a5031e18b592 Mon Sep 17 00:00:00 2001
From: patrick.xu <patrick.xu@broconcentric.com>
Date: 星期一, 21 十二月 2020 09:54:48 +0800
Subject: [PATCH] 1. gocator添加byte2/byte4的配置,目前测试byte4不成功,暂时还是使用byte2配置。 2. 添加键名代码映射配置和NG键名代码上传功能

---
 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