example.remote.interface.demo/src/terra/harvest/bundle/demo/RemoteInterfaceOSGiDemo.java
public void runMissionProgrammingDemo() throws IOException
    {

        //---------------------------------------------------------------------
        //              GET STORED TEMPLATE NAMES
        // See what templates, if any, are on the destination controller
        // device. The response contains a list of known templates on the
        // controller device. 
        //---------------------------------------------------------------------
        
        // Construct and send a TerraHarvestMessage
        this.m_MessageFactory.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest,
                null).queue(this.m_TargetSystemID, EncryptType.NONE, new ReceiveTemplatesHandler());
        
        // The response will be handled by configAdminEventHandler.handleEvent and the ReceiveTemplatesHandler

      
        //---------------------------------------------------------------------
        //              LOAD TEMPLATES
        // Missions can be instantiated by loading a template and providing a
        // set of parameters.  
        // Multiple missions may be created from the same template.
        // Different instances might use different parameters; for example,
        // one mission may reference one asset, but another mission constructed
        // from the same template may reference a different asset (such as
        // 'left' and 'right' cameras).
        //---------------------------------------------------------------------
        
        // Each template has a script. Scripts may contain variables that must be defined; see the script in the
        // template to determine what variables must be defined.
        // To define these variables, build a VariableMetaData instance.
        final MissionProgramTemplateGen.MissionVariableMetaData varData = 
                MissionProgramTemplateGen.MissionVariableMetaData.newBuilder().
                setBase(VariableMetaData.newBuilder().
                    setName("variable").
                    setDescription("I describe a variable").
                    setDefaultValue("My Asset").
                    setHumanReadableName("The variable")).
                setType(MissionProgramTemplateGen.MissionVariableTypes.Enum.ASSET).
                build();
        // Build a mission from a template
        final MissionProgramTemplateGen.MissionProgramTemplate template = 
                MissionProgramTemplateGen.MissionProgramTemplate.
                newBuilder().
                setName("TEST_TEMPLATE").
                setSource("If one wanted to change the script, this is where the change would be made").
                setDescription("This describes the template").
                addVariableMetaData(varData).
                build();
        // Build a template message
        final LoadTemplateRequestData loadTemplateRequest = MissionProgramMessages.LoadTemplateRequestData.
                newBuilder().
                setMission(template).
                build();
        
        
        // Construct and send a TerraHarvestMessage
        this.m_MessageFactory.createMissionProgrammingMessage(
                MissionProgrammingMessageType.LoadTemplateRequest, loadTemplateRequest).
                queue(this.m_TargetSystemID, EncryptType.NONE, new LoadMissionHandler(this));

        // The response will be handled by configAdminEventHandler.handleEvent and the LoadMissionHandler

    }
/**
     * This demonstrates using templates with the mission programming namespace. Mission program management enables the
     * execution of scripts on controller software. Scripts can use or exploit assets, custom comms, or other
     * capabilities. Templates are pre-configured controller software configurations and scripts. 
     * 
     * This part of the demo employs a more complicated pair of response handlers, LoadMissionHandler and 
     * ReceiveTemplatesHandler.
     * 
     * @throws IOException
     *      When an endpoint cannot be reached
     */
This demonstrates using templates with the mission programming namespace. Mission program management enables the
execution of scripts on controller software. Scripts can use or exploit assets, custom comms, or other
capabilities. Templates are pre-configured controller software configurations and scripts.

This part of the demo employs a more complicated pair of response handlers, LoadMissionHandler and
ReceiveTemplatesHandler.

