Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Jung2011-10-31 20:20:09 +0000
committerThomas Jung2011-10-31 20:20:09 +0000
commitf50ab81cb4bd4f0c3857c6c2ac7f978efff58bd2 (patch)
treea93ccb1c6c461b0676213945541fb4bfbeba6c9a
parentf7035058ee105c1801d8e0576f14758d40d036be (diff)
downloadorg.eclipse.etrice-f50ab81cb4bd4f0c3857c6c2ac7f978efff58bd2.tar.gz
org.eclipse.etrice-f50ab81cb4bd4f0c3857c6c2ac7f978efff58bd2.tar.xz
org.eclipse.etrice-f50ab81cb4bd4f0c3857c6c2ac7f978efff58bd2.zip
[doc.doc] running the predefined tutorials added
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/013-Setting-up-the-Workspace.textile14
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile47
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace05.pngbin0 -> 96270 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace06.pngbin0 -> 120492 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace07.pngbin0 -> 99024 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky04.pngbin87665 -> 123157 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky05.pngbin51030 -> 66958 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky06.pngbin42110 -> 87676 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky07.pngbin66597 -> 65913 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky09.pngbin139947 -> 149213 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky10.pngbin52521 -> 72486 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky12.pngbin53077 -> 60412 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky13.pngbin66735 -> 82323 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky14.pngbin60308 -> 67458 bytes
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/images/020-Blinky15.pngbin54755 -> 73411 bytes
15 files changed, 53 insertions, 8 deletions
diff --git a/plugins/org.eclipse.etrice.doc/doc/013-Setting-up-the-Workspace.textile b/plugins/org.eclipse.etrice.doc/doc/013-Setting-up-the-Workspace.textile
index 01e037d73..750856a11 100644
--- a/plugins/org.eclipse.etrice.doc/doc/013-Setting-up-the-Workspace.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/013-Setting-up-the-Workspace.textile
@@ -26,3 +26,17 @@ Do the same steps for ??eTrice Java Runtime?? and ??eTrice Java Tutorials??. The
!images/013-SetupWorkspace04.png!
Now workspace is set up and you can perform the tutorials or start with your work.
+
+The tutorial models are available in the ??org.eclipse.etrice.tutorials?? project. All tutorials are ready to generate and run without any changes. To start the code generator simply run ??gen_org.eclipse.etrice.tutorials.launch?? as ??gen_org.eclipse.etrice.tutorials.launch??:
+
+!images/013-SetupWorkspace05.png!
+
+After generation for each tutorial a java file called ??SubSystem_ModelnameRunner.java?? is generated. To run the model simply run this file as a java application:
+
+!images/013-SetupWorkspace06.png!
+
+To stop the application type "quit" in the console window.
+
+!images/013-SetupWorkspace07.png!
+
+Performing the tutorials will setup an dedicated project for each tutorial. Therefore there are some slight changes especially whenever a path must be set (e.g. to the model library) within your own projects. All this is described in the tutorials.
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 133c7e459..bd32d6a0c 100644
--- a/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
@@ -5,13 +5,15 @@ h2. Scope
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 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.
+After the exercise is created you must copy the GUI to your src directory (see below).
+
+The package contains four java classes which implements 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 toggle the yellow light.
+Within this tutorial we will just toggle the yellow light.
You will perform the following steps:
@@ -28,6 +30,9 @@ h2. Create a new model from scratch
Remember exercise ??HelloWorld??.
Create a new eTrice project and name it ??Blinky??
+
+To use the GUI please copy the package ??org.eclipse.etrice.tutorials.PedLightGUI?? from "org.eclipse.etrice.tutorials/src" to your ??src?? directory "Blinky/src". For this tutorial you must remove the error markers by editing the file ??PedestrianLightWndNoTcp.java??. Appropriate comments are provided to remove the error marker for this turorial.
+
Open the ??Blinky.room?? file and copy the following code into the file or use content assist to create the model.
bc..
@@ -58,6 +63,8 @@ Select ??ActorClass - actor class skeleton?? and name it ??Blinky??.
Repeat the described procedure and name the new actor ??BlinkyController??.
+With Ctrl+Shift+F you can beautify the model code.
+
Save the model and visit the outline view.
h2. Create a new protocol
@@ -73,7 +80,29 @@ With Ctrl-Shift+F or selecting ??Format?? from the context menu you can format t
h2. Import the Timing Service
-Switching on and off the LED is timing controlled. Therefore a timing service is needed. To import the timing service in the outline view right click to ??SubSystem_Blinky??. Select ??Edit Structure??. Drag and Drop an ??ActorRef?? to the ??SubSystem_Blinky?? and name it ??application??. From the actor class drop down list select ??BlinkyTop??. Do the same clicks for the timing service. Name it ??timingService?? and from the drop down list select ??room.basic.service.timing.ATimingService??. Draw a ??LayerConnection?? from ??application?? to each service provision point (SPP) of the ??timingService??. The resulting structure should look like this:
+Switching on and off the LED is timing controlled. The timing service is provided from the model library and must be imported before it can be used from the model.
+
+This is the first time you use an element from the modellib. Make sure that your Java Build Path has the appropriate entry to the modellib. Otherwise the jave code, which will be generated from the modellib, can not be referenced.
+(right click to ??Blinky?? and select properties. Select the ??Java Build Path?? tab)
+
+!images/020-Blinky16.png!
+
+After the build path is set up return to the model and navigate the cursor at the beginning of the model and import the timing service:
+
+bc..
+RoomModel Blinky {
+
+ import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib/models/TimingService.room"
+
+ LogicalSystem System_Blinky {
+ SubSystemRef subsystem: SubSystem_Blinky
+ }
+...
+bq.
+
+Make sure that the path fits to your folder structure.
+
+Now it can be used within the model. Right click to ??SubSystem_Blinky?? within the outline view. Select ??Edit Structure??. The ??application?? is already referenced in the subsystem. Drag and Drop an ??ActorRef?? to the ??SubSystem_Blinky?? and name it ??timingService??. From the actor class drop down list select ??room.basic.service.timing.ATimingService??. Draw a ??LayerConnection?? from ??application?? to each service provision point (SPP) of the ??timingService??. The resulting structure should look like this:
!images/020-Blinky06.png!
@@ -90,7 +119,7 @@ The resulting code should look like this:
h2. Finish the model structure
-From the outline view right click to ??Blinky?? and select ??Edit Structure??. Drag and Drop an ??Interface Port?? to the boarder of the ??Blinky?? actor. Note that an interface port is not possible inside the the actor. Name the port ??ControlPort?? and select ??BlinkyControlProtocol?? from the drop down list. Uncheck ??Conjugated?? and ??Is Relay Port??. Klick ??ok??. The resulting structure should look like this:
+From the outline view right click to ??Blinky?? and select ??Edit Structure??. Drag and Drop an ??Interface Port?? to the boarder of the ??Blinky?? actor. Note that an interface port is not possible inside the actor. Name the port ??ControlPort?? and select ??BlinkyControlProtocol?? from the drop down list. Uncheck ??Conjugated?? and ??Is Relay Port??. Klick ??ok??. The resulting structure should look like this:
!images/020-Blinky04.png!
@@ -116,7 +145,7 @@ Use the ??Transition?? tool to draw transitions from ??init?? to ??off?? from ??
Open the transition dialog by double click the arrow to specify the trigger event and the action code of each transition. Note that the initial transition does not have a trigger event.
-The dialog should look like this:
+The transition dialog should look like this:
!{width=500px}images/020-Blinky09.png!
@@ -125,6 +154,7 @@ The defined ports will be generated as a member attribute of the actor class fro
Within each transition the timer will be restarted and the appropriate message will be sent via the ??ControlPort??.
The resulting state machine should look like this:
+(Note that the arrows peak changes if the transition contains action code.)
!images/020-Blinky10.png!
@@ -136,15 +166,16 @@ Now we will implement ??Blinky??. Due to the fact that ??Blinky?? interacts with
Double click ??Blinky?? in the outline view to navigate to ??Blinky?? within the model file.
Add the following code:
+(type it or simply copy it from the tutorial project)
!images/020-Blinky12.png!
??usercode1?? will be generated at the beginning of the file, outside the class definition. ??usercode2?? will be generated within the class definition. The code imports the GUI class and instantiates the window class. Attributes for the carLights and pedLights will be declared to easily access the lights in the state machine.
The Operation ??destroyUser()?? is a predefined operation that will be called during shutdown of the application. Within this operation, cleanup of manual coded classes can be done.
-
-
-Now design the FSM of ??Blinky??. Open the behavior diagram of ??Blinky?? by right clicking the ??Blinky?? actor in the outline view. Create two states named ??blinking?? and ??off??. Right click to ??blinking?? and create a subgraph.
+Now design the FSM of ??Blinky??. Remember, as the name suggested ??blinking?? is a state in which the LED must be switched on and off. We will realize that by an hierarchical FSM in which the ??blinking?? state has two sub states.
+
+Open the behavior diagram of ??Blinky?? by right clicking the ??Blinky?? actor in the outline view. Create two states named ??blinking?? and ??off??. Right click to ??blinking?? and create a subgraph.
!images/020-Blinky13.png!
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace05.png b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace05.png
new file mode 100644
index 000000000..91a0ced08
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace05.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace06.png b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace06.png
new file mode 100644
index 000000000..aeb02efdd
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace06.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace07.png b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace07.png
new file mode 100644
index 000000000..01f62dcd3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc/images/013-SetupWorkspace07.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky04.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky04.png
index 1eafad963..4c927f45d 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky04.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky04.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky05.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky05.png
index 77cf2aad0..98a0cd9a4 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky05.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky05.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky06.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky06.png
index 4952706d0..908424770 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky06.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky06.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky07.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky07.png
index 30d86ff93..826396be0 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky07.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky07.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky09.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky09.png
index 8c79f070d..a0eca57a1 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky09.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky09.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky10.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky10.png
index c633e3f87..2ba986377 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky10.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky10.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky12.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky12.png
index 5fc09ec05..92be3fd98 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky12.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky12.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky13.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky13.png
index 7abeb00cc..321c46186 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky13.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky13.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky14.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky14.png
index 3a83094c7..771e9bd02 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky14.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky14.png
Binary files differ
diff --git a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky15.png b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky15.png
index df40f7a99..2a3b3af07 100644
--- a/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky15.png
+++ b/plugins/org.eclipse.etrice.doc/doc/images/020-Blinky15.png
Binary files differ

Back to the top