From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
HMI.Core/Util/PathHelper.cs | 188 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 188 insertions(+), 0 deletions(-)
diff --git a/HMI.Core/Util/PathHelper.cs b/HMI.Core/Util/PathHelper.cs
new file mode 100644
index 0000000..092287d
--- /dev/null
+++ b/HMI.Core/Util/PathHelper.cs
@@ -0,0 +1,188 @@
+锘縰sing System;
+using System.IO;
+
+namespace HMI.Core.Util
+{
+ 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>
+ /// 搴旂敤绋嬪簭鐨勬牴鐩綍
+ /// </summary>
+ /// <returns></returns>
+ private static string RootPath()
+ {
+ 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";
+ LangFolder = InitFolder(path + "\\Lang");
+ SettingFolder = InitFolder(ConfigFolder + "\\SystemSetting");
+ ParameterFolder = InitFolder(ConfigFolder + "\\Parameter");
+ ParameterDataPath = ParameterFolder + "\\CommonParameter.data";
+
+ //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>
+ /// 绯荤粺閰嶇疆淇℃伅瀛樺偍鏂囦欢澶硅矾寰�
+ /// </summary>
+ /// <returns>绯荤粺閰嶇疆淇℃伅鏂囦欢澶�</returns>
+ public static string SystemSettingFolder()
+ {
+ string Path = RootPath() + "\\Config\\SystemSetting";
+ return Path;
+ }
+
+ /// <summary>
+ /// 绯荤粺閰嶇疆鏂囦欢
+ /// </summary>
+ /// <returns>绯荤粺閰嶇疆鏂囦欢璺緞</returns>
+ public static string SystemSettingFile()
+ {
+ string Path = RootPath() + "\\Config\\SystemSetting\\system.setting";
+ return Path;
+ }
+
+ // <summary>
+ /// 鑿滃崟閰嶇疆鏂囦欢
+ /// </summary>
+ /// <returns>鑿滃崟閰嶇疆鏂囦欢</returns>
+ public static string MenuFile()
+ {
+ string Path = RootPath() + "\\Config\\SystemSetting\\menu.setting";
+ return Path;
+ }
+
+ /// <summary>
+ /// 鐢熶骇閰嶇疆鏂囦欢澶�
+ /// </summary>
+ /// <returns>鐢熶骇閰嶇疆鏂囦欢澶�</returns>
+ public static string ProductionFolder()
+ {
+ string Path = RootPath() + "\\Config\\ProductionSetting";
+ return Path;
+ }
+
+ /// <summary>
+ /// 娴嬭瘯椤逛俊鎭瓨鍌ㄦ枃浠跺す
+ /// </summary>
+ /// <returns>娴嬭瘯椤瑰瓨鍌ㄦ枃浠跺す</returns>
+ public static string TestItemFolder()
+ {
+ string Path = ProductionFolder() + "\\TestItem";
+ return Path;
+ }
+
+ public static string BlockAlarmSettingPath()
+ {
+ string Path = RootPath() + "\\Config\\AlarmInfo\\BlockSetting.xml";
+ return Path;
+ }
+
+ public static string MarkAlarmSettingPath()
+ {
+ string Path = RootPath() + "\\Config\\AlarmInfo\\MarkSetting.xml";
+ return Path;
+ }
+
+ /// <summary>
+ /// 鎻掍欢瀛樺偍鐩綍
+ /// </summary>
+ /// <returns>鎻掍欢瀛樺偍鐩綍</returns>
+ public static string PluginFolder()
+ {
+ string Path = RootPath() + "\\Plugin";
+ return Path;
+ }
+
+ public static string InitFolder(string path)
+ {
+ try
+ {
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
+ }
+ catch
+ {
+
+ }
+ return path;
+ }
+ }
+}
--
Gitblit v1.9.1