Skip navigation links

Package ptolemy.cg.kernel.generic.program.procedural.fmima

Generate code for the Functional Mockup Unit Master Algorithm (FMIMA) $PTII/bin/ptcg -generatorPackage ptolemy.cg.kernel.generic.program.procedural.fmima \ -generatorPackagelist generic.program.procedural.fmima \ $PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/test/auto/FMUIncScale20RC1pt.xml Overview The ptolemy.cg has a lot of classes, but the FMIMA work consists of only a few classes.

See: Description

Package ptolemy.cg.kernel.generic.program.procedural.fmima Description

Generate code for the Functional Mockup Unit Master Algorithm (FMIMA)
$PTII/bin/ptcg -generatorPackage ptolemy.cg.kernel.generic.program.procedural.fmima \
    -generatorPackagelist generic.program.procedural.fmima \
    $PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/test/auto/FMUIncScale20RC1pt.xml

Overview

The ptolemy.cg has a lot of classes, but the FMIMA work consists of only a few classes.

The easist way to work with the code is to look for the fmima directories and then the .java files

bash-3.2$ cd $PTII/ptolemy/cg
bash-3.2$ find . -name fmima
./adapter/generic/program/procedural/fmima
./kernel/generic/program/procedural/fmima
bash-3.2$ find ./adapter/generic/program/procedural/fmima -name "*.java"
./adapter/generic/program/procedural/fmima/adapters/ptolemy/actor/Director.java
./adapter/generic/program/procedural/fmima/adapters/ptolemy/actor/lib/fmi/FMUImport.java
./adapter/generic/program/procedural/fmima/adapters/ptolemy/actor/TypedCompositeActor.java
./adapter/generic/program/procedural/fmima/test/junit/JUnitTclTest.java
bash-3.2$ find ./kernel/generic/program/procedural/fmima -name "*.java"
./kernel/generic/program/procedural/fmima/FMIMACodeGenerator.java
./kernel/generic/program/procedural/fmima/FMIMACodeGeneratorAdapter.java
./kernel/generic/program/procedural/fmima/test/junit/JUnitTclTest.java
bash-3.2$ 

Invoking

The main entry point is $PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/FMIMACodeGenerator.java. When the code generator is invoked, that class is instantiated.

Below is the command to run a sample model:

$PTII/bin/ptcg -generatorPackage ptolemy.cg.kernel.generic.program.procedural.fmima \
    -generatorPackagelist generic.program.procedural.fmima \
    $PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/test/auto/FMUIncScale20RC1pt.xml
$PTII/bin/ptcg
The command that invokes ptolemy.cg.kernel.generic.GenericCodeGenerator with the appropriate classpath.
-generatorPackage ptolemy.cg.kernel.generic.program.procedural.fmima
The Java package of code generator, defaults to ptolemy.cg.kernel.generic.program.procedural.c
-generatorPackagelist generic.program.procedural.fmima
Semicolon or * separated list of Java packages to be searched for adapters. The "ptolemy.cg.adapter." string is prepended
$PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/test/auto/FMUIncScale20RC1pt.xml
The Ptolemy model to be invoked

Run $PTII/bin/ptcg -help to see other command line arguments.

How it works

In a nut shell, the code iterates through the model, finding actors and attributes. An adapter class is searched for that will handle each actor and attribute. If an adapter is not found, then an adapter for the parent class of the actor or attribute is searched for.

Since:
Ptolemy II 10.0
Skip navigation links