Hi Sung-Wen,

To start Vergil, use ptolemy.vergil.VergilApplication.

http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#invoking%20Ptolemy%20II?
says:

--start--
If you install Ptolemy II using the Windows installer, then menu
choices should be added to Start -> Programs -> Ptolemy.

Ptolemy II models can be run from the command line, this is what we do
for the nightly test suite.

$PTII/bin/vergil foo.xml
    will bring up a visual editor for the model defined in
    foo.xml. The visual editor allows you to change the model and run
    it. 
$PTII/bin/ptolemy foo.xml
    will bring up a run control panel for that model and allow you to
    run it 
$PTII/bin/ptexecute foo.xml
    will run the model. The model need not be graphical. 
java -classpath $PTII ptolemy.actor.gui.MoMLSimpleApplication foo.xml
    will run the model without requiring a connection to a
    display. Use this method for running models as part of cron jobs
    etc. 

MoMLApplication supports setting top level parameters using command
line arguments.

The MoMLApplication docs say:

    If a Ptolemy model is instantiated on the command line, either by
    giving a MoML file or a -class argument, then parameters of that
    model can be set on the command line. The syntax is:

       ptolemy modelFile.xml -parameterName value
       

    where parameterName is the name of a parameter relative to the top
    level of a model or the director of a model. For instance, if
    foo.xml defines a toplevel entity named x and x contains an entity
    named y and a parameter named a, and y contains a parameter named
    b, then:

       ptolemy foo.xml -a 5 -y.b 10
       

    would set the values of the two parameters.

    Note that strings need to be carefully backslashed, so to set a
    parameter named c to the string "bar" it might be necessary to do
    something like:

       ptolemy foo.xml -a 5 -y.b 10 -c \\\"bar\\\"
       

    The reason the backslashes are necessary is because ptolemy is a
    shell script which tends to strip off the double quotes. 

Toplevel parameters can be set by calling vergil with a similar
syntax:

$PTII/bin/vergil foo.xml -a 5 -y.b 10

or

$PTII/bin/ptexecute foo.xml -a 5 -y.b 10

Note that MoMLSimpleApplication does not do this type of command line
parsing.

If you want to start Vergil by hand, the answer depends on which
version of Ptolemy II you are using.

If you downloaded the source files and compiled them, then the only
jar file that might need to be included is diva.jar. Releases after
Ptolemy II 3.0.2 include the diva source files, so in theory,

java -classpath "$PTII" ptolemy.vergil.VergilApplication

should work.

Under Windows with Cygwin with Ptolemy II 3.0.2 and earlier, try:

java -classpath "$PTII;$PTII/lib/diva.jar"
ptolemy.vergil.VergilApplication

If you have chose the Windows Installer, then the individual .class
files have been placed in jar files Vergil uses the following jar
files

    * ./ptolemy/ptsupport.jar
    * ./ptolemy/vergil/vergil.jar
    * ./ptolemy/lib/diva.jar
    * ./ptolemy/domains/domains.jar
    * ./ptolemy/copernicus/copernicus.jar 

The directory where Ptolemy II is installed should also be in the
classpath.

To start Vergil by hand when the Ptolemy II was installed from the
Windows installer, try starting up by cd'ing to where the release is
installed and typing in the following (all on one line)

java -classpath ".;./ptolemy/ptsupport.jar;\
./ptolemy/vergil/vergil.jar;./lib/diva.jar;\
./ptolemy/copernicus/copernicus.jar;\
./ptolemy/domains/domains.jar"\
 ptolemy.vergil.VergilApplication
--end--

_Christopher
--------

    Dear Ptolemy expert,
    I would like to rebuild Ptolemy II without Cygwin. 
    After searching the keyword "main()" in ptII directory, I found there are m
   any
    main() entry point. Could anyone tell me what's starting entry point of the
    Ptolemy II?
    
    Best Regards,
    Sung-Wen Wang
    --
    Communication and Multimedia Laboratory
    Dept. of Computer Science and Information Engineering, NTU
    
    
    ---------------------------------------------------------------------------
   -
    Posted to the ptolemy-hackers mailing list.  Please send administrative
    mail for this list to: [EMAIL PROTECTED]
--------

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to