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() {
|
|
}
|
|
/// <summary>
|
/// 首页布局行数
|
/// </summary>
|
private int row = 1;
|
public int Row
|
{
|
get
|
{
|
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;
|
}
|
|
/// <summary>
|
/// 首页布局列数
|
/// </summary>
|
private int column = 2;
|
public int Column
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? column : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 炉数 -1 就是row*column
|
/// </summary>
|
private int cellCount = -1;
|
public int CellCount
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? cellCount : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 点位列数
|
/// </summary>
|
private int positionColumn = 6;
|
public int PositionColumn
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? positionColumn : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 每个炉子的点位数
|
/// </summary>
|
private int positionCount = 54;
|
public int PositionCount
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? positionCount : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 曲线最多保存多少数据
|
/// </summary>
|
private int maxSize = 10000;
|
public int MaxSize
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? maxSize : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 图表刷新频率 ms
|
/// </summary>
|
private int refreshInterval = 500;
|
public int RefreshInterval
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? refreshInterval : int.Parse(data);
|
}
|
}
|
|
/// <summary>
|
/// 炉子名称
|
/// </summary>
|
private string nameStr = "A,B,C,D,E,F,G";
|
public string NameStr
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? nameStr : data;
|
}
|
}
|
|
/// <summary>
|
/// 默认展示的图表标题
|
/// </summary>
|
private string mainChartTitle = "平均温度";
|
public string MainChartTitle
|
{
|
get
|
{
|
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;
|
}
|
}
|
|
/// <summary>
|
/// 穴位Step列表最大容量
|
/// </summary>
|
private int cellListMaxSize = 10000;
|
public int CellListMaxSize
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? cellListMaxSize : int.Parse(data);
|
}
|
}
|
|
private int portStart = 6660;
|
public int PortStart
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? portStart : int.Parse(data);
|
}
|
}
|
|
private string codeParserType;
|
public string CodeParserType
|
{
|
get
|
{
|
var data = GetValue();
|
return data == null ? codeParserType : data.ToString();
|
}
|
}
|
|
public bool testing = false;
|
}
|
}
|