public class NC2MoML
extends java.lang.Object
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 pathExample:
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.ncExample 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))
Constructor and Description |
---|
NC2MoML() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static void generateComponent(java.lang.String sourcePath, java.lang.String componentName, java.lang.String outputFile)
sourcePath
- The path to the component source file (.nc).componentName
- The name of the component (no suffix).outputFile
- The file to generate.public static void main(java.lang.String[] args) throws java.io.IOException
args
- A series of command line arguments, see the
class comment for details.java.io.IOException
- If there is a problem reading or
writing a file.