The Site Interface
Site interfaces represent the services made available to the plugin by the application. Each application implements and extends the IAgUtPluginSite interface. IAgUtPluginSite is a base interface that provides the capability for the plugin to write messages to the message viewer and to obtain the name of the site interface itself. Different sites provide additional providers of input data. Three sites have been implemented:
- IAgStkPluginSite -- provided by STK to plugins other than those used by Astrogator
- IAgOdtkPluginSite -- provided by ODTK for its plugins
- IAgGatorPluginSite -- provided by STK to Astrogator plugin points
Currently, the Site interface passed to the plugin is valid only during the computation process. Once the computation has completed (i.e., the plugin component's Free() method is called), the Site interface is no longer valid and should be released by the plugin as well.
Obtaining Vector Tool Objects as Inputs
IAgStkPluginSite and IAgGatorPluginSite have a property called VectorToolProvider. The vector tool provider allows a plugin to request objects from the STK Vector Tool. Angles, Axes, Planes, Points, Systems, and Vectors may be requested. During a plugin function call, the vector tool object can be evaluated at the current time and/or a requested time. This provides a mechanism to obtain the ephemeris and attitude of every object within the scenario.
Obtaining Calculation Tool Objects as Inputs
IAgStkPluginSite and IAgGatorPluginSite have a property called CalcToolProvider. The calculation tool provider allows a plugin to request objects from the STK Calculation Tool. Parameter Sets, Parameter Sets with Rates, Scalars, and Scalars with Rates may be requested. During a plugin function call, the calculation tool object can be evaluated at the current time and/or a requested time. This provides a mechanism to obtain the ephemeris and attitude of every object within the scenario.
Obtaining Astrogator Calc Objects as Inputs
IAgGatorPluginSite has a property AgGatorPluginProvider. The Astrogator plugin provider allows a plugin to request a calc object from the Component Browser. The calc object can then be evaluated at the current time.
Using the STK Object Model within STK plugins
IAgStkPluginSite and IAgGatorPluginSite also provide the StkRootObject property, which enables a plugin to access the STK Object Model. The root of the Object Model is returned as an object. You can cast (in .Net) or QueryInterface (COM) this to IAgStkObjectRoot.
From the root of the object model, you can access the properties for the STK objects in the scenario. However, you can only use the STK Object Model to read the current settings, not write them (i.e., the use of certain methods is restricted). This has been done to avoid situations where an action taken through the object model adversely affects the computation involving the plugin (e.g., you cannot close the current scenario). There are a few exceptions to this rule:
- You can change the UnitPreferences in order to get the values in your preferred units.
- You can use the conversion utilities provided by the IAgConversionUtility interface
- You can change the STK Object short and long descriptions
The STK Object Model, in turn, allows you to isolate the effects of these changes to a particular instance of the root.