From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;
---
Plugin.TestResult/Model/BaseConfig.cs | 78 ++++++++++++++++++++++++---------------
1 files changed, 48 insertions(+), 30 deletions(-)
diff --git a/Plugin.TestResult/Model/BaseConfig.cs b/Plugin.TestResult/Model/BaseConfig.cs
index 5aca5c4..686ee89 100644
--- a/Plugin.TestResult/Model/BaseConfig.cs
+++ b/Plugin.TestResult/Model/BaseConfig.cs
@@ -1,4 +1,7 @@
-锘縰sing System.Collections;
+锘縰sing HMI.Core.Entity;
+using HMI.Core.Manager;
+using System;
+using System.Collections;
using System.Configuration;
using System.Runtime.CompilerServices;
@@ -7,6 +10,12 @@
public class BaseConfig
{
private static Hashtable customConfig = (Hashtable)ConfigurationManager.GetSection("TestResultConfig");
+
+ private string GetValue([CallerMemberName] string propertyName = null)
+ {
+ return (customConfig != null && customConfig.ContainsKey(propertyName)) ? customConfig[propertyName].ToString() : null;
+ }
+
/// <summary>
/// 棣栭〉甯冨眬琛屾暟
/// </summary>
@@ -18,11 +27,10 @@
var data = GetValue();
return data == null ? row : int.Parse(data);
}
- }
-
- private string GetValue([CallerMemberName] string propertyName = null)
- {
- return (customConfig != null && customConfig.ContainsKey(propertyName)) ? customConfig[propertyName].ToString() : null;
+ set
+ {
+ customConfig[nameof(Row)] = value;
+ }
}
/// <summary>
@@ -35,6 +43,10 @@
{
var data = GetValue();
return data == null ? column : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(Column)] = value;
}
}
@@ -49,6 +61,10 @@
var data = GetValue();
return data == null ? cellCount : int.Parse(data);
}
+ set
+ {
+ customConfig[nameof(CellCount)] = value;
+ }
}
/// <summary>
@@ -61,6 +77,10 @@
{
var data = GetValue();
return data == null ? positionColumn : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(PositionColumn)] = value;
}
}
@@ -75,6 +95,10 @@
var data = GetValue();
return data == null ? positionCount : int.Parse(data);
}
+ set
+ {
+ customConfig[nameof(PositionCount)] = value;
+ }
}
/// <summary>
@@ -87,6 +111,10 @@
{
var data = GetValue();
return data == null ? maxSize : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(MaxSize)] = value;
}
}
@@ -101,6 +129,10 @@
var data = GetValue();
return data == null ? refreshInterval : int.Parse(data);
}
+ set
+ {
+ customConfig[nameof(RefreshInterval)] = value;
+ }
}
/// <summary>
@@ -114,31 +146,9 @@
var data = GetValue();
return data == null ? nameStr : data;
}
- }
-
- /// <summary>
- /// 榛樿灞曠ず鐨勫浘琛ㄦ爣棰�
- /// </summary>
- private string mainChartTitle = "骞冲潎娓╁害";
- public string MainChartTitle
- {
- get
+ set
{
- var data = GetValue();
- return data == null ? mainChartTitle : data;
- }
- }
-
- /// <summary>
- /// 鍙屽嚮鎵撳紑鐨勮缁嗗浘琛ㄦ爣棰�
- /// </summary>
- private string detailChartTitle = "璇︾粏娓╁害";
- public string DetailChartTitle
- {
- get
- {
- var data = GetValue();
- return data == null ? detailChartTitle : data;
+ customConfig[nameof(NameStr)] = value;
}
}
@@ -153,6 +163,10 @@
var data = GetValue();
return data == null ? cellListMaxSize : int.Parse(data);
}
+ set
+ {
+ customConfig[nameof(CellListMaxSize)] = value;
+ }
}
private int portStart = 6660;
@@ -163,6 +177,10 @@
var data = GetValue();
return data == null ? portStart : int.Parse(data);
}
+ set
+ {
+ customConfig[nameof(PortStart)] = value;
+ }
}
private string codeParserType;
--
Gitblit v1.9.1