From 2e54b439c64e0adbb7e010243c1f33aa5fc5f503 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期二, 11 三月 2025 14:08:57 +0800
Subject: [PATCH] 完善程序; Merge branch 'master' of http://58.211.88.246:3600/r/WPF/WPFProject
---
HMI.Core/Setting/SystemSetting.cs | 41 ++++++++++++++++++++++++++++++++++-------
1 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/HMI.Core/Setting/SystemSetting.cs b/HMI.Core/Setting/SystemSetting.cs
index 774d75b..5378e82 100644
--- a/HMI.Core/Setting/SystemSetting.cs
+++ b/HMI.Core/Setting/SystemSetting.cs
@@ -8,7 +8,12 @@
public class SystemSetting
{
public static SystemSetting Instance { get; private set; }
+ /// <summary>
+ /// 绯荤粺璁剧疆鏀瑰彉浜嬩欢
+ /// </summary>
public static event EventHandler<SystemSetting> SystemSettingChanged;
+
+ private static string FilePath = Path.Combine(PathHelper.SettingFolder, "SystemConfig.xml");
static SystemSetting()
{
@@ -22,18 +27,20 @@
public string LogoPath { get; private set; }
public string WindowTitle { get; private set; }
+ public string PlcIp { get; private set; }
+ public bool PlcEnabled { get; private set; }
+ public string CurrentLanguage { get; private set; }
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;
@@ -42,14 +49,13 @@
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;
@@ -74,5 +80,26 @@
get => windowTitle;
set { Set(ref windowTitle, value); }
}
+
+ private string plcIp;
+ public string PlcIp
+ {
+ get => plcIp;
+ set { Set(ref plcIp, 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); }
+ }
}
}
--
Gitblit v1.9.1