@throws IOException
When an endpoint cannot be reached
This demonstrates using templates with the mission programming namespace . Mission program management enables the execution of scripts on controller software . Scripts can use or exploit assets custom comms or other capabilities . Templates are pre - configured controller software configurations and scripts . This part of the demo employs a more complicated pair of response handlers LoadMissionHandler and ReceiveTemplatesHandler . @throws IOException When an endpoint cannot be reached
public void runMissionProgrammingDemo() throws IOException
    {
        this.m_MessageFactory.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest,
                null).queue(this.m_TargetSystemID, EncryptType.NONE, new ReceiveTemplatesHandler());
        final MissionProgramTemplateGen.MissionVariableMetaData varData = 
                MissionProgramTemplateGen.MissionVariableMetaData.newBuilder().
                setBase(VariableMetaData.newBuilder().
                    setName("variable").
                    setDescription("I describe a variable").
                    setDefaultValue("My Asset").
                    setHumanReadableName("The variable")).
                setType(MissionProgramTemplateGen.MissionVariableTypes.Enum.ASSET).
                build();
        final MissionProgramTemplateGen.MissionProgramTemplate template = 
                MissionProgramTemplateGen.MissionProgramTemplate.
                newBuilder().
                setName("TEST_TEMPLATE").
                setSource("If one wanted to change the script, this is where the change would be made").
                setDescription("This describes the template").
                addVariableMetaData(varData).
                build();
        final LoadTemplateRequestData loadTemplateRequest = MissionProgramMessages.LoadTemplateRequestData.
                newBuilder().
                setMission(template).
                build();
        this.m_MessageFactory.createMissionProgrammingMessage(
                MissionProgrammingMessageType.LoadTemplateRequest, loadTemplateRequest).
                queue(this.m_TargetSystemID, EncryptType.NONE, new LoadMissionHandler(this));
    }
public void runMissionProgrammingDemo ( ) throws IOException { this . m_MessageFactory . createMissionProgrammingMessage ( MissionProgrammingMessageType . GetTemplatesRequest , null ) . queue ( this . m_TargetSystemID , EncryptType . NONE , new ReceiveTemplatesHandler ( ) ) ; final MissionProgramTemplateGen . MissionVariableMetaData varData = MissionProgramTemplateGen . MissionVariableMetaData . newBuilder ( ) . setBase ( VariableMetaData . newBuilder ( ) . setName ( "variable" ) . setDescription ( "I describe a variable" ) . setDefaultValue ( "My Asset" ) . setHumanReadableName ( "The variable" ) ) . setType ( MissionProgramTemplateGen . MissionVariableTypes . Enum . ASSET ) . build ( ) ; final MissionProgramTemplateGen . MissionProgramTemplate template = MissionProgramTemplateGen . MissionProgramTemplate . newBuilder ( ) . setName ( "TEST_TEMPLATE" ) . setSource ( "If one wanted to change the script, this is where the change would be made" ) . setDescription ( "This describes the template" ) . addVariableMetaData ( varData ) . build ( ) ; final LoadTemplateRequestData loadTemplateRequest = MissionProgramMessages . LoadTemplateRequestData . newBuilder ( ) . setMission ( template ) . build ( ) ; this . m_MessageFactory . createMissionProgrammingMessage ( MissionProgrammingMessageType . LoadTemplateRequest , loadTemplateRequest ) . queue ( this . m_TargetSystemID , EncryptType . NONE , new LoadMissionHandler ( this ) ) ; }
This demonstrates using templates with the mission programming namespace.
This demonstrates using templates with the mission programming namespace .
//--------------------------------------------------------------------- //              GET STORED TEMPLATE NAMES // See what templates, if any, are on the destination controller // device. The response contains a list of known templates on the // controller device.  //--------------------------------------------------------------------- // Construct and send a TerraHarvestMessage // The response will be handled by configAdminEventHandler.handleEvent and the ReceiveTemplatesHandler //--------------------------------------------------------------------- //              LOAD TEMPLATES // Missions can be instantiated by loading a template and providing a // set of parameters.   // Multiple missions may be created from the same template. // Different instances might use different parameters; for example, // one mission may reference one asset, but another mission constructed // from the same template may reference a different asset (such as // 'left' and 'right' cameras). //--------------------------------------------------------------------- // Each template has a script. Scripts may contain variables that must be defined; see the script in the // template to determine what variables must be defined. // To define these variables, build a VariableMetaData instance. // Build a mission from a template // Build a template message // Construct and send a TerraHarvestMessage // The response will be handled by configAdminEventHandler.handleEvent and the LoadMissionHandler