3 using System.Collections.Generic;
20 public int Number {
get; set; }
23 private int _FirstOutputNumber;
31 public int FirstOutputNumber
33 get {
return _FirstOutputNumber; }
34 set { _FirstOutputNumber = value; }
69 public int RequiredOutputCount
73 return (this.Any(S => S.OutputType ==
OutputTypeEnum.RGBOutput) ? 3 : 1);
88 return this.Any(S => S.IsArea);
105 bool ExceptionOccured =
false;
106 List<string> ColumnConfigs =
new List<string>(SplitSettings(ColumnData));
108 foreach (
string CC
in ColumnConfigs)
110 if (!CC.IsNullOrWhiteSpace())
122 ExceptionOccured =
true;
123 Log.
Exception(
"Could not parse setting {0} in column data {1}.".Build(CC, ColumnData), E);
126 throw new Exception(
"Could not parse setting {0} in column data {1}.".Build(CC, ColumnData), E);
131 return !ExceptionOccured;
135 private string[] SplitSettings(
string ConfigData)
137 List<string> L =
new List<string>();
139 int BracketCount = 0;
143 for (
int P = 0; P < ConfigData.Length; P++)
145 if (ConfigData[P] ==
'(')
149 else if (ConfigData[P] ==
')')
152 }
if (ConfigData[P] ==
'/' && BracketCount <= 0)
154 L.Add(ConfigData.Substring(LP, P - LP));
161 if (LP < ConfigData.Length)
163 L.Add(ConfigData.Substring(LP));
174 public TableConfigColumn(
int ColumnNumber,
string ColumnData,
bool ThrowExceptions =
false)
182 this.Number = ColumnNumber;
183 ParseColumnData(ColumnData, ThrowExceptions);
A single setting from a LedControl.ini file.
OutputControlEnum
Used the specify how the output for a setting is controled.
Column in a LedControl.ini file. Is a list of TableConfigSettingObjects for that column...
A simple logger used to record important events and exceptions.
OutputTypeEnum
The output types for the ini file loader.
bool ParseColumnData(string ColumnData, bool ThrowExceptions=false)
Parses data for a column from a LedControl.ini file.
TableConfigColumn()
Initializes a new instance of the TableConfigColumn class.
static void Exception(string Message, Exception E=null)
Writes a exception message to the log.
OutputControlEnum OutputControl
Defines the control mode for a output. It can be constantly on, off or it can be controlled by a elem...