use of net.sourceforge.usbdm.deviceEditor.model.CategoryModel in project usbdm-eclipse-plugins by podonoghue.
the class ParseMenuXML method parseChildModel.
/**
* Parse element containing: <ul>
* <li> <fragment> referencing only elements below
* <li> <intOption>
* <li> <bitmaskOption>
* <li> <floatOption>
* <li> <binaryOption>
* <li> <irqOption>
* <li> <choiceOption>
* <li> <stringOption>
* <li> <numericListOption>
* <li> <pinListOption>
* <li> <aliasOption>
* <li> <constant>
* <li> <section>
* <li> <signals>
* <li> Control items...
*</ul>
*
* Elements found are added as children of the parentModel
*
* @param parentModel Model to attach children to
* @param menuElement Menu element to parse
*
* @throws Exception
*/
void parseChildModel(BaseModel parentModel, Element element) throws Exception {
String tagName = element.getTagName();
String name = element.getAttribute("name");
String toolTip = getToolTip(element);
// System.err.println("parseChildModel(): " + tagName + ", " + element.getAttribute("name"));
if (tagName == "fragment") {
parseChildModels(parentModel, element);
} else if (tagName == "category") {
BaseModel model = new CategoryModel(parentModel, name, toolTip);
parseChildModels(model, element);
} else if (tagName == "indexedCategory") {
parseIndexedCategoryOption(parentModel, element);
} else if (tagName == "intOption") {
parseLongOption(parentModel, element);
} else if (tagName == "bitmaskOption") {
parseBitmaskOption(parentModel, element);
} else if (tagName == "floatOption") {
parseDoubleOption(parentModel, element);
} else if (tagName == "binaryOption") {
parseBinaryOption(parentModel, element);
} else if (tagName == "irqOption") {
parseIrqOption(parentModel, element);
} else if (tagName == "choiceOption") {
parseChoiceOption(parentModel, element);
} else if (tagName == "stringOption") {
parseStringOption(parentModel, element);
} else if (tagName == "numericListOption") {
parseNumericListOption(parentModel, element);
} else if (tagName == "pinListOption") {
parsePinListOption(parentModel, element);
} else if (tagName == "aliasOption") {
parseAliasOption(parentModel, element);
} else if (tagName == "constant") {
parseConstant(parentModel, element);
} else if (tagName == "section") {
BaseModel model = new ParametersModel(parentModel, name, toolTip);
parseChildModels(model, element);
} else if (tagName == "list") {
BaseModel model = new ListModel(parentModel, name);
parseSectionsOrOther(model, element);
} else if (tagName == "signals") {
parseSignalsOption(parentModel, element);
} else {
parseControlItem(element);
}
}
use of net.sourceforge.usbdm.deviceEditor.model.CategoryModel in project usbdm-eclipse-plugins by podonoghue.
the class PeripheralValidator method validateMappedPins.
/**
* Checks if signals are mapped to pins<br>
* If not then a warning is attached to pins category
*
* @param requiredSignals Array of required signals as index into the signal table
* @param table Peripheral signal table to use
*
* @throws Exception
*/
protected void validateMappedPins(int[] requiredSignals, Vector<Signal> table) throws Exception {
CategoryModel pinModel = getPeripheral().getPinModel();
Status unmappedSignals = null;
for (int pinNum : requiredSignals) {
Signal signal = table.get(pinNum);
if ((signal == null) || (signal.getMappedPin().getPin() == Pin.UNASSIGNED_PIN)) {
unmappedSignals = UNMAPPED_PIN_STATUS;
break;
}
}
pinModel.setStatus(unmappedSignals);
pinModel.update();
}
Aggregations