Common Tasks

This page introduces you to some common tasks that you can perofrm with the STK Astrogator Object Model.

Adding and Removing Segments from the MCS

To add, remove, cut, copy, or paste an MCS segment in the MCS, get the MainSequence instance of the IAgVAMCSSegmentCollection, which represents the list of segments in the Main Sequence.

Configuring Segments

Once the interface to a sequence is obtained, segments in the sequence can be accessed using the bracket operator with the argument of the segment's name. Since the return type is IAgVAMCSSegment, you will have to cast the returned interface to the correct segment interface if you want to access any of the segment-specific properties or methods.

Configuring Stopping Conditions

To configure a stopping condition, get an instance of IAgVAStoppingConditionElement from the list of stopping conditions on a segment. The Properties property on this interface is type IAgVAStoppingConditionComponent, which can be cast to the correct stopping condition type: IAgVAAccessStoppingCondition, IAgVALightingStoppingCondition and IAgVAStoppingCondition. The properties for the specific type of stopping condition are accessed through these interfaces.

Configuring Results

The collection of results is a property of the IAgVAMCSSegment interface. Results are added, removed, and accessed from this list. The return type of an element in this list is IAgComponentInfo, so the returned interface will have to be cast to the correct calc object interface to set the properties of the result.

Making Controls Available to Search Profiles

To make a control available to search profiles (equivalent to checking a target icon in the GUI), use the EnableControlParameter method on the segment interface.

Configuring Targeting

Targeting Profiles are added and removed from the Profiles property on the IAgVAMCSTargetSequence interface. Profiles are accessed using the bracket operator with the profile name as the argument. The returned interface is IAgVAProfile, so the returned interface will have to be cast to the appropriate derived interface to access properties specific to that profile. To access the available controls and results and choose them to be active for targeting, get an instance of IAgVAProfileDifferentialCorrector, IAgVAProfileDEOptimizer, or IAgVAProfileSearchPlugin and use the ControlParameters and Results collections. To get a control use the GetControlByPaths method and to get a result use the GetResultByPaths method. Use the properties of the returned interfaces to configure the controls and results.

Running the MCS

To run the MCS once the segments are configured, use the RunMCS method on the IAgVADriverMCS interface.

Running Segments Individually

The Astrogator Object Model allows a programmer to run segments from the MCS in any order or for any number of times that is desired. This is accomplished by starting with the BeginRun method on the IAgVADriverMCS interface to begin the run. Following this, segments are run by calling the Run method on the interface for the segment desired. To complete the run, invoke the EndRun method on the IAgVADriverMCS interface.

Accessing the State of a Segment

The IAgVAMCSSegment interface has properties for InitialState and FinalState. These will return an IAgVAState which can be used to access the orbit state at the beginning or the end of a segment. The method GetResultValue can be used to access the value of a result at the end of a segment or the value of any calc object at the end of the segment.

Accessing the Component Browser

The Component Browser is accessed through the IAgScenario interface using the ComponentDirectory property. This property returns an IAgComponentDirectory interface. To access the Astrogator-specific components, call the GetComponents method using eComponentAstrogator as the argument. This returns an IAgComponentInfoCollection which can be used to navigate through the Component Browser.

Duplicating Components

Components that can be duplicated implement the IAgCloneable interface. This interface provides the CloneObject method which is used to duplicate Component Browser objects.

STK Programming Interface 11.0.1