From b544d5cccd76735e034c8055918a50927b437474 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期二, 10 十一月 2026 08:29:04 +0800
Subject: [PATCH] fix: 维护模式重复进入失败与按钮灰死 + Broker 并发验证用例
---
HMI.Core/Util/PathHelper.cs | 97 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 82 insertions(+), 15 deletions(-)
diff --git a/HMI.Core/Util/PathHelper.cs b/HMI.Core/Util/PathHelper.cs
index be757b0..092287d 100644
--- a/HMI.Core/Util/PathHelper.cs
+++ b/HMI.Core/Util/PathHelper.cs
@@ -5,11 +5,69 @@
{
public class PathHelper
{
+ /// <summary>
+ /// 绋嬪簭鐩綍
+ /// </summary>
public static string AppFolder { get; private set; } = RootPath();
+
+ /// <summary>
+ /// 鍥炬爣鐩綍
+ /// </summary>
public static string IconFolder { get; private set; }
+
+ /// <summary>
+ /// Config鐩綍
+ /// </summary>
public static string ConfigFolder { get; private set; }
+
+ /// <summary>
+ /// Sqlite鏁版嵁搴撶洰褰�
+ /// </summary>
public static string DatabaseFolder { get; private set; }
+
+ /// <summary>
+ /// Sqlite鏁版嵁搴揚ath
+ /// </summary>
public static string DatabasePath { get; private set; }
+
+ /// <summary>
+ /// 澶氳瑷�鐩綍
+ /// </summary>
+ public static string LangFolder { get; private set; }
+
+ /// <summary>
+ /// 绯荤粺璁剧疆鐩綍
+ /// </summary>
+ public static string SettingFolder { get; private set; }
+
+ /// <summary>
+ /// 鍙傛暟鐩綍
+ /// </summary>
+ public static string ParameterFolder { get; private set; }
+
+ /// <summary>
+ /// 鍙傛暟鏁版嵁婧愭枃浠�
+ /// </summary>
+ public static string ParameterDataPath { get; private set; }
+
+
+
+
+ /// <summary>
+ /// 娴嬭瘯椤规暟鎹洰褰�
+ /// </summary>
+ public static string TestItemDataFolder { get; private set; }
+
+ /// <summary>
+ /// 娴嬭瘯椤规暟鎹簮鏂囦欢
+ /// </summary>
+ public static string TestItemDataFile { get; private set; }
+
+ /// <summary>
+ /// sqlite鏃ュ織鏁版嵁搴撴枃浠跺す
+ /// </summary>
+ public static string LogViewerDir { get; private set; }
+
/// <summary>
/// 搴旂敤绋嬪簭鐨勬牴鐩綍
@@ -17,19 +75,26 @@
/// <returns></returns>
private static string RootPath()
{
- string DllPath = DllHelper.GetAssemblyPath();
+ string DllPath = AppDomain.CurrentDomain.BaseDirectory;
string path = Path.GetFullPath(".");
IconFolder = InitFolder(path + "\\Icon");
ConfigFolder = InitFolder(path + "\\Config");
DatabaseFolder = InitFolder(ConfigFolder + "\\Database");
DatabasePath = DatabaseFolder + "\\database.db";
- return path;
- }
+ LangFolder = InitFolder(path + "\\Lang");
+ SettingFolder = InitFolder(ConfigFolder + "\\SystemSetting");
+ ParameterFolder = InitFolder(ConfigFolder + "\\Parameter");
+ ParameterDataPath = ParameterFolder + "\\CommonParameter.data";
- public static string SettingFolder()
- {
- string Path = RootPath() + "\\Config\\Setting";
- return Path;
+ //ProductDataFolder = InitFolder(ConfigFolder + "\\Product");
+ //ProductParameterFolder = InitFolder(ProductDataFolder + "\\Parameter");
+ //ProductDataFile = ProductDataFolder + "\\Product.data";
+
+ // TestItemDataFolder = InitFolder(ProductDataFolder + "\\TestItem");
+ TestItemDataFile = TestItemDataFolder + "\\TestItem.data";
+
+ LogViewerDir = InitFolder(ConfigFolder + "\\LogViewer");
+ return path;
}
/// <summary>
@@ -82,13 +147,15 @@
return Path;
}
- /// <summary>
- /// 璁剧疆鍙傛暟鏂囦欢澶�
- /// </summary>
- /// <returns>璁剧疆鍙傛暟鏂囦欢澶�</returns>
- public static string ParameterFolder()
+ public static string BlockAlarmSettingPath()
{
- string Path = ProductionFolder() + "\\Parameter";
+ string Path = RootPath() + "\\Config\\AlarmInfo\\BlockSetting.xml";
+ return Path;
+ }
+
+ public static string MarkAlarmSettingPath()
+ {
+ string Path = RootPath() + "\\Config\\AlarmInfo\\MarkSetting.xml";
return Path;
}
@@ -102,7 +169,7 @@
return Path;
}
- private static string InitFolder(string path)
+ public static string InitFolder(string path)
{
try
{
@@ -111,7 +178,7 @@
Directory.CreateDirectory(path);
}
}
- catch (Exception ex)
+ catch
{
}
--
Gitblit v1.9.1