Search in sources :

Example 1 with TelemetryMetaDataType

use of org.omg.space.xtce.TelemetryMetaDataType in project CCDD by nasa.

the class CcddXTCEHandler method unbuildSpaceSystems.

/**
 ********************************************************************************************
 * Extract the telemetry and/or command information from the space system. This is a recursive
 * method
 *
 * @param system
 *            space system
 *
 * @param parentPath
 *            full path name for this space system (based on its nesting within other space
 *            systems)
 *
 * @param importFileName
 *            import file name
 *
 * @throws CCDDException
 *             If an input error is detected
 ********************************************************************************************
 */
private void unbuildSpaceSystems(SpaceSystemType system, String parentPath, 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(parentPath + "_" + system.getName());
    // Get the child system's telemetry metadata information
    TelemetryMetaDataType tlmMetaData = system.getTelemetryMetaData();
    // that this is a structure table
    if (tlmMetaData != null) {
        // Build the structure table from the telemetry data
        importStructureTable(system, tlmMetaData, tableName);
    }
    // Get the child system's command metadata information
    CommandMetaDataType cmdMetaData = system.getCommandMetaData();
    // that this is a command table
    if (cmdMetaData != null) {
        // Build the structure table from the telemetry data
        importCommandTable(system, cmdMetaData, tableName);
    }
    // far
    if (importType == ImportType.IMPORT_ALL || tableDefinitions.isEmpty()) {
        // Step through each child system, if any
        for (SpaceSystemType childSystem : system.getSpaceSystem()) {
            // Process this system's children, if any
            unbuildSpaceSystems(childSystem, tableName, importType);
        }
    }
}
Also used : TelemetryMetaDataType(org.omg.space.xtce.TelemetryMetaDataType) CommandMetaDataType(org.omg.space.xtce.CommandMetaDataType) SpaceSystemType(org.omg.space.xtce.SpaceSystemType)

Example 2 with TelemetryMetaDataType

use of org.omg.space.xtce.TelemetryMetaDataType in project CCDD by nasa.

the class CcddXTCEHandler method findMetaData.

/**
 ********************************************************************************************
 * Recursively scan the import file in order to determine if any structure or command tables
 * exist. If a command table determine the maximum number of command arguments its commands
 * require
 *
 * @param system
 *            space system
 *
 * @param importFileName
 *            import file name
 ********************************************************************************************
 */
private void findMetaData(SpaceSystemType system, ImportType importType) {
    // Get the child system's telemetry metadata information
    TelemetryMetaDataType tlmMetaData = system.getTelemetryMetaData();
    // that this is a structure table
    if (tlmMetaData != null) {
        isTelemetry = true;
    }
    // Get the child system's command metadata information
    CommandMetaDataType cmdMetaData = system.getCommandMetaData();
    // that this is a command table
    if (cmdMetaData != null) {
        isCommand = true;
        // Get the reference to the meta-command set
        MetaCommandSet commandSet = cmdMetaData.getMetaCommandSet();
        // Check if the meta-command set exists
        if (commandSet != null) {
            // Step through each entry in the meta-command set
            for (Object metaCommand : commandSet.getMetaCommandOrMetaCommandRefOrBlockMetaCommand()) {
                // Check if the entry is a meta-command type
                if (metaCommand instanceof MetaCommandType) {
                    // The number of entries in the meta-command type is the number of command
                    // arguments required by this command. Store the largest number of command
                    // arguments required by all commands in the import file
                    maxNumArguments = Math.max(maxNumArguments, ((MetaCommandType) metaCommand).getArgumentList().getArgument().size());
                }
            }
        }
    }
    // but none has been found
    if (importType == ImportType.IMPORT_ALL || (!isTelemetry && !isCommand)) {
        // Step through each child system, if any
        for (SpaceSystemType childSystem : system.getSpaceSystem()) {
            // Process this system's children, if any
            findMetaData(childSystem, importType);
        }
    }
}
Also used : MetaCommandSet(org.omg.space.xtce.CommandMetaDataType.MetaCommandSet) TelemetryMetaDataType(org.omg.space.xtce.TelemetryMetaDataType) CommandMetaDataType(org.omg.space.xtce.CommandMetaDataType) SpaceSystemType(org.omg.space.xtce.SpaceSystemType) MetaCommandType(org.omg.space.xtce.MetaCommandType)

Aggregations

CommandMetaDataType (org.omg.space.xtce.CommandMetaDataType)2 SpaceSystemType (org.omg.space.xtce.SpaceSystemType)2 TelemetryMetaDataType (org.omg.space.xtce.TelemetryMetaDataType)2 MetaCommandSet (org.omg.space.xtce.CommandMetaDataType.MetaCommandSet)1 MetaCommandType (org.omg.space.xtce.MetaCommandType)1