| | |
| | | using System.Collections; |
| | | using HMI.Core.Entity; |
| | | using HMI.Core.Manager; |
| | | using System.Collections; |
| | | using System.Configuration; |
| | | using System.Runtime.CompilerServices; |
| | | |
| | |
| | | |
| | | public static readonly BaseConfig Instance = new BaseConfig(); |
| | | |
| | | private 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 = 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> |
| | | 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; |
| | | set |
| | | { |
| | | customConfig[nameof(Row)] = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | var data = GetValue(); |
| | | return data == null ? column : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(Column)] = value; |
| | | } |
| | | } |
| | | |
| | |
| | | var data = GetValue(); |
| | | return data == null ? cellCount : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(CellCount)] = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | var data = GetValue(); |
| | | return data == null ? positionColumn : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(PositionColumn)] = value; |
| | | } |
| | | } |
| | | |
| | |
| | | var data = GetValue(); |
| | | return data == null ? positionCount : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(PositionCount)] = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | var data = GetValue(); |
| | | return data == null ? maxSize : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(MaxSize)] = value; |
| | | } |
| | | } |
| | | |
| | |
| | | var data = GetValue(); |
| | | return data == null ? refreshInterval : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(RefreshInterval)] = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | var data = GetValue(); |
| | | return data == null ? cellListMaxSize : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(CellListMaxSize)] = value; |
| | | } |
| | | } |
| | | |
| | | private int portStart = 6660; |
| | |
| | | var data = GetValue(); |
| | | return data == null ? portStart : int.Parse(data); |
| | | } |
| | | set |
| | | { |
| | | customConfig[nameof(PortStart)] = value; |
| | | } |
| | | } |
| | | |
| | | private string codeParserType; |