2 using System.Collections.Generic;
4 namespace DirectOutput.LedControl.Loader
25 public void ParseControlData(
string LedControlData,
bool ThrowExceptions =
false)
27 string[] Cols = LedControlData.Split(
new char[] {
',' });
30 Log.
Warning(
"No data to parse found in LedControlData: {0}".Build(LedControlData));
33 throw new Exception(
"No data to parse found in LedControlData: {0}".Build(LedControlData));
37 int FirstOutputNumber = 1;
38 int LastColumnWithData = -1;
39 for (
int i = 1; i < Cols.Length; i++)
41 if (!Cols[i].IsNullOrWhiteSpace())
43 LastColumnWithData = i;
46 for (
int i = 1; i <= LastColumnWithData; i++)
54 Log.
Warning(
"Previous exceptions occured in the line {0} of the ledcontrol file".Build(LedControlData));
57 throw new Exception(
"Exception(s) accorud when parsing {0}".Build(LedControlData));
63 Log.
Warning(
"To many outputs (>32) are configured in the following line {0}".Build(LedControlData));
66 throw new Exception(
"To many outputs (>32) are configured in the following line {0}".Build(LedControlData));
82 public new void Sort()
84 base.Sort((a, b) => a.Number.CompareTo(b.Number));
99 ParseControlData(LedControlData, ThrowExceptions);