/** * @anchor ExternalApplications * @page LEVEL2 Runtime GUIs * * Trick provides the following graphical user interfaces: */ #include "sim_services/ExternalApplications/scp.dox_in" /** * @page LEVEL2cont * - @subpage SimControlPanelPage "LEVEL3cont Sim Control Panel"
* Send control commands to and view the status of a simulation. */ #include "sim_services/ExternalApplications/tv.dox_in" /** * @page LEVEL2cont * - @subpage TrickViewPage "LEVEL3cont Trick View"
* Browse and modify a simulation's variables while it's running. Launch integrated strip charts. */ #include "sim_services/ExternalApplications/mtv.dox_in" /** * @page LEVEL2cont * - @subpage MalfunctionsTrickViewPage "LEVEL3cont Events/Malfunctions Trick View"
* Manage the events and malfunctions of a simulation. */ #include "sim_services/ExternalApplications/mm.dox_in" /** * @page LEVEL2cont * - @subpage MonteMonitorPage "LEVEL3cont Monte Monitor"
* Monitor the status of a Monte Carlo simulation; create, start, and stop slaves. * * @section LEVEL3 Managing External Applications * * External applications are managed by instantiating and invoking calls on instances of launcher classes, which provide * interfaces for setting up external applications from the input file or user model code. For instance, to manipulate * %Trick View from the input file: * * @code trickView = trick.TrickView() @endcode * * You now have an instance of the %Trick View launcher class on which you can invoke calls to modify the actual %Trick View * application's behavior at launch. For instance, you could set the host and port: * * @code * trickView.set_host("localhost") * trickView.set_port(7000) * @endcode * * And then add it for automatic launching: * * @code trick.add_external_application(trickView) @endcode * * Provided launcher classes are derived from and listed in Trick::ExternalApplication. Some functionality is shared * among launcher classes, and each class provides its own specific additional options. %Trick allows any number of * instances of any subclass of ExternalApplication. This means you could automatically launch two different %Trick Views * with completely separate settings (if you find that sort of thing useful). * * @anchor ExternalApplicationsAutomaticLaunching * @section LEVEL3 Automatically Launching Applications * * Applications can be set to automatically launch during the initialization job phase by adding them to the queue of * external applications managed by %Trick. To do this, instantiate an instance of the appropriate launcher class (see * above) and call Trick::ExternalApplication::add_external_application. * * @section LEVEL3 Manually Launching Applications * * %Trick automatically launches all applications that have been added to its queue during simulation initialization. * However, applications may also be manually launched via Trick::ExternalApplication::launch. * * @section LEVEL3 Launch Command * * Default commands suitable to launch each application are provided by their individual constructors. However, they may be * changed, if desired, via Trick::ExternalApplication::set_startup_command. * * @section LEVEL3 Launching Custom Applications or Commands * * Having %Trick automatically launch a custom application, or execute any command at all really, is a simple matter of * instantiating an instance of the base class ExternalApplication and then setting the desired command as described above. * * @code * customApplication = trick.ExternalApplication() * customApplication.set_startup_command("echo Hello World!") * customApplication.set_arguments("") * trick.add_external_application(customApplication) * @endcode * * Note that ExternalApplication automatically appends the host and port argument unless you set the arguments by calling * Trick::ExternalApplication::set_arguments. * * Why would anyone want to have %Trick automatically run additional commands? Well, for one thing, it saves you from * manually running them each time you run a sim or writing a script to do it. But more importantly, applications managed by * %Trick are included in binary checkpoints, which means they can be saved and restored with no work on your part! * * @section LEVEL3 Shared Options * * As each %Trick GUI was written by a different developer and few standards were in place, most options vary according to * each GUI. The following apply to at least %Trick View and Monte Monitor. Application-specific options can be passed from * the input file or user model code via Trick::ExternalApplication::set_arguments or * Trick::ExternalApplication::add_arguments. * * @section LEVEL4 Host * * The host of the Variable Server to which the application will connect at launch can be specified via one of: * * - From the command line, use the \-\-host option. * * - From the input file or user model code, use Trick::ExternalApplication::set_host * * If no host is specified, it will automatically be set to that of the simulation which is launching this application. * * @section LEVEL4 Port * * The port of the Variable Server to which the application will connect at launch can be specified via one of: * * - From the command line, use the \-\-port option. * * - From the input file or user model code, use Trick::ExternalApplication::set_port * * If no port is specified, it will automatically be set to that of the simulation which is launching this application. * * @section LEVEL4 Automatically Reconnect * * The application can be configured to automatically reestablish lost connections via one of: * * - From the command line, use the \-\-autoReconnect option. * * - From the input file or user model code, use Trick::ExternalApplication::set_auto_reconnect * * - From the application, use the File->Settings menu. * * The default value is false. * * @section LEVEL4 Window Size and Placement * * The window's coordinates and dimensions at launch can be set via one of: * * - From the command line, use the \-\-x, \-\-y, \-\-width, or \-\-height * options. * * - From the input file or user model code, use Trick::ExternalApplication::set_x, Trick::ExternalApplication::set_y, * Trick::ExternalApplication::set_width, or Trick::ExternalApplication::set_height. * * @section LEVEL4 Cycle Period * * The period (in seconds) at which the Variable Server sends information to the application can be specified via one of: * * - From the command line, use the \-\-cycle option. * * - From the input file or user model code, use Trick::ExternalApplication::set_cycle_period. * * - From the application, use the File->Settings menu. * * The cycle period must be a non-negative number. Specify 0 to recieve updates at the maximum rate. Values * below the minimum cycle period will be set to the minimum cycle period. * * @section LEVEL4 Minimum Cycle Period * * The minimum period (in seconds) at which the Variable Server can be requested to send information to the application * can be specified via one of: * * - From the command line, use the \-\-minCycle option. * * - From the input file or user model code, use Trick::ExternalApplication::set_minimum_cycle_period. * * The minimum cycle period must be a non-negative number. The recommended and default value is 0.1. Values * below this may cause instability in %Trick GUIs. * * @section LEVEL4 Application Behavior * * The application can take one of several actions when it loses the connection with the simulation: * * - Close
* Terminate and close. * * - Notify
* Present a notification dialog describing the failure. * * - Nothing
* Do nothing. * * This behavior can be specified via one of: * * - From the command line, use the \-\-disconnectBehavior option. * * - From the input file or user model code, use Trick::ExternalApplication::set_disconnect_behavior. * * - From the application, use the File->Settings menu. */