Hi, I fixed up Copernicus shallow code generation and the jode2java script so that given a wireless domain model in a .xml file, I can create a .java file that extends TypedCompositeActor that implements the model.
The primary fix was that I edited ptolemy/copernicus/kernel/Copernicus.java and changed removeGraphicalClasses.put("ptolemy.kernel.util.Location", null); to //removeGraphicalClasses.put("ptolemy.kernel.util.Location", null); and recompiled Copernicus.java
I then did the following to generate a .class file that extends TypedCompositeActor:
cd $PTII/ptolemy/copernicus/shallow/cg
$PTII/bin/copernicus -codeGenerator shallow ./../../domains/wireless/test/auto/simpleDE.xml
To generate the .java file from the .class file, I had to mess with copernicus/shallow/test/jode2java and make the following change
if ( $1 ~ /\"/) { became: if ( $1 ~ /\"/ && $0 !~ /"\);$/ && $0 !~ /"\)\);$/ ) {
and then I did:
cd $PTII/ptolemy/copernicus/shallow/cg/simpleDE make jodeDecompile
This produced the simpleDE/CGSimpleDE.java file which I've attached.
To use this file, do:
tar -zxf simpleDE.tar.gz
javac -classpath "${PTII};." simpleDE/CGsimpleDE.java
java -classpath "${PTII};." ptolemy.actor.gui.CompositeActorApplication -class simpleDE.CGsimpleDE
This should show you how you can create a TypedCompositeActor in the wireless domain.
However
_Christopher
simpleDE.tar.gz
Description: Binary data