GMAT Plugins with GUI components and related documentation

Development related to the GMAT core and GUI

GMAT Plugins with GUI components and related documentation

Postby marchand » Thu Mar 14, 2013 4:42 pm

Howdy folks,

Is it possible to create a new object in GMAT, specifically via the plug-in framework, that also has a GUI component? Is there any sort of documentation availale to that effect?

As I understand it, from the plug-in documentation, objects created specifically through the plug-in framework only supports user defined objects that extend GmatBase. That would only include classes that live under the base folder in the GMAT tree, not the gui folder.

I can tell, from exploring the existing objects in the GMAT source tree, that every GMAT object that has a class under base has a corresponding class under the gui folder that extends GmatPanel. For example, Achieve.cpp/.hpp vs. AchievePanel.cpp/.hpp. This isn't something I have found anywhere in the documentation so far. So, to give you an example, say I just wanted to duplicate Spacecraft, for instance, and call it Spacecraft2. If I wanted to add a GUI component to that, would it only be necessary to copy SpacecraftPanel to Spacecraft2Panel, edit the Spacecraft2 and Spacecraft2Panel *.cpp and *.hpp files as needed to update references, manually add them to the appropriate projects in VS2010, and recompile GMAT? Or is there more to adding a component with a GUI than that?

The primary documentation sources I would normally operate from are:

Official Documentation Page: http://gmat.sourceforge.net/docs/,
Wiki docs (http://gmat.ed-pages.com/wiki/System+QA+Tracking)
API Docs (http://gmat.sourceforge.net/docs/nightl ... index.html),

I've read the architectural specification front to back but the part related to creating new objects is incomplete, and does not seem to include any relevant guidance in regards to this particular question, at least not the copy that lives in the trunk. The plug-in framework documentation in the gmat trunk also does not appear to offer any guidance in that regard either. I've looked through the wiki docs and the api docs as well (Core and GUI) . The API docs give you an idea of the class dependencies and hierarchy, but not a lot of detail on what is required to effect something like this.

Can you offer some guidance in this regard, or identify an alternate document which may already outline that information?

Thanks!
marchand
 
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm

Re: GMAT Plugins with GUI components and related documentati

Postby shughes » Thu Mar 14, 2013 5:39 pm

This should answer most of your questions: http://li394-117.members.linode.com:809 ... MAT+Panels
shughes
 
Posts: 443
Joined: Mon Jun 09, 2008 6:27 pm

Re: GMAT Plugins with GUI components and related documentati

Postby marchand » Thu Mar 14, 2013 6:25 pm

I admit, I never would have thought to look for documentation in the project's JIRA page, since that's typically more for issue and bug tracking. I always thought the only GMAT wiki was this one, http://gmat.ed-pages.com/wiki/tiki-index.php. I didn't realize there was a second one inside the JIRA page. Thanks for pointing it out!!!!

Thanks Steve!
marchand
 
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm

Re: GMAT Plugins with GUI components and related documentati

Postby jjkparker » Thu Mar 14, 2013 8:50 pm

This will become a lot clearer in a few weeks, but the link Steve provided is to our new trial wiki, on a temporary site. It's a Confluence wiki, which is made by the same folks as JIRA (which is why it looks similar). This will replace the current wiki at a new URL sometime soon.
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: GMAT Plugins with GUI components and related documentati

Postby DJCinSB » Thu Mar 14, 2013 11:06 pm

Just as an added comment here. The discussion of the GMAT panels Steve references addresses the configuration and access to objects -- Resources and Commands -- that "live" exclusively inside of the GMAT engine, coded in the base library, and basically talks to those elements before they are copied into a Sandbox for a run.

There is a second type of object that you may be interested in accessing that is not currently accessible as plugin code: objects that live partially in the engine code and partially in the GUI code, and that reflects the data generated during a run. That is how the OrbitView and XYPlot components work: they have base code Subscribers that interact (through the Publisher) with the engine during a run, and pass the received data out of the engine to GUI components that display the data to the user in the OrbitView and XYPlot windows on the GUI. The plotting code that shows the data for those pieces is all gui code. So, for example, OrbitView and XYPlot pass their data to the GUI side through a interface that you can see defined in the PlotReceiver class (see base/executive/PlotReceiver.*). On the GUI side, the received data is received by a class derived from PlotReceiver: GuiPlotReceiver, implemented in the gui/app/GuiPlotReceiver files. That derived wxWidgets specific interface passes the data to the GUI components that show the data to users, captured in OrbitViewCanvas and TsPlotCanvas objects and the objects that they manipulate for display to the user.

We don't currently have a mechanism to add the GUI side of this type of subsystem as a plug-in. If you need to, for instance, provide a different component to show and manipulate data received during a run in the GUI, we don't currently have a plug-in mechanism to add the GUI component that actually shows the data to the user and that allows for user manipulation. For that piece, you'd need to add the component into the GMAT source tree. (Adding a plugin feature for that type of GUI side is not impossible -- or even hard, IMO; we just have not had a need for it to date.)

(I'm not sure if I'm being clear or obtuse here, so please ask questions if this is too confusing, and I may resort to some drawings or something!)
DJCinSB
 
Posts: 274
Joined: Mon Jun 09, 2008 3:57 pm

Re: GMAT Plugins with GUI components and related documentati

Postby marchand » Mon Mar 25, 2013 8:55 pm

Darrel,

I need clarification on this. The plug-in documentation under:

http://gmatplugins.sourceforge.net/blog/wp-content/uploads/2011/09/PluginDevelopment.pdf

clearly states, in chapter 2, that "GMAT’s Plug-in capabilities apply to the classes derived from the GmatBase class." This does not include anything that lives under the src\gui folder, however. So, does that mean that plugins cannot have custom GUIs via the plug-in framework? In other words, the only user defined objects that can have a custom GUI are those that are directly built into the GMAT tree?

According to the wiki page, http://li394-117.members.linode.com:8090/display/GW/How+to+Create+GMAT+Panels,

For every GMAT native* resource without a special-purpose panel, the GMAT GUI creates a panel by inspecting the resource's parameters. The GmatBaseSetupPanel class inspects the object, and for every visible, non-read only parameter of the object, retrieves its type, label and unit, and creates the appropriate control, or widget, for the parameter.


So, this tells me that if I create an object via the plug-in framework, say something that extends Spacecraft, for instance, I should have some default panel automatically created based on that object's properties. However, if I need any sort of customization to that panel, I cannot accomplish that through the plug-in framework because GmatPanel does not extend GmatBase. Is that accurate?


--B.
marchand
 
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm

Re: GMAT Plugins with GUI components and related documentati

Postby DJCinSB » Tue Mar 26, 2013 8:53 pm

When I wrote:
DJCinSB wrote:We don't currently have a mechanism to add the GUI side of this type of subsystem as a plug-in. If you need to, for instance, provide a different component to show and manipulate data received during a run in the GUI, we don't currently have a plug-in mechanism to add the GUI component that actually shows the data to the user and that allows for user manipulation. For that piece, you'd need to add the component into the GMAT source tree. (Adding a plugin feature for that type of GUI side is not impossible -- or even hard, IMO; we just have not had a need for it to date.)

that is precisely what I meant. Classes added that are derived from GmatBase have infrastructure that you fill in to make object properties visible to users. Those properties are exposed through the GetRealParameter/SetRealParameter, GetStringParameter/SetStringParameter, etc methods defined in GmatBase and overridden in the derived classes. The GUI builds configuration panels using those interfaces, as described in the "How to Create GMAT Panels" document you referenced. If you need more functionality than that, the current GMAT code does not have the hooks to do it as a plugin on the GUI side.

I don't think it is hard to do, though a bit time consuming. The base side took about 3-4 weeks to do, and that included incorporating the VF13ad optimizer into the plugin.
DJCinSB
 
Posts: 274
Joined: Mon Jun 09, 2008 3:57 pm


Return to Core Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron