Search in sources :

Example 6 with InterfaceDeclarationType

use of org.ccsds.schema.sois.seds.InterfaceDeclarationType in project CCDD by nasa.

the class CcddEDSHandler method unbuildSpaceSystems.

/**
 ********************************************************************************************
 * Extract the telemetry and/or command information from the space system. This is a recursive
 * method
 *
 * @param namespace
 *            name space
 *
 * @param importFileName
 *            import file name
 *
 * @throws CCDDException
 *             If an input error is detected
 ********************************************************************************************
 */
private void unbuildSpaceSystems(NamespaceType namespace, ImportType importType) throws CCDDException {
    // Get the table name based on the space system name and the path to this system. Convert
    // the name to be a valid table name
    String tableName = convertPathToTableName(namespace.getName());
    boolean hasParameter = false;
    boolean hasCommand = false;
    // sets
    for (InterfaceDeclarationType intfcDecType : namespace.getDeclaredInterfaceSet().getInterface()) {
        // Check if the interface contains a parameter set
        if (intfcDecType.getParameterSet() != null && !intfcDecType.getParameterSet().getParameter().isEmpty()) {
            hasParameter = true;
        }
        // Check if the interface contains a command set
        if (intfcDecType.getCommandSet() != null && !intfcDecType.getCommandSet().getCommand().isEmpty()) {
            hasCommand = true;
        }
    }
    // sets
    for (InterfaceDeclarationType intfcDecType : namespace.getDeclaredInterfaceSet().getInterface()) {
        // Check if the interface contains a parameter set
        if (intfcDecType.getParameterSet() != null && !intfcDecType.getParameterSet().getParameter().isEmpty()) {
            // Build the structure table from the telemetry data
            importStructureTable(namespace, intfcDecType.getParameterSet().getParameter(), tableName, hasCommand);
        }
        // Check if the interface contains a command set
        if (intfcDecType.getCommandSet() != null && !intfcDecType.getCommandSet().getCommand().isEmpty()) {
            // Build the structure table from the telemetry data
            importCommandTable(namespace, intfcDecType.getCommandSet().getCommand(), tableName, hasParameter);
        }
        // Check if the data from only the first table is to be read and one has been found
        if (importType == ImportType.FIRST_DATA_ONLY && (isTelemetry || isCommand)) {
            break;
        }
    }
}
Also used : InterfaceDeclarationType(org.ccsds.schema.sois.seds.InterfaceDeclarationType)

Aggregations

InterfaceDeclarationType (org.ccsds.schema.sois.seds.InterfaceDeclarationType)6 TableDefinition (CCDD.CcddClassesDataTable.TableDefinition)1 JAXBElement (javax.xml.bind.JAXBElement)1 JAXBException (javax.xml.bind.JAXBException)1 BaseTypeSetType (org.ccsds.schema.sois.seds.BaseTypeSetType)1 CommandArgumentType (org.ccsds.schema.sois.seds.CommandArgumentType)1 GenericTypeType (org.ccsds.schema.sois.seds.GenericTypeType)1 InterfaceCommandType (org.ccsds.schema.sois.seds.InterfaceCommandType)1 InterfaceParameterType (org.ccsds.schema.sois.seds.InterfaceParameterType)1 InterfaceRefType (org.ccsds.schema.sois.seds.InterfaceRefType)1 NamespaceType (org.ccsds.schema.sois.seds.NamespaceType)1