Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-07-25 07:17:52 +0000
committerHenrik Rentz-Reichert2012-07-25 07:17:52 +0000
commit75d608b93a41a9ad974cfce52d5b06b380021d39 (patch)
tree933c2ecbd7a78dc93aae476782106a9b815fe913 /examples
parentbfce14478c734a55059834e5db4f743caa096188 (diff)
downloadorg.eclipse.etrice-75d608b93a41a9ad974cfce52d5b06b380021d39.tar.gz
org.eclipse.etrice-75d608b93a41a9ad974cfce52d5b06b380021d39.tar.xz
org.eclipse.etrice-75d608b93a41a9ad974cfce52d5b06b380021d39.zip
[tutorials] re-generated
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room2
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/Blinky/diagrams/Blinky.SubSystem_Blinky.structure16
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/PedLightsController/PedLightsController.room4
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/PedLightsController/diagrams/PedLightsController.SubSys_PedLights.structure16
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/SendingData/SendingData.room2
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room2
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/Blinky/Blinky.java136
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyControlProtocoll.java16
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyController.java66
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyTop.java15
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/Blinky/SubSystem_Blinky.java50
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/HelloWorldTop.java20
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/SubSystem_HelloWorld.java2
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/Controller.java152
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/GuiAdapter.java79
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedControlProtocol.java16
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedLightsTop.java15
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/SubSys_PedLights.java42
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPingActor.java245
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPongActor1.java204
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongProtocol.java186
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongTop.java71
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPong.java155
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java36
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/DemoData.java14
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPing.java86
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPong.java63
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/PingPongProtocol.java16
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingDataTop.java15
-rw-r--r--examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingData_SubSystem.java14
30 files changed, 1370 insertions, 386 deletions
diff --git a/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room b/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
index da3384e84..8025fd879 100644
--- a/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
+++ b/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
@@ -1,6 +1,6 @@
RoomModel Blinky {
- import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib/models/TimingService.room"
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.java/models/TimingService.room"
LogicalSystem System_Blinky {
SubSystemRef subsystem: SubSystem_Blinky
diff --git a/examples/org.eclipse.etrice.tutorials/model/Blinky/diagrams/Blinky.SubSystem_Blinky.structure b/examples/org.eclipse.etrice.tutorials/model/Blinky/diagrams/Blinky.SubSystem_Blinky.structure
index 1bbc9eb81..2ee15cbf9 100644
--- a/examples/org.eclipse.etrice.tutorials/model/Blinky/diagrams/Blinky.SubSystem_Blinky.structure
+++ b/examples/org.eclipse.etrice.tutorials/model/Blinky/diagrams/Blinky.SubSystem_Blinky.structure
@@ -46,29 +46,29 @@
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="port"/>
<properties key="item-kind" value=""/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="56">
- <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="53">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../../../../org.eclipse.etrice.modellib/models/TimingService.room#SPPRef:ATimingService$timer"/>
+ <businessObjects href="file:/C:/Users/hrentz/Documents/protos/Entwicklung/Projekte/protos/eTrice/tasks/bugs/2012-01-18/ws/eTrice-rt/org.eclipse.etrice.modellib.java/models/TimingService.room#SPPRef:ATimingService$timer"/>
</link>
<anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@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="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timer"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timer"/>
</children>
</children>
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="port"/>
<properties key="item-kind" value=""/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="123">
- <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="106">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../../../../org.eclipse.etrice.modellib/models/TimingService.room#SPPRef:ATimingService$timeout"/>
+ <businessObjects href="file:/C:/Users/hrentz/Documents/protos/Entwicklung/Projekte/protos/eTrice/tasks/bugs/2012-01-18/ws/eTrice-rt/org.eclipse.etrice.modellib.java/models/TimingService.room#SPPRef:ATimingService$timeout"/>
</link>
<anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.1/@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="40" height="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timeout"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timeout"/>
</children>
</children>
</children>
diff --git a/examples/org.eclipse.etrice.tutorials/model/PedLightsController/PedLightsController.room b/examples/org.eclipse.etrice.tutorials/model/PedLightsController/PedLightsController.room
index 37cf6c1e9..257737664 100644
--- a/examples/org.eclipse.etrice.tutorials/model/PedLightsController/PedLightsController.room
+++ b/examples/org.eclipse.etrice.tutorials/model/PedLightsController/PedLightsController.room
@@ -1,7 +1,7 @@
RoomModel PedLightsController {
- import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib/models/TimingService.room"
- import room.basic.types.java.* from "../../../org.eclipse.etrice.modellib/models/JavaTypes.room"
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.java/models/TimingService.room"
+ import room.basic.types.java.* from "../../../org.eclipse.etrice.modellib.java/models/JavaTypes.room"
LogicalSystem LogSys_PedLights {
SubSystemRef application: SubSys_PedLights
diff --git a/examples/org.eclipse.etrice.tutorials/model/PedLightsController/diagrams/PedLightsController.SubSys_PedLights.structure b/examples/org.eclipse.etrice.tutorials/model/PedLightsController/diagrams/PedLightsController.SubSys_PedLights.structure
index 439e83e11..981060844 100644
--- a/examples/org.eclipse.etrice.tutorials/model/PedLightsController/diagrams/PedLightsController.SubSys_PedLights.structure
+++ b/examples/org.eclipse.etrice.tutorials/model/PedLightsController/diagrams/PedLightsController.SubSys_PedLights.structure
@@ -46,29 +46,29 @@
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="port"/>
<properties key="item-kind" value=""/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="56">
- <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="53">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../../../../org.eclipse.etrice.modellib/models/TimingService.room#SPPRef:ATimingService$timer"/>
+ <businessObjects href="file:/C:/Users/hrentz/Documents/protos/Entwicklung/Projekte/protos/eTrice/tasks/bugs/2012-01-18/ws/eTrice-rt/org.eclipse.etrice.modellib.java/models/TimingService.room#SPPRef:ATimingService$timer"/>
</link>
<anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@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="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timer"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timer"/>
</children>
</children>
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="port"/>
<properties key="item-kind" value=""/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="123">
- <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="106">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../../../../org.eclipse.etrice.modellib/models/TimingService.room#SPPRef:ATimingService$timeout"/>
+ <businessObjects href="file:/C:/Users/hrentz/Documents/protos/Entwicklung/Projekte/protos/eTrice/tasks/bugs/2012-01-18/ws/eTrice-rt/org.eclipse.etrice.modellib.java/models/TimingService.room#SPPRef:ATimingService$timeout"/>
</link>
<anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.1/@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="40" height="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timeout"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timeout"/>
</children>
</children>
</children>
diff --git a/examples/org.eclipse.etrice.tutorials/model/SendingData/SendingData.room b/examples/org.eclipse.etrice.tutorials/model/SendingData/SendingData.room
index fc2bcc25f..47a64e198 100644
--- a/examples/org.eclipse.etrice.tutorials/model/SendingData/SendingData.room
+++ b/examples/org.eclipse.etrice.tutorials/model/SendingData/SendingData.room
@@ -1,6 +1,6 @@
RoomModel SendingData {
- import room.basic.types.java.* from "../../../org.eclipse.etrice.modellib/models/JavaTypes.room"
+ import room.basic.types.java.* from "../../../org.eclipse.etrice.modellib.java/models/JavaTypes.room"
LogicalSystem SendingData_LogSystem {
SubSystemRef SendingDataAppl: SendingData_SubSystem
diff --git a/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room b/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room
index ec42cc43e..4d7e6465d 100644
--- a/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room
+++ b/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room
@@ -1,6 +1,6 @@
RoomModel PingPong {
- import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib/models/TimingService.room"
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.java/models/TimingService.room"
LogicalSystem System_PingPong {
SubSystemRef subsystem: SubSystem_PingPong
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/Blinky.java b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/Blinky.java
index 8e8b32723..c0f69ae0f 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/Blinky.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/Blinky.java
@@ -13,31 +13,33 @@ import room.basic.service.timing.*;
import Blinky.BlinkyControlProtocoll.*;
import room.basic.service.timing.PTimeout.*;
-//--------------------- begin user code
- import org.eclipse.etrice.tutorials.PedLightGUI.*;
-//--------------------- end user code
+/*--------------------- begin user code ---------------------*/
+import org.eclipse.etrice.tutorials.PedLightGUI.*;
+/*--------------------- end user code ---------------------*/
public class Blinky extends ActorClassBase {
- //--------------------- begin user code
- private PedestrianLightWndNoTcp light = new PedestrianLightWndNoTcp();
- private TrafficLight3 carLights;
- private TrafficLight2 pedLights;
- //--------------------- end user code
+ /*--------------------- begin user code ---------------------*/
+ private PedestrianLightWndNoTcp light = new PedestrianLightWndNoTcp();
+ private TrafficLight3 carLights;
+ private TrafficLight2 pedLights;
+ /*--------------------- end user code ---------------------*/
//--------------------- ports
protected BlinkyControlProtocollPort ControlPort = null;
+
//--------------------- saps
protected PTimeoutConjPort timer = null;
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_ControlPort = 1;
public static final int IFITEM_timer = 2;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
public void destroyUser() {
light.closeWindow();
}
@@ -51,11 +53,21 @@ public class Blinky extends ActorClassBase {
// own ports
ControlPort = new BlinkyControlProtocollPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
+
// own saps
timer = new PTimeoutConjPort(this, "timer", IFITEM_timer, 0, port_addr[IFITEM_timer][0], peer_addr[IFITEM_timer][0]);
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public BlinkyControlProtocollPort getControlPort (){
+ return this.ControlPort;
+ }
+ public PTimeoutConjPort getTimer (){
+ return this.timer;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -71,34 +83,34 @@ public class Blinky extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
- public static final int STATE_off = 2;
- public static final int STATE_blinking_on = 3;
- public static final int STATE_blinking_off = 4;
- public static final int STATE_blinking = 5;
+ public static final int STATE_blinking = 2;
+ public static final int STATE_off = 3;
+ public static final int STATE_blinking_on = 4;
+ public static final int STATE_blinking_off = 5;
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__off = 1;
- public static final int CHAIN_TRANS_blinking_TO_off_BY_stopControlPort = 2;
- public static final int CHAIN_TRANS_off_TO_blinking_tp0_BY_startControlPort = 3;
+ public static final int CHAIN_TRANS_tr0_FROM_off_TO_blinking_tp0_BY_startControlPort = 2;
+ public static final int CHAIN_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort = 3;
public static final int CHAIN_blinking_TRANS_INITIAL_TO__on = 4;
- public static final int CHAIN_blinking_TRANS_off_TO_on_BY_timeoutTicktimer = 5;
- public static final int CHAIN_blinking_TRANS_on_TO_off_BY_timeoutTicktimer = 6;
+ public static final int CHAIN_blinking_TRANS_tr1_FROM_on_TO_off_BY_timeoutTicktimer = 5;
+ public static final int CHAIN_blinking_TRANS_tr2_FROM_off_TO_on_BY_timeoutTicktimer = 6;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_ControlPort__start = IFITEM_ControlPort + EVT_SHIFT*BlinkyControlProtocoll.IN_start;
public static final int TRIG_ControlPort__stop = IFITEM_ControlPort + EVT_SHIFT*BlinkyControlProtocoll.IN_stop;
public static final int TRIG_timer__timeoutTick = IFITEM_timer + EVT_SHIFT*PTimeout.OUT_timeoutTick;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","off",
+ protected static final String stateStrings[] = {"<no state>","<top>","blinking",
+ "off",
"blinking_on",
- "blinking_off",
- "blinking"
+ "blinking_off"
};
// history
@@ -112,7 +124,7 @@ public class Blinky extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
protected void entry_blinking_on() {
timer.Start(1000);
carLights.setState(TrafficLight3.YELLOW);
@@ -122,14 +134,14 @@ public class Blinky extends ActorClassBase {
carLights.setState(TrafficLight3.OFF);
}
- //*** Action Codes
+ /* Action Codes */
protected void action_TRANS_INITIAL_TO__off() {
carLights = light.getCarLights();
pedLights = light.getPedLights();
carLights.setState(TrafficLight3.OFF);
pedLights.setState(TrafficLight2.OFF);
}
- protected void action_TRANS_blinking_TO_off_BY_stopControlPort(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort(InterfaceItemBase ifitem) {
timer.Kill();
carLights.setState(TrafficLight3.OFF);
}
@@ -178,20 +190,20 @@ public class Blinky extends ActorClassBase {
action_TRANS_INITIAL_TO__off();
return STATE_off;
}
- case CHAIN_TRANS_off_TO_blinking_tp0_BY_startControlPort:
+ case CHAIN_TRANS_tr0_FROM_off_TO_blinking_tp0_BY_startControlPort:
{
return STATE_blinking_on;
}
- case CHAIN_TRANS_blinking_TO_off_BY_stopControlPort:
+ case CHAIN_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort:
{
- action_TRANS_blinking_TO_off_BY_stopControlPort(ifitem);
+ action_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort(ifitem);
return STATE_off;
}
- case CHAIN_blinking_TRANS_on_TO_off_BY_timeoutTicktimer:
+ case CHAIN_blinking_TRANS_tr1_FROM_on_TO_off_BY_timeoutTicktimer:
{
return STATE_blinking_off;
}
- case CHAIN_blinking_TRANS_off_TO_on_BY_timeoutTicktimer:
+ case CHAIN_blinking_TRANS_tr2_FROM_off_TO_on_BY_timeoutTicktimer:
{
return STATE_blinking_on;
}
@@ -261,44 +273,44 @@ public class Blinky extends ActorClassBase {
switch (this.state) {
case STATE_off:
switch(trigger) {
- case TRIG_ControlPort__start:
- {
- chain = CHAIN_TRANS_off_TO_blinking_tp0_BY_startControlPort;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_ControlPort__start:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_off_TO_blinking_tp0_BY_startControlPort;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_blinking_on:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_blinking_TRANS_on_TO_off_BY_timeoutTicktimer;
- catching_state = STATE_blinking;
- }
- break;
- case TRIG_ControlPort__stop:
- {
- chain = CHAIN_TRANS_blinking_TO_off_BY_stopControlPort;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_blinking_TRANS_tr1_FROM_on_TO_off_BY_timeoutTicktimer;
+ catching_state = STATE_blinking;
+ }
+ break;
+ case TRIG_ControlPort__stop:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_blinking_off:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_blinking_TRANS_off_TO_on_BY_timeoutTicktimer;
- catching_state = STATE_blinking;
- }
- break;
- case TRIG_ControlPort__stop:
- {
- chain = CHAIN_TRANS_blinking_TO_off_BY_stopControlPort;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_blinking_TRANS_tr2_FROM_off_TO_on_BY_timeoutTicktimer;
+ catching_state = STATE_blinking;
+ }
+ break;
+ case TRIG_ControlPort__stop:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_blinking_TO_off_BY_stopControlPort;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyControlProtocoll.java b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyControlProtocoll.java
index 9b02e033b..501161f82 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyControlProtocoll.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyControlProtocoll.java
@@ -34,7 +34,7 @@ public class BlinkyControlProtocoll {
static public class BlinkyControlProtocollPort extends PortBase {
// constructors
public BlinkyControlProtocollPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public BlinkyControlProtocollPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -65,13 +65,13 @@ public class BlinkyControlProtocoll {
}
// replicated port class
- static public class BlinkyControlProtocollPortRepl {
+ static public class BlinkyControlProtocollReplPort {
private ArrayList<BlinkyControlProtocollPort> ports;
private int replication;
- public BlinkyControlProtocollPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public BlinkyControlProtocollReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<BlinkyControlProtocoll.BlinkyControlProtocollPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new BlinkyControlProtocollPort(
@@ -99,7 +99,7 @@ public class BlinkyControlProtocoll {
static public class BlinkyControlProtocollConjPort extends PortBase {
// constructors
public BlinkyControlProtocollConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public BlinkyControlProtocollConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -144,13 +144,13 @@ public class BlinkyControlProtocoll {
}
// replicated port class
- static public class BlinkyControlProtocollConjPortRepl {
+ static public class BlinkyControlProtocollConjReplPort {
private ArrayList<BlinkyControlProtocollConjPort> ports;
private int replication;
- public BlinkyControlProtocollConjPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public BlinkyControlProtocollConjReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<BlinkyControlProtocoll.BlinkyControlProtocollConjPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new BlinkyControlProtocollConjPort(
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyController.java b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyController.java
index 6feeda89b..1f4896acf 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyController.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyController.java
@@ -20,16 +20,18 @@ public class BlinkyController extends ActorClassBase {
//--------------------- ports
protected BlinkyControlProtocollConjPort ControlPort = null;
+
//--------------------- saps
protected PTimeoutConjPort timer = null;
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_ControlPort = 1;
public static final int IFITEM_timer = 2;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public BlinkyController(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -40,11 +42,21 @@ public class BlinkyController extends ActorClassBase {
// own ports
ControlPort = new BlinkyControlProtocollConjPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
+
// own saps
timer = new PTimeoutConjPort(this, "timer", IFITEM_timer, 0, port_addr[IFITEM_timer][0], peer_addr[IFITEM_timer][0]);
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public BlinkyControlProtocollConjPort getControlPort (){
+ return this.ControlPort;
+ }
+ public PTimeoutConjPort getTimer (){
+ return this.timer;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -60,8 +72,7 @@ public class BlinkyController extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -70,10 +81,11 @@ public class BlinkyController extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__on = 1;
- public static final int CHAIN_TRANS_off_TO_on_BY_timeoutTicktimer = 2;
- public static final int CHAIN_TRANS_on_TO_off_BY_timeoutTicktimer = 3;
+ public static final int CHAIN_TRANS_goOff_FROM_on_TO_off_BY_timeoutTicktimer = 2;
+ public static final int CHAIN_TRANS_goOn_FROM_off_TO_on_BY_timeoutTicktimer = 3;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_timer__timeoutTick = IFITEM_timer + EVT_SHIFT*PTimeout.OUT_timeoutTick;
// state names
@@ -92,18 +104,18 @@ public class BlinkyController extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
+ /* Action Codes */
protected void action_TRANS_INITIAL_TO__on() {
timer.Start(5000);
ControlPort.start();
}
- protected void action_TRANS_on_TO_off_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_goOff_FROM_on_TO_off_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
ControlPort.stop();
timer.Start(5000);
}
- protected void action_TRANS_off_TO_on_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_goOn_FROM_off_TO_on_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
ControlPort.start();
timer.Start(5000);
}
@@ -144,14 +156,14 @@ public class BlinkyController extends ActorClassBase {
action_TRANS_INITIAL_TO__on();
return STATE_on;
}
- case CHAIN_TRANS_on_TO_off_BY_timeoutTicktimer:
+ case CHAIN_TRANS_goOff_FROM_on_TO_off_BY_timeoutTicktimer:
{
- action_TRANS_on_TO_off_BY_timeoutTicktimer(ifitem);
+ action_TRANS_goOff_FROM_on_TO_off_BY_timeoutTicktimer(ifitem);
return STATE_off;
}
- case CHAIN_TRANS_off_TO_on_BY_timeoutTicktimer:
+ case CHAIN_TRANS_goOn_FROM_off_TO_on_BY_timeoutTicktimer:
{
- action_TRANS_off_TO_on_BY_timeoutTicktimer(ifitem);
+ action_TRANS_goOn_FROM_off_TO_on_BY_timeoutTicktimer(ifitem);
return STATE_on;
}
}
@@ -201,22 +213,22 @@ public class BlinkyController extends ActorClassBase {
switch (this.state) {
case STATE_on:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_on_TO_off_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_goOff_FROM_on_TO_off_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_off:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_off_TO_on_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_goOn_FROM_off_TO_on_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyTop.java b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyTop.java
index 79fe1a02c..8f82eb998 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyTop.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/BlinkyTop.java
@@ -16,13 +16,15 @@ public class BlinkyTop extends ActorClassBase {
//--------------------- ports
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public BlinkyTop(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -32,10 +34,14 @@ public class BlinkyTop extends ActorClassBase {
// initialize attributes
// own ports
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
//--------------------- lifecycle functions
public void init(){
@@ -51,8 +57,7 @@ public class BlinkyTop extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
//--------------------- no state machine
@Override
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/SubSystem_Blinky.java b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/SubSystem_Blinky.java
index 0d045dae7..906d60d8e 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/SubSystem_Blinky.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/Blinky/SubSystem_Blinky.java
@@ -34,10 +34,10 @@ public class SubSystem_Blinky extends SubSystemClassBase{
public void instantiateActors(){
// all addresses
// Addresses for the Subsystem Systemport
- Address addr_item_SystemPort_0 = new Address(0,0,111);
- Address addr_item_SystemPort_1 = new Address(0,0,112);
- Address addr_item_SystemPort_2 = new Address(0,0,113);
- Address addr_item_SystemPort_3 = new Address(0,0,114);
+ Address addr_item_SystemPort_0 = new Address(0,0,112);
+ Address addr_item_SystemPort_1 = new Address(0,0,113);
+ Address addr_item_SystemPort_2 = new Address(0,0,114);
+ Address addr_item_SystemPort_3 = new Address(0,0,115);
// actor instance /SubSystem_Blinky/application itself => Systemport Address
// TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
@@ -79,12 +79,12 @@ public class SubSystem_Blinky extends SubSystemClassBase{
"blinky",
// own interface item addresses
new Address[][] {{addr_item__SubSystem_Blinky_application_blinky},
- {
- addr_item__SubSystem_Blinky_application_blinky_ControlPort
- },
- {
- addr_item__SubSystem_Blinky_application_blinky_timer
- }
+ {
+ addr_item__SubSystem_Blinky_application_blinky_ControlPort
+ },
+ {
+ addr_item__SubSystem_Blinky_application_blinky_timer
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_1},
@@ -101,12 +101,12 @@ public class SubSystem_Blinky extends SubSystemClassBase{
"controller",
// own interface item addresses
new Address[][] {{addr_item__SubSystem_Blinky_application_controller},
- {
- addr_item__SubSystem_Blinky_application_controller_ControlPort
- },
- {
- addr_item__SubSystem_Blinky_application_controller_timer
- }
+ {
+ addr_item__SubSystem_Blinky_application_controller_ControlPort
+ },
+ {
+ addr_item__SubSystem_Blinky_application_controller_timer
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_2},
@@ -123,23 +123,23 @@ public class SubSystem_Blinky extends SubSystemClassBase{
"timingService",
// own interface item addresses
new Address[][] {{addr_item__SubSystem_Blinky_timingService},
- {
- },
- {
- addr_item__SubSystem_Blinky_timingService_timeout_0,
- addr_item__SubSystem_Blinky_timingService_timeout_1
- }
+ {
+ addr_item__SubSystem_Blinky_timingService_timeout_0,
+ addr_item__SubSystem_Blinky_timingService_timeout_1
+ },
+ null
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_3},
{
- },
- {
addr_item__SubSystem_Blinky_application_blinky_timer,
addr_item__SubSystem_Blinky_application_controller_timer
- }
+ },
+ null
}
);
+
+ // apply instance attribute configurations
// create the subsystem system port
RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/HelloWorldTop.java b/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/HelloWorldTop.java
index 5e4f6bee6..3146d0b87 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/HelloWorldTop.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/HelloWorldTop.java
@@ -16,13 +16,15 @@ public class HelloWorldTop extends ActorClassBase {
//--------------------- ports
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public HelloWorldTop(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -32,10 +34,14 @@ public class HelloWorldTop extends ActorClassBase {
// initialize attributes
// own ports
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
//--------------------- lifecycle functions
public void init(){
@@ -51,8 +57,7 @@ public class HelloWorldTop extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -62,6 +67,7 @@ public class HelloWorldTop extends ActorClassBase {
public static final int CHAIN_TRANS_INITIAL_TO__state0 = 1;
/* triggers */
+ public static final int POLLING = 0;
// state names
protected static final String stateStrings[] = {"<no state>","<top>","state0"
@@ -78,9 +84,9 @@ public class HelloWorldTop extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
+ /* Action Codes */
protected void action_TRANS_INITIAL_TO__state0() {
System.out.println("HelloWorld !");
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/SubSystem_HelloWorld.java b/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/SubSystem_HelloWorld.java
index 590a822ea..d0e64c0fe 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/SubSystem_HelloWorld.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/HelloWorld/SubSystem_HelloWorld.java
@@ -52,6 +52,8 @@ public class SubSystem_HelloWorld extends SubSystemClassBase{
new Address[][] {{addr_item_SystemPort_0}
}
);
+
+ // apply instance attribute configurations
// create the subsystem system port
RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/Controller.java b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/Controller.java
index 558634e59..d1da04f9e 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/Controller.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/Controller.java
@@ -13,9 +13,9 @@ import room.basic.service.timing.*;
import room.basic.service.timing.PTimeout.*;
import PedLightsController.PedControlProtocol.*;
-//--------------------- begin user code
- import org.eclipse.etrice.tutorials.PedLightGUI.*;
-//--------------------- end user code
+/*--------------------- begin user code ---------------------*/
+import org.eclipse.etrice.tutorials.PedLightGUI.*;
+/*--------------------- end user code ---------------------*/
public class Controller extends ActorClassBase {
@@ -23,16 +23,18 @@ public class Controller extends ActorClassBase {
//--------------------- ports
protected PedControlProtocolPort ControlPort = null;
+
//--------------------- saps
protected PTimeoutConjPort timer = null;
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_ControlPort = 1;
public static final int IFITEM_timer = 2;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public Controller(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -43,11 +45,21 @@ public class Controller extends ActorClassBase {
// own ports
ControlPort = new PedControlProtocolPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
+
// own saps
timer = new PTimeoutConjPort(this, "timer", IFITEM_timer, 0, port_addr[IFITEM_timer][0], peer_addr[IFITEM_timer][0]);
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PedControlProtocolPort getControlPort (){
+ return this.ControlPort;
+ }
+ public PTimeoutConjPort getTimer (){
+ return this.timer;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -63,8 +75,7 @@ public class Controller extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -77,14 +88,15 @@ public class Controller extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__off = 1;
- public static final int CHAIN_TRANS_carsGreen2_TO_off_BY_timeoutTicktimer = 2;
- public static final int CHAIN_TRANS_carsGreen_TO_carsYellow_BY_timeoutTicktimer = 3;
- public static final int CHAIN_TRANS_carsRed_TO_carsYellowRed_BY_timeoutTicktimer = 4;
- public static final int CHAIN_TRANS_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer = 5;
- public static final int CHAIN_TRANS_carsYellow_TO_carsRed_BY_timeoutTicktimer = 6;
- public static final int CHAIN_TRANS_off_TO_carsGreen_BY_startControlPort = 7;
+ public static final int CHAIN_TRANS_tr0_FROM_off_TO_carsGreen_BY_startControlPort = 2;
+ public static final int CHAIN_TRANS_tr1_FROM_carsGreen_TO_carsYellow_BY_timeoutTicktimer = 3;
+ public static final int CHAIN_TRANS_tr2_FROM_carsYellow_TO_carsRed_BY_timeoutTicktimer = 4;
+ public static final int CHAIN_TRANS_tr3_FROM_carsRed_TO_carsYellowRed_BY_timeoutTicktimer = 5;
+ public static final int CHAIN_TRANS_tr4_FROM_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer = 6;
+ public static final int CHAIN_TRANS_tr5_FROM_carsGreen2_TO_off_BY_timeoutTicktimer = 7;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_ControlPort__start = IFITEM_ControlPort + EVT_SHIFT*PedControlProtocol.IN_start;
public static final int TRIG_timer__timeoutTick = IFITEM_timer + EVT_SHIFT*PTimeout.OUT_timeoutTick;
@@ -108,35 +120,35 @@ public class Controller extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
- protected void action_TRANS_off_TO_carsGreen_BY_startControlPort(InterfaceItemBase ifitem) {
+ /* Action Codes */
+ protected void action_TRANS_tr0_FROM_off_TO_carsGreen_BY_startControlPort(InterfaceItemBase ifitem) {
timer.Start(700);
ControlPort.setCarLights(TrafficLight3.GREEN);
ControlPort.setPedLights(TrafficLight2.RED);
}
- protected void action_TRANS_carsGreen_TO_carsYellow_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr1_FROM_carsGreen_TO_carsYellow_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
timer.Start(700);
ControlPort.setCarLights(TrafficLight3.YELLOW);
ControlPort.setPedLights(TrafficLight2.RED);
}
- protected void action_TRANS_carsYellow_TO_carsRed_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr2_FROM_carsYellow_TO_carsRed_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
timer.Start(1500);
ControlPort.setCarLights(TrafficLight3.RED);
ControlPort.setPedLights(TrafficLight2.GREEN);
}
- protected void action_TRANS_carsRed_TO_carsYellowRed_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr3_FROM_carsRed_TO_carsYellowRed_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
timer.Start(700);
ControlPort.setCarLights(TrafficLight3.YELLOW_RED);
ControlPort.setPedLights(TrafficLight2.RED);
}
- protected void action_TRANS_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr4_FROM_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
timer.Start(700);
ControlPort.setCarLights(TrafficLight3.GREEN);
ControlPort.setPedLights(TrafficLight2.RED);
}
- protected void action_TRANS_carsGreen2_TO_off_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ protected void action_TRANS_tr5_FROM_carsGreen2_TO_off_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
ControlPort.setCarLights(TrafficLight3.OFF);
ControlPort.setPedLights(TrafficLight2.OFF);
}
@@ -192,34 +204,34 @@ public class Controller extends ActorClassBase {
{
return STATE_off;
}
- case CHAIN_TRANS_off_TO_carsGreen_BY_startControlPort:
+ case CHAIN_TRANS_tr0_FROM_off_TO_carsGreen_BY_startControlPort:
{
- action_TRANS_off_TO_carsGreen_BY_startControlPort(ifitem);
+ action_TRANS_tr0_FROM_off_TO_carsGreen_BY_startControlPort(ifitem);
return STATE_carsGreen;
}
- case CHAIN_TRANS_carsGreen_TO_carsYellow_BY_timeoutTicktimer:
+ case CHAIN_TRANS_tr1_FROM_carsGreen_TO_carsYellow_BY_timeoutTicktimer:
{
- action_TRANS_carsGreen_TO_carsYellow_BY_timeoutTicktimer(ifitem);
+ action_TRANS_tr1_FROM_carsGreen_TO_carsYellow_BY_timeoutTicktimer(ifitem);
return STATE_carsYellow;
}
- case CHAIN_TRANS_carsYellow_TO_carsRed_BY_timeoutTicktimer:
+ case CHAIN_TRANS_tr2_FROM_carsYellow_TO_carsRed_BY_timeoutTicktimer:
{
- action_TRANS_carsYellow_TO_carsRed_BY_timeoutTicktimer(ifitem);
+ action_TRANS_tr2_FROM_carsYellow_TO_carsRed_BY_timeoutTicktimer(ifitem);
return STATE_carsRed;
}
- case CHAIN_TRANS_carsRed_TO_carsYellowRed_BY_timeoutTicktimer:
+ case CHAIN_TRANS_tr3_FROM_carsRed_TO_carsYellowRed_BY_timeoutTicktimer:
{
- action_TRANS_carsRed_TO_carsYellowRed_BY_timeoutTicktimer(ifitem);
+ action_TRANS_tr3_FROM_carsRed_TO_carsYellowRed_BY_timeoutTicktimer(ifitem);
return STATE_carsYellowRed;
}
- case CHAIN_TRANS_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer:
+ case CHAIN_TRANS_tr4_FROM_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer:
{
- action_TRANS_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer(ifitem);
+ action_TRANS_tr4_FROM_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer(ifitem);
return STATE_carsGreen2;
}
- case CHAIN_TRANS_carsGreen2_TO_off_BY_timeoutTicktimer:
+ case CHAIN_TRANS_tr5_FROM_carsGreen2_TO_off_BY_timeoutTicktimer:
{
- action_TRANS_carsGreen2_TO_off_BY_timeoutTicktimer(ifitem);
+ action_TRANS_tr5_FROM_carsGreen2_TO_off_BY_timeoutTicktimer(ifitem);
return STATE_off;
}
}
@@ -281,62 +293,62 @@ public class Controller extends ActorClassBase {
switch (this.state) {
case STATE_off:
switch(trigger) {
- case TRIG_ControlPort__start:
- {
- chain = CHAIN_TRANS_off_TO_carsGreen_BY_startControlPort;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_ControlPort__start:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_off_TO_carsGreen_BY_startControlPort;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_carsGreen:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_carsGreen_TO_carsYellow_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_carsGreen_TO_carsYellow_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_carsYellow:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_carsYellow_TO_carsRed_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr2_FROM_carsYellow_TO_carsRed_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_carsRed:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_carsRed_TO_carsYellowRed_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr3_FROM_carsRed_TO_carsYellowRed_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_carsYellowRed:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr4_FROM_carsYellowRed_TO_carsGreen2_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_carsGreen2:
switch(trigger) {
- case TRIG_timer__timeoutTick:
- {
- chain = CHAIN_TRANS_carsGreen2_TO_off_BY_timeoutTicktimer;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr5_FROM_carsGreen2_TO_off_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/GuiAdapter.java b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/GuiAdapter.java
index dbff0f9fc..ee23b4545 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/GuiAdapter.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/GuiAdapter.java
@@ -11,29 +11,31 @@ import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import PedLightsController.PedControlProtocol.*;
-//--------------------- begin user code
- import org.eclipse.etrice.tutorials.PedLightGUI.*;
-//--------------------- end user code
+/*--------------------- begin user code ---------------------*/
+import org.eclipse.etrice.tutorials.PedLightGUI.*;
+/*--------------------- end user code ---------------------*/
public class GuiAdapter extends ActorClassBase {
- //--------------------- begin user code
- private PedestrianLightWndNoTcp lights = new PedestrianLightWndNoTcp("Pedestrian Lights"," external port connection ");
- private TrafficLight3 carLights;
- private TrafficLight2 pedLights;
- //--------------------- end user code
+ /*--------------------- begin user code ---------------------*/
+ private PedestrianLightWndNoTcp lights = new PedestrianLightWndNoTcp("Pedestrian Lights"," external port connection ");
+ private TrafficLight3 carLights;
+ private TrafficLight2 pedLights;
+ /*--------------------- end user code ---------------------*/
//--------------------- ports
protected PedControlProtocolConjPort ControlPort = null;
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_ControlPort = 1;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
public void destroyUser() {
lights.closeWindow();
}
@@ -47,10 +49,17 @@ public class GuiAdapter extends ActorClassBase {
// own ports
ControlPort = new PedControlProtocolConjPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PedControlProtocolConjPort getControlPort (){
+ return this.ControlPort;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -66,8 +75,7 @@ public class GuiAdapter extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -75,10 +83,11 @@ public class GuiAdapter extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__running = 1;
- public static final int CHAIN_TRANS_running_TO_running_BY_setCarLightsControlPort_tr0 = 2;
- public static final int CHAIN_TRANS_running_TO_running_BY_setPedLightsControlPort_tr1 = 3;
+ public static final int CHAIN_TRANS_tr0_FROM_running_TO_running_BY_setCarLightsControlPort_tr0 = 2;
+ public static final int CHAIN_TRANS_tr1_FROM_running_TO_running_BY_setPedLightsControlPort_tr1 = 3;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_ControlPort__setCarLights = IFITEM_ControlPort + EVT_SHIFT*PedControlProtocol.OUT_setCarLights;
public static final int TRIG_ControlPort__setPedLights = IFITEM_ControlPort + EVT_SHIFT*PedControlProtocol.OUT_setPedLights;
@@ -97,9 +106,9 @@ public class GuiAdapter extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
+ /* Action Codes */
protected void action_TRANS_INITIAL_TO__running() {
carLights=lights.getCarLights();
pedLights=lights.getPedLights();
@@ -107,10 +116,10 @@ public class GuiAdapter extends ActorClassBase {
pedLights.setState(TrafficLight2.OFF);
lights.setPort(ControlPort);
}
- protected void action_TRANS_running_TO_running_BY_setCarLightsControlPort_tr0(InterfaceItemBase ifitem, int state) {
+ protected void action_TRANS_tr0_FROM_running_TO_running_BY_setCarLightsControlPort_tr0(InterfaceItemBase ifitem, int state) {
carLights.setState(state);
}
- protected void action_TRANS_running_TO_running_BY_setPedLightsControlPort_tr1(InterfaceItemBase ifitem, int state) {
+ protected void action_TRANS_tr1_FROM_running_TO_running_BY_setPedLightsControlPort_tr1(InterfaceItemBase ifitem, int state) {
pedLights.setState(state);
}
@@ -146,16 +155,16 @@ public class GuiAdapter extends ActorClassBase {
action_TRANS_INITIAL_TO__running();
return STATE_running;
}
- case CHAIN_TRANS_running_TO_running_BY_setCarLightsControlPort_tr0:
+ case CHAIN_TRANS_tr0_FROM_running_TO_running_BY_setCarLightsControlPort_tr0:
{
int state = (Integer) generic_data;
- action_TRANS_running_TO_running_BY_setCarLightsControlPort_tr0(ifitem, state);
+ action_TRANS_tr0_FROM_running_TO_running_BY_setCarLightsControlPort_tr0(ifitem, state);
return STATE_running;
}
- case CHAIN_TRANS_running_TO_running_BY_setPedLightsControlPort_tr1:
+ case CHAIN_TRANS_tr1_FROM_running_TO_running_BY_setPedLightsControlPort_tr1:
{
int state = (Integer) generic_data;
- action_TRANS_running_TO_running_BY_setPedLightsControlPort_tr1(ifitem, state);
+ action_TRANS_tr1_FROM_running_TO_running_BY_setPedLightsControlPort_tr1(ifitem, state);
return STATE_running;
}
}
@@ -202,18 +211,18 @@ public class GuiAdapter extends ActorClassBase {
switch (this.state) {
case STATE_running:
switch(trigger) {
- case TRIG_ControlPort__setCarLights:
- {
- chain = CHAIN_TRANS_running_TO_running_BY_setCarLightsControlPort_tr0;
- catching_state = STATE_TOP;
- }
- break;
- case TRIG_ControlPort__setPedLights:
- {
- chain = CHAIN_TRANS_running_TO_running_BY_setPedLightsControlPort_tr1;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_ControlPort__setCarLights:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_running_TO_running_BY_setCarLightsControlPort_tr0;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_ControlPort__setPedLights:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_running_TO_running_BY_setPedLightsControlPort_tr1;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedControlProtocol.java b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedControlProtocol.java
index 4602341e3..a8d9bc050 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedControlProtocol.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedControlProtocol.java
@@ -35,7 +35,7 @@ public class PedControlProtocol {
static public class PedControlProtocolPort extends PortBase {
// constructors
public PedControlProtocolPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public PedControlProtocolPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -80,13 +80,13 @@ public class PedControlProtocol {
}
// replicated port class
- static public class PedControlProtocolPortRepl {
+ static public class PedControlProtocolReplPort {
private ArrayList<PedControlProtocolPort> ports;
private int replication;
- public PedControlProtocolPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public PedControlProtocolReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<PedControlProtocol.PedControlProtocolPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new PedControlProtocolPort(
@@ -124,7 +124,7 @@ public class PedControlProtocol {
static public class PedControlProtocolConjPort extends PortBase {
// constructors
public PedControlProtocolConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public PedControlProtocolConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -162,13 +162,13 @@ public class PedControlProtocol {
}
// replicated port class
- static public class PedControlProtocolConjPortRepl {
+ static public class PedControlProtocolConjReplPort {
private ArrayList<PedControlProtocolConjPort> ports;
private int replication;
- public PedControlProtocolConjPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public PedControlProtocolConjReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<PedControlProtocol.PedControlProtocolConjPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new PedControlProtocolConjPort(
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedLightsTop.java b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedLightsTop.java
index 2544472bd..0481c978f 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedLightsTop.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/PedLightsTop.java
@@ -16,13 +16,15 @@ public class PedLightsTop extends ActorClassBase {
//--------------------- ports
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public PedLightsTop(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -32,10 +34,14 @@ public class PedLightsTop extends ActorClassBase {
// initialize attributes
// own ports
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
//--------------------- lifecycle functions
public void init(){
@@ -51,8 +57,7 @@ public class PedLightsTop extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
//--------------------- no state machine
@Override
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/SubSys_PedLights.java b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/SubSys_PedLights.java
index 60a1a947c..1f00a869b 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/SubSys_PedLights.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PedLightsController/SubSys_PedLights.java
@@ -34,10 +34,10 @@ public class SubSys_PedLights extends SubSystemClassBase{
public void instantiateActors(){
// all addresses
// Addresses for the Subsystem Systemport
- Address addr_item_SystemPort_0 = new Address(0,0,109);
- Address addr_item_SystemPort_1 = new Address(0,0,110);
- Address addr_item_SystemPort_2 = new Address(0,0,111);
- Address addr_item_SystemPort_3 = new Address(0,0,112);
+ Address addr_item_SystemPort_0 = new Address(0,0,110);
+ Address addr_item_SystemPort_1 = new Address(0,0,111);
+ Address addr_item_SystemPort_2 = new Address(0,0,112);
+ Address addr_item_SystemPort_3 = new Address(0,0,113);
// actor instance /SubSys_PedLights/PedLightsTopRef itself => Systemport Address
// TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
@@ -77,9 +77,9 @@ public class SubSys_PedLights extends SubSystemClassBase{
"adapter",
// own interface item addresses
new Address[][] {{addr_item__SubSys_PedLights_PedLightsTopRef_adapter},
- {
- addr_item__SubSys_PedLights_PedLightsTopRef_adapter_ControlPort
- }
+ {
+ addr_item__SubSys_PedLights_PedLightsTopRef_adapter_ControlPort
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_1},
@@ -93,12 +93,12 @@ public class SubSys_PedLights extends SubSystemClassBase{
"controller",
// own interface item addresses
new Address[][] {{addr_item__SubSys_PedLights_PedLightsTopRef_controller},
- {
- addr_item__SubSys_PedLights_PedLightsTopRef_controller_ControlPort
- },
- {
- addr_item__SubSys_PedLights_PedLightsTopRef_controller_timer
- }
+ {
+ addr_item__SubSys_PedLights_PedLightsTopRef_controller_ControlPort
+ },
+ {
+ addr_item__SubSys_PedLights_PedLightsTopRef_controller_timer
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_2},
@@ -115,21 +115,21 @@ public class SubSys_PedLights extends SubSystemClassBase{
"timingService",
// own interface item addresses
new Address[][] {{addr_item__SubSys_PedLights_timingService},
- {
- },
- {
- addr_item__SubSys_PedLights_timingService_timeout_0
- }
+ {
+ addr_item__SubSys_PedLights_timingService_timeout_0
+ },
+ null
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_3},
{
- },
- {
addr_item__SubSys_PedLights_PedLightsTopRef_controller_timer
- }
+ },
+ null
}
);
+
+ // apply instance attribute configurations
// create the subsystem system port
RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPingActor.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPingActor.java
new file mode 100644
index 000000000..d7bb5bb67
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPingActor.java
@@ -0,0 +1,245 @@
+package PingPong;
+
+import org.eclipse.etrice.runtime.java.messaging.Address;
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
+import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+
+import room.basic.service.timing.*;
+
+import room.basic.service.timing.PTimeout.*;
+import PingPong.PingPongProtocol.*;
+
+
+
+public class MrPingActor extends ActorClassBase {
+
+
+ //--------------------- ports
+ protected PingPongProtocolConjReplPort PingPongPort = null;
+
+ //--------------------- saps
+ protected PTimeoutConjPort timer = null;
+
+ //--------------------- services
+
+ //--------------------- interface item IDs
+ public static final int IFITEM_PingPongPort = 1;
+ public static final int IFITEM_timer = 2;
+
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
+
+ //--------------------- construction
+ public MrPingActor(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
+ super(parent, name, port_addr[0][0], peer_addr[0][0]);
+ setClassName("MrPingActor");
+
+ // initialize attributes
+
+ // own ports
+ PingPongPort = new PingPongProtocolConjReplPort(this, "PingPongPort", IFITEM_PingPongPort, port_addr[IFITEM_PingPongPort], peer_addr[IFITEM_PingPongPort]);
+
+ // own saps
+ timer = new PTimeoutConjPort(this, "timer", IFITEM_timer, 0, port_addr[IFITEM_timer][0], peer_addr[IFITEM_timer][0]);
+
+ // own service implementations
+ }
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PingPongProtocolConjReplPort getPingPongPort (){
+ return this.PingPongPort;
+ }
+ public PTimeoutConjPort getTimer (){
+ return this.timer;
+ }
+
+ //--------------------- lifecycle functions
+ public void init(){
+ initUser();
+ }
+
+ public void start(){
+ startUser();
+ }
+
+ public void stop(){
+ stopUser();
+ }
+
+ public void destroy(){
+ }
+
+
+ /* state IDs */
+ public static final int STATE_waitForTimer = 2;
+ public static final int STATE_waitForPong = 3;
+
+ /* transition chains */
+ public static final int CHAIN_TRANS_INITIAL_TO__waitForTimer = 1;
+ public static final int CHAIN_TRANS_tr1_FROM_waitForTimer_TO_waitForPong_BY_timeoutTicktimer = 2;
+ public static final int CHAIN_TRANS_tr2_FROM_waitForPong_TO_waitForTimer_BY_pongPingPongPort = 3;
+
+ /* triggers */
+ public static final int POLLING = 0;
+ public static final int TRIG_PingPongPort__pong = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.OUT_pong;
+ public static final int TRIG_timer__timeoutTick = IFITEM_timer + EVT_SHIFT*PTimeout.OUT_timeoutTick;
+
+ // state names
+ protected static final String stateStrings[] = {"<no state>","<top>","waitForTimer",
+ "waitForPong"
+ };
+
+ // history
+ protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+
+ private void setState(int new_state) {
+ DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
+ if (stateStrings[new_state]!="Idle") {
+ System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
+ }
+ this.state = new_state;
+ }
+
+ /* Entry and Exit Codes */
+
+ /* Action Codes */
+ protected void action_TRANS_INITIAL_TO__waitForTimer() {
+ timer.Start(1000);
+ }
+ protected void action_TRANS_tr1_FROM_waitForTimer_TO_waitForPong_BY_timeoutTicktimer(InterfaceItemBase ifitem) {
+ PingPongPort.ping();
+ }
+ protected void action_TRANS_tr2_FROM_waitForPong_TO_waitForTimer_BY_pongPingPongPort(InterfaceItemBase ifitem) {
+ timer.Start(1000);
+ }
+
+ /**
+ * calls exit codes while exiting from the current state to one of its
+ * parent states while remembering the history
+ * @param current - the current state
+ * @param to - the final parent state
+ * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
+ */
+ private void exitTo(int current, int to, boolean handler) {
+ while (current!=to) {
+ switch (current) {
+ case STATE_waitForTimer:
+ this.history[STATE_TOP] = STATE_waitForTimer;
+ current = STATE_TOP;
+ break;
+ case STATE_waitForPong:
+ this.history[STATE_TOP] = STATE_waitForPong;
+ current = STATE_TOP;
+ break;
+ }
+ }
+ }
+
+ /**
+ * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
+ * matching the trigger of this chain. The ID of the final state is returned
+ * @param chain - the chain ID
+ * @param generic_data - the generic data pointer
+ * @return the ID of the final state
+ */
+ private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) {
+ switch (chain) {
+ case CHAIN_TRANS_INITIAL_TO__waitForTimer:
+ {
+ action_TRANS_INITIAL_TO__waitForTimer();
+ return STATE_waitForTimer;
+ }
+ case CHAIN_TRANS_tr1_FROM_waitForTimer_TO_waitForPong_BY_timeoutTicktimer:
+ {
+ action_TRANS_tr1_FROM_waitForTimer_TO_waitForPong_BY_timeoutTicktimer(ifitem);
+ return STATE_waitForPong;
+ }
+ case CHAIN_TRANS_tr2_FROM_waitForPong_TO_waitForTimer_BY_pongPingPongPort:
+ {
+ action_TRANS_tr2_FROM_waitForPong_TO_waitForTimer_BY_pongPingPongPort(ifitem);
+ return STATE_waitForTimer;
+ }
+ }
+ return NO_STATE;
+ }
+
+ /**
+ * calls entry codes while entering a state's history. The ID of the final leaf state is returned
+ * @param state - the state which is entered
+ * @param handler - entry code is executed if not handler
+ * @return - the ID of the final leaf state
+ */
+ private int enterHistory(int state, boolean handler, boolean skip_entry) {
+ while (true) {
+ switch (state) {
+ case STATE_waitForTimer:
+ // in leaf state: return state id
+ return STATE_waitForTimer;
+ case STATE_waitForPong:
+ // in leaf state: return state id
+ return STATE_waitForPong;
+ case STATE_TOP:
+ state = this.history[STATE_TOP];
+ break;
+ }
+ skip_entry = false;
+ }
+ //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true)
+ }
+
+ public void executeInitTransition() {
+ int chain = CHAIN_TRANS_INITIAL_TO__waitForTimer;
+ int next = executeTransitionChain(chain, null, null);
+ next = enterHistory(next, false, false);
+ setState(next);
+ }
+
+ /* receiveEvent contains the main implementation of the FSM */
+ public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) {
+ int trigger = ifitem.getLocalId() + EVT_SHIFT*evt;
+ int chain = NOT_CAUGHT;
+ int catching_state = NO_STATE;
+ boolean is_handler = false;
+ boolean skip_entry = false;
+
+ if (!handleSystemEvent(ifitem, evt, generic_data)) {
+ switch (this.state) {
+ case STATE_waitForTimer:
+ switch(trigger) {
+ case TRIG_timer__timeoutTick:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_waitForTimer_TO_waitForPong_BY_timeoutTicktimer;
+ catching_state = STATE_TOP;
+ }
+ break;
+ }
+ break;
+ case STATE_waitForPong:
+ switch(trigger) {
+ case TRIG_PingPongPort__pong:
+ {
+ chain = CHAIN_TRANS_tr2_FROM_waitForPong_TO_waitForTimer_BY_pongPingPongPort;
+ catching_state = STATE_TOP;
+ }
+ break;
+ }
+ break;
+ }
+ }
+ if (chain != NOT_CAUGHT) {
+ exitTo(this.state, catching_state, is_handler);
+ int next = executeTransitionChain(chain, ifitem, generic_data);
+ next = enterHistory(next, is_handler, skip_entry);
+ setState(next);
+ }
+ }
+
+ //******************************************
+ // END of generated code for FSM
+ //******************************************
+};
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPongActor1.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPongActor1.java
new file mode 100644
index 000000000..95e3b5e75
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/MrPongActor1.java
@@ -0,0 +1,204 @@
+package PingPong;
+
+import org.eclipse.etrice.runtime.java.messaging.Address;
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
+import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+
+
+import PingPong.PingPongProtocol.*;
+
+
+
+public class MrPongActor1 extends ActorClassBase {
+
+
+ //--------------------- ports
+ protected PingPongProtocolPort PingPongPort = null;
+
+ //--------------------- saps
+
+ //--------------------- services
+
+ //--------------------- interface item IDs
+ public static final int IFITEM_PingPongPort = 1;
+
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
+
+ //--------------------- construction
+ public MrPongActor1(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
+ super(parent, name, port_addr[0][0], peer_addr[0][0]);
+ setClassName("MrPongActor1");
+
+ // initialize attributes
+
+ // own ports
+ PingPongPort = new PingPongProtocolPort(this, "PingPongPort", IFITEM_PingPongPort, 0, port_addr[IFITEM_PingPongPort][0], peer_addr[IFITEM_PingPongPort][0]);
+
+ // own saps
+
+ // own service implementations
+ }
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PingPongProtocolPort getPingPongPort (){
+ return this.PingPongPort;
+ }
+
+ //--------------------- lifecycle functions
+ public void init(){
+ initUser();
+ }
+
+ public void start(){
+ startUser();
+ }
+
+ public void stop(){
+ stopUser();
+ }
+
+ public void destroy(){
+ }
+
+
+ /* state IDs */
+ public static final int STATE_waitForPing = 2;
+
+ /* transition chains */
+ public static final int CHAIN_TRANS_INITIAL_TO__waitForPing = 1;
+ public static final int CHAIN_TRANS_myTrigger_FROM_waitForPing_TO_waitForPing_BY_pingPingPongPort_myTrigger = 2;
+
+ /* triggers */
+ public static final int POLLING = 0;
+ public static final int TRIG_PingPongPort__ping = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.IN_ping;
+
+ // state names
+ protected static final String stateStrings[] = {"<no state>","<top>","waitForPing"
+ };
+
+ // history
+ protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+
+ private void setState(int new_state) {
+ DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
+ if (stateStrings[new_state]!="Idle") {
+ System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
+ }
+ this.state = new_state;
+ }
+
+ /* Entry and Exit Codes */
+
+ /* Action Codes */
+ protected void action_TRANS_myTrigger_FROM_waitForPing_TO_waitForPing_BY_pingPingPongPort_myTrigger(InterfaceItemBase ifitem) {
+ PingPongPort.pong();
+ }
+
+ /**
+ * calls exit codes while exiting from the current state to one of its
+ * parent states while remembering the history
+ * @param current - the current state
+ * @param to - the final parent state
+ * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
+ */
+ private void exitTo(int current, int to, boolean handler) {
+ while (current!=to) {
+ switch (current) {
+ case STATE_waitForPing:
+ this.history[STATE_TOP] = STATE_waitForPing;
+ current = STATE_TOP;
+ break;
+ }
+ }
+ }
+
+ /**
+ * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
+ * matching the trigger of this chain. The ID of the final state is returned
+ * @param chain - the chain ID
+ * @param generic_data - the generic data pointer
+ * @return the ID of the final state
+ */
+ private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) {
+ switch (chain) {
+ case CHAIN_TRANS_INITIAL_TO__waitForPing:
+ {
+ return STATE_waitForPing;
+ }
+ case CHAIN_TRANS_myTrigger_FROM_waitForPing_TO_waitForPing_BY_pingPingPongPort_myTrigger:
+ {
+ action_TRANS_myTrigger_FROM_waitForPing_TO_waitForPing_BY_pingPingPongPort_myTrigger(ifitem);
+ return STATE_waitForPing;
+ }
+ }
+ return NO_STATE;
+ }
+
+ /**
+ * calls entry codes while entering a state's history. The ID of the final leaf state is returned
+ * @param state - the state which is entered
+ * @param handler - entry code is executed if not handler
+ * @return - the ID of the final leaf state
+ */
+ private int enterHistory(int state, boolean handler, boolean skip_entry) {
+ while (true) {
+ switch (state) {
+ case STATE_waitForPing:
+ // in leaf state: return state id
+ return STATE_waitForPing;
+ case STATE_TOP:
+ state = this.history[STATE_TOP];
+ break;
+ }
+ skip_entry = false;
+ }
+ //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true)
+ }
+
+ public void executeInitTransition() {
+ int chain = CHAIN_TRANS_INITIAL_TO__waitForPing;
+ int next = executeTransitionChain(chain, null, null);
+ next = enterHistory(next, false, false);
+ setState(next);
+ }
+
+ /* receiveEvent contains the main implementation of the FSM */
+ public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) {
+ int trigger = ifitem.getLocalId() + EVT_SHIFT*evt;
+ int chain = NOT_CAUGHT;
+ int catching_state = NO_STATE;
+ boolean is_handler = false;
+ boolean skip_entry = false;
+
+ if (!handleSystemEvent(ifitem, evt, generic_data)) {
+ switch (this.state) {
+ case STATE_waitForPing:
+ switch(trigger) {
+ case TRIG_PingPongPort__ping:
+ {
+ chain = CHAIN_TRANS_myTrigger_FROM_waitForPing_TO_waitForPing_BY_pingPingPongPort_myTrigger;
+ catching_state = STATE_TOP;
+ }
+ break;
+ }
+ break;
+ }
+ }
+ if (chain != NOT_CAUGHT) {
+ exitTo(this.state, catching_state, is_handler);
+ int next = executeTransitionChain(chain, ifitem, generic_data);
+ next = enterHistory(next, is_handler, skip_entry);
+ setState(next);
+ }
+ }
+
+ //******************************************
+ // END of generated code for FSM
+ //******************************************
+};
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongProtocol.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongProtocol.java
new file mode 100644
index 000000000..b2be71926
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongProtocol.java
@@ -0,0 +1,186 @@
+package PingPong;
+
+import java.util.ArrayList;
+
+import org.eclipse.etrice.runtime.java.messaging.Address;
+import org.eclipse.etrice.runtime.java.messaging.Message;
+import org.eclipse.etrice.runtime.java.modelbase.*;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+
+
+
+public class PingPongProtocol {
+ // message IDs
+ public static final int MSG_MIN = 0;
+ public static final int OUT_pong = 1;
+ public static final int IN_ping = 2;
+ public static final int MSG_MAX = 3;
+
+
+ private static String messageStrings[] = {"MIN", "pong", "ping","MAX"};
+
+ public String getMessageString(int msg_id) {
+ if (msg_id<MSG_MIN || msg_id>MSG_MAX+1){
+ // id out of range
+ return "Message ID out of range";
+ }
+ else{
+ return messageStrings[msg_id];
+ }
+ }
+
+
+ // port class
+ static public class PingPongProtocolPort extends PortBase {
+ // constructors
+ public PingPongProtocolPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
+ this(actor, name, localId, 0, addr, peerAddress);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+ public PingPongProtocolPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
+ super(actor, name, localId, idx, addr, peerAddress);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ @Override
+ public void receive(Message m) {
+ if (!(m instanceof EventMessage))
+ return;
+ EventMessage msg = (EventMessage) m;
+ if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
+ System.out.println("unknown");
+ else {
+ if (messageStrings[msg.getEvtId()] != "timerTick"){
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ }
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
+ }
+ }
+
+
+ // sent messages
+ public void pong() {
+ if (messageStrings[ OUT_pong] != "timerTick"){
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_pong]);
+ }
+ if (getPeerAddress()!=null)
+ getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_pong));
+ }
+ }
+
+ // replicated port class
+ static public class PingPongProtocolReplPort {
+ private ArrayList<PingPongProtocolPort> ports;
+ private int replication;
+
+ public PingPongProtocolReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
+ Address[] peerAddress) {
+ replication = addr==null? 0:addr.length;
+ ports = new ArrayList<PingPongProtocol.PingPongProtocolPort>(replication);
+ for (int i=0; i<replication; ++i) {
+ ports.add(new PingPongProtocolPort(
+ actor, name+i, localId, i, addr[i], peerAddress[i]));
+ }
+ }
+
+ public int getReplication() {
+ return replication;
+ }
+
+ public int getIndexOf(InterfaceItemBase ifitem){
+ return ifitem.getIdx();
+ }
+
+ public PingPongProtocolPort get(int i) {
+ return ports.get(i);
+ }
+
+ // outgoing messages
+ public void pong(){
+ for (int i=0; i<replication; ++i) {
+ ports.get(i).pong();
+ }
+ }
+ }
+
+
+ // port class
+ static public class PingPongProtocolConjPort extends PortBase {
+ // constructors
+ public PingPongProtocolConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
+ this(actor, name, localId, 0, addr, peerAddress);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+ public PingPongProtocolConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
+ super(actor, name, localId, idx, addr, peerAddress);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ @Override
+ public void receive(Message m) {
+ if (!(m instanceof EventMessage))
+ return;
+ EventMessage msg = (EventMessage) m;
+ if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
+ System.out.println("unknown");
+ else {
+ if (messageStrings[msg.getEvtId()] != "timerTick"){
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ }
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
+ }
+ }
+
+
+ // sent messages
+ public void ping() {
+ if (messageStrings[ IN_ping] != "timerTick"){
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_ping]);
+ }
+ if (getPeerAddress()!=null)
+ getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_ping));
+ }
+ }
+
+ // replicated port class
+ static public class PingPongProtocolConjReplPort {
+ private ArrayList<PingPongProtocolConjPort> ports;
+ private int replication;
+
+ public PingPongProtocolConjReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
+ Address[] peerAddress) {
+ replication = addr==null? 0:addr.length;
+ ports = new ArrayList<PingPongProtocol.PingPongProtocolConjPort>(replication);
+ for (int i=0; i<replication; ++i) {
+ ports.add(new PingPongProtocolConjPort(
+ actor, name+i, localId, i, addr[i], peerAddress[i]));
+ }
+ }
+
+ public int getReplication() {
+ return replication;
+ }
+
+ public int getIndexOf(InterfaceItemBase ifitem){
+ return ifitem.getIdx();
+ }
+
+ public PingPongProtocolConjPort get(int i) {
+ return ports.get(i);
+ }
+
+ // incoming messages
+ public void ping(){
+ for (int i=0; i<replication; ++i) {
+ ports.get(i).ping();
+ }
+ }
+ }
+
+}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongTop.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongTop.java
new file mode 100644
index 000000000..30373b71c
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/PingPongTop.java
@@ -0,0 +1,71 @@
+package PingPong;
+
+import org.eclipse.etrice.runtime.java.messaging.Address;
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
+import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+
+
+
+
+
+public class PingPongTop extends ActorClassBase {
+
+
+ //--------------------- ports
+
+ //--------------------- saps
+
+ //--------------------- services
+
+ //--------------------- interface item IDs
+
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
+
+ //--------------------- construction
+ public PingPongTop(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
+ super(parent, name, port_addr[0][0], peer_addr[0][0]);
+ setClassName("PingPongTop");
+
+ // initialize attributes
+
+ // own ports
+
+ // own saps
+
+ // own service implementations
+ }
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+
+ //--------------------- lifecycle functions
+ public void init(){
+ initUser();
+ }
+
+ public void start(){
+ startUser();
+ }
+
+ public void stop(){
+ stopUser();
+ }
+
+ public void destroy(){
+ }
+
+ //--------------------- no state machine
+ @Override
+ public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) {
+ handleSystemEvent(ifitem, evt, data);
+ }
+
+ @Override
+ public void executeInitTransition(){
+ }
+};
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPong.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPong.java
new file mode 100644
index 000000000..b0af8667b
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPong.java
@@ -0,0 +1,155 @@
+package PingPong;
+
+import org.eclipse.etrice.runtime.java.messaging.MessageService;
+import org.eclipse.etrice.runtime.java.messaging.RTServices;
+import org.eclipse.etrice.runtime.java.messaging.Address;
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.RTSystemServicesProtocol.*;
+import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+
+import room.basic.service.timing.*;
+
+
+
+public class SubSystem_PingPong extends SubSystemClassBase{
+
+
+ public SubSystem_PingPong(IRTObject parent, String name) {
+ super(parent, name);
+ }
+
+ @Override
+ public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data){
+ }
+
+ @Override
+ public void instantiateMessageServices(){
+
+ RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, 0, 0),"MessageService_Main"));
+ RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, 1, 0),"MessageService_mrPingThread", 5));
+ RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, 2, 0),"MessageService_mrPong1Thread", 5));
+ }
+
+ @Override
+ public void instantiateActors(){
+ // all addresses
+ // Addresses for the Subsystem Systemport
+ Address addr_item_SystemPort_0 = new Address(0,0,111);
+ Address addr_item_SystemPort_1 = new Address(0,0,112);
+ Address addr_item_SystemPort_2 = new Address(0,0,113);
+ Address addr_item_SystemPort_3 = new Address(0,0,114);
+
+ // actor instance /SubSystem_PingPong/application itself => Systemport Address
+ // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
+ Address addr_item__SubSystem_PingPong_application = new Address(0,0,101);
+ // interface items of /SubSystem_PingPong/application
+ // actor instance /SubSystem_PingPong/application/MrPing itself => Systemport Address
+ // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
+ Address addr_item__SubSystem_PingPong_application_MrPing = new Address(0,1,102);
+ // interface items of /SubSystem_PingPong/application/MrPing
+ Address addr_item__SubSystem_PingPong_application_MrPing_PingPongPort_0 = new Address(0,0,103);
+ Address addr_item__SubSystem_PingPong_application_MrPing_timer = new Address(0,1,105);
+ // actor instance /SubSystem_PingPong/application/MrPong1 itself => Systemport Address
+ // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
+ Address addr_item__SubSystem_PingPong_application_MrPong1 = new Address(0,2,106);
+ // interface items of /SubSystem_PingPong/application/MrPong1
+ Address addr_item__SubSystem_PingPong_application_MrPong1_PingPongPort = new Address(0,2,107);
+ // actor instance /SubSystem_PingPong/services itself => Systemport Address
+ // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
+ Address addr_item__SubSystem_PingPong_services = new Address(0,0,108);
+ // interface items of /SubSystem_PingPong/services
+ Address addr_item__SubSystem_PingPong_services_timeout_0 = new Address(0,0,109);
+
+ // instantiate all actor instances
+ instances = new ActorClassBase[4];
+ instances[0] = new PingPongTop(
+ this,
+ "application",
+ // own interface item addresses
+ new Address[][] {{addr_item__SubSystem_PingPong_application}
+ },
+ // peer interface item addresses
+ new Address[][] {{addr_item_SystemPort_0}
+ }
+ );
+ instances[1] = new MrPingActor(
+ instances[0],
+ "MrPing",
+ // own interface item addresses
+ new Address[][] {{addr_item__SubSystem_PingPong_application_MrPing},
+ {
+ addr_item__SubSystem_PingPong_application_MrPing_PingPongPort_0
+ },
+ {
+ addr_item__SubSystem_PingPong_application_MrPing_timer
+ }
+ },
+ // peer interface item addresses
+ new Address[][] {{addr_item_SystemPort_1},
+ {
+ addr_item__SubSystem_PingPong_application_MrPong1_PingPongPort
+ },
+ {
+ addr_item__SubSystem_PingPong_services_timeout_0
+ }
+ }
+ );
+ instances[2] = new MrPongActor1(
+ instances[0],
+ "MrPong1",
+ // own interface item addresses
+ new Address[][] {{addr_item__SubSystem_PingPong_application_MrPong1},
+ {
+ addr_item__SubSystem_PingPong_application_MrPong1_PingPongPort
+ }
+ },
+ // peer interface item addresses
+ new Address[][] {{addr_item_SystemPort_2},
+ {
+ addr_item__SubSystem_PingPong_application_MrPing_PingPongPort_0
+ }
+ }
+ );
+ instances[3] = new ATimingService(
+ this,
+ "services",
+ // own interface item addresses
+ new Address[][] {{addr_item__SubSystem_PingPong_services},
+ {
+ addr_item__SubSystem_PingPong_services_timeout_0
+ },
+ null
+ },
+ // peer interface item addresses
+ new Address[][] {{addr_item_SystemPort_3},
+ {
+ addr_item__SubSystem_PingPong_application_MrPing_timer
+ },
+ null
+ }
+ );
+
+ // apply instance attribute configurations
+
+ // create the subsystem system port
+ RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
+ 0, //local ID
+ // own addresses
+ new Address[]{
+ addr_item_SystemPort_0,
+ addr_item_SystemPort_1,
+ addr_item_SystemPort_2,
+ addr_item_SystemPort_3
+ },
+ // peer addresses
+ new Address[]{
+ addr_item__SubSystem_PingPong_application,
+ addr_item__SubSystem_PingPong_application_MrPing,
+ addr_item__SubSystem_PingPong_application_MrPong1,
+ addr_item__SubSystem_PingPong_services
+ });
+
+ }
+};
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java
new file mode 100644
index 000000000..d840fd674
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java
@@ -0,0 +1,36 @@
+/**
+ * @author generated by eTrice
+ *
+ * this class contains the main function running component SubSystem_PingPong
+ * it instantiates SubSystem_PingPong and starts and ends the lifecycle
+ */
+
+package PingPong;
+
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemRunnerBase;
+
+class SubSystem_PingPongRunner extends SubSystemRunnerBase {
+
+ static SubSystem_PingPong main_component = new SubSystem_PingPong(null, "SubSystem_PingPong");
+
+ /**
+ * main function
+ * creates component and starts and stops the lifecycle
+ */
+ public static void main(String[] args) {
+
+ System.out.println("*** T H E B E G I N ***");
+
+ main_component.init(); // lifecycle init
+ main_component.start(); // lifecycle start
+
+ // application runs until quit
+ waitForQuit();
+
+ // end the lifecycle
+ main_component.stop(); // lifecycle stop
+ main_component.destroy(); // lifecycle destroy
+
+ System.out.println("*** T H E E N D ***");
+ }
+};
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/DemoData.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/DemoData.java
index 840bdb67e..d656faac2 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/DemoData.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/DemoData.java
@@ -6,11 +6,11 @@ package SendingData;
public class DemoData {
- //--------------------- attributes
- protected int int32Val;
- protected byte[] int8Array;
- protected double float64Val;
- protected String stringVal;
+ /*--------------------- attributes ---------------------*/
+ int int32Val;
+ byte int8Array[];
+ double float64Val;
+ String stringVal;
//--------------------- attribute setters and getters
public void setInt32Val (int int32Val) {
@@ -38,7 +38,7 @@ public class DemoData {
return this.stringVal;
}
- //--------------------- operations
+ /*--------------------- operations ---------------------*/
// default constructor
public DemoData() {
@@ -65,7 +65,7 @@ public class DemoData {
public DemoData deepCopy() {
DemoData copy = new DemoData();
copy.int32Val = int32Val;
- for (int i=0;i<10;i++){
+ for (int i=0;i<int8Array.length;i++){
copy.int8Array[i] = int8Array[i];
}
copy.float64Val = float64Val;
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPing.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPing.java
index ae333d4f5..ed2f3f09b 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPing.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPing.java
@@ -18,14 +18,16 @@ public class MrPing extends ActorClassBase {
//--------------------- ports
protected PingPongProtocolConjPort PingPongPort = null;
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_PingPongPort = 1;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
public void printData(DemoData d) {
System.out.printf("d.int32Val: %d\n",d.int32Val);
System.out.printf("d.float64Val: %f\n",d.float64Val);
@@ -44,10 +46,17 @@ public class MrPing extends ActorClassBase {
// own ports
PingPongPort = new PingPongProtocolConjPort(this, "PingPongPort", IFITEM_PingPongPort, 0, port_addr[IFITEM_PingPongPort][0], peer_addr[IFITEM_PingPongPort][0]);
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PingPongProtocolConjPort getPingPongPort (){
+ return this.PingPongPort;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -63,8 +72,7 @@ public class MrPing extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -73,11 +81,12 @@ public class MrPing extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__waitForPongSimple = 1;
- public static final int CHAIN_TRANS_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1 = 2;
- public static final int CHAIN_TRANS_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort = 3;
- public static final int CHAIN_TRANS_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2 = 4;
+ public static final int CHAIN_TRANS_next_FROM_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort = 2;
+ public static final int CHAIN_TRANS_wait1_FROM_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1 = 3;
+ public static final int CHAIN_TRANS_wait2_FROM_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2 = 4;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_PingPongPort__pong = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.OUT_pong;
public static final int TRIG_PingPongPort__pongSimple = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.OUT_pongSimple;
@@ -97,18 +106,18 @@ public class MrPing extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
- protected void action_TRANS_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2(InterfaceItemBase ifitem, DemoData data) {
+ /* Action Codes */
+ protected void action_TRANS_wait2_FROM_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2(InterfaceItemBase ifitem, DemoData data) {
printData(data);
}
- protected void action_TRANS_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1(InterfaceItemBase ifitem, int data) {
+ protected void action_TRANS_wait1_FROM_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1(InterfaceItemBase ifitem, int data) {
// keep in mind that MrPong increments
PingPongPort.pingSimple(data);
System.out.printf("data: %d\n",data);
}
- protected void action_TRANS_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort(InterfaceItemBase ifitem, int data) {
+ protected void action_TRANS_next_FROM_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort(InterfaceItemBase ifitem, int data) {
System.out.printf("data: %d\n",data);
DemoData d = new DemoData();
@@ -157,22 +166,22 @@ public class MrPing extends ActorClassBase {
*/
private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) {
switch (chain) {
- case CHAIN_TRANS_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2:
+ case CHAIN_TRANS_wait2_FROM_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2:
{
DemoData data = (DemoData) generic_data;
- action_TRANS_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2(ifitem, data);
+ action_TRANS_wait2_FROM_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2(ifitem, data);
return STATE_waitForPong;
}
- case CHAIN_TRANS_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1:
+ case CHAIN_TRANS_wait1_FROM_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1:
{
int data = (Integer) generic_data;
- action_TRANS_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1(ifitem, data);
+ action_TRANS_wait1_FROM_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1(ifitem, data);
return STATE_waitForPongSimple;
}
- case CHAIN_TRANS_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort:
+ case CHAIN_TRANS_next_FROM_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort:
{
int data = (Integer) generic_data;
- action_TRANS_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort(ifitem, data);
+ action_TRANS_next_FROM_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort(ifitem, data);
return STATE_waitForPong;
}
case CHAIN_TRANS_INITIAL_TO__waitForPongSimple:
@@ -227,30 +236,29 @@ public class MrPing extends ActorClassBase {
switch (this.state) {
case STATE_waitForPong:
switch(trigger) {
- case TRIG_PingPongPort__pong:
- {
- chain = CHAIN_TRANS_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_PingPongPort__pong:
+ {
+ chain = CHAIN_TRANS_wait2_FROM_waitForPong_TO_waitForPong_BY_pongPingPongPort_wait2;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
case STATE_waitForPongSimple:
switch(trigger) {
- case TRIG_PingPongPort__pongSimple:
- { int data = (Integer) generic_data;
- if (data < 10
- )
- {
- chain = CHAIN_TRANS_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1;
- catching_state = STATE_TOP;
- } else
- {
- chain = CHAIN_TRANS_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort;
- catching_state = STATE_TOP;
- }
- }
- break;
+ case TRIG_PingPongPort__pongSimple:
+ { int data = (Integer) generic_data;
+ if (data < 10)
+ {
+ chain = CHAIN_TRANS_wait1_FROM_waitForPongSimple_TO_waitForPongSimple_BY_pongSimplePingPongPort_wait1;
+ catching_state = STATE_TOP;
+ } else
+ {
+ chain = CHAIN_TRANS_next_FROM_waitForPongSimple_TO_waitForPong_BY_pongSimplePingPongPort;
+ catching_state = STATE_TOP;
+ }
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPong.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPong.java
index 86372deb1..416f08c1c 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPong.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/MrPong.java
@@ -18,14 +18,16 @@ public class MrPong extends ActorClassBase {
//--------------------- ports
protected PingPongProtocolPort PingPongPort = null;
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
public static final int IFITEM_PingPongPort = 1;
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public MrPong(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -36,10 +38,17 @@ public class MrPong extends ActorClassBase {
// own ports
PingPongPort = new PingPongProtocolPort(this, "PingPongPort", IFITEM_PingPongPort, 0, port_addr[IFITEM_PingPongPort][0], peer_addr[IFITEM_PingPongPort][0]);
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
+ public PingPongProtocolPort getPingPongPort (){
+ return this.PingPongPort;
+ }
//--------------------- lifecycle functions
public void init(){
@@ -55,8 +64,7 @@ public class MrPong extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
/* state IDs */
@@ -64,10 +72,11 @@ public class MrPong extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__looping = 1;
- public static final int CHAIN_TRANS_looping_TO_looping_BY_pingPingPongPort_tr0 = 2;
- public static final int CHAIN_TRANS_looping_TO_looping_BY_pingSimplePingPongPort_tr1 = 3;
+ public static final int CHAIN_TRANS_tr0_FROM_looping_TO_looping_BY_pingPingPongPort_tr0 = 2;
+ public static final int CHAIN_TRANS_tr1_FROM_looping_TO_looping_BY_pingSimplePingPongPort_tr1 = 3;
/* triggers */
+ public static final int POLLING = 0;
public static final int TRIG_PingPongPort__ping = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.IN_ping;
public static final int TRIG_PingPongPort__pingSimple = IFITEM_PingPongPort + EVT_SHIFT*PingPongProtocol.IN_pingSimple;
@@ -86,13 +95,13 @@ public class MrPong extends ActorClassBase {
this.state = new_state;
}
- //*** Entry and Exit Codes
+ /* Entry and Exit Codes */
- //*** Action Codes
- protected void action_TRANS_looping_TO_looping_BY_pingPingPongPort_tr0(InterfaceItemBase ifitem, DemoData data) {
+ /* Action Codes */
+ protected void action_TRANS_tr0_FROM_looping_TO_looping_BY_pingPingPongPort_tr0(InterfaceItemBase ifitem, DemoData data) {
PingPongPort.pong(data);
}
- protected void action_TRANS_looping_TO_looping_BY_pingSimplePingPongPort_tr1(InterfaceItemBase ifitem, int data) {
+ protected void action_TRANS_tr1_FROM_looping_TO_looping_BY_pingSimplePingPongPort_tr1(InterfaceItemBase ifitem, int data) {
PingPongPort.pongSimple(data+1);
}
@@ -127,16 +136,16 @@ public class MrPong extends ActorClassBase {
{
return STATE_looping;
}
- case CHAIN_TRANS_looping_TO_looping_BY_pingPingPongPort_tr0:
+ case CHAIN_TRANS_tr0_FROM_looping_TO_looping_BY_pingPingPongPort_tr0:
{
DemoData data = (DemoData) generic_data;
- action_TRANS_looping_TO_looping_BY_pingPingPongPort_tr0(ifitem, data);
+ action_TRANS_tr0_FROM_looping_TO_looping_BY_pingPingPongPort_tr0(ifitem, data);
return STATE_looping;
}
- case CHAIN_TRANS_looping_TO_looping_BY_pingSimplePingPongPort_tr1:
+ case CHAIN_TRANS_tr1_FROM_looping_TO_looping_BY_pingSimplePingPongPort_tr1:
{
int data = (Integer) generic_data;
- action_TRANS_looping_TO_looping_BY_pingSimplePingPongPort_tr1(ifitem, data);
+ action_TRANS_tr1_FROM_looping_TO_looping_BY_pingSimplePingPongPort_tr1(ifitem, data);
return STATE_looping;
}
}
@@ -183,18 +192,18 @@ public class MrPong extends ActorClassBase {
switch (this.state) {
case STATE_looping:
switch(trigger) {
- case TRIG_PingPongPort__ping:
- {
- chain = CHAIN_TRANS_looping_TO_looping_BY_pingPingPongPort_tr0;
- catching_state = STATE_TOP;
- }
- break;
- case TRIG_PingPongPort__pingSimple:
- {
- chain = CHAIN_TRANS_looping_TO_looping_BY_pingSimplePingPongPort_tr1;
- catching_state = STATE_TOP;
- }
- break;
+ case TRIG_PingPongPort__ping:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_looping_TO_looping_BY_pingPingPongPort_tr0;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_PingPongPort__pingSimple:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_looping_TO_looping_BY_pingSimplePingPongPort_tr1;
+ catching_state = STATE_TOP;
+ }
+ break;
}
break;
}
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/PingPongProtocol.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/PingPongProtocol.java
index eaa0e80ae..0a252d148 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/PingPongProtocol.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/PingPongProtocol.java
@@ -36,7 +36,7 @@ public class PingPongProtocol {
static public class PingPongProtocolPort extends PortBase {
// constructors
public PingPongProtocolPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public PingPongProtocolPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -84,13 +84,13 @@ public class PingPongProtocol {
}
// replicated port class
- static public class PingPongProtocolPortRepl {
+ static public class PingPongProtocolReplPort {
private ArrayList<PingPongProtocolPort> ports;
private int replication;
- public PingPongProtocolPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public PingPongProtocolReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<PingPongProtocol.PingPongProtocolPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new PingPongProtocolPort(
@@ -128,7 +128,7 @@ public class PingPongProtocol {
static public class PingPongProtocolConjPort extends PortBase {
// constructors
public PingPongProtocolConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
- super(actor, name, localId, 0, addr, peerAddress);
+ this(actor, name, localId, 0, addr, peerAddress);
DebuggingService.getInstance().addPortInstance(this);
}
public PingPongProtocolConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
@@ -176,13 +176,13 @@ public class PingPongProtocol {
}
// replicated port class
- static public class PingPongProtocolConjPortRepl {
+ static public class PingPongProtocolConjReplPort {
private ArrayList<PingPongProtocolConjPort> ports;
private int replication;
- public PingPongProtocolConjPortRepl(IEventReceiver actor, String name, int localId, Address[] addr,
+ public PingPongProtocolConjReplPort(IEventReceiver actor, String name, int localId, Address[] addr,
Address[] peerAddress) {
- replication = addr.length;
+ replication = addr==null? 0:addr.length;
ports = new ArrayList<PingPongProtocol.PingPongProtocolConjPort>(replication);
for (int i=0; i<replication; ++i) {
ports.add(new PingPongProtocolConjPort(
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingDataTop.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingDataTop.java
index be016b167..2a59b21fd 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingDataTop.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingDataTop.java
@@ -16,13 +16,15 @@ public class SendingDataTop extends ActorClassBase {
//--------------------- ports
+
//--------------------- saps
+
//--------------------- services
//--------------------- interface item IDs
- //--------------------- attributes
- //--------------------- operations
+ /*--------------------- attributes ---------------------*/
+ /*--------------------- operations ---------------------*/
//--------------------- construction
public SendingDataTop(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
@@ -32,10 +34,14 @@ public class SendingDataTop extends ActorClassBase {
// initialize attributes
// own ports
+
// own saps
+
// own service implementations
}
-
+ //--------------------- attributes getter and setter
+ //--------------------- attribute setters and getters
+ //--------------------- port getters
//--------------------- lifecycle functions
public void init(){
@@ -51,8 +57,7 @@ public class SendingDataTop extends ActorClassBase {
}
public void destroy(){
- destroyUser();
- }
+ }
//--------------------- no state machine
@Override
diff --git a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingData_SubSystem.java b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingData_SubSystem.java
index 20b905bfc..69ecf97d5 100644
--- a/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingData_SubSystem.java
+++ b/examples/org.eclipse.etrice.tutorials/src-gen/SendingData/SendingData_SubSystem.java
@@ -69,9 +69,9 @@ public class SendingData_SubSystem extends SubSystemClassBase{
"ref0",
// own interface item addresses
new Address[][] {{addr_item__SendingData_SubSystem_SendigDataTopRef_ref0},
- {
- addr_item__SendingData_SubSystem_SendigDataTopRef_ref0_PingPongPort
- }
+ {
+ addr_item__SendingData_SubSystem_SendigDataTopRef_ref0_PingPongPort
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_1},
@@ -85,9 +85,9 @@ public class SendingData_SubSystem extends SubSystemClassBase{
"ref1",
// own interface item addresses
new Address[][] {{addr_item__SendingData_SubSystem_SendigDataTopRef_ref1},
- {
- addr_item__SendingData_SubSystem_SendigDataTopRef_ref1_PingPongPort
- }
+ {
+ addr_item__SendingData_SubSystem_SendigDataTopRef_ref1_PingPongPort
+ }
},
// peer interface item addresses
new Address[][] {{addr_item_SystemPort_2},
@@ -96,6 +96,8 @@ public class SendingData_SubSystem extends SubSystemClassBase{
}
}
);
+
+ // apply instance attribute configurations
// create the subsystem system port
RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",

Back to the top