public static ADLConfig Parse(string config) { ADLConfig result = new ADLConfig { currentConfig = config, position = 0 }; while (result.HasChar) { ADLElement elem = new ADLElement(result); result.elements.Add(elem); } return(result); }
public static DisplayControl CreateControl(ADLConfig config, ADLElement element) { DisplayControl result = knownControls.Select(row => row.ADLConfig(config, element)) .FirstOrDefault(row => row != null); if (result != null) { result.DynamicCondition = DynamicCondition.NONE; if (element["dynamic attribute"] != null) { if (element["dynamic attribute"]["vis"] != null) { if (element["dynamic attribute"]["vis"].Value == "if not zero") { result.DynamicCondition = DynamicCondition.IF_NOT_ZERO; } else if (element["dynamic attribute"]["vis"].Value == "if zero") { result.DynamicCondition = DynamicCondition.IF_ZERO; } else if (element["dynamic attribute"]["vis"].Value == "calc" && element["dynamic attribute"]["calc"].Value == "A=0") { result.DynamicCondition = DynamicCondition.IF_ZERO; } else if (element["dynamic attribute"]["vis"].Value == "calc" && element["dynamic attribute"]["calc"].Value == "A=1") { result.DynamicCondition = DynamicCondition.IF_ONE; } else if (element["dynamic attribute"]["vis"].Value == "calc") { result.DynamicCondition = DynamicCondition.CALC; result.ConditionCode = element["dynamic attribute"]["calc"]; } } if (element["dynamic attribute"]["chan"] != null) { result.DynamicChannelA = element["dynamic attribute"]["chan"]; } } } return(result); }
protected abstract DisplayControl ADLConfig(ADLConfig config, ADLElement element);