summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-08-03 04:43:52 (EDT)
committerHenrik Rentz-Reichert2011-08-03 04:43:52 (EDT)
commit3e6ac8acfe6d8ab9ac0b78f767d79ea936861fbe (patch)
tree0317621e89edcf67a9320d1a8feec5b77f9ef71e
parent5a19820a388d4a9198c388200495a3388d63a50d (diff)
downloadorg.eclipse.etrice-3e6ac8acfe6d8ab9ac0b78f767d79ea936861fbe.zip
org.eclipse.etrice-3e6ac8acfe6d8ab9ac0b78f767d79ea936861fbe.tar.gz
org.eclipse.etrice-3e6ac8acfe6d8ab9ac0b78f767d79ea936861fbe.tar.bz2
[doc] minor changes and typos
also fixed footer of PDF to display eTrice 0.1 Change-Id: I378cbe74c6d6aaf6d3d73b9b942a5db32a5ba5cc
-rw-r--r--plugins/org.eclipse.etrice.doc/build/etrice.textile279
-rw-r--r--plugins/org.eclipse.etrice.doc/build/etrice.xml469
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/015-getting-started.textile12
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile16
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile810
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile474
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Addadataclass.html120
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Buildandrunthemodel.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/CreateMrPingandMrPongActors.html202
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch.html4
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch3.html106
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Createanewprotocol.html4
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Createanewprotocol2.html102
-rw-r--r--plugins/org.eclipse.etrice.doc/help/DefineActorStructureandBehavior.html (renamed from plugins/org.eclipse.etrice.doc/help/DefinetheActorsStructureandBehavior.html)366
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html387
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Finishthemodelstructure.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Generateandrunthemodel.html158
-rw-r--r--plugins/org.eclipse.etrice.doc/help/ImplementtheBehavior.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/OpentheMessageSequenceChart.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Setupthemodel.html316
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Summary.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Summary2.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Summary3.html72
-rw-r--r--plugins/org.eclipse.etrice.doc/help/TutorialBlinky.html6
-rw-r--r--plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html2
-rw-r--r--plugins/org.eclipse.etrice.doc/help/TutorialPedestrianLights.html84
-rw-r--r--plugins/org.eclipse.etrice.doc/help/TutorialSendingData.html182
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html48
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.pngbin9756 -> 0 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/030-PedLights01.pngbin0 -> 40586 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/030-PedLights02.pngbin0 -> 59926 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/030-PedLights03.pngbin0 -> 91507 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/help/images/030-PedLights04.pngbin0 -> 57514 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/etrice.html561
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.pngbin9756 -> 0 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/030-PedLights01.pngbin0 -> 40586 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/030-PedLights02.pngbin0 -> 59926 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/030-PedLights03.pngbin0 -> 91507 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/html/images/030-PedLights04.pngbin0 -> 57514 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/manual/etrice.pdfbin2701349 -> 2939168 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/styles/fopdf.xsl2
-rw-r--r--plugins/org.eclipse.etrice.doc/styles/xmpp.xsl4
-rw-r--r--plugins/org.eclipse.etrice.doc/toc.xml11
44 files changed, 3129 insertions, 1682 deletions
diff --git a/plugins/org.eclipse.etrice.doc/build/etrice.textile b/plugins/org.eclipse.etrice.doc/build/etrice.textile
index 059f854..ff11736 100644
--- a/plugins/org.eclipse.etrice.doc/build/etrice.textile
+++ b/plugins/org.eclipse.etrice.doc/build/etrice.textile
@@ -27,7 +27,7 @@ h1. Tutorial HelloWorld
h2. Scope
-In this tutorial you will build your first very simple etrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:
+In this tutorial you will build your first very simple eTrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:
# create a new model from scratch
# add a very simple state machine to an actor
@@ -74,9 +74,9 @@ The goal of eTrice is to describe distributed systems on a logical level. In the
* at least one ??SubSystemClass??
* at least one ??ActorClass??
-The ??LogicalSystem?? represents the complete distributed system and contains at least one ??SubSystemRef??. The ??SubSystemClass?? represents an address space and contains at least one ??ActorRef??. The ??ActorClass?? is the building block of which an application will be build of. It is a good idea to define a top level actor that can be used as reference within the subsystem.
+The ??LogicalSystem?? represents the complete distributed system and contains at least one ??SubSystemRef??. The ??SubSystemClass?? represents an address space and contains at least one ??ActorRef??. The ??ActorClass?? is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
-Mention that a outline view was created that represents all currently existing model elements in a graphical way.
+The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.
!images/015-HelloWorld02.PNG!
@@ -107,7 +107,7 @@ Now the model is finished and source code can be generated. The project wizard h
!images/015-HelloWorld06.PNG!
-The code will be generated to the src-gen directory. The main class will be contained in ??SubSystem_HelloWorldRunner.java??. Select this file and run it as Java application.
+The code will be generated to the src-gen directory. The main function will be contained in ??SubSystem_HelloWorldRunner.java??. Select this file and run it as Java application.
!images/015-HelloWorld07.PNG!
@@ -118,7 +118,7 @@ The Hello World application starts and the string will be printed on the console
h2. Open the Message Sequence Chart
-During runtime the application produces a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq. You should see something like this:
+During runtime the application produced a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq using Trace2UML (it is open source and can be obtained from http://trace2uml.tigris.org/). You should see something like this:
!images/015-HelloWorld09.PNG!
@@ -126,23 +126,23 @@ During runtime the application produces a MSC and wrote it to a file. Open /org.
h2. Summary
Now you have generated your first eTrice model from scratch. You can switch between diagram editor and model (.room file) and you can see what will be generated during editing and saving the diagram files.
-You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials deals with more complex state machines hierarchies in structure and behavior.
+You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials will deal with more complex hierarchies in structure and behavior.
h1. Tutorial Blinky
h2. Scope
-This tutorial describes how to use the ??TimingService??, combine a generated model with manual code and how to modeling a hierarchical state machine. The idea of the tutorial is, to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
+This tutorial describes how to use the ??TimingService??, how to combine a generated model with manual code and how to model a hierarchical state machine. The idea of the tutorial is to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
For this exercise we will use a little GUI class that will be used in more sophisticated tutorials too. The GUI simulates a pedestrian traffic crossing. For now, just a simple LED simulation will be used from the GUI.
-To use the GUI please copy the package ??de.protos.PedLightGUI?? to your ??src?? directory. The package contains four java classes which implements a little window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
+To use the GUI please copy the package ??de.protos.PedLightGUI?? to your ??src?? directory. The package contains four java classes which implement a small window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
The GUI looks like this:
!images/020-Blinky08.PNG!
-Within this tutorial we just will switching on and off the yellow light.
+Within this tutorial we just will toggle the yellow light.
You will perform the following steps:
@@ -194,13 +194,13 @@ Save the model and visit the outline view.
h2. Create a new protocol
With the help of ??Content Assist?? create a ??ProtocolClass?? and name it ??BlinkyControlProtocol??.
-Inside the brackets use the ??Content Assist?? (CTRL+Space) to create two incomming messages called ??start?? and ??stop??.
+Inside the brackets use the ??Content Assist?? (CTRL+Space) to create two incoming messages called ??start?? and ??stop??.
The resulting code should look like this:
!images/020-Blinky03.PNG!
-With Ctrl-Shift+F or selecting ??Format?? from the context menu you can format the text. Mention that all elements are displayed in the outline view.
+With Ctrl-Shift+F or selecting ??Format?? from the context menu you can format the text. Note that all elements are displayed in the outline view.
h2. Import the Timing Service
@@ -228,7 +228,7 @@ From the outline view right click to ??Blinky?? and select ??Edit Structure??. D
Repeat the above steps for the ??BlinkyController??. Make the port ??Conjugated??
-Keep in mind that the protocol defines ??start?? and ??stop?? as incoming messages. ??Blinky?? receives this messages and therefore ??Blinky??'s ??ControlPort?? must be a base port and ??BlinkyController??'s ??ControlPort?? must be a conjugated port.
+Keep in mind that the protocol defines ??start?? and ??stop?? as incoming messages. ??Blinky?? receives this messages and therefore ??Blinky??'s ??ControlPort?? must be a regular port and ??BlinkyController??'s ??ControlPort?? must be a conjugated port.
From the outline view right click ??BlinkyTop?? and select ??Edit Structure??.
@@ -251,7 +251,7 @@ The dialog should look like this:
!{width=500px}images/020-Blinky09.PNG!
-The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state ??port.message(p1,p2);??. In this example ??ControlPort.start()?? sends the ??start?? message via the ??ControlPort?? to the outside world. Assuming that ??Blinky?? is connected to this port, the message will start the one second blinking FSM. It is the same thing with the ??timer??. The SAP is also a port and follows the same rules. So it is clear that ??timer.Start(5000);?? will send the ??Start?? message to the timing service. The timing service will send a ??timeoutTick?? message back after 5000ms.
+The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state ??port.message(param);??. In this example ??ControlPort.start()?? sends the ??start?? message via the ??ControlPort?? to the outside world. Assuming that ??Blinky?? is connected to this port, the message will start the one second blinking FSM. It is the same thing with the ??timer??. The SAP is also a port and follows the same rules. So it is clear that ??timer.Start(5000);?? will send the ??Start?? message to the timing service. The timing service will send a ??timeoutTick?? message back after 5000ms.
Within each transition the timer will be restarted and the appropriate message will be sent via the ??ControlPort??.
@@ -480,7 +480,7 @@ The model is complete now. You can run and debug the model as described in getti
h2. Summary
-Run the model and take look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.
+Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.
h1. Tutorial Sending Data
@@ -488,7 +488,7 @@ h1. Tutorial Sending Data
h2. Scope
This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
-MrPing will sent data and verify the result.
+MrPing will send data and verify the result.
You will perform the following steps:
@@ -505,6 +505,7 @@ Remember exercise ??HelloWorld??.
Create a new eTrice project and name it ??SendingData??
Open the ??SendingData.room?? file and copy the following code into the file or use content assist to create the model.
+
bc..
RoomModel SendingData {
LogicalSystem SendingData_LogSystem {
@@ -610,7 +611,7 @@ The outline view should look like this:
!images/025-SendingData03.png!
-h2. Define the Actors Structure and Behavior
+h2. Define Actor Structure and Behavior
Save the model and visit the outline view. Within the outline view, right click on the ??MrPong?? actor and select ??Edit Structure??. Select an ??Interface Port?? from the toolbox and add it to MrPong. Name the Port ??PingPongPort?? and select the ??PingPongProtocol??
@@ -685,7 +686,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 {
@@ -831,7 +831,7 @@ h2. Generate and run the model
With the MWe2 workflow generate the code and run the model.
The output should look like this:
-
+bq..
type 'quit' to exit
/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
@@ -879,13 +879,252 @@ d.stringVal: some contents
/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
quit
echo: quit
+bq.
h2. Summary
-Within the first loop a integer value will be incremented from ??MrPong?? and sent back to ??MrPing??. Is long as the guard is true ??MrPing?? sends back the value.
+Within the first loop an integer value will be incremented from ??MrPong?? and sent back to ??MrPing??. As long as the guard is true ??MrPing?? sends back the value.
Within the ??next?? transition, ??MrPing?? creates a data class and sends the default values. Than ??MrPing?? changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
-In later versions of eTrice a additional mechanism to send references will be implemented. However, keep in mind that sending references takes the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+In future versions of eTrice an additional mechanism to send references will be implemented. However, keep in mind that sending references transfers the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+
+
+
+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. Being familiar with the basic tool features is mandatory 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 several 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 few 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).
+* In PedestrianLightWndNoTcp.jav uncomment 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 safe?
+
+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 safe and does not violate 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.
+
diff --git a/plugins/org.eclipse.etrice.doc/build/etrice.xml b/plugins/org.eclipse.etrice.doc/build/etrice.xml
index 3ee57b6..76cc63c 100644
--- a/plugins/org.eclipse.etrice.doc/build/etrice.xml
+++ b/plugins/org.eclipse.etrice.doc/build/etrice.xml
@@ -29,7 +29,7 @@
<title>Tutorial HelloWorld</title>
<section id="Scope">
<title>Scope</title>
- <para>In this tutorial you will build your first very simple etrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</para>
+ <para>In this tutorial you will build your first very simple eTrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</para>
<orderedlist>
<listitem>
<para>create a new model from scratch</para>
@@ -123,9 +123,9 @@
<citation>SubSystemRef</citation>. The
<citation>SubSystemClass</citation> represents an address space and contains at least one
<citation>ActorRef</citation>. The
- <citation>ActorClass</citation> is the building block of which an application will be build of. It is a good idea to define a top level actor that can be used as reference within the subsystem.
+ <citation>ActorClass</citation> is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
</para>
- <para>Mention that a outline view was created that represents all currently existing model elements in a graphical way.</para>
+ <para>The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.</para>
<para>
<mediaobject>
<imageobject>
@@ -187,7 +187,7 @@
</imageobject>
</mediaobject>
</para>
- <para>The code will be generated to the src-gen directory. The main class will be contained in
+ <para>The code will be generated to the src-gen directory. The main function will be contained in
<citation>SubSystem_HelloWorldRunner.java</citation>. Select this file and run it as Java application.
</para>
<para>
@@ -210,7 +210,7 @@
</section>
<section id="OpentheMessageSequenceChart">
<title>Open the Message Sequence Chart</title>
- <para>During runtime the application produces a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq. You should see something like this:</para>
+ <para>During runtime the application produced a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq using Trace2UML (it is open source and can be obtained from http://trace2uml.tigris.org/). You should see something like this:</para>
<para>
<mediaobject>
<imageobject>
@@ -222,7 +222,7 @@
<section id="Summary">
<title>Summary</title>
<para>Now you have generated your first eTrice model from scratch. You can switch between diagram editor and model (.room file) and you can see what will be generated during editing and saving the diagram files.
- You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials deals with more complex state machines hierarchies in structure and behavior.</para>
+ You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials will deal with more complex hierarchies in structure and behavior.</para>
</section>
</chapter>
<chapter id="TutorialBlinky">
@@ -230,12 +230,12 @@
<section id="Scope2">
<title>Scope</title>
<para>This tutorial describes how to use the
- <citation>TimingService</citation>, combine a generated model with manual code and how to modeling a hierarchical state machine. The idea of the tutorial is, to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
+ <citation>TimingService</citation>, how to combine a generated model with manual code and how to model a hierarchical state machine. The idea of the tutorial is to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
For this exercise we will use a little GUI class that will be used in more sophisticated tutorials too. The GUI simulates a pedestrian traffic crossing. For now, just a simple LED simulation will be used from the GUI.
</para>
<para>To use the GUI please copy the package
<citation>de.protos.PedLightGUI</citation> to your
- <citation>src</citation> directory. The package contains four java classes which implements a little window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
+ <citation>src</citation> directory. The package contains four java classes which implement a small window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
</para>
<para>The GUI looks like this:</para>
<para>
@@ -245,7 +245,7 @@
</imageobject>
</mediaobject>
</para>
- <para>Within this tutorial we just will switching on and off the yellow light.</para>
+ <para>Within this tutorial we just will toggle the yellow light.</para>
<para>You will perform the following steps:</para>
<orderedlist>
<listitem>
@@ -338,7 +338,7 @@
<citation>ProtocolClass</citation> and name it
<citation>BlinkyControlProtocol</citation>.
Inside the brackets use the
- <citation>Content Assist</citation> (CTRL+Space) to create two incomming messages called
+ <citation>Content Assist</citation> (CTRL+Space) to create two incoming messages called
<citation>start</citation> and
<citation>stop</citation>.
</para>
@@ -351,7 +351,7 @@
</mediaobject>
</para>
<para>With Ctrl-Shift+F or selecting
- <citation>Format</citation> from the context menu you can format the text. Mention that all elements are displayed in the outline view.
+ <citation>Format</citation> from the context menu you can format the text. Note that all elements are displayed in the outline view.
</para>
</section>
<section id="ImporttheTimingService">
@@ -423,7 +423,7 @@
<citation>stop</citation> as incoming messages.
<citation>Blinky</citation> receives this messages and therefore
<citation>Blinky</citation>'s
- <citation>ControlPort</citation> must be a base port and
+ <citation>ControlPort</citation> must be a regular port and
<citation>BlinkyController</citation>'s
<citation>ControlPort</citation> must be a conjugated port.
</para>
@@ -479,7 +479,7 @@
</mediaobject>
</para>
<para>The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state
- <citation>port.message(p1,p2);</citation>. In this example
+ <citation>port.message(param);</citation>. In this example
<citation>ControlPort.start()</citation> sends the
<citation>start</citation> message via the
<citation>ControlPort</citation> to the outside world. Assuming that
@@ -779,7 +779,7 @@ carLights.setState(TrafficLight3.OFF);
</section>
<section id="Summary2">
<title>Summary</title>
- <para>Run the model and take look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</para>
+ <para>Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</para>
</section>
</chapter>
<chapter id="TutorialSendingData">
@@ -787,7 +787,7 @@ carLights.setState(TrafficLight3.OFF);
<section id="Scope3">
<title>Scope</title>
<para>This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
- MrPing will sent data and verify the result. </para>
+ MrPing will send data and verify the result. </para>
<para>You will perform the following steps:</para>
<orderedlist>
<listitem>
@@ -949,8 +949,8 @@ carLights.setState(TrafficLight3.OFF);
</mediaobject>
</para>
</section>
- <section id="DefinetheActorsStructureandBehavior">
- <title>Define the Actors Structure and Behavior</title>
+ <section id="DefineActorStructureandBehavior">
+ <title>Define Actor Structure and Behavior</title>
<para>Save the model and visit the outline view. Within the outline view, right click on the
<citation>MrPong</citation> actor and select
<citation>Edit Structure</citation>. Select an
@@ -1090,7 +1090,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 {
@@ -1237,67 +1236,401 @@ carLights.setState(TrafficLight3.OFF);
<title>Generate and run the model</title>
<para>With the MWe2 workflow generate the code and run the model.
The output should look like this:</para>
- <para>type &#8218;quit’ to exit
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 1
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 2
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 3
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 4
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 5
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 6
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 7
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 8
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 9
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 10
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- d.int32Val: 4711
- d.float64Val: 0,000000
- d.int8Array: 1 2 3 4 5 6 7 8 9 10
- d.stringVal: empty
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- d.int32Val: 815
- d.float64Val: 3,141234
- d.int8Array: 100 101 102 103 104 105 106 107 108 109
- d.stringVal: some contents
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- quit
- echo: quit</para>
+ <blockquote>
+ <para>
+ type &#8218;quit’ to exit
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 1
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 2
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 3
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 4
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 5
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 6
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 7
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 8
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 9
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 10
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ d.int32Val: 4711
+ d.float64Val: 0,000000
+ d.int8Array: 1 2 3 4 5 6 7 8 9 10
+ d.stringVal: empty
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ d.int32Val: 815
+ d.float64Val: 3,141234
+ d.int8Array: 100 101 102 103 104 105 106 107 108 109
+ d.stringVal: some contents
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ quit
+ echo: quit</para>
+ </blockquote>
+ <blockquote>
+ <para></para>
+ </blockquote>
</section>
<section id="Summary3">
<title>Summary</title>
- <para>Within the first loop a integer value will be incremented from
+ <para>Within the first loop an integer value will be incremented from
<citation>MrPong</citation> and sent back to
- <citation>MrPing</citation>. Is long as the guard is true
+ <citation>MrPing</citation>. As long as the guard is true
<citation>MrPing</citation> sends back the value.
</para>
<para>Within the
<citation>next</citation> transition,
<citation>MrPing</citation> creates a data class and sends the default values. Than
<citation>MrPing</citation> changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
- In later versions of eTrice a additional mechanism to send references will be implemented. However, keep in mind that sending references takes the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+ In future versions of eTrice an additional mechanism to send references will be implemented. However, keep in mind that sending references transfers the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+ </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. Being familiar with the basic tool features is mandatory 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 several 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 few 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>In PedestrianLightWndNoTcp.jav uncomment 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="Whydoesitworkandwhyisitsafe">
+ <title>Why does it work and why is it safe?</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 safe and does not violate 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">
diff --git a/plugins/org.eclipse.etrice.doc/doc/015-getting-started.textile b/plugins/org.eclipse.etrice.doc/doc/015-getting-started.textile
index bd9ff38..d56c5f3 100644
--- a/plugins/org.eclipse.etrice.doc/doc/015-getting-started.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/015-getting-started.textile
@@ -2,7 +2,7 @@ h1. Tutorial HelloWorld
h2. Scope
-In this tutorial you will build your first very simple etrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:
+In this tutorial you will build your first very simple eTrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:
# create a new model from scratch
# add a very simple state machine to an actor
@@ -49,9 +49,9 @@ The goal of eTrice is to describe distributed systems on a logical level. In the
* at least one ??SubSystemClass??
* at least one ??ActorClass??
-The ??LogicalSystem?? represents the complete distributed system and contains at least one ??SubSystemRef??. The ??SubSystemClass?? represents an address space and contains at least one ??ActorRef??. The ??ActorClass?? is the building block of which an application will be build of. It is a good idea to define a top level actor that can be used as reference within the subsystem.
+The ??LogicalSystem?? represents the complete distributed system and contains at least one ??SubSystemRef??. The ??SubSystemClass?? represents an address space and contains at least one ??ActorRef??. The ??ActorClass?? is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
-Mention that a outline view was created that represents all currently existing model elements in a graphical way.
+The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.
!images/015-HelloWorld02.PNG!
@@ -82,7 +82,7 @@ Now the model is finished and source code can be generated. The project wizard h
!images/015-HelloWorld06.PNG!
-The code will be generated to the src-gen directory. The main class will be contained in ??SubSystem_HelloWorldRunner.java??. Select this file and run it as Java application.
+The code will be generated to the src-gen directory. The main function will be contained in ??SubSystem_HelloWorldRunner.java??. Select this file and run it as Java application.
!images/015-HelloWorld07.PNG!
@@ -93,7 +93,7 @@ The Hello World application starts and the string will be printed on the console
h2. Open the Message Sequence Chart
-During runtime the application produces a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq. You should see something like this:
+During runtime the application produced a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq using Trace2UML (it is open source and can be obtained from http://trace2uml.tigris.org/). You should see something like this:
!images/015-HelloWorld09.PNG!
@@ -101,5 +101,5 @@ During runtime the application produces a MSC and wrote it to a file. Open /org.
h2. Summary
Now you have generated your first eTrice model from scratch. You can switch between diagram editor and model (.room file) and you can see what will be generated during editing and saving the diagram files.
-You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials deals with more complex state machines hierarchies in structure and behavior.
+You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials will deal with more complex hierarchies in structure and behavior.
diff --git a/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile b/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
index 7553874..5265e87 100644
--- a/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
@@ -2,16 +2,16 @@ h1. Tutorial Blinky
h2. Scope
-This tutorial describes how to use the ??TimingService??, combine a generated model with manual code and how to modeling a hierarchical state machine. The idea of the tutorial is, to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
+This tutorial describes how to use the ??TimingService??, how to combine a generated model with manual code and how to model a hierarchical state machine. The idea of the tutorial is to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
For this exercise we will use a little GUI class that will be used in more sophisticated tutorials too. The GUI simulates a pedestrian traffic crossing. For now, just a simple LED simulation will be used from the GUI.
-To use the GUI please copy the package ??de.protos.PedLightGUI?? to your ??src?? directory. The package contains four java classes which implements a little window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
+To use the GUI please copy the package ??de.protos.PedLightGUI?? to your ??src?? directory. The package contains four java classes which implement a small window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
The GUI looks like this:
!images/020-Blinky08.PNG!
-Within this tutorial we just will switching on and off the yellow light.
+Within this tutorial we just will toggle the yellow light.
You will perform the following steps:
@@ -63,13 +63,13 @@ Save the model and visit the outline view.
h2. Create a new protocol
With the help of ??Content Assist?? create a ??ProtocolClass?? and name it ??BlinkyControlProtocol??.
-Inside the brackets use the ??Content Assist?? (CTRL+Space) to create two incomming messages called ??start?? and ??stop??.
+Inside the brackets use the ??Content Assist?? (CTRL+Space) to create two incoming messages called ??start?? and ??stop??.
The resulting code should look like this:
!images/020-Blinky03.PNG!
-With Ctrl-Shift+F or selecting ??Format?? from the context menu you can format the text. Mention that all elements are displayed in the outline view.
+With Ctrl-Shift+F or selecting ??Format?? from the context menu you can format the text. Note that all elements are displayed in the outline view.
h2. Import the Timing Service
@@ -97,7 +97,7 @@ From the outline view right click to ??Blinky?? and select ??Edit Structure??. D
Repeat the above steps for the ??BlinkyController??. Make the port ??Conjugated??
-Keep in mind that the protocol defines ??start?? and ??stop?? as incoming messages. ??Blinky?? receives this messages and therefore ??Blinky??'s ??ControlPort?? must be a base port and ??BlinkyController??'s ??ControlPort?? must be a conjugated port.
+Keep in mind that the protocol defines ??start?? and ??stop?? as incoming messages. ??Blinky?? receives this messages and therefore ??Blinky??'s ??ControlPort?? must be a regular port and ??BlinkyController??'s ??ControlPort?? must be a conjugated port.
From the outline view right click ??BlinkyTop?? and select ??Edit Structure??.
@@ -120,7 +120,7 @@ The dialog should look like this:
!{width=500px}images/020-Blinky09.PNG!
-The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state ??port.message(p1,p2);??. In this example ??ControlPort.start()?? sends the ??start?? message via the ??ControlPort?? to the outside world. Assuming that ??Blinky?? is connected to this port, the message will start the one second blinking FSM. It is the same thing with the ??timer??. The SAP is also a port and follows the same rules. So it is clear that ??timer.Start(5000);?? will send the ??Start?? message to the timing service. The timing service will send a ??timeoutTick?? message back after 5000ms.
+The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state ??port.message(param);??. In this example ??ControlPort.start()?? sends the ??start?? message via the ??ControlPort?? to the outside world. Assuming that ??Blinky?? is connected to this port, the message will start the one second blinking FSM. It is the same thing with the ??timer??. The SAP is also a port and follows the same rules. So it is clear that ??timer.Start(5000);?? will send the ??Start?? message to the timing service. The timing service will send a ??timeoutTick?? message back after 5000ms.
Within each transition the timer will be restarted and the appropriate message will be sent via the ??ControlPort??.
@@ -349,5 +349,5 @@ The model is complete now. You can run and debug the model as described in getti
h2. Summary
-Run the model and take look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.
+Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.
diff --git a/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile b/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
index 5a46d9b..09e2765 100644
--- a/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
@@ -1,404 +1,406 @@
-h1. Tutorial Sending Data
-
-h2. Scope
-
-This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
-MrPing will sent data and verify the result.
-
-You will perform the following steps:
-
-# create a new model from scratch
-# create a data class
-# define a protocol with attached data
-# create an actor structure
-# create two simple state machines
-# build and run the model
-
-h2. Create a new model from scratch
-
-Remember exercise ??HelloWorld??.
-Create a new eTrice project and name it ??SendingData??
-Open the ??SendingData.room?? file and copy the following code into the file or use content assist to create the model.
-
-bc..
-RoomModel SendingData {
- LogicalSystem SendingData_LogSystem {
- SubSystemRef SendingDataAppl:SendingData_SubSystem
- }
- SubSystemClass SendingData_SubSystem {
- ActorRef SendigDataTopRef:SendingDataTop
- }
- ActorClass SendingDataTop {
- }
- }
-bq.
-
-h2. Add a data class
-
-Position the cursor outside any class definition and right click the mouse within the editor window. From the context menu select ??Content Assist?? (or Ctrl+Space).
-
-!images/025-SendingData01.png!
-
-Select ??DataClass - data class skeleton?? and name it ??DemoData??.
-Remove the operations and ass the following Attributes:
-
-bc..
- DataClass DemoData {
- Attribute int32Val: int32 = "4711"
- Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
- Attribute float64Val: float64 = "0.0"
- Attribute stringVal: string = "\"empty\""
- }
-bq.
-
-Save the model and visit the outline view.
-Note that the outline view contains all data elements as defined in the model.
-
-h2. Create a new protocol
-
-With the help of ??Content Assist?? create a ??ProtocolClass?? and name it ??PingPongProtocol??. Create the following messages:
-
-bc..
-ProtocolClass PingPongProtocol {
- incoming {
- Message ping(data: DemoData)
- Message pingSimple(data:int32)
- }
- outgoing {
- Message pong(data: DemoData)
- Message pongSimple(data:int32)
- }
- }
-bq.
-
-h2. Create MrPing and MrPong Actors
-
-With the help of ??Content Assist?? create two new actor classes and name them ??MrPing?? and ??MrPong??. The resulting model should look like this:
-
-bc..
-RoomModel SendingData {
-
- LogicalSystem SendingData_LogSystem {
- SubSystemRef SendingDataAppl: SendingData_SubSystem
- }
-
- SubSystemClass SendingData_SubSystem {
- ActorRef SendigDataTopRef: SendingDataTop
- }
-
- ActorClass SendingDataTop { }
-
- DataClass DemoData {
- Attribute int32Val: int32 = "4711"
- Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
- Attribute float64Val: float64 = "0.0"
- Attribute stringVal: string = "\"empty\""
- }
-
- ProtocolClass PingPongProtocol {
- incoming {
- Message ping(data: DemoData)
- Message pingSimple(data: int32)
- }
- outgoing {
- Message pong(data: DemoData)
- Message pongSimple(data: int32)
- }
- }
-
- ActorClass MrPing {
- Interface { }
- Structure { }
- Behavior { }
- }
-
- ActorClass MrPong {
- Interface { }
- Structure { }
- Behavior { }
- }
-}
-
-bq.
-
-The outline view should look like this:
-
-!images/025-SendingData03.png!
-
-h2. Define the Actors Structure and Behavior
-
-Save the model and visit the outline view. Within the outline view, right click on the ??MrPong?? actor and select ??Edit Structure??. Select an ??Interface Port?? from the toolbox and add it to MrPong. Name the Port ??PingPongPort?? and select the ??PingPongProtocol??
-
-!images/025-SendingData02.png!
-
-Do the same with MrPing but mark the port as ??conjugated??
-
-h3. Define MrPongs behavior
-
-Within the outline view, right click MrPong and select ??Edit Behavior??. Create the following state machine:
-
-!images/025-SendingData04.png!
-
-The transition dialogues should look like this:
-For ??ping??:
-
-!images/025-SendingData05.png!
-
-For ??pingSimple??:
-
-!images/025-SendingData06.png!
-
-
-h3. Define MrPing behavior
-
-Within the outline view double click MrPing. Navigate the cursor to the behavior of MrPing. With the help of content assist create a new operation.
-
-!images/025-SendingData07.png!
-
-Name the operation ??printData?? and define the DemoData as a parameter.
-
-Fill in the following code:
-
-bc..
-Operation printData(d: DemoData) : void {
- "System.out.printf(\"d.int32Val: %d\\n\",d.int32Val);"
- "System.out.printf(\"d.float64Val: %f\\n\",d.float64Val);"
- "System.out.printf(\"d.int8Array: \");"
- "for(int i = 0; i<d.int8Array.length; i++) {"
- "System.out.printf(\"%d \",d.int8Array[i]);}"
- "System.out.printf(\"\\nd.stringVal: %s\\n\",d.stringVal);"
- }
-bq.
-
-For MrPing create the following state machine:
-
-!images/025-SendingData08.png!
-
-The transition dialogues should look like this:
-
-For ??init??:
-
-!images/025-SendingData09.png!
-
-For ??wait1??:
-
-!images/025-SendingData10.png!
-
-For ??next??:
-
-!images/025-SendingData11.png!
-
-For ??wait2??:
-
-!images/025-SendingData12.png!
-
-h2. Define the top level
-
-Open the Structure from SendingDataTop and add MrPing and MrPong as a reference. Connect the ports.
-
-!images/025-SendingData13.png!
-
-The model is finished now and the model file should look like this:
-
-bc..
-RoomModel SendingData {
-
- LogicalSystem SendingData_LogSystem {
- SubSystemRef SendingDataAppl: SendingData_SubSystem
- }
-
- SubSystemClass SendingData_SubSystem {
- ActorRef SendigDataTopRef: SendingDataTop
- }
-
- ActorClass SendingDataTop {
- Structure {
- ActorRef ref0: MrPing
- ActorRef ref1: MrPong
- Binding ref0.PingPongPort and ref1.PingPongPort
- }
- Behavior { }
- }
-
- ActorClass MrPing {
- Interface {
- conjugated Port PingPongPort: PingPongProtocol
- }
- Structure {
- external Port PingPongPort
- }
- Behavior {
-
- Operation printData(d: DemoData) : void {
- "System.out.printf(\"d.int32Val: %d\\n\",d.int32Val);"
- "System.out.printf(\"d.float64Val: %f\\n\",d.float64Val);"
- "System.out.printf(\"d.int8Array: \");"
- "for(int i = 0; i<d.int8Array.length; i++) {"
- "System.out.printf(\"%d \",d.int8Array[i]);}"
- "System.out.printf(\"\\nd.stringVal: %s\\n\",d.stringVal);"
- }
-
- StateMachine {
- Transition wait2: waitForPong -> waitForPong {
- triggers {
- <pong: PingPongPort>
- }
- action {
- "printData(data);"
- }
- }
- Transition wait1: waitForPongSimple -> waitForPongSimple {
- triggers {
- <pongSimple: PingPongPort guard {
- "data < 10"
- }>
- }
- action {
- "// keep in mind that MrPong increments"
- "PingPongPort.pingSimple(data);"
- "System.out.printf(\"data: %d\\n\",data);"
- }
- }
- Transition next: waitForPongSimple -> waitForPong {
- triggers {
- <pongSimple: PingPongPort>
- }
- action {
- "System.out.printf(\"data: %d\\n\",data);"
- ""
- "DemoData d = new DemoData();"
- "// send the default values"
- "PingPongPort.ping(d);"
- "d.int32Val=815;"
- "for (int i = 0; i<d.int8Array.length;i++){"
- "\td.int8Array[i]=(byte)(i+100);"
- "\t}"
- "d.stringVal=\"some contents\";"
- "d.float64Val=3.141234;"
- "PingPongPort.ping(d);"
- }
- }
- Transition init0: initial -> waitForPongSimple {
- action {
- "PingPongPort.pingSimple(0);"
- }
- }
- State waitForPong
- State waitForPongSimple
- }
- }
- }
-
- ActorClass MrPong {
- Interface {
- Port PingPongPort: PingPongProtocol
- }
- Structure {
- external Port PingPongPort
- }
- Behavior {
- StateMachine {
- Transition init: initial -> looping { }
- Transition tr0: looping -> looping {
- triggers {
- <ping: PingPongPort>
- }
- action {
- "PingPongPort.pong(data);"
- }
- }
- Transition tr1: looping -> looping {
- triggers {
- <pingSimple: PingPongPort>
- }
- action {
- "PingPongPort.pongSimple(data+1);"
- }
- }
- State looping
- }
- }
- }
-
- ProtocolClass PingPongProtocol {
- incoming {
- Message ping(data: DemoData)
- Message pingSimple(data: int32)
- }
- outgoing {
- Message pong(data: DemoData)
- Message pongSimple(data: int32)
- }
- }
-
- DataClass DemoData {
- Attribute int32Val: int32 = "4711"
- Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
- Attribute float64Val: float64 = "0.0"
- Attribute stringVal: string = "\"empty\""
- }
-}
-bq.
-
-h2. Generate and run the model
-
-With the MWe2 workflow generate the code and run the model.
-The output should look like this:
-
-
-type 'quit' to exit
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 1
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 2
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 3
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 4
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 5
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 6
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 7
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 8
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 9
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-data: 10
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
-d.int32Val: 4711
-d.float64Val: 0,000000
-d.int8Array: 1 2 3 4 5 6 7 8 9 10
-d.stringVal: empty
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
-d.int32Val: 815
-d.float64Val: 3,141234
-d.int8Array: 100 101 102 103 104 105 106 107 108 109
-d.stringVal: some contents
-/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
-quit
-echo: quit
-
-h2. Summary
-
-Within the first loop a integer value will be incremented from ??MrPong?? and sent back to ??MrPing??. Is long as the guard is true ??MrPing?? sends back the value.
-
-Within the ??next?? transition, ??MrPing?? creates a data class and sends the default values. Than ??MrPing?? changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
-In later versions of eTrice a additional mechanism to send references will be implemented. However, keep in mind that sending references takes the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
-
-
+h1. Tutorial Sending Data
+
+h2. Scope
+
+This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
+MrPing will send data and verify the result.
+
+You will perform the following steps:
+
+# create a new model from scratch
+# create a data class
+# define a protocol with attached data
+# create an actor structure
+# create two simple state machines
+# build and run the model
+
+h2. Create a new model from scratch
+
+Remember exercise ??HelloWorld??.
+Create a new eTrice project and name it ??SendingData??
+Open the ??SendingData.room?? file and copy the following code into the file or use content assist to create the model.
+
+
+bc..
+RoomModel SendingData {
+ LogicalSystem SendingData_LogSystem {
+ SubSystemRef SendingDataAppl:SendingData_SubSystem
+ }
+ SubSystemClass SendingData_SubSystem {
+ ActorRef SendigDataTopRef:SendingDataTop
+ }
+ ActorClass SendingDataTop {
+ }
+ }
+bq.
+
+h2. Add a data class
+
+Position the cursor outside any class definition and right click the mouse within the editor window. From the context menu select ??Content Assist?? (or Ctrl+Space).
+
+!images/025-SendingData01.png!
+
+Select ??DataClass - data class skeleton?? and name it ??DemoData??.
+Remove the operations and ass the following Attributes:
+
+bc..
+ DataClass DemoData {
+ Attribute int32Val: int32 = "4711"
+ Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
+ Attribute float64Val: float64 = "0.0"
+ Attribute stringVal: string = "\"empty\""
+ }
+bq.
+
+Save the model and visit the outline view.
+Note that the outline view contains all data elements as defined in the model.
+
+h2. Create a new protocol
+
+With the help of ??Content Assist?? create a ??ProtocolClass?? and name it ??PingPongProtocol??. Create the following messages:
+
+bc..
+ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping(data: DemoData)
+ Message pingSimple(data:int32)
+ }
+ outgoing {
+ Message pong(data: DemoData)
+ Message pongSimple(data:int32)
+ }
+ }
+bq.
+
+h2. Create MrPing and MrPong Actors
+
+With the help of ??Content Assist?? create two new actor classes and name them ??MrPing?? and ??MrPong??. The resulting model should look like this:
+
+bc..
+RoomModel SendingData {
+
+ LogicalSystem SendingData_LogSystem {
+ SubSystemRef SendingDataAppl: SendingData_SubSystem
+ }
+
+ SubSystemClass SendingData_SubSystem {
+ ActorRef SendigDataTopRef: SendingDataTop
+ }
+
+ ActorClass SendingDataTop { }
+
+ DataClass DemoData {
+ Attribute int32Val: int32 = "4711"
+ Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
+ Attribute float64Val: float64 = "0.0"
+ Attribute stringVal: string = "\"empty\""
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping(data: DemoData)
+ Message pingSimple(data: int32)
+ }
+ outgoing {
+ Message pong(data: DemoData)
+ Message pongSimple(data: int32)
+ }
+ }
+
+ ActorClass MrPing {
+ Interface { }
+ Structure { }
+ Behavior { }
+ }
+
+ ActorClass MrPong {
+ Interface { }
+ Structure { }
+ Behavior { }
+ }
+}
+
+bq.
+
+The outline view should look like this:
+
+!images/025-SendingData03.png!
+
+h2. Define Actor Structure and Behavior
+
+Save the model and visit the outline view. Within the outline view, right click on the ??MrPong?? actor and select ??Edit Structure??. Select an ??Interface Port?? from the toolbox and add it to MrPong. Name the Port ??PingPongPort?? and select the ??PingPongProtocol??
+
+!images/025-SendingData02.png!
+
+Do the same with MrPing but mark the port as ??conjugated??
+
+h3. Define MrPongs behavior
+
+Within the outline view, right click MrPong and select ??Edit Behavior??. Create the following state machine:
+
+!images/025-SendingData04.png!
+
+The transition dialogues should look like this:
+For ??ping??:
+
+!images/025-SendingData05.png!
+
+For ??pingSimple??:
+
+!images/025-SendingData06.png!
+
+
+h3. Define MrPing behavior
+
+Within the outline view double click MrPing. Navigate the cursor to the behavior of MrPing. With the help of content assist create a new operation.
+
+!images/025-SendingData07.png!
+
+Name the operation ??printData?? and define the DemoData as a parameter.
+
+Fill in the following code:
+
+bc..
+Operation printData(d: DemoData) : void {
+ "System.out.printf(\"d.int32Val: %d\\n\",d.int32Val);"
+ "System.out.printf(\"d.float64Val: %f\\n\",d.float64Val);"
+ "System.out.printf(\"d.int8Array: \");"
+ "for(int i = 0; i<d.int8Array.length; i++) {"
+ "System.out.printf(\"%d \",d.int8Array[i]);}"
+ "System.out.printf(\"\\nd.stringVal: %s\\n\",d.stringVal);"
+ }
+bq.
+
+For MrPing create the following state machine:
+
+!images/025-SendingData08.png!
+
+The transition dialogues should look like this:
+
+For ??init??:
+
+!images/025-SendingData09.png!
+
+For ??wait1??:
+
+!images/025-SendingData10.png!
+
+For ??next??:
+
+!images/025-SendingData11.png!
+
+For ??wait2??:
+
+!images/025-SendingData12.png!
+
+h2. Define the top level
+
+Open the Structure from SendingDataTop and add MrPing and MrPong as a reference. Connect the ports.
+
+!images/025-SendingData13.png!
+
+The model is finished now and the model file should look like this:
+
+bc..
+RoomModel SendingData {
+
+ LogicalSystem SendingData_LogSystem {
+ SubSystemRef SendingDataAppl: SendingData_SubSystem
+ }
+
+ SubSystemClass SendingData_SubSystem {
+ ActorRef SendigDataTopRef: SendingDataTop
+ }
+
+ ActorClass SendingDataTop {
+ Structure {
+ ActorRef ref0: MrPing
+ ActorRef ref1: MrPong
+ Binding ref0.PingPongPort and ref1.PingPongPort
+ }
+ Behavior { }
+ }
+
+ ActorClass MrPing {
+ Interface {
+ conjugated Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+
+ Operation printData(d: DemoData) : void {
+ "System.out.printf(\"d.int32Val: %d\\n\",d.int32Val);"
+ "System.out.printf(\"d.float64Val: %f\\n\",d.float64Val);"
+ "System.out.printf(\"d.int8Array: \");"
+ "for(int i = 0; i<d.int8Array.length; i++) {"
+ "System.out.printf(\"%d \",d.int8Array[i]);}"
+ "System.out.printf(\"\\nd.stringVal: %s\\n\",d.stringVal);"
+ }
+
+ StateMachine {
+ Transition wait2: waitForPong -> waitForPong {
+ triggers {
+ <pong: PingPongPort>
+ }
+ action {
+ "printData(data);"
+ }
+ }
+ Transition wait1: waitForPongSimple -> waitForPongSimple {
+ triggers {
+ <pongSimple: PingPongPort guard {
+ "data < 10"
+ }>
+ }
+ action {
+ "// keep in mind that MrPong increments"
+ "PingPongPort.pingSimple(data);"
+ "System.out.printf(\"data: %d\\n\",data);"
+ }
+ }
+ Transition next: waitForPongSimple -> waitForPong {
+ triggers {
+ <pongSimple: PingPongPort>
+ }
+ action {
+ "System.out.printf(\"data: %d\\n\",data);"
+ ""
+ "DemoData d = new DemoData();"
+ "// send the default values"
+ "PingPongPort.ping(d);"
+ "d.int32Val=815;"
+ "for (int i = 0; i<d.int8Array.length;i++){"
+ "\td.int8Array[i]=(byte)(i+100);"
+ "\t}"
+ "d.stringVal=\"some contents\";"
+ "d.float64Val=3.141234;"
+ "PingPongPort.ping(d);"
+ }
+ }
+ Transition init0: initial -> waitForPongSimple {
+ action {
+ "PingPongPort.pingSimple(0);"
+ }
+ }
+ State waitForPong
+ State waitForPongSimple
+ }
+ }
+ }
+
+ ActorClass MrPong {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> looping { }
+ Transition tr0: looping -> looping {
+ triggers {
+ <ping: PingPongPort>
+ }
+ action {
+ "PingPongPort.pong(data);"
+ }
+ }
+ Transition tr1: looping -> looping {
+ triggers {
+ <pingSimple: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongSimple(data+1);"
+ }
+ }
+ State looping
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping(data: DemoData)
+ Message pingSimple(data: int32)
+ }
+ outgoing {
+ Message pong(data: DemoData)
+ Message pongSimple(data: int32)
+ }
+ }
+
+ DataClass DemoData {
+ Attribute int32Val: int32 = "4711"
+ Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
+ Attribute float64Val: float64 = "0.0"
+ Attribute stringVal: string = "\"empty\""
+ }
+}
+bq.
+
+h2. Generate and run the model
+
+With the MWe2 workflow generate the code and run the model.
+The output should look like this:
+
+bq..
+type 'quit' to exit
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 1
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 2
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 3
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 4
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 5
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 6
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 7
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 8
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 9
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPongSimple
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+data: 10
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+/SendingData_SubSystem/SendigDataTopRef/ref1 -> looping
+d.int32Val: 4711
+d.float64Val: 0,000000
+d.int8Array: 1 2 3 4 5 6 7 8 9 10
+d.stringVal: empty
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
+d.int32Val: 815
+d.float64Val: 3,141234
+d.int8Array: 100 101 102 103 104 105 106 107 108 109
+d.stringVal: some contents
+/SendingData_SubSystem/SendigDataTopRef/ref0 -> waitForPong
+quit
+echo: quit
+bq.
+
+h2. Summary
+
+Within the first loop an integer value will be incremented from ??MrPong?? and sent back to ??MrPing??. As long as the guard is true ??MrPing?? sends back the value.
+
+Within the ??next?? transition, ??MrPing?? creates a data class and sends the default values. Than ??MrPing?? changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
+In future versions of eTrice an additional mechanism to send references will be implemented. However, keep in mind that sending references transfers the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+
+
diff --git a/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile b/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
index c6a22d2..3083dd0 100644
--- a/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
@@ -1,237 +1,237 @@
-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. 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. Being familiar with the basic tool features is mandatory 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 several 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 few 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).
+* In PedestrianLightWndNoTcp.jav uncomment 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 safe?
+
+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 safe and does not violate 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.
+
+
+
diff --git a/plugins/org.eclipse.etrice.doc/help/Addadataclass.html b/plugins/org.eclipse.etrice.doc/help/Addadataclass.html
index 796c4b8..67b7989 100644
--- a/plugins/org.eclipse.etrice.doc/help/Addadataclass.html
+++ b/plugins/org.eclipse.etrice.doc/help/Addadataclass.html
@@ -1,60 +1,60 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Add a data class</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="Createanewmodelfromscratch3.html" title="Create a new model from scratch">
-<link rel="next" href="Createanewprotocol2.html" title="Create a new protocol">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Add a data class</h1>
-<div class="section" title="Add a data class">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Addadataclass"></a>Add a data class</h2>
-</div>
-</div>
-</div>
-<p>Position the cursor outside any class definition and right click the mouse within the editor window. From the context menu select
- [<span class="citation">Content Assist</span>] (or Ctrl+Space).
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData01.png"></div>
-<p>
-
-</p>
-<p>Select
- [<span class="citation">DataClass &ndash; data class skeleton</span>] and name it
- [<span class="citation">DemoData</span>].
- Remove the operations and ass the following Attributes:
- </p>
-<div class="literallayout">
-<p>
-<code class="code"> DataClass&nbsp;DemoData&nbsp;{<br>
- Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
- Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
- Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
- Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
- }<br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-<p>Save the model and visit the outline view.
- Note that the outline view contains all data elements as defined in the model. </p>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Add a data class</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="Createanewmodelfromscratch3.html" title="Create a new model from scratch">
+<link rel="next" href="Createanewprotocol2.html" title="Create a new protocol">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Add a data class</h1>
+<div class="section" title="Add a data class">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Addadataclass"></a>Add a data class</h2>
+</div>
+</div>
+</div>
+<p>Position the cursor outside any class definition and right click the mouse within the editor window. From the context menu select
+ [<span class="citation">Content Assist</span>] (or Ctrl+Space).
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData01.png"></div>
+<p>
+
+</p>
+<p>Select
+ [<span class="citation">DataClass &ndash; data class skeleton</span>] and name it
+ [<span class="citation">DemoData</span>].
+ Remove the operations and ass the following Attributes:
+ </p>
+<div class="literallayout">
+<p>
+<code class="code"> DataClass&nbsp;DemoData&nbsp;{<br>
+ Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
+ Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
+ Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
+ Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
+ }<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<p>Save the model and visit the outline view.
+ Note that the outline view contains all data elements as defined in the model. </p>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Buildandrunthemodel.html b/plugins/org.eclipse.etrice.doc/help/Buildandrunthemodel.html
index 367b9f2..3d65d1e 100644
--- a/plugins/org.eclipse.etrice.doc/help/Buildandrunthemodel.html
+++ b/plugins/org.eclipse.etrice.doc/help/Buildandrunthemodel.html
@@ -32,7 +32,7 @@
<p>
</p>
-<p>The code will be generated to the src-gen directory. The main class will be contained in
+<p>The code will be generated to the src-gen directory. The main function will be contained in
[<span class="citation">SubSystem_HelloWorldRunner.java</span>]. Select this file and run it as Java application.
</p>
<p>
diff --git a/plugins/org.eclipse.etrice.doc/help/CreateMrPingandMrPongActors.html b/plugins/org.eclipse.etrice.doc/help/CreateMrPingandMrPongActors.html
index e0b253b..8a8e89b 100644
--- a/plugins/org.eclipse.etrice.doc/help/CreateMrPingandMrPongActors.html
+++ b/plugins/org.eclipse.etrice.doc/help/CreateMrPingandMrPongActors.html
@@ -1,101 +1,101 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Create MrPing and MrPong Actors</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="Createanewprotocol2.html" title="Create a new protocol">
-<link rel="next" href="DefinetheActorsStructureandBehavior.html" title="Define the Actors Structure and Behavior">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create MrPing and MrPong Actors</h1>
-<div class="section" title="Create MrPing and MrPong Actors">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="CreateMrPingandMrPongActors"></a>Create MrPing and MrPong Actors</h2>
-</div>
-</div>
-</div>
-<p>With the help of
- [<span class="citation">Content Assist</span>] create two new actor classes and name them
- [<span class="citation">MrPing</span>] and
- [<span class="citation">MrPong</span>]. The resulting model should look like this:
- </p>
-<div class="literallayout">
-<p>
-<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
-
-<br>
- LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
- SubSystemRef&nbsp;SendingDataAppl:&nbsp;SendingData_SubSystem<br>
- }<br>
-
-<br>
- SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
- ActorRef&nbsp;SendigDataTopRef:&nbsp;SendingDataTop<br>
- }<br>
-
-<br>
- ActorClass&nbsp;SendingDataTop&nbsp;{&nbsp;}<br>
-
-<br>
- DataClass&nbsp;DemoData&nbsp;{<br>
- Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
- Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
- Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
- Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
- }<br>
-
-<br>
- ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
- incoming&nbsp;{<br>
- Message&nbsp;ping(data:&nbsp;DemoData)<br>
- Message&nbsp;pingSimple(data:&nbsp;int32)<br>
- }<br>
- outgoing&nbsp;{<br>
- Message&nbsp;pong(data:&nbsp;DemoData)<br>
- Message&nbsp;pongSimple(data:&nbsp;int32)<br>
- }<br>
- }<br>
-
-<br>
- ActorClass&nbsp;MrPing&nbsp;{<br>
- Interface&nbsp;{&nbsp;}<br>
- Structure&nbsp;{&nbsp;}<br>
- Behavior&nbsp;{&nbsp;}<br>
- }<br>
-
-<br>
- ActorClass&nbsp;MrPong&nbsp;{<br>
- Interface&nbsp;{&nbsp;}<br>
- Structure&nbsp;{&nbsp;}<br>
- Behavior&nbsp;{&nbsp;}<br>
- }<br>
-}&nbsp;<br>
-
-<br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-<p>The outline view should look like this:</p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData03.png"></div>
-<p>
-
-</p>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Create MrPing and MrPong Actors</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="Createanewprotocol2.html" title="Create a new protocol">
+<link rel="next" href="DefineActorStructureandBehavior.html" title="Define Actor Structure and Behavior">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create MrPing and MrPong Actors</h1>
+<div class="section" title="Create MrPing and MrPong Actors">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="CreateMrPingandMrPongActors"></a>Create MrPing and MrPong Actors</h2>
+</div>
+</div>
+</div>
+<p>With the help of
+ [<span class="citation">Content Assist</span>] create two new actor classes and name them
+ [<span class="citation">MrPing</span>] and
+ [<span class="citation">MrPong</span>]. The resulting model should look like this:
+ </p>
+<div class="literallayout">
+<p>
+<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
+
+<br>
+ LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
+ SubSystemRef&nbsp;SendingDataAppl:&nbsp;SendingData_SubSystem<br>
+ }<br>
+
+<br>
+ SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
+ ActorRef&nbsp;SendigDataTopRef:&nbsp;SendingDataTop<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;SendingDataTop&nbsp;{&nbsp;}<br>
+
+<br>
+ DataClass&nbsp;DemoData&nbsp;{<br>
+ Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
+ Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
+ Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
+ Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
+ }<br>
+
+<br>
+ ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
+ incoming&nbsp;{<br>
+ Message&nbsp;ping(data:&nbsp;DemoData)<br>
+ Message&nbsp;pingSimple(data:&nbsp;int32)<br>
+ }<br>
+ outgoing&nbsp;{<br>
+ Message&nbsp;pong(data:&nbsp;DemoData)<br>
+ Message&nbsp;pongSimple(data:&nbsp;int32)<br>
+ }<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;MrPing&nbsp;{<br>
+ Interface&nbsp;{&nbsp;}<br>
+ Structure&nbsp;{&nbsp;}<br>
+ Behavior&nbsp;{&nbsp;}<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;MrPong&nbsp;{<br>
+ Interface&nbsp;{&nbsp;}<br>
+ Structure&nbsp;{&nbsp;}<br>
+ Behavior&nbsp;{&nbsp;}<br>
+ }<br>
+}&nbsp;<br>
+
+<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<p>The outline view should look like this:</p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData03.png"></div>
+<p>
+
+</p>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch.html b/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch.html
index c1afd04..76f50dc 100644
--- a/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch.html
+++ b/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch.html
@@ -108,9 +108,9 @@
[<span class="citation">SubSystemRef</span>]. The
[<span class="citation">SubSystemClass</span>] represents an address space and contains at least one
[<span class="citation">ActorRef</span>]. The
- [<span class="citation">ActorClass</span>] is the building block of which an application will be build of. It is a good idea to define a top level actor that can be used as reference within the subsystem.
+ [<span class="citation">ActorClass</span>] is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
</p>
-<p>Mention that a outline view was created that represents all currently existing model elements in a graphical way.</p>
+<p>The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.</p>
<p>
</p>
diff --git a/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch3.html b/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch3.html
index 15a5a52..d9f127e 100644
--- a/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch3.html
+++ b/plugins/org.eclipse.etrice.doc/help/Createanewmodelfromscratch3.html
@@ -1,53 +1,53 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Create a new model from scratch</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="next" href="Addadataclass.html" title="Add a data class">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create a new model from scratch</h1>
-<div class="section" title="Create a new model from scratch">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Createanewmodelfromscratch3"></a>Create a new model from scratch</h2>
-</div>
-</div>
-</div>
-<p>Remember exercise
- [<span class="citation">HelloWorld</span>].
- Create a new eTrice project and name it
- [<span class="citation">SendingData</span>]
- Open the
- [<span class="citation">SendingData.room</span>] file and copy the following code into the file or use content assist to create the model.
- </p>
-<div class="literallayout">
-<p>
-<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
- LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
- SubSystemRef&nbsp;SendingDataAppl:SendingData_SubSystem&nbsp;<br>
- }<br>
- SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
- ActorRef&nbsp;SendigDataTopRef:SendingDataTop&nbsp;<br>
- }<br>
- ActorClass&nbsp;SendingDataTop&nbsp;{<br>
- }<br>
- }<br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Create a new model from scratch</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="next" href="Addadataclass.html" title="Add a data class">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create a new model from scratch</h1>
+<div class="section" title="Create a new model from scratch">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Createanewmodelfromscratch3"></a>Create a new model from scratch</h2>
+</div>
+</div>
+</div>
+<p>Remember exercise
+ [<span class="citation">HelloWorld</span>].
+ Create a new eTrice project and name it
+ [<span class="citation">SendingData</span>]
+ Open the
+ [<span class="citation">SendingData.room</span>] file and copy the following code into the file or use content assist to create the model.
+ </p>
+<div class="literallayout">
+<p>
+<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
+ LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
+ SubSystemRef&nbsp;SendingDataAppl:SendingData_SubSystem&nbsp;<br>
+ }<br>
+ SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
+ ActorRef&nbsp;SendigDataTopRef:SendingDataTop&nbsp;<br>
+ }<br>
+ ActorClass&nbsp;SendingDataTop&nbsp;{<br>
+ }<br>
+ }<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Createanewprotocol.html b/plugins/org.eclipse.etrice.doc/help/Createanewprotocol.html
index f603006..a8ec4d3 100644
--- a/plugins/org.eclipse.etrice.doc/help/Createanewprotocol.html
+++ b/plugins/org.eclipse.etrice.doc/help/Createanewprotocol.html
@@ -25,7 +25,7 @@
[<span class="citation">ProtocolClass</span>] and name it
[<span class="citation">BlinkyControlProtocol</span>].
Inside the brackets use the
- [<span class="citation">Content Assist</span>] (CTRL+Space) to create two incomming messages called
+ [<span class="citation">Content Assist</span>] (CTRL+Space) to create two incoming messages called
[<span class="citation">start</span>] and
[<span class="citation">stop</span>].
</p>
@@ -39,7 +39,7 @@
</p>
<p>With Ctrl-Shift+F or selecting
- [<span class="citation">Format</span>] from the context menu you can format the text. Mention that all elements are displayed in the outline view.
+ [<span class="citation">Format</span>] from the context menu you can format the text. Note that all elements are displayed in the outline view.
</p>
</div>
</body>
diff --git a/plugins/org.eclipse.etrice.doc/help/Createanewprotocol2.html b/plugins/org.eclipse.etrice.doc/help/Createanewprotocol2.html
index 86ef1d9..14ddeb7 100644
--- a/plugins/org.eclipse.etrice.doc/help/Createanewprotocol2.html
+++ b/plugins/org.eclipse.etrice.doc/help/Createanewprotocol2.html
@@ -1,51 +1,51 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Create a new protocol</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="Addadataclass.html" title="Add a data class">
-<link rel="next" href="CreateMrPingandMrPongActors.html" title="Create MrPing and MrPong Actors">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create a new protocol</h1>
-<div class="section" title="Create a new protocol">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Createanewprotocol2"></a>Create a new protocol</h2>
-</div>
-</div>
-</div>
-<p>With the help of
- [<span class="citation">Content Assist</span>] create a
- [<span class="citation">ProtocolClass</span>] and name it
- [<span class="citation">PingPongProtocol</span>]. Create the following messages:
- </p>
-<div class="literallayout">
-<p>
-<code class="code">ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
- incoming&nbsp;{<br>
- Message&nbsp;ping(data:&nbsp;DemoData)<br>
- Message&nbsp;pingSimple(data:int32)<br>
- }<br>
- outgoing&nbsp;{<br>
- Message&nbsp;pong(data:&nbsp;DemoData)<br>
- Message&nbsp;pongSimple(data:int32)<br>
- }<br>
- } <br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Create a new protocol</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="Addadataclass.html" title="Add a data class">
+<link rel="next" href="CreateMrPingandMrPongActors.html" title="Create MrPing and MrPong Actors">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create a new protocol</h1>
+<div class="section" title="Create a new protocol">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Createanewprotocol2"></a>Create a new protocol</h2>
+</div>
+</div>
+</div>
+<p>With the help of
+ [<span class="citation">Content Assist</span>] create a
+ [<span class="citation">ProtocolClass</span>] and name it
+ [<span class="citation">PingPongProtocol</span>]. Create the following messages:
+ </p>
+<div class="literallayout">
+<p>
+<code class="code">ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
+ incoming&nbsp;{<br>
+ Message&nbsp;ping(data:&nbsp;DemoData)<br>
+ Message&nbsp;pingSimple(data:int32)<br>
+ }<br>
+ outgoing&nbsp;{<br>
+ Message&nbsp;pong(data:&nbsp;DemoData)<br>
+ Message&nbsp;pongSimple(data:int32)<br>
+ }<br>
+ } <br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/DefinetheActorsStructureandBehavior.html b/plugins/org.eclipse.etrice.doc/help/DefineActorStructureandBehavior.html
index f551ce3..826ea94 100644
--- a/plugins/org.eclipse.etrice.doc/help/DefinetheActorsStructureandBehavior.html
+++ b/plugins/org.eclipse.etrice.doc/help/DefineActorStructureandBehavior.html
@@ -1,183 +1,183 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Define the Actors Structure and Behavior</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="CreateMrPingandMrPongActors.html" title="Create MrPing and MrPong Actors">
-<link rel="next" href="Definethetoplevel.html" title="Define the top level">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Define the Actors Structure and Behavior</h1>
-<div class="section" title="Define the Actors Structure and Behavior">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="DefinetheActorsStructureandBehavior"></a>Define the Actors Structure and Behavior</h2>
-</div>
-</div>
-</div>
-<p>Save the model and visit the outline view. Within the outline view, right click on the
- [<span class="citation">MrPong</span>] actor and select
- [<span class="citation">Edit Structure</span>]. Select an
- [<span class="citation">Interface Port</span>] from the toolbox and add it to MrPong. Name the Port
- [<span class="citation">PingPongPort</span>] and select the
- [<span class="citation">PingPongProtocol</span>]
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData02.png"></div>
-<p>
-
-</p>
-<p>Do the same with MrPing but mark the port as
- [<span class="citation">conjugated</span>]
- </p>
-<div class="section" title="Define MrPongs behavior">
-<div class="titlepage">
-<div>
-<div>
-<h3 class="title">
-<a name="DefineMrPongsbehavior"></a>Define MrPongs behavior</h3>
-</div>
-</div>
-</div>
-<p>Within the outline view, right click MrPong and select
- [<span class="citation">Edit Behavior</span>]. Create the following state machine:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData04.png"></div>
-<p>
-
-</p>
-<p>The transition dialogues should look like this:
- For
- [<span class="citation">ping</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData05.png"></div>
-<p>
-
-</p>
-<p>For
- [<span class="citation">pingSimple</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData06.png"></div>
-<p>
-
-</p>
-</div>
-<div class="section" title="Define MrPing behavior">
-<div class="titlepage">
-<div>
-<div>
-<h3 class="title">
-<a name="DefineMrPingbehavior"></a>Define MrPing behavior</h3>
-</div>
-</div>
-</div>
-<p>Within the outline view double click MrPing. Navigate the cursor to the behavior of MrPing. With the help of content assist create a new operation.</p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData07.png"></div>
-<p>
-
-</p>
-<p>Name the operation
- [<span class="citation">printData</span>] and define the DemoData as a parameter.
- </p>
-<p>Fill in the following code:</p>
-<div class="literallayout">
-<p>
-<code class="code">Operation&nbsp;printData(d:&nbsp;DemoData)&nbsp;:&nbsp;void&nbsp;{<br>
- "System.out.printf(\"d.int32Val:&nbsp;%d\\n\",d.int32Val);"<br>
- "System.out.printf(\"d.float64Val:&nbsp;%f\\n\",d.float64Val);"<br>
- "System.out.printf(\"d.int8Array:&nbsp;\");"<br>
- "for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;&nbsp;i++)&nbsp;{"<br>
- "System.out.printf(\"%d&nbsp;\",d.int8Array[i]);}"<br>
- "System.out.printf(\"\\nd.stringVal:&nbsp;%s\\n\",d.stringVal);"<br>
- }<br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-<p>For MrPing create the following state machine:</p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData08.png"></div>
-<p>
-
-</p>
-<p>The transition dialogues should look like this:</p>
-<p>For
- [<span class="citation">init</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData09.png"></div>
-<p>
-
-</p>
-<p>For
- [<span class="citation">wait1</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData10.png"></div>
-<p>
-
-</p>
-<p>For
- [<span class="citation">next</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData11.png"></div>
-<p>
-
-</p>
-<p>For
- [<span class="citation">wait2</span>]:
- </p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData12.png"></div>
-<p>
-
-</p>
-</div>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Define Actor Structure and Behavior</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="CreateMrPingandMrPongActors.html" title="Create MrPing and MrPong Actors">
+<link rel="next" href="Definethetoplevel.html" title="Define the top level">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Define Actor Structure and Behavior</h1>
+<div class="section" title="Define Actor Structure and Behavior">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="DefineActorStructureandBehavior"></a>Define Actor Structure and Behavior</h2>
+</div>
+</div>
+</div>
+<p>Save the model and visit the outline view. Within the outline view, right click on the
+ [<span class="citation">MrPong</span>] actor and select
+ [<span class="citation">Edit Structure</span>]. Select an
+ [<span class="citation">Interface Port</span>] from the toolbox and add it to MrPong. Name the Port
+ [<span class="citation">PingPongPort</span>] and select the
+ [<span class="citation">PingPongProtocol</span>]
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData02.png"></div>
+<p>
+
+</p>
+<p>Do the same with MrPing but mark the port as
+ [<span class="citation">conjugated</span>]
+ </p>
+<div class="section" title="Define MrPongs behavior">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="DefineMrPongsbehavior"></a>Define MrPongs behavior</h3>
+</div>
+</div>
+</div>
+<p>Within the outline view, right click MrPong and select
+ [<span class="citation">Edit Behavior</span>]. Create the following state machine:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData04.png"></div>
+<p>
+
+</p>
+<p>The transition dialogues should look like this:
+ For
+ [<span class="citation">ping</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData05.png"></div>
+<p>
+
+</p>
+<p>For
+ [<span class="citation">pingSimple</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData06.png"></div>
+<p>
+
+</p>
+</div>
+<div class="section" title="Define MrPing behavior">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="DefineMrPingbehavior"></a>Define MrPing behavior</h3>
+</div>
+</div>
+</div>
+<p>Within the outline view double click MrPing. Navigate the cursor to the behavior of MrPing. With the help of content assist create a new operation.</p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData07.png"></div>
+<p>
+
+</p>
+<p>Name the operation
+ [<span class="citation">printData</span>] and define the DemoData as a parameter.
+ </p>
+<p>Fill in the following code:</p>
+<div class="literallayout">
+<p>
+<code class="code">Operation&nbsp;printData(d:&nbsp;DemoData)&nbsp;:&nbsp;void&nbsp;{<br>
+ "System.out.printf(\"d.int32Val:&nbsp;%d\\n\",d.int32Val);"<br>
+ "System.out.printf(\"d.float64Val:&nbsp;%f\\n\",d.float64Val);"<br>
+ "System.out.printf(\"d.int8Array:&nbsp;\");"<br>
+ "for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;&nbsp;i++)&nbsp;{"<br>
+ "System.out.printf(\"%d&nbsp;\",d.int8Array[i]);}"<br>
+ "System.out.printf(\"\\nd.stringVal:&nbsp;%s\\n\",d.stringVal);"<br>
+ }<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<p>For MrPing create the following state machine:</p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData08.png"></div>
+<p>
+
+</p>
+<p>The transition dialogues should look like this:</p>
+<p>For
+ [<span class="citation">init</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData09.png"></div>
+<p>
+
+</p>
+<p>For
+ [<span class="citation">wait1</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData10.png"></div>
+<p>
+
+</p>
+<p>For
+ [<span class="citation">next</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData11.png"></div>
+<p>
+
+</p>
+<p>For
+ [<span class="citation">wait2</span>]:
+ </p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData12.png"></div>
+<p>
+
+</p>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html b/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
index 390b779..3693877 100644
--- a/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
+++ b/plugins/org.eclipse.etrice.doc/help/Definethetoplevel.html
@@ -1,195 +1,192 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Define the top level</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="DefinetheActorsStructureandBehavior.html" title="Define the Actors Structure and Behavior">
-<link rel="next" href="Generateandrunthemodel.html" title="Generate and run the model">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Define the top level</h1>
-<div class="section" title="Define the top level">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Definethetoplevel"></a>Define the top level</h2>
-</div>
-</div>
-</div>
-<p>Open the Structure from SendingDataTop and add MrPing and MrPong as a reference. Connect the ports.</p>
-<p>
-
-</p>
-<div class="mediaobject">
-<img src="images/025-SendingData13.png"></div>
-<p>
-
-</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>
-
-<br>
- LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
- SubSystemRef&nbsp;SendingDataAppl:&nbsp;SendingData_SubSystem<br>
- }<br>
-
-<br>
- SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
- ActorRef&nbsp;SendigDataTopRef:&nbsp;SendingDataTop<br>
- }<br>
-
-<br>
- ActorClass&nbsp;SendingDataTop&nbsp;{<br>
- Structure&nbsp;{<br>
- ActorRef&nbsp;ref0:&nbsp;MrPing<br>
- ActorRef&nbsp;ref1:&nbsp;MrPong<br>
- Binding&nbsp;ref0.PingPongPort&nbsp;and&nbsp;ref1.PingPongPort<br>
- }<br>
- Behavior&nbsp;{&nbsp;}<br>
- }<br>
-
-<br>
- ActorClass&nbsp;MrPing&nbsp;{<br>
- Interface&nbsp;{<br>
- conjugated&nbsp;Port&nbsp;PingPongPort:&nbsp;PingPongProtocol<br>
- }<br>
- Structure&nbsp;{<br>
- external&nbsp;Port&nbsp;PingPongPort<br>
- }<br>
- Behavior&nbsp;{<br>
-
-<br>
- Operation&nbsp;printData(d:&nbsp;DemoData)&nbsp;:&nbsp;void&nbsp;{<br>
- "System.out.printf(\"d.int32Val:&nbsp;%d\\n\",d.int32Val);"<br>
- "System.out.printf(\"d.float64Val:&nbsp;%f\\n\",d.float64Val);"<br>
- "System.out.printf(\"d.int8Array:&nbsp;\");"<br>
- "for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;&nbsp;i++)&nbsp;{"<br>
- "System.out.printf(\"%d&nbsp;\",d.int8Array[i]);}"<br>
- "System.out.printf(\"\\nd.stringVal:&nbsp;%s\\n\",d.stringVal);"<br>
- }<br>
-
-<br>
- StateMachine&nbsp;{<br>
- Transition&nbsp;wait2:&nbsp;waitForPong&nbsp;-&gt;&nbsp;waitForPong&nbsp;{<br>
- triggers&nbsp;{<br>
- &lt;pong:&nbsp;PingPongPort&gt;<br>
- }<br>
- action&nbsp;{<br>
- "printData(data);"<br>
- }<br>
- }<br>
- Transition&nbsp;wait1:&nbsp;waitForPongSimple&nbsp;-&gt;&nbsp;waitForPongSimple&nbsp;{<br>
- triggers&nbsp;{<br>
- &lt;pongSimple:&nbsp;PingPongPort&nbsp;guard&nbsp;{<br>
- "data&nbsp;&lt;&nbsp;10"<br>
- }&gt;<br>
- }<br>
- action&nbsp;{<br>
- "//&nbsp;keep&nbsp;in&nbsp;mind&nbsp;that&nbsp;MrPong&nbsp;increments"<br>
- "PingPongPort.pingSimple(data);"<br>
- "System.out.printf(\"data:&nbsp;%d\\n\",data);"<br>
- }<br>
- }<br>
- Transition&nbsp;next:&nbsp;waitForPongSimple&nbsp;-&gt;&nbsp;waitForPong&nbsp;{<br>
- triggers&nbsp;{<br>
- &lt;pongSimple:&nbsp;PingPongPort&gt;<br>
- }<br>
- action&nbsp;{<br>
- "System.out.printf(\"data:&nbsp;%d\\n\",data);"<br>
- ""<br>
- "DemoData&nbsp;d&nbsp;=&nbsp;new&nbsp;DemoData();"<br>
- "//&nbsp;send&nbsp;the&nbsp;default&nbsp;values"<br>
- "PingPongPort.ping(d);"<br>
- "d.int32Val=815;"<br>
- "for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;i++){"<br>
- "\td.int8Array[i]=(byte)(i+100);"<br>
- "\t}"<br>
- "d.stringVal=\"some&nbsp;contents\";"<br>
- "d.float64Val=3.141234;"<br>
- "PingPongPort.ping(d);"<br>
- }<br>
- }<br>
- Transition&nbsp;init0:&nbsp;initial&nbsp;-&gt;&nbsp;waitForPongSimple&nbsp;{<br>
- action&nbsp;{<br>
- "PingPongPort.pingSimple(0);"<br>
- }<br>
- }<br>
- State&nbsp;waitForPong<br>
- State&nbsp;waitForPongSimple<br>
- }<br>
- }<br>
- }<br>
-
-<br>
- ActorClass&nbsp;MrPong&nbsp;{<br>
- Interface&nbsp;{<br>
- Port&nbsp;PingPongPort:&nbsp;PingPongProtocol<br>
- }<br>
- Structure&nbsp;{<br>
- external&nbsp;Port&nbsp;PingPongPort<br>
- }<br>
- Behavior&nbsp;{<br>
- StateMachine&nbsp;{<br>
- Transition&nbsp;init:&nbsp;initial&nbsp;-&gt;&nbsp;looping&nbsp;{&nbsp;}<br>
- Transition&nbsp;tr0:&nbsp;looping&nbsp;-&gt;&nbsp;looping&nbsp;{<br>
- triggers&nbsp;{<br>
- &lt;ping:&nbsp;PingPongPort&gt;<br>
- }<br>
- action&nbsp;{<br>
- "PingPongPort.pong(data);"<br>
- }<br>
- }<br>
- Transition&nbsp;tr1:&nbsp;looping&nbsp;-&gt;&nbsp;looping&nbsp;{<br>
- triggers&nbsp;{<br>
- &lt;pingSimple:&nbsp;PingPongPort&gt;<br>
- }<br>
- action&nbsp;{<br>
- "PingPongPort.pongSimple(data+1);"<br>
- }<br>
- }<br>
- State&nbsp;looping<br>
- }<br>
- }<br>
- }<br>
-
-<br>
- ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
- incoming&nbsp;{<br>
- Message&nbsp;ping(data:&nbsp;DemoData)<br>
- Message&nbsp;pingSimple(data:&nbsp;int32)<br>
- }<br>
- outgoing&nbsp;{<br>
- Message&nbsp;pong(data:&nbsp;DemoData)<br>
- Message&nbsp;pongSimple(data:&nbsp;int32)<br>
- }<br>
- }<br>
-
-<br>
- DataClass&nbsp;DemoData&nbsp;{<br>
- Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
- Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
- Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
- Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
- }<br>
-}<br>
-
-</code>
-</p>
-</div>
-<div class="blockquote">
-<blockquote class="blockquote">
-<p></p>
-</blockquote>
-</div>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Define the top level</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="DefineActorStructureandBehavior.html" title="Define Actor Structure and Behavior">
+<link rel="next" href="Generateandrunthemodel.html" title="Generate and run the model">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Define the top level</h1>
+<div class="section" title="Define the top level">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Definethetoplevel"></a>Define the top level</h2>
+</div>
+</div>
+</div>
+<p>Open the Structure from SendingDataTop and add MrPing and MrPong as a reference. Connect the ports.</p>
+<p>
+
+</p>
+<div class="mediaobject">
+<img src="images/025-SendingData13.png"></div>
+<p>
+
+</p>
+<p>The model is finished now and the model file should look like this:</p>
+<div class="literallayout">
+<p>
+<code class="code">RoomModel&nbsp;SendingData&nbsp;{<br>
+
+<br>
+ LogicalSystem&nbsp;SendingData_LogSystem&nbsp;{<br>
+ SubSystemRef&nbsp;SendingDataAppl:&nbsp;SendingData_SubSystem<br>
+ }<br>
+
+<br>
+ SubSystemClass&nbsp;SendingData_SubSystem&nbsp;{<br>
+ ActorRef&nbsp;SendigDataTopRef:&nbsp;SendingDataTop<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;SendingDataTop&nbsp;{<br>
+ Structure&nbsp;{<br>
+ ActorRef&nbsp;ref0:&nbsp;MrPing<br>
+ ActorRef&nbsp;ref1:&nbsp;MrPong<br>
+ Binding&nbsp;ref0.PingPongPort&nbsp;and&nbsp;ref1.PingPongPort<br>
+ }<br>
+ Behavior&nbsp;{&nbsp;}<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;MrPing&nbsp;{<br>
+ Interface&nbsp;{<br>
+ conjugated&nbsp;Port&nbsp;PingPongPort:&nbsp;PingPongProtocol<br>
+ }<br>
+ Structure&nbsp;{<br>
+ external&nbsp;Port&nbsp;PingPongPort<br>
+ }<br>
+ Behavior&nbsp;{<br>
+
+<br>
+ Operation&nbsp;printData(d:&nbsp;DemoData)&nbsp;:&nbsp;void&nbsp;{<br>
+ "System.out.printf(\"d.int32Val:&nbsp;%d\\n\",d.int32Val);"<br>
+ "System.out.printf(\"d.float64Val:&nbsp;%f\\n\",d.float64Val);"<br>
+ "System.out.printf(\"d.int8Array:&nbsp;\");"<br>
+ "for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;&nbsp;i++)&nbsp;{"<br>
+ "System.out.printf(\"%d&nbsp;\",d.int8Array[i]);}"<br>
+ "System.out.printf(\"\\nd.stringVal:&nbsp;%s\\n\",d.stringVal);"<br>
+ }<br>
+
+<br>
+ StateMachine&nbsp;{<br>
+ Transition&nbsp;wait2:&nbsp;waitForPong&nbsp;-&gt;&nbsp;waitForPong&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;pong:&nbsp;PingPongPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "printData(data);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;wait1:&nbsp;waitForPongSimple&nbsp;-&gt;&nbsp;waitForPongSimple&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;pongSimple:&nbsp;PingPongPort&nbsp;guard&nbsp;{<br>
+ "data&nbsp;&lt;&nbsp;10"<br>
+ }&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "//&nbsp;keep&nbsp;in&nbsp;mind&nbsp;that&nbsp;MrPong&nbsp;increments"<br>
+ "PingPongPort.pingSimple(data);"<br>
+ "System.out.printf(\"data:&nbsp;%d\\n\",data);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;next:&nbsp;waitForPongSimple&nbsp;-&gt;&nbsp;waitForPong&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;pongSimple:&nbsp;PingPongPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "System.out.printf(\"data:&nbsp;%d\\n\",data);"<br>
+ ""<br>
+ "DemoData&nbsp;d&nbsp;=&nbsp;new&nbsp;DemoData();"<br>
+ "//&nbsp;send&nbsp;the&nbsp;default&nbsp;values"<br>
+ "PingPongPort.ping(d);"<br>
+ "d.int32Val=815;"<br>
+ "for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;i++){"<br>
+ "\td.int8Array[i]=(byte)(i+100);"<br>
+ "\t}"<br>
+ "d.stringVal=\"some&nbsp;contents\";"<br>
+ "d.float64Val=3.141234;"<br>
+ "PingPongPort.ping(d);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;init0:&nbsp;initial&nbsp;-&gt;&nbsp;waitForPongSimple&nbsp;{<br>
+ action&nbsp;{<br>
+ "PingPongPort.pingSimple(0);"<br>
+ }<br>
+ }<br>
+ State&nbsp;waitForPong<br>
+ State&nbsp;waitForPongSimple<br>
+ }<br>
+ }<br>
+ }<br>
+
+<br>
+ ActorClass&nbsp;MrPong&nbsp;{<br>
+ Interface&nbsp;{<br>
+ Port&nbsp;PingPongPort:&nbsp;PingPongProtocol<br>
+ }<br>
+ Structure&nbsp;{<br>
+ external&nbsp;Port&nbsp;PingPongPort<br>
+ }<br>
+ Behavior&nbsp;{<br>
+ StateMachine&nbsp;{<br>
+ Transition&nbsp;init:&nbsp;initial&nbsp;-&gt;&nbsp;looping&nbsp;{&nbsp;}<br>
+ Transition&nbsp;tr0:&nbsp;looping&nbsp;-&gt;&nbsp;looping&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;ping:&nbsp;PingPongPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "PingPongPort.pong(data);"<br>
+ }<br>
+ }<br>
+ Transition&nbsp;tr1:&nbsp;looping&nbsp;-&gt;&nbsp;looping&nbsp;{<br>
+ triggers&nbsp;{<br>
+ &lt;pingSimple:&nbsp;PingPongPort&gt;<br>
+ }<br>
+ action&nbsp;{<br>
+ "PingPongPort.pongSimple(data+1);"<br>
+ }<br>
+ }<br>
+ State&nbsp;looping<br>
+ }<br>
+ }<br>
+ }<br>
+
+<br>
+ ProtocolClass&nbsp;PingPongProtocol&nbsp;{<br>
+ incoming&nbsp;{<br>
+ Message&nbsp;ping(data:&nbsp;DemoData)<br>
+ Message&nbsp;pingSimple(data:&nbsp;int32)<br>
+ }<br>
+ outgoing&nbsp;{<br>
+ Message&nbsp;pong(data:&nbsp;DemoData)<br>
+ Message&nbsp;pongSimple(data:&nbsp;int32)<br>
+ }<br>
+ }<br>
+
+<br>
+ DataClass&nbsp;DemoData&nbsp;{<br>
+ Attribute&nbsp;int32Val:&nbsp;int32&nbsp;=&nbsp;"4711"<br>
+ Attribute&nbsp;int8Array&nbsp;[&nbsp;10&nbsp;]:&nbsp;int8&nbsp;=&nbsp;"{1,2,3,4,5,6,7,8,9,10}"<br>
+ Attribute&nbsp;float64Val:&nbsp;float64&nbsp;=&nbsp;"0.0"<br>
+ Attribute&nbsp;stringVal:&nbsp;string&nbsp;=&nbsp;"\"empty\""<br>
+ }<br>
+}<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Finishthemodelstructure.html b/plugins/org.eclipse.etrice.doc/help/Finishthemodelstructure.html
index d68aac2..638af0e 100644
--- a/plugins/org.eclipse.etrice.doc/help/Finishthemodelstructure.html
+++ b/plugins/org.eclipse.etrice.doc/help/Finishthemodelstructure.html
@@ -48,7 +48,7 @@
[<span class="citation">stop</span>] as incoming messages.
[<span class="citation">Blinky</span>] receives this messages and therefore
[<span class="citation">Blinky</span>]'s
- [<span class="citation">ControlPort</span>] must be a base port and
+ [<span class="citation">ControlPort</span>] must be a regular port and
[<span class="citation">BlinkyController</span>]'s
[<span class="citation">ControlPort</span>] must be a conjugated port.
</p>
diff --git a/plugins/org.eclipse.etrice.doc/help/Generateandrunthemodel.html b/plugins/org.eclipse.etrice.doc/help/Generateandrunthemodel.html
index bf08789..c3e43e2 100644
--- a/plugins/org.eclipse.etrice.doc/help/Generateandrunthemodel.html
+++ b/plugins/org.eclipse.etrice.doc/help/Generateandrunthemodel.html
@@ -1,74 +1,84 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Generate and run the model</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<link rel="home" href="index.html" title="eTrice User Guide">
-<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
-<link rel="prev" href="Definethetoplevel.html" title="Define the top level">
-<link rel="next" href="Summary3.html" title="Summary">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Generate and run the model</h1>
-<div class="section" title="Generate and run the model">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Generateandrunthemodel"></a>Generate and run the model</h2>
-</div>
-</div>
-</div>
-<p>With the MWe2 workflow generate the code and run the model.
- The output should look like this:</p>
-<p>type &sbquo;quit&rsquo; to exit
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 1
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 2
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 3
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 4
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 5
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 6
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 7
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 8
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 9
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 10
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- d.int32Val: 4711
- d.float64Val: 0,000000
- d.int8Array: 1 2 3 4 5 6 7 8 9 10
- d.stringVal: empty
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- d.int32Val: 815
- d.float64Val: 3,141234
- d.int8Array: 100 101 102 103 104 105 106 107 108 109
- d.stringVal: some contents
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- quit
- echo: quit</p>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Generate and run the model</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialSendingData.html" title="Tutorial Sending Data">
+<link rel="prev" href="Definethetoplevel.html" title="Define the top level">
+<link rel="next" href="Summary3.html" title="Summary">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Generate and run the model</h1>
+<div class="section" title="Generate and run the model">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Generateandrunthemodel"></a>Generate and run the model</h2>
+</div>
+</div>
+</div>
+<p>With the MWe2 workflow generate the code and run the model.
+ The output should look like this:</p>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p>
+ type &sbquo;quit&rsquo; to exit
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 1
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 2
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 3
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 4
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 5
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 6
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 7
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 8
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 9
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 10
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ d.int32Val: 4711
+ d.float64Val: 0,000000
+ d.int8Array: 1 2 3 4 5 6 7 8 9 10
+ d.stringVal: empty
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ d.int32Val: 815
+ d.float64Val: 3,141234
+ d.int8Array: 100 101 102 103 104 105 106 107 108 109
+ d.stringVal: some contents
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ quit
+ echo: quit</p>
+</blockquote>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/ImplementtheBehavior.html b/plugins/org.eclipse.etrice.doc/help/ImplementtheBehavior.html
index d8f0ae8..504ea67 100644
--- a/plugins/org.eclipse.etrice.doc/help/ImplementtheBehavior.html
+++ b/plugins/org.eclipse.etrice.doc/help/ImplementtheBehavior.html
@@ -52,7 +52,7 @@
</p>
<p>The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state
- [<span class="citation">port.message(p1,p2);</span>]. In this example
+ [<span class="citation">port.message(param);</span>]. In this example
[<span class="citation">ControlPort.start()</span>] sends the
[<span class="citation">start</span>] message via the
[<span class="citation">ControlPort</span>] to the outside world. Assuming that
diff --git a/plugins/org.eclipse.etrice.doc/help/OpentheMessageSequenceChart.html b/plugins/org.eclipse.etrice.doc/help/OpentheMessageSequenceChart.html
index b3721aa..e5d7c6f 100644
--- a/plugins/org.eclipse.etrice.doc/help/OpentheMessageSequenceChart.html
+++ b/plugins/org.eclipse.etrice.doc/help/OpentheMessageSequenceChart.html
@@ -20,7 +20,7 @@
</div>
</div>
</div>
-<p>During runtime the application produces a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq. You should see something like this:</p>
+<p>During runtime the application produced a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq using Trace2UML (it is open source and can be obtained from http://trace2uml.tigris.org/). You should see something like this:</p>
<p>
</p>
diff --git a/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html b/plugins/org.eclipse.etrice.doc/help/ROOMConcepts.html
index f0b4e56..f70dd85 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="Whydoesitworkandwhyisitsafe.html" title="Why does it work and why is it safe?">
</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>
diff --git a/plugins/org.eclipse.etrice.doc/help/Setupthemodel.html b/plugins/org.eclipse.etrice.doc/help/Setupthemodel.html
new file mode 100644
index 0000000..ad03581
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/Setupthemodel.html
@@ -0,0 +1,316 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Setup the model</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialPedestrianLights.html" title="Tutorial Pedestrian Lights">
+<link rel="prev" href="TutorialPedestrianLights.html" title="Tutorial Pedestrian Lights">
+<link rel="next" href="Whydoesitworkandwhyisitsafe.html" title="Why does it work and why is it safe?">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Setup the model</h1>
+<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>In PedestrianLightWndNoTcp.jav uncomment 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>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Summary.html b/plugins/org.eclipse.etrice.doc/help/Summary.html
index f0fe2ea..5f04962 100644
--- a/plugins/org.eclipse.etrice.doc/help/Summary.html
+++ b/plugins/org.eclipse.etrice.doc/help/Summary.html
@@ -21,7 +21,7 @@
</div>
</div>
<p>Now you have generated your first eTrice model from scratch. You can switch between diagram editor and model (.room file) and you can see what will be generated during editing and saving the diagram files.
- You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials deals with more complex state machines hierarchies in structure and behavior.</p>
+ You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials will deal with more complex hierarchies in structure and behavior.</p>
</div>
</body>
</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Summary2.html b/plugins/org.eclipse.etrice.doc/help/Summary2.html
index 28ef397..6912775 100644
--- a/plugins/org.eclipse.etrice.doc/help/Summary2.html
+++ b/plugins/org.eclipse.etrice.doc/help/Summary2.html
@@ -20,7 +20,7 @@
</div>
</div>
</div>
-<p>Run the model and take look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</p>
+<p>Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</p>
</div>
</body>
</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Summary3.html b/plugins/org.eclipse.etrice.doc/help/Summary3.html
index feb52d2..9a85aab 100644
--- a/plugins/org.eclipse.etrice.doc/help/Summary3.html
+++ b/plugins/org.eclipse.etrice.doc/help/Summary3.html
@@ -1,36 +1,36 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Summary</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
-<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">
-</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>
-<div class="section" title="Summary">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Summary3"></a>Summary</h2>
-</div>
-</div>
-</div>
-<p>Within the first loop a integer value will be incremented from
- [<span class="citation">MrPong</span>] and sent back to
- [<span class="citation">MrPing</span>]. Is long as the guard is true
- [<span class="citation">MrPing</span>] sends back the value.
- </p>
-<p>Within the
- [<span class="citation">next</span>] transition,
- [<span class="citation">MrPing</span>] creates a data class and sends the default values. Than
- [<span class="citation">MrPing</span>] changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
- In later versions of eTrice a additional mechanism to send references will be implemented. However, keep in mind that sending references takes the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
- </p>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Summary</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<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="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>
+<div class="section" title="Summary">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Summary3"></a>Summary</h2>
+</div>
+</div>
+</div>
+<p>Within the first loop an integer value will be incremented from
+ [<span class="citation">MrPong</span>] and sent back to
+ [<span class="citation">MrPing</span>]. As long as the guard is true
+ [<span class="citation">MrPing</span>] sends back the value.
+ </p>
+<p>Within the
+ [<span class="citation">next</span>] transition,
+ [<span class="citation">MrPing</span>] creates a data class and sends the default values. Than
+ [<span class="citation">MrPing</span>] changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
+ In future versions of eTrice an additional mechanism to send references will be implemented. However, keep in mind that sending references transfers the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+ </p>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/TutorialBlinky.html b/plugins/org.eclipse.etrice.doc/help/TutorialBlinky.html
index a80d385..b52ad72 100644
--- a/plugins/org.eclipse.etrice.doc/help/TutorialBlinky.html
+++ b/plugins/org.eclipse.etrice.doc/help/TutorialBlinky.html
@@ -58,12 +58,12 @@
</div>
</div>
<p>This tutorial describes how to use the
- [<span class="citation">TimingService</span>], combine a generated model with manual code and how to modeling a hierarchical state machine. The idea of the tutorial is, to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
+ [<span class="citation">TimingService</span>], how to combine a generated model with manual code and how to model a hierarchical state machine. The idea of the tutorial is to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
For this exercise we will use a little GUI class that will be used in more sophisticated tutorials too. The GUI simulates a pedestrian traffic crossing. For now, just a simple LED simulation will be used from the GUI.
</p>
<p>To use the GUI please copy the package
[<span class="citation">de.protos.PedLightGUI</span>] to your
- [<span class="citation">src</span>] directory. The package contains four java classes which implements a little window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
+ [<span class="citation">src</span>] directory. The package contains four java classes which implement a small window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
</p>
<p>The GUI looks like this:</p>
<p>
@@ -74,7 +74,7 @@
<p>
</p>
-<p>Within this tutorial we just will switching on and off the yellow light.</p>
+<p>Within this tutorial we just will toggle the yellow light.</p>
<p>You will perform the following steps:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
diff --git a/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html b/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
index d2275bf..2a327b7 100644
--- a/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
+++ b/plugins/org.eclipse.etrice.doc/help/TutorialHelloWorld.html
@@ -51,7 +51,7 @@
</div>
</div>
</div>
-<p>In this tutorial you will build your first very simple etrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</p>
+<p>In this tutorial you will build your first very simple eTrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
diff --git a/plugins/org.eclipse.etrice.doc/help/TutorialPedestrianLights.html b/plugins/org.eclipse.etrice.doc/help/TutorialPedestrianLights.html
new file mode 100644
index 0000000..1fdf67d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/TutorialPedestrianLights.html
@@ -0,0 +1,84 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Tutorial Pedestrian Lights</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<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="next" href="Setupthemodel.html" title="Setup the model">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Tutorial Pedestrian Lights</h1>
+<div class="chapter" title="Tutorial Pedestrian Lights">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title">
+<a name="TutorialPedestrianLights"></a>Tutorial Pedestrian Lights</h2>
+</div>
+</div>
+</div>
+<div class="toc">
+<dl>
+<dt>
+<span class="section"><a href="TutorialPedestrianLights.html#Scope4">Scope</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Setupthemodel.html">Setup the model</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Whydoesitworkandwhyisitsafe.html">Why does it work and why is it safe?</a></span>
+</dt>
+</dl>
+</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. Being familiar with the basic tool features is mandatory 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 several 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 few 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>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/TutorialSendingData.html b/plugins/org.eclipse.etrice.doc/help/TutorialSendingData.html
index 6a87e64..c37d160 100644
--- a/plugins/org.eclipse.etrice.doc/help/TutorialSendingData.html
+++ b/plugins/org.eclipse.etrice.doc/help/TutorialSendingData.html
@@ -1,91 +1,91 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Tutorial Sending Data</title>
-<link href="book.css" rel="stylesheet" type="text/css">
-<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="Summary2.html" title="Summary">
-<link rel="next" href="Createanewmodelfromscratch3.html" title="Create a new model from scratch">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Tutorial Sending Data</h1>
-<div class="chapter" title="Tutorial Sending Data">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title">
-<a name="TutorialSendingData"></a>Tutorial Sending Data</h2>
-</div>
-</div>
-</div>
-<div class="toc">
-<dl>
-<dt>
-<span class="section"><a href="TutorialSendingData.html#Scope3">Scope</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Createanewmodelfromscratch3.html">Create a new model from scratch</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Addadataclass.html">Add a data class</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Createanewprotocol2.html">Create a new protocol</a></span>
-</dt>
-<dt>
-<span class="section"><a href="CreateMrPingandMrPongActors.html">Create MrPing and MrPong Actors</a></span>
-</dt>
-<dt>
-<span class="section"><a href="DefinetheActorsStructureandBehavior.html">Define the Actors Structure and Behavior</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Definethetoplevel.html">Define the top level</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Generateandrunthemodel.html">Generate and run the model</a></span>
-</dt>
-<dt>
-<span class="section"><a href="Summary3.html">Summary</a></span>
-</dt>
-</dl>
-</div>
-<div class="section" title="Scope">
-<div class="titlepage">
-<div>
-<div>
-<h2 class="title" style="clear: both">
-<a name="Scope3"></a>Scope</h2>
-</div>
-</div>
-</div>
-<p>This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
- MrPing will sent data and verify the result. </p>
-<p>You will perform the following steps:</p>
-<div class="orderedlist">
-<ol class="orderedlist" type="1">
-<li class="listitem">
-<p>create a new model from scratch</p>
-</li>
-<li class="listitem">
-<p>create a data class</p>
-</li>
-<li class="listitem">
-<p>define a protocol with attached data</p>
-</li>
-<li class="listitem">
-<p>create an actor structure</p>
-</li>
-<li class="listitem">
-<p>create two simple state machines</p>
-</li>
-<li class="listitem">
-<p>build and run the model</p>
-</li>
-</ol>
-</div>
-</div>
-</div>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Tutorial Sending Data</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<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="Summary2.html" title="Summary">
+<link rel="next" href="Createanewmodelfromscratch3.html" title="Create a new model from scratch">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Tutorial Sending Data</h1>
+<div class="chapter" title="Tutorial Sending Data">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title">
+<a name="TutorialSendingData"></a>Tutorial Sending Data</h2>
+</div>
+</div>
+</div>
+<div class="toc">
+<dl>
+<dt>
+<span class="section"><a href="TutorialSendingData.html#Scope3">Scope</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Createanewmodelfromscratch3.html">Create a new model from scratch</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Addadataclass.html">Add a data class</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Createanewprotocol2.html">Create a new protocol</a></span>
+</dt>
+<dt>
+<span class="section"><a href="CreateMrPingandMrPongActors.html">Create MrPing and MrPong Actors</a></span>
+</dt>
+<dt>
+<span class="section"><a href="DefineActorStructureandBehavior.html">Define Actor Structure and Behavior</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Definethetoplevel.html">Define the top level</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Generateandrunthemodel.html">Generate and run the model</a></span>
+</dt>
+<dt>
+<span class="section"><a href="Summary3.html">Summary</a></span>
+</dt>
+</dl>
+</div>
+<div class="section" title="Scope">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Scope3"></a>Scope</h2>
+</div>
+</div>
+</div>
+<p>This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
+ MrPing will send data and verify the result. </p>
+<p>You will perform the following steps:</p>
+<div class="orderedlist">
+<ol class="orderedlist" type="1">
+<li class="listitem">
+<p>create a new model from scratch</p>
+</li>
+<li class="listitem">
+<p>create a data class</p>
+</li>
+<li class="listitem">
+<p>define a protocol with attached data</p>
+</li>
+<li class="listitem">
+<p>create an actor structure</p>
+</li>
+<li class="listitem">
+<p>create two simple state machines</p>
+</li>
+<li class="listitem">
+<p>build and run the model</p>
+</li>
+</ol>
+</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html b/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html
new file mode 100644
index 0000000..cb5cf38
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Why does it work and why is it safe?</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialPedestrianLights.html" title="Tutorial Pedestrian Lights">
+<link rel="prev" href="Setupthemodel.html" title="Setup the model">
+<link rel="next" href="ROOMConcepts.html" title="ROOM Concepts">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Why does it work and why is it safe?</h1>
+<div class="section" title="Why does it work and why is it safe?">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Whydoesitworkandwhyisitsafe"></a>Why does it work and why is it safe?</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 safe and does not violate 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>
+</body>
+</html>
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 b178015..0000000
--- a/plugins/org.eclipse.etrice.doc/help/images/025-SendigData03.png
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/help/images/030-PedLights01.png b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights01.png
new file mode 100644
index 0000000..bc4fc10
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights01.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/help/images/030-PedLights02.png b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights02.png
new file mode 100644
index 0000000..d1670a6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights02.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/help/images/030-PedLights03.png b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights03.png
new file mode 100644
index 0000000..bdf2514
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights03.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/help/images/030-PedLights04.png b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights04.png
new file mode 100644
index 0000000..064bf39
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/images/030-PedLights04.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/etrice.html b/plugins/org.eclipse.etrice.doc/html/etrice.html
index a31da93..6545eb3 100644
--- a/plugins/org.eclipse.etrice.doc/html/etrice.html
+++ b/plugins/org.eclipse.etrice.doc/html/etrice.html
@@ -120,7 +120,7 @@
<span class="section"><a href="#CreateMrPingandMrPongActors">Create MrPing and MrPong Actors</a></span>
</dt>
<dt>
-<span class="section"><a href="#DefinetheActorsStructureandBehavior">Define the Actors Structure and Behavior</a></span>
+<span class="section"><a href="#DefineActorStructureandBehavior">Define Actor Structure and Behavior</a></span>
</dt>
<dt>
<span class="section"><a href="#Definethetoplevel">Define the top level</a></span>
@@ -134,7 +134,23 @@
</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="#Whydoesitworkandwhyisitsafe">Why does it work and why is it safe?</a></span>
+</dt>
+</dl>
+</dd>
+<dt>
+<span class="chapter"><a href="#ROOMConcepts">7. ROOM Concepts</a></span>
</dt>
<dd>
<dl>
@@ -229,7 +245,7 @@
</div>
</div>
</div>
-<p>In this tutorial you will build your first very simple etrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</p>
+<p>In this tutorial you will build your first very simple eTrice model. The goal is to learn the work flow of eTrice and to understand a few basic features of ROOM. You will perform the following steps:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
@@ -347,9 +363,9 @@
[<span class="citation">SubSystemRef</span>]. The
[<span class="citation">SubSystemClass</span>] represents an address space and contains at least one
[<span class="citation">ActorRef</span>]. The
- [<span class="citation">ActorClass</span>] is the building block of which an application will be build of. It is a good idea to define a top level actor that can be used as reference within the subsystem.
+ [<span class="citation">ActorClass</span>] is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
</p>
-<p>Mention that a outline view was created that represents all currently existing model elements in a graphical way.</p>
+<p>The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.</p>
<p>
</p>
@@ -435,7 +451,7 @@
<p>
</p>
-<p>The code will be generated to the src-gen directory. The main class will be contained in
+<p>The code will be generated to the src-gen directory. The main function will be contained in
[<span class="citation">SubSystem_HelloWorldRunner.java</span>]. Select this file and run it as Java application.
</p>
<p>
@@ -467,7 +483,7 @@
</div>
</div>
</div>
-<p>During runtime the application produces a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq. You should see something like this:</p>
+<p>During runtime the application produced a MSC and wrote it to a file. Open /org.eclipse.etrice.doc.tutorials/tmp/log/SubSystem_HelloWorld_Async.seq using Trace2UML (it is open source and can be obtained from http://trace2uml.tigris.org/). You should see something like this:</p>
<p>
</p>
@@ -487,7 +503,7 @@
</div>
</div>
<p>Now you have generated your first eTrice model from scratch. You can switch between diagram editor and model (.room file) and you can see what will be generated during editing and saving the diagram files.
- You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials deals with more complex state machines hierarchies in structure and behavior.</p>
+ You should take a look at the generated source files to understand how the state machine is generated and the life cycle of the application. The next tutorials will deal with more complex hierarchies in structure and behavior.</p>
</div>
</div>
<div class="chapter" title="Chapter&nbsp;4.&nbsp;Tutorial Blinky">
@@ -509,12 +525,12 @@
</div>
</div>
<p>This tutorial describes how to use the
- [<span class="citation">TimingService</span>], combine a generated model with manual code and how to modeling a hierarchical state machine. The idea of the tutorial is, to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
+ [<span class="citation">TimingService</span>], how to combine a generated model with manual code and how to model a hierarchical state machine. The idea of the tutorial is to switch a LED on and off. The behavior of the LED should be: blinking in a one second interval for 5 seconds, stop blinking for 5 seconds, blinking, stop,...
For this exercise we will use a little GUI class that will be used in more sophisticated tutorials too. The GUI simulates a pedestrian traffic crossing. For now, just a simple LED simulation will be used from the GUI.
</p>
<p>To use the GUI please copy the package
[<span class="citation">de.protos.PedLightGUI</span>] to your
- [<span class="citation">src</span>] directory. The package contains four java classes which implements a little window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
+ [<span class="citation">src</span>] directory. The package contains four java classes which implement a small window with a 3-light traffic light which simulates the signals for the car traffic and a 2-light traffic light which simulates the pedestrian signals.
</p>
<p>The GUI looks like this:</p>
<p>
@@ -525,7 +541,7 @@
<p>
</p>
-<p>Within this tutorial we just will switching on and off the yellow light.</p>
+<p>Within this tutorial we just will toggle the yellow light.</p>
<p>You will perform the following steps:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
@@ -653,7 +669,7 @@
[<span class="citation">ProtocolClass</span>] and name it
[<span class="citation">BlinkyControlProtocol</span>].
Inside the brackets use the
- [<span class="citation">Content Assist</span>] (CTRL+Space) to create two incomming messages called
+ [<span class="citation">Content Assist</span>] (CTRL+Space) to create two incoming messages called
[<span class="citation">start</span>] and
[<span class="citation">stop</span>].
</p>
@@ -667,7 +683,7 @@
</p>
<p>With Ctrl-Shift+F or selecting
- [<span class="citation">Format</span>] from the context menu you can format the text. Mention that all elements are displayed in the outline view.
+ [<span class="citation">Format</span>] from the context menu you can format the text. Note that all elements are displayed in the outline view.
</p>
</div>
<div class="section" title="Import the Timing Service">
@@ -761,7 +777,7 @@
[<span class="citation">stop</span>] as incoming messages.
[<span class="citation">Blinky</span>] receives this messages and therefore
[<span class="citation">Blinky</span>]'s
- [<span class="citation">ControlPort</span>] must be a base port and
+ [<span class="citation">ControlPort</span>] must be a regular port and
[<span class="citation">BlinkyController</span>]'s
[<span class="citation">ControlPort</span>] must be a conjugated port.
</p>
@@ -826,7 +842,7 @@
</p>
<p>The defined ports will be generated as a member attribute of the actor class from type of the attached protocol. So, to send e message you must state
- [<span class="citation">port.message(p1,p2);</span>]. In this example
+ [<span class="citation">port.message(param);</span>]. In this example
[<span class="citation">ControlPort.start()</span>] sends the
[<span class="citation">start</span>] message via the
[<span class="citation">ControlPort</span>] to the outside world. Assuming that
@@ -1182,7 +1198,7 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</div>
</div>
</div>
-<p>Run the model and take look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</p>
+<p>Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.</p>
</div>
</div>
<div class="chapter" title="Chapter&nbsp;5.&nbsp;Tutorial Sending Data">
@@ -1204,7 +1220,7 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</div>
</div>
<p>This tutorial shows how data will be sent in a eTrice model. Within the example you will create two actors (MrPing and MrPong). MrPong will simply loop back every data it received.
- MrPing will sent data and verify the result. </p>
+ MrPing will send data and verify the result. </p>
<p>You will perform the following steps:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
@@ -1434,12 +1450,12 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</p>
</div>
-<div class="section" title="Define the Actors Structure and Behavior">
+<div class="section" title="Define Actor Structure and Behavior">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
-<a name="DefinetheActorsStructureandBehavior"></a>Define the Actors Structure and Behavior</h2>
+<a name="DefineActorStructureandBehavior"></a>Define Actor Structure and Behavior</h2>
</div>
</div>
</div>
@@ -1622,9 +1638,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>
@@ -1793,53 +1806,63 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</div>
<p>With the MWe2 workflow generate the code and run the model.
The output should look like this:</p>
-<p>type &sbquo;quit&rsquo; to exit
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 1
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 2
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 3
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 4
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 5
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 6
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 7
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 8
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 9
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- data: 10
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
- d.int32Val: 4711
- d.float64Val: 0,000000
- d.int8Array: 1 2 3 4 5 6 7 8 9 10
- d.stringVal: empty
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- d.int32Val: 815
- d.float64Val: 3,141234
- d.int8Array: 100 101 102 103 104 105 106 107 108 109
- d.stringVal: some contents
- /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
- quit
- echo: quit</p>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p>
+ type &sbquo;quit&rsquo; to exit
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 1
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 2
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 3
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 4
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 5
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 6
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 7
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 8
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 9
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPongSimple
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ data: 10
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ /SendingData_SubSystem/SendigDataTopRef/ref1 -&gt; looping
+ d.int32Val: 4711
+ d.float64Val: 0,000000
+ d.int8Array: 1 2 3 4 5 6 7 8 9 10
+ d.stringVal: empty
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ d.int32Val: 815
+ d.float64Val: 3,141234
+ d.int8Array: 100 101 102 103 104 105 106 107 108 109
+ d.stringVal: some contents
+ /SendingData_SubSystem/SendigDataTopRef/ref0 -&gt; waitForPong
+ quit
+ echo: quit</p>
+</blockquote>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
</div>
<div class="section" title="Summary">
<div class="titlepage">
@@ -1850,25 +1873,415 @@ carLights.setState(TrafficLight3.OFF);&nbsp;<br>
</div>
</div>
</div>
-<p>Within the first loop a integer value will be incremented from
+<p>Within the first loop an integer value will be incremented from
[<span class="citation">MrPong</span>] and sent back to
- [<span class="citation">MrPing</span>]. Is long as the guard is true
+ [<span class="citation">MrPing</span>]. As long as the guard is true
[<span class="citation">MrPing</span>] sends back the value.
</p>
<p>Within the
[<span class="citation">next</span>] transition,
[<span class="citation">MrPing</span>] creates a data class and sends the default values. Than
[<span class="citation">MrPing</span>] changes the values and sends the class again. At this point you should note that during the send operation, a copy of the data class will be created and sent. Otherwise it would not be possible to send the same object two times, even more it would not be possible to send a stack object at all.
- In later versions of eTrice a additional mechanism to send references will be implemented. However, keep in mind that sending references takes the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
+ In future versions of eTrice an additional mechanism to send references will be implemented. However, keep in mind that sending references transfers the responsibility of the life cycle of the sent object to the user. It looks simple but is a very common source of failures.
</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. Being familiar with the basic tool features is mandatory 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 several 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 few 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>In PedestrianLightWndNoTcp.jav uncomment 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 safe?">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Whydoesitworkandwhyisitsafe"></a>Why does it work and why is it safe?</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 safe and does not violate 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>
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 b178015..0000000
--- a/plugins/org.eclipse.etrice.doc/html/images/025-SendigData03.png
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/images/030-PedLights01.png b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights01.png
new file mode 100644
index 0000000..bc4fc10
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights01.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/images/030-PedLights02.png b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights02.png
new file mode 100644
index 0000000..d1670a6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights02.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/images/030-PedLights03.png b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights03.png
new file mode 100644
index 0000000..bdf2514
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights03.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/html/images/030-PedLights04.png b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights04.png
new file mode 100644
index 0000000..064bf39
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/html/images/030-PedLights04.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/manual/etrice.pdf b/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
index 029584d..527c9fa 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/fopdf.xsl b/plugins/org.eclipse.etrice.doc/styles/fopdf.xsl
index 0e59623..6b00bc5 100644
--- a/plugins/org.eclipse.etrice.doc/styles/fopdf.xsl
+++ b/plugins/org.eclipse.etrice.doc/styles/fopdf.xsl
@@ -82,7 +82,7 @@
<fo:table-row>
<fo:table-cell text-align="center">
<fo:block>
- <fo:external-graphic src="file:build/images/logo/xtext_logo.jpg"/>
+ <fo:external-graphic src="file:doc/images/logo/eTRICE-logo.png"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
diff --git a/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl b/plugins/org.eclipse.etrice.doc/styles/xmpp.xsl
index d73663a..8f152e6 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 2f69395..bc19761 100644
--- a/plugins/org.eclipse.etrice.doc/toc.xml
+++ b/plugins/org.eclipse.etrice.doc/toc.xml
@@ -30,14 +30,19 @@
<topic href="help/Addadataclass.html" label="Add a data class"></topic>
<topic href="help/Createanewprotocol2.html" label="Create a new protocol"></topic>
<topic href="help/CreateMrPingandMrPongActors.html" label="Create MrPing and MrPong Actors"></topic>
-<topic href="help/DefinetheActorsStructureandBehavior.html" label="Define the Actors Structure and Behavior">
-<topic href="help/DefinetheActorsStructureandBehavior.html#DefineMrPongsbehavior" label="Define MrPongs behavior"></topic>
-<topic href="help/DefinetheActorsStructureandBehavior.html#DefineMrPingbehavior" label="Define MrPing behavior"></topic>
+<topic href="help/DefineActorStructureandBehavior.html" label="Define Actor Structure and Behavior">
+<topic href="help/DefineActorStructureandBehavior.html#DefineMrPongsbehavior" label="Define MrPongs behavior"></topic>
+<topic href="help/DefineActorStructureandBehavior.html#DefineMrPingbehavior" label="Define MrPing behavior"></topic>
</topic>
<topic href="help/Definethetoplevel.html" label="Define the top level"></topic>
<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/Whydoesitworkandwhyisitsafe.html" label="Why does it work and why is it safe?"></topic>
+</topic>
<topic href="help/ROOMConcepts.html" label="ROOM Concepts">
<topic href="help/ROOMConcepts.html#MainConcepts" label="Main Concepts"></topic>
</topic>