Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortschuetz2011-08-05 17:33:39 +0000
committertschuetz2011-08-05 17:33:39 +0000
commit48b93df983542066dbafd2377ba8a117727601d3 (patch)
treea157161725afa88f39da93e641c01b60c32bdedc
parent63b7437316b293ce3d2d4159dba69d7d23a9befe (diff)
downloadorg.eclipse.etrice-48b93df983542066dbafd2377ba8a117727601d3.tar.gz
org.eclipse.etrice-48b93df983542066dbafd2377ba8a117727601d3.tar.xz
org.eclipse.etrice-48b93df983542066dbafd2377ba8a117727601d3.zip
[doc] added table of contents to room-concepts and room-introduction
-rw-r--r--plugins/org.eclipse.etrice.doc/build/etrice.textile266
-rw-r--r--plugins/org.eclipse.etrice.doc/build/etrice.xml365
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/010-room-introduction.textile23
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/040-room-concepts.textile4
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/050-etrice-features.textile11
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html3
-rw-r--r--plugins/org.eclipse.etrice.doc/help/IntroductiontotheROOMLanguage.html28
-rw-r--r--plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html14
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Summary3.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.pngbin9756 -> 0 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/etrice.html532
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.pngbin9756 -> 0 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/manual/etrice.pdfbin2701349 -> 2947153 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/styles/xmpp.xsl4
-rw-r--r--plugins/org.eclipse.etrice.doc/toc.xml19
16 files changed, 1246 insertions, 27 deletions
diff --git a/plugins/org.eclipse.etrice.doc/build/etrice.textile b/plugins/org.eclipse.etrice.doc/build/etrice.textile
index 059f85413..a87601393 100644
--- a/plugins/org.eclipse.etrice.doc/build/etrice.textile
+++ b/plugins/org.eclipse.etrice.doc/build/etrice.textile
@@ -22,6 +22,29 @@ TODO
h1. Introduction to the ROOM Language
+h2. Scope of ROOM
+
+h2. Basic Concepts
+
+
+
+h2. Benefits
+
+h2. Execution Models
+
+h3. Logical Machine
+
+* run to completion
+
+h3. Queue Based Execution Model
+
+h3. Polled Execution Model
+not implemented yet
+
+h3. Hybrid Execution Model
+not implemented yet
+
+
h1. Tutorial HelloWorld
@@ -685,7 +708,6 @@ Open the Structure from SendingDataTop and add MrPing and MrPong as a reference.
The model is finished now and the model file should look like this:
-pre..
bc..
RoomModel SendingData {
@@ -889,7 +911,249 @@ In later versions of eTrice a additional mechanism to send references will be im
+h1. Tutorial Pedestrian Lights
+
+h2. Scope
+
+The scope of this tutorial is to demonstrate how to receive model messages from outside the model. Calling methods which are not part of the model is simple and you have already done this within the blinky tutorial (this is the other way round model => external code). Receiving events from outside the model is a very common problem and a very frequently asked question. Therefore this tutorial shows how an external event (outside the model) can be received from the model.
+
+This tutorial is not like hello world or blinky. Be familiar with the basic tool features is a precondition for this tutorial. The goal is to understand the mechanism not to learn the tool features.
+
+The idea behind the exercise is, to control a Pedestrian crossing light. We will use the same GUI as for the blinky tutorial but now we will use the ??REQUEST?? button to start a FSM, which controls the traffic lights.
+
+!images/020-Blinky08.PNG!
+
+The ??REQUEST?? must lead to a model message which starts the activity of the lights.
+
+There are a view possibilities to receive external events (e.g. TCP/UDP Socket, using OS messaging mechanism), but the easiest way is, to make a port usable from outside the model. To do that a view steps are necessary:
+# specify the messages (within a protocol) which should be sent into the model
+# model an actor with a port (which uses the specified protocol) and connect the port to the receiver
+# the external code should know the port (import of the port class)
+# the external code should provide a registration method, so that the actor is able to allow access to this port
+# the port can be used from the external code
+
+h2. Setup the model
+
+* Use the ??New Model Wizzard?? to create a new eTrice project and name it ??PedLightsController??.
+* Copy the package ??de.protos.PedLightGUI?? to your ??src?? directory (see blinky tutorial).
+* Uncoment line 15 (import), 36, 122 (usage) and 132-134 (registration).
+* Copy the following model to your model file:
+
+bc..
+RoomModel PedLightsController {
+
+ LogicalSystem LogSys_PedLights {
+ SubSystemRef application: SubSys_PedLights
+ }
+
+ SubSystemClass SubSys_PedLights {
+ ActorRef PedLightsTopRef: PedLightsTop
+ ActorRef timingService: room.basic.service.timing.ATimingService
+ LayerConnection ref PedLightsTopRef satisfied_by timingService.timer
+ LayerConnection ref PedLightsTopRef satisfied_by timingService.timeout
+ }
+
+ ActorClass PedLightsTop {
+ Structure {
+ ActorRef adapter: GuiAdapter
+ ActorRef controller: Controller
+ Binding adapter.ControlPort and controller.ControlPort
+ }
+ Behavior { }
+ }
+
+ ActorClass GuiAdapter {
+ Interface {
+ conjugated Port ControlPort: PedControlProtocol
+ }
+ Structure {
+ usercode1 {
+ "import PedLightGUI.*;"
+ }
+ usercode2 {
+ "private PedestrianLightWndNoTcp lights = new PedestrianLightWndNoTcp(\"Pedestrian Lights\",\" external port connection \");"
+ "private TrafficLight3 carLights;"
+ "private TrafficLight2 pedLights;"
+ }
+ external Port ControlPort
+ }
+ Behavior {
+ Operation destroyUser() {
+ "lights.closeWindow();"
+ }
+ StateMachine {
+ Transition init: initial -> running {
+ action {
+ "carLights=lights.getCarLights();"
+ "pedLights=lights.getPedLights();"
+ "carLights.setState(TrafficLight3.OFF);"
+ "pedLights.setState(TrafficLight2.OFF);"
+ "lights.setPort(ControlPort);"
+ }
+ }
+ Transition tr0: running -> running {
+ triggers {
+ <setCarLights: ControlPort>
+ }
+ action {
+ "carLights.setState(state);"
+ }
+ }
+ Transition tr1: running -> running {
+ triggers {
+ <setPedLights: ControlPort>
+ }
+ action {
+ "pedLights.setState(state);"
+ }
+ }
+ State running
+ }
+ }
+ }
+
+ ActorClass Controller {
+ Interface {
+ Port ControlPort: PedControlProtocol
+ }
+ Structure {
+ usercode1 {
+ "import PedLightGUI.*;"
+ }
+ external Port ControlPort
+ SAP timer: room.basic.service.timing.PTimeout
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> off { }
+ Transition tr0: off -> carsGreen {
+ triggers {
+ <start: ControlPort>
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr1: carsGreen -> carsYellow {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.YELLOW);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr2: carsYellow -> carsRed {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "timer.Start(1500);"
+ "ControlPort.setCarLights(TrafficLight3.RED);"
+ "ControlPort.setPedLights(TrafficLight2.GREEN);"
+ }
+ }
+ Transition tr3: carsRed -> carsYellowRed {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.YELLOW_RED);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr4: carsYellowRed -> carsGreen2 {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr5: carsGreen2 -> off {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "ControlPort.setCarLights(TrafficLight3.OFF);"
+ "ControlPort.setPedLights(TrafficLight2.OFF);"
+ }
+ }
+ State off
+ State carsGreen
+ State carsYellow
+ State carsRed
+ State carsYellowRed
+ State carsGreen2
+ }
+ }
+ }
+
+ ProtocolClass PedControlProtocol {
+ incoming {
+ Message start()
+ }
+ outgoing {
+ Message setCarLights(state: int32)
+ Message setPedLights(state: int32)
+ }
+ }
+}
+bq.
+
+* Arrange the Structure and the Statemachines to understand the model
+
+!images/030-PedLights01.PNG!
+The ??GuiAdapter?? represents the interface to the external code. It registers its ??ControlPort?? by the external code.
+
+!images/030-PedLights02.PNG!
+Visit the initial transition to understand the registration. The actor handles the incoming messages as usual and controls the traffic lights as known from blinky.
+
+!images/030-PedLights03.PNG!
+The ??Controller?? receives the ??start?? message and controls the timing of the lights. Note that the ??start?? message will be sent from the external code whenever the ??REQUEST?? button is pressed.
+
+* Visit the model and take a closer look to the following elements:
+# PedControlProtocol => notice that the start message is defined as usual
+# Initial transition of the ??GuiAdapter?? => see the registration
+# The ??Controller?? => notice that the ??Controller?? receives the external message (not the ??GuiAdapter??). The ??GuiAdapter?? just provides its port and handles the incoming messages.
+# Visit the hand written code => see the import statement of the protocol class and the usage of the port.
+
+* Generate and test the model
+* Take a look at the generated MSC => notice that the start message will shown as if the ??GuiAdapter?? had sent it.
+
+!images/030-PedLights04.PNG!
+
+h2. Why does it work and why is it save?
+
+The tutorial shows that it is generally possible to use every port from outside the model as long as the port knows its peer. This is guaranteed by describing protocol and the complete structure (especially the bindings) within the model.
+The only remaining question is: Why is it save and does not hurt the "run to completion" semantic. To answer this question, take a look at the ??MessageService.java?? from the runtime environment. There you will find the receive method which puts each message into the queue.
+
+bc..
+ @Override
+ public synchronized void receive(Message msg) {
+ if (msg!=null) {
+ messageQueue.push(msg);
+ notifyAll(); // wake up thread to compute message
+ }
+ }
+bq.
+
+This method is synchronized. That means, regardless who sends the message, the queue is secured. If we later on (e.g. for performance reasons in C/C++) distinguish between internal and external senders (same thread or not), care must be taken to use the external (secure) queue.
+
+
+
+
h1. ROOM Concepts
h2. Main Concepts
+h3. ActorClass
+h3. Port
+h3. Protocol
+
diff --git a/plugins/org.eclipse.etrice.doc/build/etrice.xml b/plugins/org.eclipse.etrice.doc/build/etrice.xml
index 3ee57b607..2abcc7663 100644
--- a/plugins/org.eclipse.etrice.doc/build/etrice.xml
+++ b/plugins/org.eclipse.etrice.doc/build/etrice.xml
@@ -24,6 +24,37 @@
</chapter>
<chapter id="IntroductiontotheROOMLanguage">
<title>Introduction to the ROOM Language</title>
+ <section id="ScopeofROOM">
+ <title>Scope of ROOM</title>
+ </section>
+ <section id="BasicConcepts">
+ <title>Basic Concepts</title>
+ </section>
+ <section id="Benefits">
+ <title>Benefits</title>
+ </section>
+ <section id="ExecutionModels">
+ <title>Execution Models</title>
+ <section id="LogicalMachine">
+ <title>Logical Machine</title>
+ <itemizedlist>
+ <listitem>
+ <para>run to completion</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="QueueBasedExecutionModel">
+ <title>Queue Based Execution Model</title>
+ </section>
+ <section id="PolledExecutionModel">
+ <title>Polled Execution Model
+ not implemented yet</title>
+ </section>
+ <section id="HybridExecutionModel">
+ <title>Hybrid Execution Model
+ not implemented yet</title>
+ </section>
+ </section>
</chapter>
<chapter id="TutorialHelloWorld">
<title>Tutorial HelloWorld</title>
@@ -1090,7 +1121,6 @@ carLights.setState(TrafficLight3.OFF);
</mediaobject>
</para>
<para>The model is finished now and the model file should look like this:</para>
- <literallayout></literallayout>
<literallayout><code>RoomModel SendingData {
LogicalSystem SendingData_LogSystem {
@@ -1300,10 +1330,341 @@ carLights.setState(TrafficLight3.OFF);
</para>
</section>
</chapter>
+ <chapter id="TutorialPedestrianLights">
+ <title>Tutorial Pedestrian Lights</title>
+ <section id="Scope4">
+ <title>Scope</title>
+ <para>The scope of this tutorial is to demonstrate how to receive model messages from outside the model. Calling methods which are not part of the model is simple and you have already done this within the blinky tutorial (this is the other way round model =&gt; external code). Receiving events from outside the model is a very common problem and a very frequently asked question. Therefore this tutorial shows how an external event (outside the model) can be received from the model.</para>
+ <para>This tutorial is not like hello world or blinky. Be familiar with the basic tool features is a precondition for this tutorial. The goal is to understand the mechanism not to learn the tool features.</para>
+ <para>The idea behind the exercise is, to control a Pedestrian crossing light. We will use the same GUI as for the blinky tutorial but now we will use the
+ <citation>REQUEST</citation> button to start a FSM, which controls the traffic lights.
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/020-Blinky08.PNG"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The
+ <citation>REQUEST</citation> must lead to a model message which starts the activity of the lights.
+ </para>
+ <para>There are a view possibilities to receive external events (e.g. TCP/UDP Socket, using OS messaging mechanism), but the easiest way is, to make a port usable from outside the model. To do that a view steps are necessary:</para>
+ <orderedlist>
+ <listitem>
+ <para>specify the messages (within a protocol) which should be sent into the model</para>
+ </listitem>
+ <listitem>
+ <para>model an actor with a port (which uses the specified protocol) and connect the port to the receiver </para>
+ </listitem>
+ <listitem>
+ <para>the external code should know the port (import of the port class)</para>
+ </listitem>
+ <listitem>
+ <para>the external code should provide a registration method, so that the actor is able to allow access to this port</para>
+ </listitem>
+ <listitem>
+ <para>the port can be used from the external code</para>
+ </listitem>
+ </orderedlist>
+ </section>
+ <section id="Setupthemodel">
+ <title>Setup the model</title>
+ <itemizedlist>
+ <listitem>
+ <para>Use the
+ <citation>New Model Wizzard</citation> to create a new eTrice project and name it
+ <citation>PedLightsController</citation>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Copy the package
+ <citation>de.protos.PedLightGUI</citation> to your
+ <citation>src</citation> directory (see blinky tutorial).
+ </para>
+ </listitem>
+ <listitem>
+ <para>Uncoment line 15 (import), 36, 122 (usage) and 132-134 (registration).</para>
+ </listitem>
+ <listitem>
+ <para>Copy the following model to your model file:</para>
+ </listitem>
+ </itemizedlist>
+ <literallayout><code>RoomModel PedLightsController {
+
+ LogicalSystem LogSys_PedLights {
+ SubSystemRef application: SubSys_PedLights
+ }
+
+ SubSystemClass SubSys_PedLights {
+ ActorRef PedLightsTopRef: PedLightsTop
+ ActorRef timingService: room.basic.service.timing.ATimingService
+ LayerConnection ref PedLightsTopRef satisfied_by timingService.timer
+ LayerConnection ref PedLightsTopRef satisfied_by timingService.timeout
+ }
+
+ ActorClass PedLightsTop {
+ Structure {
+ ActorRef adapter: GuiAdapter
+ ActorRef controller: Controller
+ Binding adapter.ControlPort and controller.ControlPort
+ }
+ Behavior { }
+ }
+
+ ActorClass GuiAdapter {
+ Interface {
+ conjugated Port ControlPort: PedControlProtocol
+ }
+ Structure {
+ usercode1 {
+ "import PedLightGUI.*;"
+ }
+ usercode2 {
+ "private PedestrianLightWndNoTcp lights = new PedestrianLightWndNoTcp(\"Pedestrian Lights\",\" external port connection \");"
+ "private TrafficLight3 carLights;"
+ "private TrafficLight2 pedLights;"
+ }
+ external Port ControlPort
+ }
+ Behavior {
+ Operation destroyUser() {
+ "lights.closeWindow();"
+ }
+ StateMachine {
+ Transition init: initial -&gt; running {
+ action {
+ "carLights=lights.getCarLights();"
+ "pedLights=lights.getPedLights();"
+ "carLights.setState(TrafficLight3.OFF);"
+ "pedLights.setState(TrafficLight2.OFF);"
+ "lights.setPort(ControlPort);"
+ }
+ }
+ Transition tr0: running -&gt; running {
+ triggers {
+ &lt;setCarLights: ControlPort&gt;
+ }
+ action {
+ "carLights.setState(state);"
+ }
+ }
+ Transition tr1: running -&gt; running {
+ triggers {
+ &lt;setPedLights: ControlPort&gt;
+ }
+ action {
+ "pedLights.setState(state);"
+ }
+ }
+ State running
+ }
+ }
+ }
+
+ ActorClass Controller {
+ Interface {
+ Port ControlPort: PedControlProtocol
+ }
+ Structure {
+ usercode1 {
+ "import PedLightGUI.*;"
+ }
+ external Port ControlPort
+ SAP timer: room.basic.service.timing.PTimeout
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -&gt; off { }
+ Transition tr0: off -&gt; carsGreen {
+ triggers {
+ &lt;start: ControlPort&gt;
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr1: carsGreen -&gt; carsYellow {
+ triggers {
+ &lt;timeoutTick: timer&gt;
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.YELLOW);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr2: carsYellow -&gt; carsRed {
+ triggers {
+ &lt;timeoutTick: timer&gt;
+ }
+ action {
+ "timer.Start(1500);"
+ "ControlPort.setCarLights(TrafficLight3.RED);"
+ "ControlPort.setPedLights(TrafficLight2.GREEN);"
+ }
+ }
+ Transition tr3: carsRed -&gt; carsYellowRed {
+ triggers {
+ &lt;timeoutTick: timer&gt;
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.YELLOW_RED);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr4: carsYellowRed -&gt; carsGreen2 {
+ triggers {
+ &lt;timeoutTick: timer&gt;
+ }
+ action {
+ "timer.Start(700);"
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"
+ "ControlPort.setPedLights(TrafficLight2.RED);"
+ }
+ }
+ Transition tr5: carsGreen2 -&gt; off {
+ triggers {
+ &lt;timeoutTick: timer&gt;
+ }
+ action {
+ "ControlPort.setCarLights(TrafficLight3.OFF);"
+ "ControlPort.setPedLights(TrafficLight2.OFF);"
+ }
+ }
+ State off
+ State carsGreen
+ State carsYellow
+ State carsRed
+ State carsYellowRed
+ State carsGreen2
+ }
+ }
+ }
+
+ ProtocolClass PedControlProtocol {
+ incoming {
+ Message start()
+ }
+ outgoing {
+ Message setCarLights(state: int32)
+ Message setPedLights(state: int32)
+ }
+ }
+}
+</code></literallayout>
+ <blockquote>
+ <para></para>
+ </blockquote>
+ <itemizedlist>
+ <listitem>
+ <para>Arrange the Structure and the Statemachines to understand the model </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/030-PedLights01.PNG"/>
+ </imageobject>
+ </mediaobject>
+ The
+ <citation>GuiAdapter</citation> represents the interface to the external code. It registers its
+ <citation>ControlPort</citation> by the external code.
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/030-PedLights02.PNG"/>
+ </imageobject>
+ </mediaobject>
+ Visit the initial transition to understand the registration. The actor handles the incoming messages as usual and controls the traffic lights as known from blinky.
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/030-PedLights03.PNG"/>
+ </imageobject>
+ </mediaobject>
+ The
+ <citation>Controller</citation> receives the
+ <citation>start</citation> message and controls the timing of the lights. Note that the
+ <citation>start</citation> message will be sent from the external code whenever the
+ <citation>REQUEST</citation> button is pressed.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para> Visit the model and take a closer look to the following elements:</para>
+ </listitem>
+ </itemizedlist>
+ <orderedlist>
+ <listitem>
+ <para>PedControlProtocol =&gt; notice that the start message is defined as usual</para>
+ </listitem>
+ <listitem>
+ <para>Initial transition of the
+ <citation>GuiAdapter</citation> =&gt; see the registration
+ </para>
+ </listitem>
+ <listitem>
+ <para>The
+ <citation>Controller</citation> =&gt; notice that the
+ <citation>Controller</citation> receives the external message (not the
+ <citation>GuiAdapter</citation>). The
+ <citation>GuiAdapter</citation> just provides its port and handles the incoming messages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Visit the hand written code =&gt; see the import statement of the protocol class and the usage of the port.</para>
+ </listitem>
+ </orderedlist>
+ <itemizedlist>
+ <listitem>
+ <para>Generate and test the model</para>
+ </listitem>
+ <listitem>
+ <para>Take a look at the generated MSC =&gt; notice that the start message will shown as if the
+ <citation>GuiAdapter</citation> had sent it.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/030-PedLights04.PNG"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section id="Whydoesitworkandwhyisitsave">
+ <title>Why does it work and why is it save?</title>
+ <para>The tutorial shows that it is generally possible to use every port from outside the model as long as the port knows its peer. This is guaranteed by describing protocol and the complete structure (especially the bindings) within the model.
+ The only remaining question is: Why is it save and does not hurt the &#8222;run to completion” semantic. To answer this question, take a look at the
+ <citation>MessageService.java</citation> from the runtime environment. There you will find the receive method which puts each message into the queue.
+ </para>
+ <literallayout><code> @Override
+ public synchronized void receive(Message msg) {
+ if (msg!=null) {
+ messageQueue.push(msg);
+ notifyAll(); // wake up thread to compute message
+ }
+ }
+</code></literallayout>
+ <blockquote>
+ <para></para>
+ </blockquote>
+ <para>This method is synchronized. That means, regardless who sends the message, the queue is secured. If we later on (e.g. for performance reasons in C/C++) distinguish between internal and external senders (same thread or not), care must be taken to use the external (secure) queue.</para>
+ </section>
+ </chapter>
<chapter id="ROOMConcepts">
<title>ROOM Concepts</title>
<section id="MainConcepts">
- <title>Main Concepts</title>
+ <title>Main Concepts
+ h3. ActorClass
+ h3. Port
+ h3. Protocol</title>
</section>
</chapter>
</book> \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.doc/doc/010-room-introduction.textile b/plugins/org.eclipse.etrice.doc/doc/010-room-introduction.textile
index 1c7b9db23..1512863dd 100644
--- a/plugins/org.eclipse.etrice.doc/doc/010-room-introduction.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/010-room-introduction.textile
@@ -1,2 +1,25 @@
h1. Introduction to the ROOM Language
+h2. Scope of ROOM
+
+h2. Basic Concepts
+
+
+
+h2. Benefits
+
+h2. Execution Models
+
+h3. Logical Machine
+
+* run to completion
+
+h3. Queue Based Execution Model
+
+h3. Polled Execution Model
+not implemented yet
+
+h3. Hybrid Execution Model
+not implemented yet
+
+
diff --git a/plugins/org.eclipse.etrice.doc/doc/040-room-concepts.textile b/plugins/org.eclipse.etrice.doc/doc/040-room-concepts.textile
index 12c328c7e..4334ff519 100644
--- a/plugins/org.eclipse.etrice.doc/doc/040-room-concepts.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/040-room-concepts.textile
@@ -1,3 +1,7 @@
h1. ROOM Concepts
h2. Main Concepts
+h3. ActorClass
+h3. Port
+h3. Protocol
+
diff --git a/plugins/org.eclipse.etrice.doc/doc/050-etrice-features.textile b/plugins/org.eclipse.etrice.doc/doc/050-etrice-features.textile
index c87458ce8..c7412ef40 100644
--- a/plugins/org.eclipse.etrice.doc/doc/050-etrice-features.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/050-etrice-features.textile
@@ -1 +1,10 @@
-h1. eTrice Features \ No newline at end of file
+h1. eTrice Features
+
+h2. Codegenerators
+
+h3. Java Generator
+
+h3. C++ Generator
+
+h3. C Generator
+
diff --git a/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html b/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
index 390b779d6..f902556fe 100644
--- a/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
+++ b/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
@@ -31,9 +31,6 @@
</p>
<p>The model is finished now and the model file should look like this:</p>
<div class="literallayout">
-<p></p>
-</div>
-<div class="literallayout">
<p>
<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
diff --git a/plugins/org.eclipse.etrice.doc/help/IntroductiontotheROOMLanguage.html b/plugins/org.eclipse.etrice.doc/help/IntroductiontotheROOMLanguage.html
index f20acff33..c73d63090 100644
--- a/plugins/org.eclipse.etrice.doc/help/IntroductiontotheROOMLanguage.html
+++ b/plugins/org.eclipse.etrice.doc/help/IntroductiontotheROOMLanguage.html
@@ -7,7 +7,7 @@
<link rel="home" href="index.html" title="eTrice User Guide">
<link rel="up" href="index.html" title="eTrice User Guide">
<link rel="prev" href="WhoisBehindeTrice.html" title="Who is Behind eTrice?">
-<link rel="next" href="TutorialHelloWorld.html" title="Tutorial HelloWorld">
+<link rel="next" href="BasicConcepts.html" title="Basic Concepts">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Introduction to the ROOM Language</h1>
@@ -20,6 +20,32 @@
</div>
</div>
</div>
+<div class="toc">
+<dl>
+<dt>
+<span class="section"><a href="IntroductiontotheROOMLanguage.html#ScopeofROOM">Scope of ROOM</a></span>
+</dt>
+<dt>
+<span class="section"><a href="BasicConcepts.html">Basic Concepts</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Benefits.html">Benefits</a></span>
+</dt>
+<dt>
+<span class="section"><a href="ExecutionModels.html">Execution Models</a></span>
+</dt>
+</dl>
+</div>
+<div class="section" title="Scope of ROOM">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="ScopeofROOM"></a>Scope of ROOM</h2>
+</div>
+</div>
+</div>
+</div>
</div>
</body>
</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html b/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html
index f0b4e564f..72db096d8 100644
--- a/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html
+++ b/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html
@@ -6,7 +6,7 @@
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="eTrice User Guide">
<link rel="up" href="index.html" title="eTrice User Guide">
-<link rel="prev" href="Summary3.html" title="Summary">
+<link rel="prev" href="Whydoesitworkandwhyisitsave.html" title="Why does it work and why is it save?">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">ROOM Concepts</h1>
@@ -22,16 +22,22 @@
<div class="toc">
<dl>
<dt>
-<span class="section"><a href="ROOMConcepts.html#MainConcepts">Main Concepts</a></span>
+<span class="section"><a href="ROOMConcepts.html#MainConcepts">Main Concepts
+ h3. ActorClass
+ h3. Port
+ h3. Protocol</a></span>
</dt>
</dl>
</div>
-<div class="section" title="Main Concepts">
+<div class="section" title="Main Concepts h3. ActorClass h3. Port h3. Protocol">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
-<a name="MainConcepts"></a>Main Concepts</h2>
+<a name="MainConcepts"></a>Main Concepts
+ h3. ActorClass
+ h3. Port
+ h3. Protocol</h2>
</div>
</div>
</div>
diff --git a/plugins/org.eclipse.etrice.doc/help/Summary3.html b/plugins/org.eclipse.etrice.doc/help/Summary3.html
index feb52d27a..0893c9d08 100644
--- a/plugins/org.eclipse.etrice.doc/help/Summary3.html
+++ b/plugins/org.eclipse.etrice.doc/help/Summary3.html
@@ -7,7 +7,7 @@
<link rel="home" href="index.html" title="eTrice User Guide">
<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
<link rel="prev" href="Generateandrunthemodel.html" title="Generate and run the model">
-<link rel="next" href="ROOMConcepts.html" title="ROOM Concepts">
+<link rel="next" href="TutorialPedestrianLights.html" title="Tutorial Pedestrian Lights">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Summary</h1>
diff --git a/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html b/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
index d2275bf8d..a20f114eb 100644
--- a/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
+++ b/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
@@ -6,7 +6,7 @@
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="eTrice User Guide">
<link rel="up" href="index.html" title="eTrice User Guide">
-<link rel="prev" href="IntroductiontotheROOMLanguage.html" title="Introduction to the ROOM Language">
+<link rel="prev" href="ExecutionModels.html" title="Execution Models">
<link rel="next" href="Createanewmodelfromscratch.html" title="Create a new model from scratch">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
diff --git a/plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.png b/plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.png
deleted file mode 100644
index b178015e3..000000000
--- a/plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.png
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/etrice.html b/plugins/org.eclipse.etrice.doc/html/etrice.html
index a31da9355..5d68b03d5 100644
--- a/plugins/org.eclipse.etrice.doc/html/etrice.html
+++ b/plugins/org.eclipse.etrice.doc/html/etrice.html
@@ -43,6 +43,22 @@
<dt>
<span class="chapter"><a href="#IntroductiontotheROOMLanguage">2. Introduction to the ROOM Language</a></span>
</dt>
+<dd>
+<dl>
+<dt>
+<span class="section"><a href="#ScopeofROOM">Scope of ROOM</a></span>
+</dt>
+<dt>
+<span class="section"><a href="#BasicConcepts">Basic Concepts</a></span>
+</dt>
+<dt>
+<span class="section"><a href="#Benefits">Benefits</a></span>
+</dt>
+<dt>
+<span class="section"><a href="#ExecutionModels">Execution Models</a></span>
+</dt>
+</dl>
+</dd>
<dt>
<span class="chapter"><a href="#TutorialHelloWorld">3. Tutorial HelloWorld</a></span>
</dt>
@@ -134,12 +150,31 @@
</dl>
</dd>
<dt>
-<span class="chapter"><a href="#ROOMConcepts">6. ROOM Concepts</a></span>
+<span class="chapter"><a href="#TutorialPedestrianLights">6. Tutorial Pedestrian Lights</a></span>
+</dt>
+<dd>
+<dl>
+<dt>
+<span class="section"><a href="#Scope4">Scope</a></span>
+</dt>
+<dt>
+<span class="section"><a href="#Setupthemodel">Setup the model</a></span>
+</dt>
+<dt>
+<span class="section"><a href="#Whydoesitworkandwhyisitsave">Why does it work and why is it save?</a></span>
+</dt>
+</dl>
+</dd>
+<dt>
+<span class="chapter"><a href="#ROOMConcepts">7. ROOM Concepts</a></span>
</dt>
<dd>
<dl>
<dt>
-<span class="section"><a href="#MainConcepts">Main Concepts</a></span>
+<span class="section"><a href="#MainConcepts">Main Concepts
+ h3. ActorClass
+ h3. Port
+ h3. Protocol</a></span>
</dt>
</dl>
</dd>
@@ -210,6 +245,95 @@
</div>
</div>
</div>
+<div class="section" title="Scope of ROOM">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="ScopeofROOM"></a>Scope of ROOM</h2>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="Basic Concepts">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="BasicConcepts"></a>Basic Concepts</h2>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="Benefits">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Benefits"></a>Benefits</h2>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="Execution Models">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="ExecutionModels"></a>Execution Models</h2>
+</div>
+</div>
+</div>
+<div class="section" title="Logical Machine">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="LogicalMachine"></a>Logical Machine</h3>
+</div>
+</div>
+</div>
+<div class="itemizedlist">
+<ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p>run to completion</p>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" title="Queue Based Execution Model">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="QueueBasedExecutionModel"></a>Queue Based Execution Model</h3>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="Polled Execution Model not implemented yet">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="PolledExecutionModel"></a>Polled Execution Model
+ not implemented yet</h3>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="Hybrid Execution Model not implemented yet">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="HybridExecutionModel"></a>Hybrid Execution Model
+ not implemented yet</h3>
+</div>
+</div>
+</div>
+</div>
+</div>
</div>
<div class="chapter" title="Chapter&nbsp;3.&nbsp;Tutorial HelloWorld">
<div class="titlepage">
@@ -1622,9 +1746,6 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</p>
<p>The model is finished now and the model file should look like this:</p>
<div class="literallayout">
-<p></p>
-</div>
-<div class="literallayout">
<p>
<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
@@ -1863,21 +1984,414 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</p>
</div>
</div>
-<div class="chapter" title="Chapter&nbsp;6.&nbsp;ROOM Concepts">
+<div class="chapter" title="Chapter&nbsp;6.&nbsp;Tutorial Pedestrian Lights">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title">
+<a name="TutorialPedestrianLights"></a>Chapter&nbsp;6.&nbsp;Tutorial Pedestrian Lights</h2>
+</div>
+</div>
+</div>
+<div class="section" title="Scope">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Scope4"></a>Scope</h2>
+</div>
+</div>
+</div>
+<p>The scope of this tutorial is to demonstrate how to receive model messages from outside the model. Calling methods which are not part of the model is simple and you have already done this within the blinky tutorial (this is the other way round model =&gt; external code). Receiving events from outside the model is a very common problem and a very frequently asked question. Therefore this tutorial shows how an external event (outside the model) can be received from the model.</p>
+<p>This tutorial is not like hello world or blinky. Be familiar with the basic tool features is a precondition for this tutorial. The goal is to understand the mechanism not to learn the tool features.</p>
+<p>The idea behind the exercise is, to control a Pedestrian crossing light. We will use the same GUI as for the blinky tutorial but now we will use the
+ [<span class="citation">REQUEST</span>] button to start a FSM, which controls the traffic lights.
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/020-Blinky08.PNG"></div>
+<p>
+
+</p>
+<p>The
+ [<span class="citation">REQUEST</span>] must lead to a model message which starts the activity of the lights.
+ </p>
+<p>There are a view possibilities to receive external events (e.g. TCP/UDP Socket, using OS messaging mechanism), but the easiest way is, to make a port usable from outside the model. To do that a view steps are necessary:</p>
+<div class="orderedlist">
+<ol class="orderedlist" type="1">
+<li class="listitem">
+<p>specify the messages (within a protocol) which should be sent into the model</p>
+</li>
+<li class="listitem">
+<p>model an actor with a port (which uses the specified protocol) and connect the port to the receiver </p>
+</li>
+<li class="listitem">
+<p>the external code should know the port (import of the port class)</p>
+</li>
+<li class="listitem">
+<p>the external code should provide a registration method, so that the actor is able to allow access to this port</p>
+</li>
+<li class="listitem">
+<p>the port can be used from the external code</p>
+</li>
+</ol>
+</div>
+</div>
+<div class="section" title="Setup the model">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Setupthemodel"></a>Setup the model</h2>
+</div>
+</div>
+</div>
+<div class="itemizedlist">
+<ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p>Use the
+ [<span class="citation">New Model Wizzard</span>] to create a new eTrice project and name it
+ [<span class="citation">PedLightsController</span>].
+ </p>
+</li>
+<li class="listitem">
+<p>Copy the package
+ [<span class="citation">de.protos.PedLightGUI</span>] to your
+ [<span class="citation">src</span>] directory (see blinky tutorial).
+ </p>
+</li>
+<li class="listitem">
+<p>Uncoment line 15 (import), 36, 122 (usage) and 132-134 (registration).</p>
+</li>
+<li class="listitem">
+<p>Copy the following model to your model file:</p>
+</li>
+</ul>
+</div>
+<div class="literallayout">
+<p>
+<code class="code">RoomModel&nbsp;PedLightsController&nbsp;{<br>
+
+<br>
+ LogicalSystem&nbsp;LogSys_PedLights&nbsp;{<br>
+ SubSystemRef&nbsp;application:&nbsp;SubSys_PedLights<br>
+ }<br>
+
+<br>
+ SubSystemClass&nbsp;SubSys_PedLights&nbsp;{<br>
+ ActorRef&nbsp;PedLightsTopRef:&nbsp;PedLightsTop<br>
+ ActorRef&nbsp;timingService:&nbsp;room.basic.service.timing.ATimingService<br>
+ LayerConnection&nbsp;ref&nbsp;PedLightsTopRef&nbsp;satisfied_by&nbsp;timingService.timer<br>
+ LayerConnection&nbsp;ref&nbsp;PedLightsTopRef&nbsp;satisfied_by&nbsp;timingService.timeout<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;PedLightsTop&nbsp;{<br>
+ Structure&nbsp;{<br>
+ ActorRef&nbsp;adapter:&nbsp;GuiAdapter<br>
+ ActorRef&nbsp;controller:&nbsp;Controller<br>
+ Binding&nbsp;adapter.ControlPort&nbsp;and&nbsp;controller.ControlPort<br>
+ }<br>
+ Behavior&nbsp;{&nbsp;}<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;GuiAdapter&nbsp;{<br>
+ Interface&nbsp;{<br>
+ conjugated&nbsp;Port&nbsp;ControlPort:&nbsp;PedControlProtocol<br>
+ }<br>
+ Structure&nbsp;{<br>
+ usercode1&nbsp;{<br>
+ "import&nbsp;PedLightGUI.*;"<br>
+ }<br>
+ usercode2&nbsp;{<br>
+ "private&nbsp;PedestrianLightWndNoTcp&nbsp;lights&nbsp;=&nbsp;new&nbsp;PedestrianLightWndNoTcp(\"Pedestrian&nbsp;Lights\",\"&nbsp;&nbsp;external&nbsp;port&nbsp;connection&nbsp;\");"<br>
+ "private&nbsp;TrafficLight3&nbsp;carLights;"<br>
+ "private&nbsp;TrafficLight2&nbsp;pedLights;"<br>
+ }<br>
+ external&nbsp;Port&nbsp;ControlPort<br>
+ }<br>
+ Behavior&nbsp;{<br>
+ Operation&nbsp;destroyUser()&nbsp;{<br>
+ "lights.closeWindow();"<br>
+ }<br>
+ StateMachine&nbsp;{<br>
+ Transition&nbsp;init:&nbsp;initial&nbsp;-&gt;&nbsp;running&nbsp;{<br>
+ action&nbsp;{<br>
+ "carLights=lights.getCarLights();"<br>
+ "pedLights=lights.getPedLights();"<br>
+ "carLights.setState(TrafficLight3.OFF);"<br>
+ "pedLights.setState(TrafficLight2.OFF);"<br>
+ "lights.setPort(ControlPort);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr0:&nbsp;running&nbsp;-&gt;&nbsp;running&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;setCarLights:&nbsp;ControlPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "carLights.setState(state);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr1:&nbsp;running&nbsp;-&gt;&nbsp;running&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;setPedLights:&nbsp;ControlPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "pedLights.setState(state);"<br>
+ }<br>
+ }<br>
+ State&nbsp;running<br>
+ }<br>
+ }<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;Controller&nbsp;{<br>
+ Interface&nbsp;{<br>
+ Port&nbsp;ControlPort:&nbsp;PedControlProtocol<br>
+ }<br>
+ Structure&nbsp;{<br>
+ usercode1&nbsp;{<br>
+ "import&nbsp;PedLightGUI.*;"<br>
+ }<br>
+ external&nbsp;Port&nbsp;ControlPort<br>
+ SAP&nbsp;timer:&nbsp;room.basic.service.timing.PTimeout<br>
+ }<br>
+ Behavior&nbsp;{<br>
+ StateMachine&nbsp;{<br>
+ Transition&nbsp;init:&nbsp;initial&nbsp;-&gt;&nbsp;off&nbsp;{&nbsp;}<br>
+ Transition&nbsp;tr0:&nbsp;off&nbsp;-&gt;&nbsp;carsGreen&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;start:&nbsp;ControlPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "timer.Start(700);"<br>
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"<br>
+ "ControlPort.setPedLights(TrafficLight2.RED);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr1:&nbsp;carsGreen&nbsp;-&gt;&nbsp;carsYellow&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;timeoutTick:&nbsp;timer&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "timer.Start(700);"<br>
+ "ControlPort.setCarLights(TrafficLight3.YELLOW);"<br>
+ "ControlPort.setPedLights(TrafficLight2.RED);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr2:&nbsp;carsYellow&nbsp;-&gt;&nbsp;carsRed&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;timeoutTick:&nbsp;timer&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "timer.Start(1500);"<br>
+ "ControlPort.setCarLights(TrafficLight3.RED);"<br>
+ "ControlPort.setPedLights(TrafficLight2.GREEN);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr3:&nbsp;carsRed&nbsp;-&gt;&nbsp;carsYellowRed&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;timeoutTick:&nbsp;timer&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "timer.Start(700);"<br>
+ "ControlPort.setCarLights(TrafficLight3.YELLOW_RED);"<br>
+ "ControlPort.setPedLights(TrafficLight2.RED);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr4:&nbsp;carsYellowRed&nbsp;-&gt;&nbsp;carsGreen2&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;timeoutTick:&nbsp;timer&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "timer.Start(700);"<br>
+ "ControlPort.setCarLights(TrafficLight3.GREEN);"<br>
+ "ControlPort.setPedLights(TrafficLight2.RED);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr5:&nbsp;carsGreen2&nbsp;-&gt;&nbsp;off&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;timeoutTick:&nbsp;timer&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "ControlPort.setCarLights(TrafficLight3.OFF);"<br>
+ "ControlPort.setPedLights(TrafficLight2.OFF);"<br>
+ }<br>
+ }<br>
+ State&nbsp;off<br>
+ State&nbsp;carsGreen<br>
+ State&nbsp;carsYellow<br>
+ State&nbsp;carsRed<br>
+ State&nbsp;carsYellowRed<br>
+ State&nbsp;carsGreen2<br>
+ }<br>
+ }<br>
+ }<br>
+
+<br>
+ ProtocolClass&nbsp;PedControlProtocol&nbsp;{<br>
+ incoming&nbsp;{<br>
+ Message&nbsp;start()<br>
+ }<br>
+ outgoing&nbsp;{<br>
+ Message&nbsp;setCarLights(state:&nbsp;int32)<br>
+ Message&nbsp;setPedLights(state:&nbsp;int32)<br>
+ }<br>
+ }<br>
+}<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<div class="itemizedlist">
+<ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p>Arrange the Structure and the Statemachines to understand the model </p>
+</li>
+</ul>
+</div>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/030-PedLights01.PNG"></div>
+<p>
+ The
+ [<span class="citation">GuiAdapter</span>] represents the interface to the external code. It registers its
+ [<span class="citation">ControlPort</span>] by the external code.
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/030-PedLights02.PNG"></div>
+<p>
+ Visit the initial transition to understand the registration. The actor handles the incoming messages as usual and controls the traffic lights as known from blinky.
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/030-PedLights03.PNG"></div>
+<p>
+ The
+ [<span class="citation">Controller</span>] receives the
+ [<span class="citation">start</span>] message and controls the timing of the lights. Note that the
+ [<span class="citation">start</span>] message will be sent from the external code whenever the
+ [<span class="citation">REQUEST</span>] button is pressed.
+ </p>
+<div class="itemizedlist">
+<ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p> Visit the model and take a closer look to the following elements:</p>
+</li>
+</ul>
+</div>
+<div class="orderedlist">
+<ol class="orderedlist" type="1">
+<li class="listitem">
+<p>PedControlProtocol =&gt; notice that the start message is defined as usual</p>
+</li>
+<li class="listitem">
+<p>Initial transition of the
+ [<span class="citation">GuiAdapter</span>] =&gt; see the registration
+ </p>
+</li>
+<li class="listitem">
+<p>The
+ [<span class="citation">Controller</span>] =&gt; notice that the
+ [<span class="citation">Controller</span>] receives the external message (not the
+ [<span class="citation">GuiAdapter</span>]). The
+ [<span class="citation">GuiAdapter</span>] just provides its port and handles the incoming messages.
+ </p>
+</li>
+<li class="listitem">
+<p>Visit the hand written code =&gt; see the import statement of the protocol class and the usage of the port.</p>
+</li>
+</ol>
+</div>
+<div class="itemizedlist">
+<ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p>Generate and test the model</p>
+</li>
+<li class="listitem">
+<p>Take a look at the generated MSC =&gt; notice that the start message will shown as if the
+ [<span class="citation">GuiAdapter</span>] had sent it.
+ </p>
+</li>
+</ul>
+</div>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/030-PedLights04.PNG"></div>
+<p>
+
+</p>
+</div>
+<div class="section" title="Why does it work and why is it save?">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Whydoesitworkandwhyisitsave"></a>Why does it work and why is it save?</h2>
+</div>
+</div>
+</div>
+<p>The tutorial shows that it is generally possible to use every port from outside the model as long as the port knows its peer. This is guaranteed by describing protocol and the complete structure (especially the bindings) within the model.
+ The only remaining question is: Why is it save and does not hurt the &bdquo;run to completion&rdquo; semantic. To answer this question, take a look at the
+ [<span class="citation">MessageService.java</span>] from the runtime environment. There you will find the receive method which puts each message into the queue.
+ </p>
+<div class="literallayout">
+<p>
+<code class="code"> @Override<br>
+ public&nbsp;synchronized&nbsp;void&nbsp;receive(Message&nbsp;msg)&nbsp;{<br>
+ if&nbsp;(msg!=null)&nbsp;{<br>
+ messageQueue.push(msg);<br>
+ notifyAll();&nbsp;//&nbsp;wake&nbsp;up&nbsp;thread&nbsp;to&nbsp;compute&nbsp;message<br>
+ }<br>
+ }<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<p>This method is synchronized. That means, regardless who sends the message, the queue is secured. If we later on (e.g. for performance reasons in C/C++) distinguish between internal and external senders (same thread or not), care must be taken to use the external (secure) queue.</p>
+</div>
+</div>
+<div class="chapter" title="Chapter&nbsp;7.&nbsp;ROOM Concepts">
<div class="titlepage">
<div>
<div>
<h2 class="title">
-<a name="ROOMConcepts"></a>Chapter&nbsp;6.&nbsp;ROOM Concepts</h2>
+<a name="ROOMConcepts"></a>Chapter&nbsp;7.&nbsp;ROOM Concepts</h2>
</div>
</div>
</div>
-<div class="section" title="Main Concepts">
+<div class="section" title="Main Concepts h3. ActorClass h3. Port h3. Protocol">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
-<a name="MainConcepts"></a>Main Concepts</h2>
+<a name="MainConcepts"></a>Main Concepts
+ h3. ActorClass
+ h3. Port
+ h3. Protocol</h2>
</div>
</div>
</div>
diff --git a/plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.png b/plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.png
deleted file mode 100644
index b178015e3..000000000
--- a/plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.png
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/manual/etrice.pdf b/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
index 029584d22..b5eda1991 100644
--- a/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
+++ b/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl b/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl
index d73663af6..c5dc4adc4 100644
--- a/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl
+++ b/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl
@@ -36,10 +36,10 @@
<xsl:variable name="Version">
<xsl:choose>
<xsl:when test="//releaseinfo">
- <xsl:text>Xtext </xsl:text><xsl:value-of select="//releaseinfo"/>
+ <xsl:text>eTrice </xsl:text><xsl:value-of select="//releaseinfo"/>
</xsl:when>
<xsl:otherwise>
- Xtext 1.0
+ eTrice 0.1
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
diff --git a/plugins/org.eclipse.etrice.doc/toc.xml b/plugins/org.eclipse.etrice.doc/toc.xml
index 2f6939520..9d7e11e38 100644
--- a/plugins/org.eclipse.etrice.doc/toc.xml
+++ b/plugins/org.eclipse.etrice.doc/toc.xml
@@ -5,7 +5,17 @@
<topic href="help/HowDoesItWork.html" label="How Does It Work?"></topic>
<topic href="help/WhoisBehindeTrice.html" label="Who is Behind eTrice?"></topic>
</topic>
-<topic href="help/IntroductiontotheROOMLanguage.html" label="Introduction to the ROOM Language"></topic>
+<topic href="help/IntroductiontotheROOMLanguage.html" label="Introduction to the ROOM Language">
+<topic href="help/IntroductiontotheROOMLanguage.html#ScopeofROOM" label="Scope of ROOM"></topic>
+<topic href="help/BasicConcepts.html" label="Basic Concepts"></topic>
+<topic href="help/Benefits.html" label="Benefits"></topic>
+<topic href="help/ExecutionModels.html" label="Execution Models">
+<topic href="help/ExecutionModels.html#LogicalMachine" label="Logical Machine"></topic>
+<topic href="help/ExecutionModels.html#QueueBasedExecutionModel" label="Queue Based Execution Model"></topic>
+<topic href="help/ExecutionModels.html#PolledExecutionModel" label="Polled Execution Model not implemented yet"></topic>
+<topic href="help/ExecutionModels.html#HybridExecutionModel" label="Hybrid Execution Model not implemented yet"></topic>
+</topic>
+</topic>
<topic href="help/TutorialHelloWorld.html" label="Tutorial HelloWorld">
<topic href="help/TutorialHelloWorld.html#Scope" label="Scope"></topic>
<topic href="help/Createanewmodelfromscratch.html" label="Create a new model from scratch"></topic>
@@ -38,7 +48,12 @@
<topic href="help/Generateandrunthemodel.html" label="Generate and run the model"></topic>
<topic href="help/Summary3.html" label="Summary"></topic>
</topic>
+<topic href="help/TutorialPedestrianLights.html" label="Tutorial Pedestrian Lights">
+<topic href="help/TutorialPedestrianLights.html#Scope4" label="Scope"></topic>
+<topic href="help/Setupthemodel.html" label="Setup the model"></topic>
+<topic href="help/Whydoesitworkandwhyisitsave.html" label="Why does it work and why is it save?"></topic>
+</topic>
<topic href="help/ROOMConcepts.html" label="ROOM Concepts">
-<topic href="help/ROOMConcepts.html#MainConcepts" label="Main Concepts"></topic>
+<topic href="help/ROOMConcepts.html#MainConcepts" label="Main Concepts h3. ActorClass h3. Port h3. Protocol"></topic>
</topic>
</toc>

Back to the top