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 作为历史根节点
---
Plugin.CurrentSensorControl/Entity/BaseConfig.cs | 252 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 252 insertions(+), 0 deletions(-)
diff --git a/Plugin.CurrentSensorControl/Entity/BaseConfig.cs b/Plugin.CurrentSensorControl/Entity/BaseConfig.cs
new file mode 100644
index 0000000..80ebe5a
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/BaseConfig.cs
@@ -0,0 +1,252 @@
+锘縰sing HMI.Core.Entity;
+using HMI.Core.Manager;
+using System.Collections;
+using System.Configuration;
+using System.Runtime.CompilerServices;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public class BaseConfig
+ {
+ private static Hashtable customConfig = (Hashtable)ConfigurationManager.GetSection("TestResultConfig");
+
+ public static readonly BaseConfig Instance = new BaseConfig();
+
+ private BaseConfig()
+ {
+ RefreshNumberConfig(this);
+ }
+
+ private void RefreshNumberConfig(BaseConfig config)
+ {
+ ParameterData value = null;
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("BurnInOvenCount");
+ string[] datas = value.Value.Trim().Split(',');
+ config.Row = int.Parse(datas[0]);
+ config.Column = int.Parse(datas[1]);
+ }
+ catch (Exception ex)
+ {
+
+ }
+
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("BurnInOvenName");
+ config.NameStr = value.Value;
+ }
+ catch (Exception ex)
+ {
+
+ }
+
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("BurnInOvenPort");
+ config.PortStart = value == null ? config.PortStart : int.Parse(value.Value);
+ }
+ catch (Exception ex)
+ {
+
+ }
+
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("BurnInCellCount");
+ string[] datas = value.Value.Trim().Split(',');
+ config.PositionColumn = int.Parse(datas[0]);
+ config.PositionCount = int.Parse(datas[1]);
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+
+ private string GetValue([CallerMemberName] string propertyName = null)
+ {
+ return (customConfig != null && customConfig.ContainsKey(propertyName)) ? customConfig[propertyName].ToString() : null;
+ }
+
+ private int row = 1;
+ /// <summary>
+ /// 棣栭〉甯冨眬琛屾暟
+ /// </summary>
+ public int Row
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? row : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(Row)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 棣栭〉甯冨眬鍒楁暟
+ /// </summary>
+ private int column = 2;
+ public int Column
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? column : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(Column)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 鐐夋暟 -1 灏辨槸row*column
+ /// </summary>
+ private int cellCount = -1;
+ public int CellCount
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? cellCount : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(CellCount)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 鐐逛綅鍒楁暟
+ /// </summary>
+ private int positionColumn = 6;
+ public int PositionColumn
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? positionColumn : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(PositionColumn)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 姣忎釜鐐夊瓙鐨勭偣浣嶆暟
+ /// </summary>
+ private int positionCount = 54;
+ public int PositionCount
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? positionCount : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(PositionCount)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 鏇茬嚎鏈�澶氫繚瀛樺灏戞暟鎹�
+ /// </summary>
+ private int maxSize = 10000;
+ public int MaxSize
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? maxSize : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(MaxSize)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 鍥捐〃鍒锋柊棰戠巼 ms
+ /// </summary>
+ private int refreshInterval = 500;
+ public int RefreshInterval
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? refreshInterval : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(RefreshInterval)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 鐐夊瓙鍚嶇О
+ /// </summary>
+ private string nameStr = "A,B,C,D,E,F,G";
+ public string NameStr
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? nameStr : data;
+ }
+ set
+ {
+ customConfig[nameof(NameStr)] = value;
+ }
+ }
+
+ /// <summary>
+ /// 绌翠綅Step鍒楄〃鏈�澶у閲�
+ /// </summary>
+ private int cellListMaxSize = 10000;
+ public int CellListMaxSize
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? cellListMaxSize : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(CellListMaxSize)] = value;
+ }
+ }
+
+ private int portStart = 6660;
+ public int PortStart
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? portStart : int.Parse(data);
+ }
+ set
+ {
+ customConfig[nameof(PortStart)] = value;
+ }
+ }
+
+ private string codeParserType;
+ public string CodeParserType
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? codeParserType : data.ToString();
+ }
+ }
+
+ public bool testing = false;
+ }
+}
--
Gitblit v1.9.1