From d1b72117058f1131046b6aa3add8e3ccfae033d8 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 10:36:07 +0800
Subject: [PATCH] docs: CAN 模拟器独立 TCP 服务进程设计规格(统一 CanDeviceDriver + 双工推送协议)
---
HMI.Base/PluginLoader.cs | 27 ++++++++-------------------
1 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/HMI.Base/PluginLoader.cs b/HMI.Base/PluginLoader.cs
index f295e9d..81e1f84 100644
--- a/HMI.Base/PluginLoader.cs
+++ b/HMI.Base/PluginLoader.cs
@@ -12,19 +12,6 @@
namespace HMI.Base
{
- public enum LoadMsgType
- {
- INIT, LOADING, FINISHED
- }
-
- public class LoadMsg
- {
- public string Message { get; set; }
- public bool? Result { get; set; }
- public LoadMsgType Type { get; set; }
- public int NumData { get; set; }
- }
-
public class PluginLoader
{
private static ILog log = LogManager.GetLogger("PluginLoader");
@@ -70,10 +57,7 @@
Plugins = new List<PluginInfo>();
Menus = LoadTreeMenu(dispatcher);
sqliteHelper.Close();
- dispatcher.Invoke(() =>
- {
- LoadMessageAppend?.Invoke(this, new LoadMsg { Type = LoadMsgType.FINISHED });
- });
+ LoadMessageAppend?.Invoke(this, new LoadMsg { Type = LoadMsgType.FINISHED });
}
pluginContainer.DoCloseEvent += PluginContainer_DoCloseEvent;
}
@@ -93,6 +77,8 @@
{
try
{
+ var start = DateTime.Now;
+ log.Info(this.lang("App.IsLoadingMenu", menu.Name));
LoadMessageAppend?.Invoke(this,
new LoadMsg
{
@@ -100,6 +86,7 @@
Message = this.lang("App.IsLoadingMenu", menu.Name)
}
);
+
if (!string.IsNullOrEmpty(menu.DllPath))
{
string dllPath = Path.Combine(PluginFolder, menu.DllPath);
@@ -136,6 +123,7 @@
menu.SettingControl = SettingInstance;
}
}
+ log.Info($"{this.lang("App.MenuLoadSuccess", menu.Name)} Cost: {(DateTime.Now - start).TotalMilliseconds}ms");
LoadMessageAppend?.Invoke(this,
new LoadMsg
{
@@ -197,8 +185,9 @@
List<PermissionData> allPermissions = UserInfo.User?.AllPermissions;
if (allPermissions != null)
{
- Application.Current.Dispatcher.Invoke(() =>
+ Application.Current.Dispatcher.Invoke(new Action(() =>
{
+ log.Info(this.lang("App.MenuCount", allPermissions.Count));
LoadMessageAppend?.Invoke(this,
new LoadMsg
{
@@ -231,7 +220,7 @@
}
Plugins.Add(menu);
}
- });
+ }));
LoadChildrenMenu();
}
}
--
Gitblit v1.9.1