ptolemy.domains.ptinyos.util.nc2moml
Class NC2MoML
java.lang.Object
ptolemy.domains.ptinyos.util.nc2moml.NC2MoML
public class NC2MoML
- extends java.lang.Object
Generate a .moml file for each .nc file in the input list.
Usage:
java -classpath $PTII ptolemy.domains.ptinyos.util.nc2moml.NC2MoMl \
<xml input prefix> \
<xml input suffix> \
<nc sub prefix> \
<moml output prefix> \
long path to file containing list of .nc files using short path
Example:
java -classpath $PTII ptolemy.domains.ptinyos.util.nc2moml.NC2MoMl \
/home/celaine/ptII/vendors/ptinyos/moml \
.ncxml \
\'$CLASSPATH\' \
/home/celaine/ptII/vendors/ptinyos/moml \
/home/celaine/ptII/vendors/ptinyos/moml/.tempfile
.tempfile contains:
tos/lib/Counters/Counter.nc
tos/lib/Counters/IntToLeds.nc
tos/lib/Counters/IntToLedsM.nc
tos/lib/Counters/IntToRfm.nc
tos/lib/Counters/IntToRfmM.nc
tos/lib/Counters/RfmToInt.nc
tos/lib/Counters/RfmToIntM.nc
tos/lib/Counters/SenseToInt.nc
Example output for Counter.nc:
<?xml version="1.0"?>
<!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
<class name="Counter" extends="ptolemy.domains.ptinyos.lib.NCComponent">
<property name="source" value="$CLASSPATH/tos/lib/Counters/Counter.nc" />
<port name="IntOutput" class="ptolemy.actor.IOPort">
<property name="output" />
<property name="_showName" class="ptolemy.kernel.util.SingletonAttribute" />
</port>
<port name="StdControl" class="ptolemy.actor.IOPort">
<property name="input" />
<property name="_showName" class="ptolemy.kernel.util.SingletonAttribute" />
</port>
<port name="Timer" class="ptolemy.actor.IOPort">
<property name="output" />
<property name="_showName" class="ptolemy.kernel.util.SingletonAttribute" />
</port>
</class>
Expects <xml input prefix>
to contain files with <xml input suffix> containing
an xml dump of:
interfaces(file(filename.nc))
- Since:
- Ptolemy II 5.1
- Version:
- $Id: NC2MoML.java 40147 2005-12-17 01:36:33Z celaine $
- Author:
- Elaine Cheong
- Accepted Rating:
- Proposed Rating:
Field Summary |
private static java.lang.String |
_FILESEPARATOR
File separator to use, currently "/". |
Method Summary |
static void |
generateComponent(java.lang.String sourcePath,
java.lang.String componentName,
java.lang.String outputFile)
Generate the .moml file for this nesC component. |
static void |
main(java.lang.String[] args)
Read in .nc xml files, generate .moml files. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_FILESEPARATOR
private static java.lang.String _FILESEPARATOR
- File separator to use, currently "/".
NC2MoML
public NC2MoML()
generateComponent
public static void generateComponent(java.lang.String sourcePath,
java.lang.String componentName,
java.lang.String outputFile)
- Generate the .moml file for this nesC component.
- Parameters:
sourcePath
- The path to the component source file (.nc).componentName
- The name of the component (no suffix).outputFile
- The file to generate.
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Read in .nc xml files, generate .moml files.
- Parameters:
args
- A series of command line arguments, see the
class comment for details.
- Throws:
java.io.IOException
- If there is a problem reading or
writing a file.