|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.gui.MoMLApplication
ptolemy.actor.gui.PtExecuteApplication
This application executes Ptolemy II models specified on the command line.
The exact facilities that are available are determined by an optional command line argument that names a directory in ptolemy/configs that contains a configuration.xml file. For example, if we call vergil -ptiny, then we will use ptolemy/configs/ptiny/configuration.xml and ptolemy/configs/ptiny/intro.htm. The default configuration is ptolemy/configs/runConfiguration.xml, which is loaded before any other command-line arguments are processed.
This application also takes an optional command line argument pair
-conf configurationFile.xml that names a configuration
to be read. For example,
$PTII/bin/ptexecute -conf ptolemy/configs/full/configuration.xml ../../domains/sdf/demo/Butterfly/Butterfly.xmland$PTII/bin/ptexecute -full ../../domains/sdf/demo/Butterfly/Butterfly.xmlare equivalentIf no configuration is specified on the command line, then the MoML file ptolemy/configs/runConfiguration.xml is loaded before other command line arguments are processed.
If one of the command-line arguments is -exit, then System.exit() is called when all the models are finished running. If there are no command-line arguments at all, then this class does nothing.
ModelFrame,
RunTableau
| Red (eal) |
| Yellow (eal) |
| Field Summary | |
protected static java.lang.String[] |
_localCommandFlags
The command-line options that are either present or not. |
protected static java.lang.String[][] |
_localCommandOptions
The command-line options that take arguments. |
| Fields inherited from class ptolemy.actor.gui.MoMLApplication |
_basePath, _commandFlags, _commandOptions, _commandTemplate, _config, _parser, _test |
| Constructor Summary | |
PtExecuteApplication(java.lang.String[] args)
Parse the specified command-line arguments, creating models and running them. |
|
| Method Summary | |
protected Configuration |
_createDefaultConfiguration()
Return a default Configuration, which in this case is given by the MoML file ptolemy/configuration/runPanelConfiguration.xml. |
protected Configuration |
_createEmptyConfiguration()
Throw an exception. |
protected boolean |
_parseArg(java.lang.String arg)
Parse a command-line argument. |
protected void |
_parseArgs(java.lang.String[] args)
Parse the command-line arguments. |
protected java.lang.String |
_usage()
Return a string summarizing the command-line arguments. |
void |
executionError(Manager manager,
java.lang.Throwable throwable)
Reduce the count of executing models by one. |
void |
executionFinished(Manager manager)
Reduce the count of executing models by one. |
static void |
main(java.lang.String[] args)
Create a new instance of this application, passing it the command-line arguments. |
void |
managerStateChanged(Manager manager)
Do nothing. |
java.util.List |
models()
Return a list of the Ptolemy II models that were created by processing the command-line arguments. |
void |
runModels()
Start the models running, each in a new thread, then return. |
void |
waitForFinish()
Wait for all executing runs to finish, then return. |
| Methods inherited from class ptolemy.actor.gui.MoMLApplication |
_configurationUsage, _readConfiguration, specToURL |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static java.lang.String[] _localCommandFlags
protected static java.lang.String[][] _localCommandOptions
| Constructor Detail |
public PtExecuteApplication(java.lang.String[] args)
throws java.lang.Exception
args - The command-line arguments.
java.lang.Exception - If command line arguments have problems.| Method Detail |
public void executionError(Manager manager,
java.lang.Throwable throwable)
executionError in interface ExecutionListenermanager - The manager calling this method.throwable - The throwable being reported.public void executionFinished(Manager manager)
executionFinished in interface ExecutionListenermanager - The manager calling this method.public static void main(java.lang.String[] args)
args - The command-line arguments.public void managerStateChanged(Manager manager)
managerStateChanged in interface ExecutionListenermanager - The manager calling this method.Manager.getState()public java.util.List models()
public void runModels()
throws IllegalActionException
IllegalActionException - If the manager throws it.public void waitForFinish()
protected Configuration _createDefaultConfiguration()
throws java.lang.Exception
_createDefaultConfiguration in class MoMLApplicationjava.lang.Exception - If the configuration cannot be opened.
protected Configuration _createEmptyConfiguration()
throws java.lang.Exception
_createEmptyConfiguration in class MoMLApplicationjava.lang.Exception - Always thrown.
protected boolean _parseArg(java.lang.String arg)
throws java.lang.Exception
_parseArg in class MoMLApplicationjava.lang.Exception - If something goes wrong.
protected void _parseArgs(java.lang.String[] args)
throws java.lang.Exception
_parseArgs in class MoMLApplicationjava.lang.Exception - If an argument is not understood or triggers
an error.protected java.lang.String _usage()
_usage in class MoMLApplication
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||