how to access read only StateArray from mission sequence ...

Spacecraft, Thruster, Tank, Propagator, CoordinateSystem, etc.

how to access read only StateArray from mission sequence ...

Postby marchand » Wed Aug 14, 2013 11:32 pm

So, the architectural specification indicates the availability of four types of interfaces: String, Real, Integer, and Boolean. If I have some read-only parameters in an object of any of these types, I know I can access them in the mission sequence by saying something like:

Code: Select all
String myString;
Variable var;

BeginMissionSequence

GMAT myString = myObject.myStringParameter;
GMAT var = myObject.myRealParameter;



Is it possible to have a parameter, accessible in a similar form, but that is essentially an array? It seems the currently available set of interfaces do not support this, but I thought I'd ask. Is this only doable by defining the array ahead of time, one of static dimensions, then passing that array as a reference object during the creation of my custom object and modify it internally so the user can query it during the mission sequence?
marchand
 
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm

Re: how to access read only StateArray from mission sequence

Postby marchand » Tue Dec 31, 2013 5:10 am

I guess, for completion, I should add this issue was resolved by creating matrix parameter for my object via the plugin framework. What I was basically getting at below is that I wanted to be able to return, in an assignment statement, a matrix as a parameter. You can already do this, for example, with the spacecraft state transition matrix. The problem is that the only examples I could find of this in GMAT were for the state transition matrix, which is an Rmatrix66 type, and the submatrices, of type Rmatrix33. There was nothing natively there for an arbitrarily sized matrix parameter... so I made one via the plugin framework. I then used that to create a custom parameter for my custom object and was ultimately able to do what I suggested below. You still have to manually size the array on the left side of the assignment statement, but as long as those dimensions match it works fine.
marchand
 
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm


Return to GMAT Resources

Who is online

Users browsing this forum: No registered users and 1 guest

cron