From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;

---
 HMI.Core/Setting/SystemSetting.cs |   57 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 10 deletions(-)

diff --git a/HMI.Core/Setting/SystemSetting.cs b/HMI.Core/Setting/SystemSetting.cs
index b2fe7be..e07e053 100644
--- a/HMI.Core/Setting/SystemSetting.cs
+++ b/HMI.Core/Setting/SystemSetting.cs
@@ -13,6 +13,8 @@
         /// </summary>
         public static event EventHandler<SystemSetting> SystemSettingChanged;
 
+        private static string FilePath = Path.Combine(PathHelper.SettingFolder, "SystemConfig.xml");
+
         static SystemSetting()
         {
             LoadFromXml();
@@ -23,38 +25,45 @@
 
         }
 
-        public string LogoPath { get; private set; }
-        public string WindowTitle { get; private set; }
-        public string PlcIp { get; private set; }
+        public string LogoPath { get; private set; } = ".\\Logo.png";
+        public string LoginLogoPath { get; private set; } = ".\\LoginLogo.png";
+        public string WindowTitle { get; private set; } = "浜у搧娴嬭瘯骞冲彴";
+        public string PlcIp { get; private set; } = "127.0.0.1";
+        public int PlcPort { get; private set; } = 102;
         public bool PlcEnabled { get; private set; }
+        public string CurrentLanguage { get; private set; } = "zh-CN";
+        public int LogExpiredDays { get; private set; } = 7;
 
         private static void LoadFromXml()
         {
             if (Instance != null) return;
-            string XmlFilePath = PathHelper.ConfigFolder + "\\SystemConfig.xml";
-            if (!File.Exists(XmlFilePath))
+            if (!File.Exists(FilePath))
             {
                 Instance = new SystemSetting();
             }
             else
             {
-                SystemSettingModel model = XmlHelper.DeserializeFromXml<SystemSettingModel>(XmlFilePath);
+                SystemSettingModel model = XmlHelper.DeserializeFromXml<SystemSettingModel>(FilePath);
                 SystemSetting setting = new SystemSetting();
                 BeanUtil.Copy(model, setting);
                 Instance = setting;
             }
         }
 
+        public static SystemSettingModel GetModel()
+        {
+            return XmlHelper.DeserializeFromXml<SystemSettingModel>(FilePath);
+        }
+
         public static void ReLoad()
         {
-            string XmlFilePath = PathHelper.ConfigFolder + "\\SystemConfig.xml";
-            if (!File.Exists(XmlFilePath))
+            if (!File.Exists(FilePath))
             {
-                Instance = new SystemSetting();
+                return;
             }
             else
             {
-                SystemSettingModel model = XmlHelper.DeserializeFromXml<SystemSettingModel>(XmlFilePath);
+                SystemSettingModel model = XmlHelper.DeserializeFromXml<SystemSettingModel>(FilePath);
                 SystemSetting setting = new SystemSetting();
                 BeanUtil.Copy(model, setting);
                 Instance = setting;
@@ -73,6 +82,13 @@
             set { Set(ref logoPath, value); }
         }
 
+        private string loginLogoPath;
+        public string LoginLogoPath
+        {
+            get => loginLogoPath;
+            set { Set(ref loginLogoPath, value); }
+        }
+
         private string windowTitle;
         public string WindowTitle
         {
@@ -87,11 +103,32 @@
             set { Set(ref plcIp, value); }
         }
 
+        private int plcPort;
+        public int PlcPort
+        {
+            get => plcPort;
+            set { Set(ref plcPort, value); }
+        }
+
         private bool plcEnabled;
         public bool PlcEnabled
         {
             get => plcEnabled;
             set { Set(ref plcEnabled, value); }
         }
+
+        private string currentLanguage;
+        public string CurrentLanguage
+        {
+            get => currentLanguage;
+            set { Set(ref currentLanguage, value); }
+        }
+
+        private int logExpiredDays;
+        public int LogExpiredDays
+        {
+            get => logExpiredDays;
+            set { Set(ref logExpiredDays, value); }
+        }
     }
 }

--
Gitblit v1.9.1