Ptolemy II PtinyOS Domain Developer Notes
If you use Eclipse to run Viptos or develop PtinyOS Domain related
code, you should follow the instructions below for setting up Eclipse
properly.
Quick links:
Setting up Eclipse to run Viptos
Setting up Eclipse to work with nesC
Setting up Eclipse to run nc2moml or ncapp2moml
These instructions assume you already having Eclipse working with
vergil (ptII). You should omit the quote symbols (") when entering
values in Eclipse.
These instructions were tested on Eclipse 3.1.
- Click on Run | Run... in the menu.
- Click on New
- Change Name from "New_configuration" to "viptos"
- In the Main tab,
- Set Project to "ptII".
- Set Main class to "ptolemy.vergil.VergilApplication".
- Uncheck Include libraries when searching for a main class.
- Uncheck Include inherited mains when searching for a main class.
- Uncheck Stop in main.
- In the Arguments tab, under Program arguments, enter "-viptos".
- In the Classpath tab, click on ptII (default classpath)
- Click on Advanced
- Click on Add Folders
- Select ptII | vendors | ptinyos | moml
- Click on OK
- You should now see an entry for moml under User Entries
- Click on Apply in the Run window
- Click on Run to run Viptos
-
If you are editing nc2moml files (in
$PTII/ptolemy/domains/ptinyos/util/nc2moml
) or ncapp2moml
files (in $PTII/ptolemy/domains/ptinyos/util/ncapp2moml
),
then you will probably want to set up Eclipse to work with nesC,
especially if you need to edit any Java files that come with the nesC
distribution.
These instructions assume that you have checked out nesc from sourceforge by doing the following:
cd $PTII/vendors/ptinyos
export CVS_RSH=ssh
cvs -z3 -d:ext:developername@nescc.cvs.sourceforge.net:/cvsroot/nescc co -P nesc
Warning: The $PTII/vendors/.cvsignore
file is designed to avoid a problem in Eclipse, whereby it
will delete all of the subdirectories named
CVS in any external CVS repositories that are
stored in $PTII/vendors . The
$PTII/vendors/.cvsignore file contains a line
with ptinyos so that CVS (for ptII) will
ignore all files in this directory.
For example, I have symbolic links in
$PTII/vendors/ptinyos that point to my
checked-out copies of the nesc and tinyos-1.x CVS
repositories. Without the .cvsignore file, running
Eclipse 3.0 with version control (using CVS from Eclipse) will
cause it to occasionally delete all the CVS subdirectories
in nesc and tinyos-1.x.
|
(If you have Eclipse 3.0, see Eclipse 3.0 instructions).
Instructions for Eclipse 3.1
These instructions assume you already having Eclipse working with
vergil (ptII). You should omit the quote symbols (") when entering
values in Eclipse.
- File | New | Project...
- Select a wizard: Java Project
Click Next.
- Project name: nesc
Select: Create project at external location
Directory: /home/celaine/ptII/vendors/ptinyos/nesc
Project layout: Use project folder as root for sources and class files
Click Next
- Java Settings | Source Tab:
Make sure "Allow output folders for source folders" is checked.
Open nesc/tools/java
Select "Output folder" and "Configure Output Folder Properties"
Source Folder Output Location: select "Specific output folder": tools/java
Output folder should now be nesc/tools/java
Click Finish
- Window | Show View | Navigator
Right click on nesc project in Navigator pane on left hand side
Build Project
- Class files should appear in nesc/tools/java/...
- Jump to instructions below on Setting up Eclipse to run nc2moml or ncapp2moml.
These instructions assume you already having Eclipse working with
vergil (ptII). You should omit the quote symbols (") when entering
values in Eclipse.
- File | New | Project...
- Select a wizard: Java Project
Click Next.
- Project name: nesc
Select: Create project at external location
Directory: /home/celaine/ptII/vendors/ptinyos/nesc
Project layout: Use project folder as root for sources and class files
Click Next
- Java Settings | Source Tab:
Make sure "Allow output folders for source folders" is checked.
Open nesc/tools/java
Select "Output folder" and Edit...
Source Folder Output Location: select "Specific output folder": tools/java
Output folder should now be nesc/tools/java
Click Finish
- Window | Show View | Navigator
Right click on nesc project in Navigator pane on left hand side
Build Project
- Class files should appear in nesc/tools/java/...
First follow the instructions above for Setting
up Eclipse to run Viptos.
To run or debug the java applications found in
$PTII/ptolemy/domains/ptinyos/util
under Eclipse, you
must pass the following VM arguments in the Run menu:
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
You may substitute a different parser if desired. See the SAX2 Driver
information at http://www.saxproject.org/quickstart.html