|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.gui.ConfigurationApplication
ptolemy.actor.gui.MoMLApplication
ptolemy.actor.gui.PtExecuteApplication
public class 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 equivalent
If 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. System.exit() returns 0 if all the models finished without throwing an exception, otherwise it returns an integer that represents the number of models that threw an exception. The main() method calls System.exit() as well and returns an integer that represents the number of models that threw an exception.
If there are no command-line arguments at all, then this class does nothing.
This class will bring up the GUI and usually requires access
to a display. The MoMLSimpleApplication
class will run models in a non-graphical context.
ModelFrame
,
RunTableau
Red (eal) |
Yellow (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.actor.gui.ConfigurationApplication |
---|
ConfigurationApplication.ConfigurationFilenameFilter, ConfigurationApplication.IgnoreErrorHandler |
Field Summary | |
---|---|
private java.lang.String |
_configurationSubdirectory
|
private java.net.URL |
_configurationURL
|
private static int |
_exitValue
|
private boolean |
_expectingConfiguration
|
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.ConfigurationApplication |
---|
_basePath, _commandFlagsWithDescriptions, _commandOptions, _commandTemplate, _configuration, _exit, _parser, _printPDF, _run, _statistics, _test |
Constructor Summary | |
---|---|
PtExecuteApplication(java.lang.String[] args)
Parse the specified command-line arguments, creating models and running them. |
Method Summary | |
---|---|
private boolean |
_configurationParseArg(java.lang.String arg)
Parse a command-line argument. |
protected Configuration |
_createDefaultConfiguration()
Return a default Configuration, which in this case is given by the MoML file ptolemy/configs/runConfiguration.xml. |
protected Configuration |
_createEmptyConfiguration()
Throw an exception. |
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)
Display a stack trace because one of the models has an error. |
static void |
main(java.lang.String[] args)
Create a new instance of this application, passing it the command-line arguments. |
Methods inherited from class ptolemy.actor.gui.MoMLApplication |
---|
_initializeApplication |
Methods inherited from class ptolemy.actor.gui.ConfigurationApplication |
---|
_configurationUsage, _configurationUsage, _openModel, _openModel, _parseArg, _printPDF, _readConfiguration, executionFinished, managerStateChanged, models, readConfiguration, runModels, specToURL, throwArgsException, waitForFinish |
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
private java.lang.String _configurationSubdirectory
private java.net.URL _configurationURL
private static int _exitValue
private boolean _expectingConfiguration
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 ExecutionListener
executionError
in class ConfigurationApplication
manager
- The manager calling this method.throwable
- The Throwable to be displayed.public static void main(java.lang.String[] args)
args
- The command-line arguments.protected Configuration _createDefaultConfiguration() throws java.lang.Exception
_createDefaultConfiguration
in class ConfigurationApplication
java.lang.Exception
- If the configuration cannot be opened.protected Configuration _createEmptyConfiguration() throws java.lang.Exception
_createEmptyConfiguration
in class ConfigurationApplication
java.lang.Exception
- Always thrown.protected void _parseArgs(java.lang.String[] args) throws java.lang.Exception
_parseArgs
in class ConfigurationApplication
args
- The command-line arguments to be parsed.
java.lang.Exception
- If an argument is not understood or triggers
an error.protected java.lang.String _usage()
_usage
in class ConfigurationApplication
private boolean _configurationParseArg(java.lang.String arg) throws java.lang.Exception
java.lang.Exception
- If something goes wrong.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |