Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2012-02-24 09:44:03 -0500
committerThomas Schuetz2012-02-24 09:44:03 -0500
commitee668a71dbbf0730df6fc70df5db9328e3e7057d (patch)
treed1ddc639155644e164b8f981c825e382c837922d
parent6685cdb3f0feae9efe025f589a483f22cb597942 (diff)
downloadorg.eclipse.etrice-ee668a71dbbf0730df6fc70df5db9328e3e7057d.tar.gz
org.eclipse.etrice-ee668a71dbbf0730df6fc70df5db9328e3e7057d.tar.xz
org.eclipse.etrice-ee668a71dbbf0730df6fc70df5db9328e3e7057d.zip
[generator.c.reference] added example for tests
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/Henrik-Test.launch10
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/model/diagrams/generic_fsm_gen.AC.behavior106
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room81
3 files changed, 197 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/Henrik-Test.launch b/examples/org.eclipse.etrice.generator.c.reference/Henrik-Test.launch
new file mode 100644
index 000000000..55fb35877
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/Henrik-Test.launch
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.c.launchConfigurationType">
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="false"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room}"/>
+</listAttribute>
+<booleanAttribute key="SaveGenModel" value="false"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/model/diagrams/generic_fsm_gen.AC.behavior b/examples/org.eclipse.etrice.generator.c.reference/model/diagrams/generic_fsm_gen.AC.behavior
new file mode 100644
index 000000000..ef3d064c9
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/model/diagrams/generic_fsm_gen.AC.behavior
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" diagramTypeId="room.behavior" name="Behavior of AC" showGuides="true" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@connections.0/@link //@connections.1/@link" verticalGridUnit="0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#ActorClass:AC"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#StateGraph:AC$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#StateGraph:AC$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="370" y="80">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#BaseState:AC$state0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0 //@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="state0"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#InitialTransition:AC$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../generic_fsm_gen.room#TriggeredTransition:AC$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" x="10" font="//@fonts.0" value="tr0: &lt;m1:fct>"/>
+ </connectionDecorators>
+ <bendpoints x="470" y="285"/>
+ <bendpoints x="470" y="285"/>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room b/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room
new file mode 100644
index 000000000..0222ae5ec
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room
@@ -0,0 +1,81 @@
+RoomModel generic_fsm_gen {
+
+ SubSystemClass Main {
+ ActorRef sys: AC
+ ActorRef peer: Peer
+ Binding sys.fct and peer.fct
+ }
+
+ ActorClass Peer {
+ Interface {
+ conjugated Port fct: PC
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> state0 {
+ action {
+ "PCConjPort_m1(&self->constData->fct);"
+ }
+ }
+ Transition tr0: state0 -> state0 {
+ triggers {
+ <m2: fct>
+ }
+ action {
+ "printf(\"Peer\\n\");"
+ "PCConjPort_m1(&self->constData->fct);"
+ }
+ }
+ State state0
+ }
+ }
+ }
+
+ ActorClass AC {
+ Interface {
+ Port fct: PC
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> state0 { }
+ Transition tr0: state0 -> state0 {
+ triggers {
+ <m1: fct>
+ }
+ action {
+ "printf(\"AC\\n\");"
+ "static int32 counter = 0;"
+ "if (++counter < 3){"
+ "\tPCPort_m2(&self->constData->fct);"
+ "}"
+ }
+ }
+ State state0
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message m1()
+ }
+ outgoing {
+ Message m2()
+ }
+ }
+
+ DataClass DC {
+ Attribute ival: int32
+ Operation mult(a: int32, b: int32): int32 {
+ "return a*b;"
+ }
+ }
+
+ PrimitiveType int32 -> int (Integer) default "0"
+} \ No newline at end of file

Back to the top