From 2e889843b4c171f2d6ad8e0d53084040703d11f6 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 13:18:21 +0800
Subject: [PATCH] docs: CAN 总线级应答器 + 硬件调试页多标签多会话 设计规格
---
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