summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Lippert2013-01-30 01:06:07 (EST)
committer Frank Lippert2013-01-30 01:06:07 (EST)
commit99983eaa7d8140a14e55bbf5ad57cb7ddfda60ec (patch)
tree7b98b1ac8de1c27641c5947953b7825d9c0fcfdf
parent35900c0a12fd8096d392b02a8ad1bbd5374cbaa2 (diff)
downloadorg.eclipse.etrice-99983eaa7d8140a14e55bbf5ad57cb7ddfda60ec.zip
org.eclipse.etrice-99983eaa7d8140a14e55bbf5ad57cb7ddfda60ec.tar.gz
org.eclipse.etrice-99983eaa7d8140a14e55bbf5ad57cb7ddfda60ec.tar.bz2
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/000-etrice-introduction.tex50
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/010-room-introduction.tex202
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/012-working-with-tutorials.tex7
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/013-setting-up-the-workspace.tex51
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/015-getting-started.tex125
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/020-tutorial-blinky.tex250
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/025-tutorial-sending-data.tex286
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/030-tutorial-ped-lights.tex87
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/032-setting-up-the-workspace_c.tex87
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/034-getting-started_c.tex168
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/036-tutorial-remove-comment_c.tex130
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/040-room-concepts.tex510
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/050-etrice-features.tex10
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/060-codegenerators.tex1
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/070-runtimes.tex1
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/080-etrice-models.tex60
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/200-dev-reference.tex230
-rw-r--r--plugins/org.eclipse.etrice.doc/doc-tex/etrice-doc.tex21
18 files changed, 2254 insertions, 22 deletions
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/000-etrice-introduction.tex b/plugins/org.eclipse.etrice.doc/doc-tex/000-etrice-introduction.tex
index 25739c2..60ff164 100644
--- a/plugins/org.eclipse.etrice.doc/doc-tex/000-etrice-introduction.tex
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/000-etrice-introduction.tex
@@ -1,31 +1,37 @@
+\chapter{eTrice Overview}
-\section{eTrice Overview}
-
-\subsection{What is eTrice?}
+\section{What is eTrice?}
eTrice provides an implementation of the ROOM modeling language (Real Time Object Oriented Modeling) together with editors, code generators for Java, C++ and C code and exemplary target middleware.
The model is defined in textual form (Xtext) with graphical editors (Graphiti) for the structural and behavioral (i.e. state machine) parts.
-h2. Reduction of Complexity
+\section{Reduction of Complexity}
eTrice is all about the reduction of complexity:
-* structural complexity
-** by explicit modeling of hierarchical Actor containment, layering and inheritance
-* behavioral complexity
-** by hierachical statemachines with inheritance
-* teamwork complexity
-** because loosely coupled Actors provide a natural way to structure team work
-** since textual model notation allows simple branching and merging
-* complexity of concurrent & distributed systems
-** because loosely coupled Actors are deployable to threads, processes, nodes
-* complexity of variant handling and reuse (e.g. for product lines)
-** by composition of existing Actors to new structures
-** since Protocols and Ports make Actors replaceable
-** by inheritance for structure, behavior and Protocols
-** by making use of model level libraries
-* complexity of debugging
-** model level debugging: state machine animation, data inspection and manipulation, message injection, generated message sequence charts
-** model checking easier for model than for code (detect errors before they occur)
-
+\begin{itemize}
+ \item structural complexity
+ \begin{itemize}
+\item by explicit modeling of hierarchical Actor containment, layering and inheritance \end{itemize}
+\item behavioral complexity
+\begin{itemize}
+\item by hierachical statemachines with inheritance \end{itemize}
+\item teamwork complexity
+ \begin{itemize}
+\item because loosely coupled Actors provide a natural way to structure team work
+\item since textual model notation allows simple branching and merging \end{itemize}
+\item complexity of concurrent \& distributed systems
+ \begin{itemize}
+\item because loosely coupled Actors are deployable to threads, processes, nodes \end{itemize}
+\item complexity of variant handling and reuse (e.g. for product lines)
+ \begin{itemize}
+\item by composition of existing Actors to new structures
+\item since Protocols and Ports make Actors replaceable
+\item by inheritance for structure, behavior and Protocols
+\item by making use of model level libraries \end{itemize}
+\item complexity of debugging
+ \begin{itemize}
+\item model level debugging: state machine animation, data inspection and manipulation, message injection, generated message sequence charts
+\item model checking easier for model than for code (detect errors before they occur) \end{itemize}
+\end{itemize}
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/010-room-introduction.tex b/plugins/org.eclipse.etrice.doc/doc-tex/010-room-introduction.tex
new file mode 100644
index 0000000..944920e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/010-room-introduction.tex
@@ -0,0 +1,202 @@
+\chapter{ Introduction to the ROOM Language}
+
+\section{Scope of ROOM}
+
+This chapter will give a rough overview of what ROOM (\b R eal time \b O bject \b O riented \b M odeling) is and what it is good for. It will try to answer the following questions:
+\begin{itemize}
+\item Where does it come from?
+\item Which kind of SW-Systems will be addressed?
+\item What is the relation between OOP and ROOM?
+\item What are the benefits of ROOM?
+\item Which consequences must be taken into account?
+
+\subsection{Where does it come from?}
+
+Room was developed in the 1990th on the background of the upcoming mobile applications with the goal to manage the complexity of such huge SW-Systems. From the very beginning ROOM has focused on a certain type of SW-Systems and is, in contrast to the UML, well suited for this kind of systems. In this sense, ROOM is a DSL (Domain Specific Language) for distributed, event driven, real time systems.
+
+Bran Selic, Garth Gullekson and Paul T. Ward have published t
+he concepts 1994 in the book \empf{Real-Time Object-Oriented Modeling}. The company \textit{object time} \texttrademark developed a ROOM tool which was taken over by \textit{Rational SW} \texttrademark and later on by \textit{IBM} \texttrademark.
+The company \textit{Protos Software Gmbh} \texttrademark also developed a ROOM tool called \textit{Trice} \texttrademark for control software for production machines and automotive systems. \textit{Trice\ \texttrademark is the predecessor of eTrice (see Introduction to eTrice).
+
+From our point of view ROOM provides still the clearest, simplest, most complete and best suited modeling concepts for the real time domain. All later proposals like the UML do not fit as well to this kind of problems.
+
+
+\subsection{Which kind of SW-Systems will be addressed?}
+
+As mentioned before ROOM addresses distributed, event driven, real time systems. But what is a *real time system*? ROOM defines a set of properties which are typical for a real time system. These properties are:
+\begin{itemize}
+\item Timeliness
+\item Dynamic internal structure
+\item Reactiveness
+\item Concurrency
+\item Distribution
+\item Reliability
+\end{itemize}
+
+Each of these properties has potential to make SW development complex. If a given system can be characterized with a combination of or all of these properties, ROOM might be applied to such a system.
+
+As an example take a look at a washing machine. The system has to react on user interactions, has to handle some error conditions like a closed water tap or a defective lye pump. It has to react simultaneously to all these inputs. It has to close the water valve in a certain time to avoid flooding the basement.
+So, the system can be characterized as timely, concurrent and reactive. As long as the washing machine does not transform to a laundry drier by itself, the system has no dynamic internal structure and as long as all functions are running on a single micro controller the (SW)-system is not distributed.
+ROOM fits perfect to such a system.
+
+A SW system which mainly consists of data transformations like signal/image processing or a loop controller (e.g. a PID controller) cannot be characterized with any of the above mentioned properties. However, in the real world most of the SW systems will be a combination of both. ROOM can be combined with such systems, so that for example an actor provides a *run to completion* context for calculating an image processing algorithm or a PID controller.
+
+\subsection{What is the relation between OOP and ROOM?}
+
+The relation between classical object oriented programming and ROOM is comparable to the relation between assembler programming and C programming. It provides a shift of the object paradigm. As the picture shows, the classic object paradigm provides some kind of information hiding. Attributes can be accessed via access methods. Logical higher level methods provide the requested behavior to the user.
+
+\includegraphics{images/010-RoomIntroduction01.png}
+% !images/010-RoomIntroduction01.png!
+
+As the figure illustrates, the classical object paradigm does not care about concurrency issues. The threads of control will be provided by the underlying operating system and the user is responsible to avoid access violations by using those operating system mechanisms directly (semaphore, mutex).
+
+\includegraphics{images/010-RoomIntroduction02.png}
+% !images/010-RoomIntroduction02.png!
+
+ROOM provides the concept of a logical machine (called actor) with its own thread of control. It provides some kind of cooperative communication infrastructure with *run to completion* semantic. That makes developing of business logic easy and safe (see basic concepts). The logical machine provides an encapsulation shell including concurrency issues (see chapter \textbf{Run to completion}).
+
+\includegraphics{images/010-RoomIntroduction03.png}
+% !images/010-RoomIntroduction03.png!
+
+This thinking of an object is much more general than the classic one.
+
+\subsection{What are the benefits of ROOM?}
+
+ROOM has a lot of benefits and it depends on the users point of view which is the most important one. From a general point of view the most important benefit is, that ROOM allows to create SW systems very efficient, robust and safe due to the fact that it provides some abstract, high level modeling concepts combined with code generation and a small efficient runtime environment.
+
+In detail:
+\begin{itemize}
+\item ROOM models contain well defined interfaces (protocols), which makes it easy to reuse components in different applications or e.g. in a test harness.
+\item Graphical modeling makes it easy to understand, maintain and share code with other developers
+\item Higher abstraction in combination with automated code generation provides very efficient mechanisms to the developer.
+\item ROOM provides graphical model execution, which makes it easy to understand the application or find defects in a very early phase.
+\end{itemize}
+
+\subsection{Which consequences must be taken into account?}
+
+Generating code from models will introduce some overhead in terms of memory footprint as well as performance. For most systems the overhead will be negligible. However, the decision for using ROOM should be made explicitly and it is always a trade off between development costs, time to market and costs in terms of a little bit more of memory and performance. Thanks to the powerful component model, ROOM is especially well suited for the development of software product lines with their need for reusable core assets.
+
+Care must be taken during the introduction of the new methodology. Due to the fact that ROOM provides a shift of the object paradigm, developers and teams need a phase of adaption. Every benefit comes at a price.
+
+\section{Basic Concepts}
+
+\subsection{Actor, Port, Protocol}
+
+The basic elements of ROOM are the actors with their ports and protocols. The protocol provides a formal interface description. The port is an interaction point where the actor interacts with its outside world. Each port has exactly one protocol attached. The sum of all ports builds up the complete interface of an actor. Each port can receive messages, with or without data, which are defined in the attached protocol. Each message will be handled by the actors behavior (state machine) or will be delegated to the actors internal structure.
+
+\begin{table}
+\caption{Actor and Protocol Example}
+\begin{tabular}{|l|l|}
+\hline
+\includegraphics{images/040-ActorClass.png} & \includegraphics{images/040-ProtocolClassTextualNotation.png} \\ \hline
+\textbf{Actor with Subactors} & \textbf{Protocol Definition} \\ \hline
+\end{tabular}
+\end{table}
+
+% <table title="Actor and Protocol Example">
+ % <tr>
+ % <td>!images/040-ActorClass.png!</td>
+ % <td>!images/040-ProtocolClassTextualNotation.png!</td>
+ % </tr>
+ % <tr>
+ % <td align="center">*Actor with Subactors*</td>
+ % <td align="center">*Protocol Definition*</td>
+ % </tr>
+% </table>
+
+The actor provides access protection for its own attributes (including complex types (classical objects)), including concurrency protection. An actor has neither public attributes nor public operations. The only interaction with the outside world takes place via interface ports. This ensures a high degree of reusability on actor level and provides an effective and safe programming model to the developer.
+
+Receiving a message via a port will trigger the internal state machine. A transition will be executed depending on the message and the current state. Within this transition, detail level code will be executed and response messages can be sent.
+
+% "video: receiving a message":http://eclipse.org/etrice/images/010-room-introduction01.avi
+
+With this model, a complex behavior can be divided into many relatively simple, linked actors. To put it the other way round: The complex behavior will be provided by a network of relatively simple components which are communicating with each other via well defined interfaces.
+
+
+\subsection{Hierarchy in Structure and Behavior
+
+ROOM provides two types of hierarchy. Behavioral hierarchy and structural hierarchy. Structural hierarchy means that actors can be nested to arbitrary depth. Usually you will add more and more details to your application with each nesting level. That means you can focus yourself on any level of abstraction with always the same element, the actor. Structural hierarchy provides a powerful mechanism to divide your problem in smaller pieces, so that you can focus on the level of abstraction you want to work on.
+
+The actor's behavior will be described with a state machine. A state in turn may contain sub states. This is another possibility to focus on an abstraction level. Take the simple FSM from the blinky actor from the blinky tutorial.
+
+Top level:
+\includegraphics{images/020-Blinky15.png}
+% !images/020-Blinky15.png!
+
+\textit{blinking} Sub machine:
+\includegraphics{images/020-Blinky151.png}
+% !images/020-Blinky151.png!
+
+From an abstract point of view there is a state \textit{blinking}. But a simple LED is not able to blink autonomously. Therefore you have to add more details to your model to make a LED blinking, but for the current work it is not of interest how the blinking is realized. This will be done in the next lower level of the hierarchy.
+
+This simple example might give an idea how powerful this mechanisms is.
+
+The hierarchical FSM provides a rich tool box to describe real world problems (see \textbf{room concepts}).
+
+\subsection{Layering}
+
+Layering is another well known form of abstraction to reduce complexity in the structure of systems. ROOM is probably the only language that supports Layering directly as language feature.
+Layering can be expressed in ROOM by Actors with specialized Ports, called Service Access Points (*SAP*) and Service Provision Points (*SPP*).
+
+The Actor that provides a service implements an SPP and the client of that service implements an SAP. The Layer Connection connects all SAPs of a specific Protocol within an Actor hierarchy with an SPP that implements the service. From the Actors point of view, SAPs and SPPs behave almost like regular ports.
+
+\includegraphics{images/010-LayerExample.png}
+% !images/010-LayerExample.png!
+
+The Example shows a layered model. The Layer Connections define e.g. that the \textit{ApplicationLayer} can only use the services of the \textit{ServiceLayer} and the \textit{CommunicationLayer}. Actors inside the _ApplicationLayer_ that implement an SAP for those services are connected directly to the implementation of the services.
+Layering and actor hierarchies with port to port connections can be mixed on every level of granularity.
+
+\subsection{Run to Completion}
+
+\textbf{Run to completion} (RTC) is a very central concept of ROOM. It enables the developer to concentrate on the functional aspects of the system. The developer doesn't have to care about concurrency issues all the time. This job is concentrated to the system designer in a very flexible way.
+What does \textbf{run to completion} mean:
+RTC means that an actor, which is processing a message, can not receive the next message as long as the processing of the current message has been finished. Receiving of the next message will be queued from the underlying run time system.
+
+Note: It is very important not to confuse run to completion and preemption. Run to completion means that an actor will finish the processing of a message before he can receive a new one (regardless of its priority). That does not mean that an actor cannot be preempted from an higher priority thread of control. But even a message from this higher prior thread of control will be queued until the current processing has been finished.
+
+With this mechanism all actor internal attributes and data structures are protected. Due to the fact that multiple actors share one thread of control, all objects are protected which are accessed from one thread of control but multiple actors. This provides the possibility to decompose complex functionality to several actors without the risk to produce access violations or dead locks.
+
+\section{Execution Models}
+
+Since from ROOM models executable code can be generated, it is important to define the way the actors are executed and communicate with each other. The combination of communication and execution is called the Execution Model.
+Currently the eTrice tooling only supports the \textbf{message driven} and parts of the \textbf{data driven} execution model. In future releases more execution models will be supported, depending on the requirements of the community.
+
+\subsection{Communication Methods}
+
+\begin{itemize}
+\item \textbf{message driven} (asynchronous, non blocking, no return value): Usually the message driven communication is implemented with message queues. Message queues are inherently asynchronous and enable a very good decoupling of the communicating parties.
+\item \textbf{data driven} (asynchronous, non blocking, no return value): In data driven communication sender and receiver often have a shared block of data. The sender writes the data and the receiver polls the data.
+\item \textbf{function call} (synchronous, blocking, return value): Regular function call as known in most programming languages.
+\end{itemize}
+
+\subsection{Execution Methods}
+
+\begin{itemize}
+\item \textbf{execution by receive event}: The message queue or the event dispatcher calls a \textbf{receive event} function of the message receiver an thereby executes the processing of the event.
+\item \textbf{polled execution}: The objects are processed by a cyclic \textbf{execute} call
+\item \textbf{execution by function call}: The caller executes the called object via function call
+
+\subsection{Execution Models}
+
+In todays embedded systems in most cases one or several of the following execution models are used:
+
+\subsubsection{message driven}
+
+The message driven execution model is a combination of message driven communication and execution by receive event.
+This model allows for distributed systems with a very high throughput.
+It can be deterministic but the determinism is hard to proof.
+This execution model is often found in telecommunication systems and high performance automation control systems.
+
+\subsubsection{data driven}
+
+The data driven execution model is a combination of data driven communication and polled execution.
+This model is highly deterministic and very robust, but the polling creates a huge performance overhead.
+The determinism is easy to proof (simple mathematics).
+The execution model is also compatible with the execution model of control software generated by Tools like Matlab(TM) and LabView(TM).
+This model is usually used for systems with requirements for safety, such as automotive and avionic systems.
+
+\subsubsection{synchronous}
+
+The synchronous execution model could also be called \textbf{simple function calls}.
+This model is in general not very well suited to support the \textbf{run to completion} semantic typical for ROOM models, but could also be generated from ROOM models.
+With this execution model also lower levels of a software system, such as device drivers, could be generated from ROOM models.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/012-working-with-tutorials.tex b/plugins/org.eclipse.etrice.doc/doc-tex/012-working-with-tutorials.tex
new file mode 100644
index 0000000..e268b19
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/012-working-with-tutorials.tex
@@ -0,0 +1,7 @@
+\chapter{Working with the eTrice Tutorials}
+
+The eTrice Tutorials will help you to learn and understand the eTrice tool and concepts. ETrice supports several target languages. The concepts will not be explained for each language.
+
+Most of the common concepts will be described for Java as target language. To start with a new language the first steps to setup the workspace and to generate and run the first model will be described also. Target language specific aspects will be described as well.
+
+Therefore the best way to start with eTrice is to follow the Java Tutorials and after that switch to your target language.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/013-setting-up-the-workspace.tex b/plugins/org.eclipse.etrice.doc/doc-tex/013-setting-up-the-workspace.tex
new file mode 100644
index 0000000..946c69e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/013-setting-up-the-workspace.tex
@@ -0,0 +1,51 @@
+\chapter{Setting up the Workspace for Java Projects}
+
+ETrice generates code out of ROOM models. The code generator and the generated code relies on a runtime framework and on some ready to use model parts. This parts provide services like:
+
+\begin{itemize}
+\item messaging
+\item logging
+\item timing
+\end{itemize}
+
+Additionally some tutorial models will be provided to make it easy to start with eTrice. All this parts must be available in our workspace before you can start working. After installation of eclipse (juno) and the eTrice plug in, your workspace should look like this:
+
+\includegraphics{images/013-SetupWorkspace01}
+% !images/013-SetupWorkspace01.png!
+
+Just the \textit{eTrice} menu item is visible from the eTrice tool.
+From the \textit{File} menu select \textbf{File->New->Project}
+
+\includegraphics{images/013-SetupWorkspace02}
+% !images/013-SetupWorkspace02.png!
+
+Open the \textit{eTrice} tab and select \textit{eTrice Java Runtime}
+
+Press \textit{Next} and \textit{Finish} to install the Runtime into your workspace.
+
+\includegraphics{images/013-SetupWorkspace03}
+% !images/013-SetupWorkspace03.png!
+
+Do the same steps for \textit{eTrice Java Modellib} and \textit{eTrice Java Tutorials}. To avoid temporary error markers you should keep the proposed order of installation. The resulting workspace should look like this:
+
+\includegraphics{images/013-SetupWorkspace04}
+% !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 \textit{org.eclipse.etrice.tutorials} project. All tutorials are ready to generate and run without any changes. To start the code generator simply run \textbf{gen\_org.eclipse.etrice.tutorials.launch} as \textbf{gen\_org.eclipse.etrice.tutorials.launch}:
+
+\includegraphics{images/013-SetupWorkspace05}
+% !images/013-SetupWorkspace05.png!
+
+After generation for each tutorial a java file called \textbf{SubSystem\_ModelnameRunner.java} is generated. To run the model simply run this file as a java application:
+
+\includegraphics{images/013-SetupWorkspace06}
+% !images/013-SetupWorkspace06.png!
+
+To stop the application type \textit{quit} in the console window.
+
+\includegraphics{images/013-SetupWorkspace07}
+% !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-tex/015-getting-started.tex b/plugins/org.eclipse.etrice.doc/doc-tex/015-getting-started.tex
new file mode 100644
index 0000000..10ba20a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/015-getting-started.tex
@@ -0,0 +1,125 @@
+\chapter{Tutorial HelloWorld for Java}
+
+\section{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:
+
+\begin{enumerate}
+\item create a new model from scratch
+\item add a very simple state machine to an actor
+\item generate the source code
+\item run the model
+\item open the message sequence chart
+\end{enumerate}
+
+Make sure that you have set up the workspace as described in \textit{Setting up the workspace}.
+
+"video hello world":http://eclipse.org/etrice/images/015-HelloWorld01.avi
+
+\section{Create a new model from scratch}
+
+The easiest way to create a new eTrice Project is to use the eclipse project wizard. From the eclipse file menu select \textbf{File->New->Project} and create a new eTrice project and name it \textbf{HelloWorld}.
+
+\includegraphics{images/015-HelloWorld10}
+% !images/015-HelloWorld10.png!
+
+The wizard creates everything that is needed to create, build and run an eTrice model. The resulting project should look like this:
+
+\includegraphics{images/015-HelloWorld11.png}
+% !images/015-HelloWorld11.png!
+
+Within the model directory the model file \textit{HelloWorld.room} was created. Open the \textit{HelloWorld.room} file and delete the contents of the file. Open the content assist with Ctrl+Space and select \textit{model skeleton}.
+
+\includegraphics{images/015-HelloWorld12}
+% !images/015-HelloWorld12.png!
+
+Edit the template variables by typing the new names and jumping with Tab from name to name.
+
+The resulting model code should look like this:
+
+\begin{verbatim}
+RoomModel HelloWorld {
+
+ LogicalSystem System_HelloWorld {
+ SubSystemRef subsystem : SubSystem_HelloWorld
+ }
+
+ SubSystemClass SubSystem_HelloWorld {
+ ActorRef application : HelloWorldTop
+ }
+
+ ActorClass HelloWorldTop {
+ }
+}
+\end{verbatim}
+
+The goal of eTrice is to describe distributed systems on a logical level. In the current version not all elements will be used. But as prerequisite for further versions the following elements can be defined:
+\begin{itemize}
+\item the \textit{LogicalSystem} (currently optional)
+\item at least one \textit{SubSystemClass} (mandatory)
+\item at least one \textit{ActorClass} (mandatory)
+\end{itemize}
+
+The \textit{LogicalSystem} represents the complete distributed system and contains at least one \textit{SubSystemRef}. The \textit{SubSystemClass} represents an address space and contains at least one \textit{ActorRef}. The \textit{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.
+
+The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.
+
+\includegraphics{images/015-HelloWorld02.png}
+% !images/015-HelloWorld02.png!
+
+
+\section{Create a state machine}
+
+We will implement the Hello World code on the initial transition of the \textit{HelloWorldTop} actor. Therefore open the state machine editor by right clicking the \textit{HelloWorldTop} actor in the outline view and select \textit{Edit Behavior}.
+
+\includegraphics{images/015-HelloWorld03.png}
+% !images/015-HelloWorld03.png!
+
+The state machine editor will be opened. Drag and drop an \textit{Initial Point} from the tool box to the diagram into the top level state. Drag and drop a \textit{State} from the tool box to the diagram. Confirm the dialogue with \textit{ok}. Select the \textit{Transition} in the tool box and draw the transition from the \textit{Initial Point} to the State. Open the transition dialogue by double clicking the transition arrow and fill in the action code.
+
+\begin{verbatim}
+bc. System.out.println("Hello World !");
+\end{verbatim}
+
+The result should look like this:
+
+\includegraphics{images/015-HelloWorld04}
+% !images/015-HelloWorld04.png!
+
+Save the diagram and inspect the model file. Note that the textual representation was created after saving the diagram.
+
+\includegraphics{images/015-HelloWorld05}
+% !images/015-HelloWorld05.png!
+
+
+\section{Build and run the model}
+
+Now the model is finished and source code can be generated. The project wizard has created a launch configuration that is responsible for generating the source code. From \textit{HelloWorld/} right click \textbf{gen\_HelloWorld.launch} and run it as gen\_HelloWorld. All model files in the model directory will be generated.
+
+\includegraphics{images/015-HelloWorld06}
+% !images/015-HelloWorld06.png!
+
+The code will be generated to the src-gen directory. The main function will be contained in \textbf{SubSystem\_HelloWorldRunner.java}. Select this file and run it as Java application.
+
+\includegraphics{images/015-HelloWorld07}
+% !images/015-HelloWorld07.png!
+
+
+The Hello World application starts and the string will be printed on the console window. To stop the application the user must type \textbf{quit} in the console window.
+
+\includegraphics{images/015-HelloWorld08}
+% !images/015-HelloWorld08.png!
+
+\section{Open the Message Sequence Chart}
+
+During runtime the application produced a MSC and wrote it to a file. Open HelloWorld/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:
+
+\includegraphics{images/015-HelloWorld09}
+% !images/015-HelloWorld09.png!
+
+
+\section{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 will deal with more complex hierarchies in structure and behavior.
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/020-tutorial-blinky.tex b/plugins/org.eclipse.etrice.doc/doc-tex/020-tutorial-blinky.tex
new file mode 100644
index 0000000..97d1fda
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/020-tutorial-blinky.tex
@@ -0,0 +1,250 @@
+\chapter{Tutorial Blinky (Java)}
+
+\section{Scope}
+
+This tutorial describes how to use the \textit{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.
+
+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:
+
+\includegraphics{images/020-Blinky08}
+% !images/020-Blinky08.png!
+
+Within this tutorial we will just toggle the yellow light.
+
+You will perform the following steps:
+
+\begin{enumerate}
+\item create a new model from scratch
+\item define a protocol
+\item create an actor structure
+\item create a hierarchical state machine
+\item use the predefined \textit{TimingService}
+\item combine manual code with generated code
+\item build and run the model
+\item open the message sequence chart
+\end{enumerate}
+
+\section{Create a new model from scratch}
+
+Remember the exercise \textit{HelloWorld}.
+Create a new eTrice project and name it \textit{Blinky}.
+
+To use the GUI please copy the package \textit{org.eclipse.etrice.tutorials.PedLightGUI} from \textit{org.eclipse.etrice.tutorials/src} to your *src* directory \textit{Blinky/src}. For this tutorial you must remove the error markers by editing the file \textit{PedestrianLightWndNoTcp.java}. Appropriate comments are provided to remove the error markers for this turorial.
+
+Open the \textit{Blinky.room} file and copy the following code into the file or use content assist to create the model.
+
+\begin{verbatim}
+RoomModel Blinky {
+
+ LogicalSystem System_Blinky {
+ SubSystemRef subsystem : SubSystem\_Blinky
+ }
+
+ SubSystemClass SubSystem\_Blinky {
+ ActorRef application : BlinkyTop
+ }
+
+ ActorClass BlinkyTop {
+ }
+}
+\end{verbatim}
+
+\section{Add two additional actor classes}
+
+Position the cursor outside any class definition and right click the mouse within the editor window. From the context menu select \textit{Content Assist}
+
+\includegraphics{images/020-Blinky02}
+% !images/020-Blinky02.png!
+
+Select \textit{ActorClass - actor class skeleton} and name it \textit{Blinky}.
+
+\includegraphics{images/020-Blinky01}
+% !images/020-Blinky01.png!
+
+Repeat the described procedure and name the new actor \textit{BlinkyController}.
+
+With Ctrl+Shift+F you can beautify the model code.
+
+Save the model and visit the outline view.
+
+\section{Create a new protocol}
+
+With the help of \textit{Content Assist} create a \textit{ProtocolClass} and name it \textit{BlinkyControlProtocol}.
+Inside the brackets use the \textit{Content Assist} (CTRL+Space) to create two incoming messages called \textit{start} and \textit{stop}.
+
+The resulting code should look like this:
+
+\includegraphics{images/020-Blinky03}
+% !images/020-Blinky03.png!
+
+With Ctrl-Shift+F or selecting \textit{Format} from the context menu you can format the text. Note that all elements are displayed in the outline view.
+
+\section{Import the Timing Service}
+
+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 \textit{Blinky} and select properties. Select the \textit{Java Build Path} tab)
+
+\includegraphics{images/020-Blinky16}
+% !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:
+
+\begin{verbatim}
+RoomModel Blinky {
+
+ import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib/models/TimingService.room"
+
+ LogicalSystem System_Blinky {
+ SubSystemRef subsystem: SubSystem\_Blinky
+ }
+}
+...
+\end{verbatim}
+
+Make sure that the path fits to your folder structure. The original tutorial code is different due to the folder structure.
+
+Now it can be used within the model. Right click to \textbf{SubSystem\_Blinky} within the outline view. Select \textit{Edit Structure}. The \textit{application} is already referenced in the subsystem. Drag and Drop an \textit{ActorRef} to the \textbf{SubSystem\_Blinky} and name it \textit{timingService}. From the actor class drop down list select \textit{room.basic.service.timing.ATimingService}. Draw a \textit{LayerConnection} from \textit{application} to each service provision point (SPP) of the \textit{timingService}. The resulting structure should look like this:
+
+\includegraphics{images/020-Blinky06}
+% !images/020-Blinky06.png!
+
+The current version of eTrice does not provide a graphical element for a service access point (SAP). Therefore the SAPs to access the timing service must be added in the .room file. Open the \textit{Blinky.room} file and navigate to the \textit{Blinky} actor. Add the following line to the structure of the actor:
+
+\begin{verbatim}SAP timer: room.basic.service.timing.PTimeout \end{verbatim}
+
+Do the same thing for \textit{BlinkyController}.
+
+The resulting code should look like this:
+
+\includegraphics{images/020-Blinky07}
+% !images/020-Blinky07.png!
+
+
+\section{Finish the model structure}
+
+From the outline view right click to \textit{Blinky} and select \textit{Edit Structure}. Drag and Drop an \textit{Interface Port} to the boarder of the \textit{Blinky} actor. Note that an interface port is not possible inside the actor. Name the port \textit{ControlPort} and select \textit{BlinkyControlProtocol} from the drop down list. Uncheck \textit{Conjugated} and \textit{Is Relay Port}. Click \textit{ok}. The resulting structure should look like this:
+
+\includegraphics{images/020-Blinky04}
+% !images/020-Blinky04.png!
+
+Repeat the above steps for the \textit{BlinkyController}. Make the port \textit{Conjugated}
+
+Keep in mind that the protocol defines \textit{start} and \textit{stop} as incoming messages. \textit{Blinky} receives this messages and therefore \textit{Blinky}'s \textit{ControlPort} must be a regular port and \textit{BlinkyController}'s \textit{ControlPort} must be a conjugated port.
+
+
+From the outline view right click \textit{BlinkyTop} and select \textit{Edit Structure}.
+
+Drag and Drop an \textit{ActorRef} inside the \textit{BlinkyTop} actor. Name it \textit{blinky}. From the actor class drop down list select \textit{Blinky}. Do the same for \textit{controller}. Connect the ports via the binding tool. The resulting structure should look like this:
+
+\includegraphics{images/020-Blinky05}
+% !images/020-Blinky05.png!
+
+\section{Implement the Behavior}
+
+The application should switch on and off the LED for 5 seconds in a 1 second interval, then stop blinking for 5 seconds and start again. To implement this behavior we will implement two FSMs. One for the 1 second interval and one for the 5 second interval. The 1 second blinking should be implemented in \textit{Blinky}. The 5 second interval should be implemented in \textit{BlinkyController}. First implement the Controller.
+
+Right click to \textit{BlinkyController} and select \textit{Edit Behavior}.
+Drag and Drop the \textit{Initial Point} and two \textit{States} into the top state. Name the states \textit{on} and \textit{off}.
+Use the \textit{Transition} tool to draw transitions from \textit{init} to \textit{on} from \textit{on} to \textit{off} and from \textit{off} to \textit{on}.
+
+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 transition dialog should look like this:
+
+\includegraphics{images/020-Blinky09}
+% !{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 \textit{port.message(param);}. In this example \textit{ControlPort.start()} sends the \textit{start} message via the \textit{ControlPort} to the outside world. Assuming that \textit{Blinky} is connected to this port, the message will start the one second blinking FSM. It is the same thing with the \textit{timer}. The SAP is also a port and follows the same rules. So it is clear that \textit{timer.Start(5000);} will send the \textit{Start} message to the timing service. The timing service will send a \textit{timeoutTick} message back after 5000ms.
+
+Within each transition the timer will be restarted and the appropriate message will be sent via the \textit{ControlPort}.
+
+The resulting state machine should look like this:
+(Note that the arrows peak changes if the transition contains action code.)
+
+\includegraphics{images/020-Blinky10}
+% !images/020-Blinky10.png!
+
+Save the diagram and inspect the \textit{Blinky.room} file. The \textit{BlinkyController} should look like this:
+
+\includegraphics{images/020-Blinky11}
+% !images/020-Blinky11.png!
+
+Now we will implement \textit{Blinky}. Due to the fact that \textit{Blinky} interacts with the GUI class a view things must to be done in the model file.
+
+Double click \textit{Blinky} in the outline view to navigate to \textit{Blinky} within the model file.
+Add the following code:
+(type it or simply copy it from the tutorial project)
+
+\includegraphics{images/020-Blinky12}
+% !images/020-Blinky12.png!
+
+\textit{usercode1} will be generated at the beginning of the file, outside the class definition. \textit{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 \textit{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 \textit{Blinky}. Remember, as the name suggested \textit{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 \textit{blinking} state has two sub states.
+
+Open the behavior diagram of \textit{Blinky} by right clicking the \textit{Blinky} actor in the outline view. Create two states named \textit{blinking} and \textit{off}. Right click to \textit{blinking} and create a subgraph.
+
+\includegraphics{images/020-Blinky13}
+% !images/020-Blinky13.png!
+
+Create the following state machine. The trigger events between \textit{on} and \textit{off} are the \textit{timeoutTick} from the \textit{timer} port.
+
+\includegraphics{images/020-Blinky14}
+% !images/020-Blinky14.png!
+
+Create entry code for both states by right clicking the state and select \textit{Edit State...}
+
+Entry code of \textit{on} is:
+
+\begin{verbatim}
+timer.Start(1000);
+carLights.setState(TrafficLight3.YELLOW);
+\end{verbatim}
+
+
+Entry code of \textit{off} is:
+
+\begin{verbatim}
+timer.Start(1000);
+carLights.setState(TrafficLight3.OFF);
+\end{verbatim}
+
+Navigate to the Top level state by double clicking the \textit{/blinking} state. Create the following state machine:
+
+\includegraphics{images/020-Blinky15}
+% !images/020-Blinky15.png!
+
+The trigger event from \textit{off} to \textit{blinking} is the \textit{start} event from the \textit{ControlPort}.The trigger event from \textit{blinking} to \textit{off} is the \textit{stop} event from the \textit{ControlPort}.
+Note: The transition from \textit{blinking} to \textit{off} is a so called group transition. This is a outgoing transition from a super state (state with sub states) without specifying the concrete leave state (state without sub states). An incoming transition to a super state is called history transition.
+
+Action code of the init transition is:
+
+\begin{verbatim}
+carLights = light.getCarLights();
+pedLights = light.getPedLights();
+carLights.setState(TrafficLight3.OFF);
+pedLights.setState(TrafficLight2.OFF);
+\end{verbatim}
+
+Action code from \textit{blinking} to \textit{off} is:
+
+\begin{verbatim}
+timer.Kill();
+carLights.setState(TrafficLight3.OFF);
+\end{verbatim}
+
+The model is complete now. You can run and debug the model as described in getting started. Have fun.
+
+The complete model can be found in /org.eclipse.etrice.tutorials/model/Blinky.
+
+\section{Summary}
+
+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-tex/025-tutorial-sending-data.tex b/plugins/org.eclipse.etrice.doc/doc-tex/025-tutorial-sending-data.tex
new file mode 100644
index 0000000..c324348
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/025-tutorial-sending-data.tex
@@ -0,0 +1,286 @@
+\chapter{Tutorial Sending Data (Java)}
+
+\section{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:
+
+\begin{enumerate}
+\item create a new model from scratch
+\item create a data class
+\item define a protocol with attached data
+\item create an actor structure
+\item create two simple state machines
+\item build and run the model
+\end{enumerate}
+
+\section{Create a new model from scratch}
+
+Remember exercise \textit{HelloWorld}.
+Create a new eTrice project and name it \textit{SendingData}.
+Open the \textit{SendingData.room} file and copy the following code into the file or use content assist to create the model.
+
+
+\begin{verbatim}
+RoomModel SendingData {
+ LogicalSystem SendingData_LogSystem {
+ SubSystemRef SendingDataAppl:SendingData_SubSystem
+ }
+ SubSystemClass SendingData_SubSystem {
+ ActorRef SendigDataTopRef:SendingDataTop
+ }
+ ActorClass SendingDataTop {
+ }
+}
+\end{verbatim}
+
+\section{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 \textit{Content Assist} (or Ctrl+Space).
+
+\includegraphics{images/025-SendingData01.png}
+% !images/025-SendingData01.png!
+
+Select \textit{DataClass - data class skeleton} and name it \textit{DemoData}.
+Remove the operations and add the following Attributes:
+
+\begin{verbatim}
+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\""
+}
+\end{verbatim}
+
+Save the model and visit the outline view.
+Note that the outline view contains all data elements as defined in the model.
+
+\section{Create a new protocol}
+
+With the help of \textit{Content Assist} create a \textit{ProtocolClass} and name it \textit{PingPongProtocol}. Create the following messages:
+
+\begin{verbatim}
+ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping(data: DemoData)
+ Message pingSimple(data:int32)
+ }
+ outgoing {
+ Message pong(data: DemoData)
+ Message pongSimple(data:int32)
+ }
+}
+\end{verbatim}
+
+\section{Create MrPing and MrPong Actors}
+
+With the help of \textit{Content Assist} create two new actor classes and name them \textit{MrPing} and \textit{MrPong}. The resulting model should look like this:
+
+\begin{verbatim}
+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 { }
+ }
+}
+
+\end{verbatim}
+
+The outline view should look like this:
+
+\includegraphics{images/025-SendingData03.png}
+% !images/025-SendingData03.png!
+
+\section{Define Actor Structure and Behavior}
+
+Save the model and visit the outline view. Within the outline view, right click on the \textit{MrPong} actor and select \textit{Edit Structure}. Select an \textit{Interface Port} from the toolbox and add it to MrPong. Name the Port \textit{PingPongPort} and select the \textit{PingPongProtocol}.
+
+\includegraphics{images/025-SendingData02.png}
+% !images/025-SendingData02.png!
+
+Do the same with MrPing but mark the port as \textit{conjugated}
+
+\subsection{Define MrPongs behavior}
+
+Within the outline view, right click MrPong and select \textit{Edit Behavior}. Create the following state machine:
+
+\includegraphics{images/025-SendingData04.png}
+% !images/025-SendingData04.png!
+
+The transition dialogues should look like this:
+For \textit{ping}:
+
+\includegraphics{images/025-SendingData05.png}
+% !images/025-SendingData05.png!
+
+For \textit{pingSimple}:
+
+\includegraphics{images/025-SendingData06.png}
+% !images/025-SendingData06.png!
+
+
+\subsection{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.
+
+\includegraphics{images/025-SendingData07.png}
+% !images/025-SendingData07.png!
+
+Name the operation \textit{printData} and define the DemoData as a parameter.
+
+Fill in the following code:
+
+\begin{verbatim}
+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);"
+}
+\end{verbatim}
+
+For MrPing create the following state machine:
+(Remember that you can copy and paste the action code from the tutorial directory.)
+
+\includegraphics{images/025-SendingData08.png}
+% !images/025-SendingData08.png!
+
+The transition dialogues should look like this:
+
+For \textit{init}:
+
+\includegraphics{images/025-SendingData09.png}
+% !images/025-SendingData09.png!
+
+For \textit{wait1}:
+
+\includegraphics{images/025-SendingData10.png}
+% !images/025-SendingData10.png!
+
+For \textit{next}:
+
+\includegraphics{images/025-SendingData11.png}
+% !images/025-SendingData11.png!
+
+For \textit{wait2}:
+
+\includegraphics{images/025-SendingData12.png}
+% !images/025-SendingData12.png!
+
+\section{Define the top level}
+
+Open the Structure from SendingDataTop and add MrPing and MrPong as a reference. Connect the ports.
+
+\includegraphics{images/025-SendingData13.png}
+% !images/025-SendingData13.png!
+
+The model is finished now and can be found in /org.eclipse.etrice.tutorials/model/SendingData.
+
+\section{Generate and run the model}
+
+Generate the code by right click to \textbf{gen\_SendingData.launch} and run it as \textbf{gen\_SendingData}. Run the model.
+The output should look like this:
+
+\begin{verbatim}
+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
+\end{verbatim}
+
+\section{Summary}
+
+Within the first loop an integer value will be incremented by \textit{MrPong} and sent back to \textit{MrPing}. As long as the guard is true \textit{MrPing} sends back the value.
+
+Within the \textit{next} transition, \textit{MrPing} creates a data class and sends the default values. Then \textit{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. This type of data passing is called \textit{sending data by value}.
+However, for performance reasons some applications requires \textit{sending data by reference}. In this case the user is responsible for the life cycle of the object. In Java the VM takes care of the life cycle of an object. This is not the case for C/C++. Consider that a object which is created within a transition of a state machine will be destroyed when the transition is finished. The receiving FSM would receive an invalid reference. Therefore care must be taken when sending references.
+
+For sending data by reference you simply have to add the keyword \textit{ref} to the protocol definition.
+
+\begin{verbatim}Message ping(data: DemoData ref)\end{verbatim}
+
+Make the test and inspect the console output.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/030-tutorial-ped-lights.tex b/plugins/org.eclipse.etrice.doc/doc-tex/030-tutorial-ped-lights.tex
new file mode 100644
index 0000000..8ddc0c1
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/030-tutorial-ped-lights.tex
@@ -0,0 +1,87 @@
+\chapter{Tutorial Pedestrian Lights (Java)}
+
+\section{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 by 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 \textit{REQUEST} button to start a FSM, which controls the traffic lights.
+
+\includegraphics{images/020-Blinky08}
+% !images/020-Blinky08.png!
+
+The \textit{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:
+\begin{enumerate}
+\item specify the messages (within a protocol) which should be sent into the model
+\item model an actor with a port (which uses the specified protocol) and connect the port to the receiver
+\item the external code should know the port (import of the port class)
+\item the external code should provide a registration method, so that the actor is able to allow access to this port
+\item the port can be used from the external code
+\end{enumerate}
+
+\section{Setup the model}
+
+\begin{itemize}
+\item Use the \textit{New Model Wizzard} to create a new eTrice project and name it \textit{PedLightsController}.
+\item Copy the package \textit{org.eclipse.etrice.tutorials.PedLightGUI} to your \textit{src} directory (see blinky tutorial).
+\item In PedestrianLightWndNoTcp.jav uncomment line 15 (import), 36, 122 (usage) and 132-134 (registration). The error markers will disappear after the code is generated from the model.
+\item Copy the model from /org.eclipse.etrice.tutorials/model/PedLightsController to your model file, or run the model directly in the tutorial directory.
+\item Adapt the import statement to your path.
+\end{itemize}
+\begin{verbatim}
+import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib/models/TimingService.room"
+\end{verbatim}
+
+\begin{itemize}
+\item Generate the code from the model.
+\item Add the org.eclipse.etrice.modellib to the Java Class Path of your project.
+\item All error markers should be disappeared and the model should be operable.
+\item Arrange the Structure and the Statemachines to understand the model
+\end{itemize}
+
+\includegraphics{images/030-PedLights01}
+% !images/030-PedLights01.png!
+The \textit{GuiAdapter} represents the interface to the external code. It registers its \textit{ControlPort} by the external code.
+
+\includegraphics{images/030-PedLights02}
+% !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.
+
+\includegraphics{images/030-PedLights03}
+% !images/030-PedLights03.png!
+The \textit{Controller} receives the \textit{start} message and controls the timing of the lights. Note that the \textit{start} message will be sent from the external code whenever the \textit{REQUEST} button is pressed.
+
+\begin{itemize}
+\item Visit the model and take a closer look to the following elements:
+\begin{enumerate}
+\item PedControlProtocol => notice that the start message is defined as usual
+\item Initial transition of the \textit{GuiAdapter} => see the registration
+\item The \textit{Controller} => notice that the \textit{Controller} receives the external message (not the \textit{GuiAdapter}). The \textit{GuiAdapter} just provides its port and handles the incoming messages.
+\item Visit the hand written code => see the import statement of the protocol class and the usage of the port.
+\end{enumerate}
+\item Generate and test the model
+\item Take a look at the generated MSC => notice that the start message will shown as if the \textit{GuiAdapter} had sent it.
+\end{itemize}
+
+\includegraphics{images/030-PedLights04}
+% !images/030-PedLights04.png!
+
+\section{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 \textbf{run to completion} semantic. To answer this question, take a look at the \textit{MessageService.java} from the runtime environment. There you will find the receive method which puts each message into the queue.
+
+\begin{verbatim}
+ @Override
+ public synchronized void receive(Message msg) {
+ if (msg!=null) {
+ messageQueue.push(msg);
+ notifyAll(); // wake up thread to compute message
+ }
+ }
+\end{verbatim}
+
+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/doc-tex/032-setting-up-the-workspace_c.tex b/plugins/org.eclipse.etrice.doc/doc-tex/032-setting-up-the-workspace_c.tex
new file mode 100644
index 0000000..7aa3fb8
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/032-setting-up-the-workspace_c.tex
@@ -0,0 +1,87 @@
+\chapter{Setting up the Workspace for C Projects}
+
+Before you can start with C, some preconditions must be fulfilled:
+
+\begin{description}
+- A C compiler must be installed on your machine (all tests and tutorials are based on MinGW)
+- The CDT-Eclipse plug in must be installed as the C development environment.
+\end{description}
+
+Once the CDT is installed, the C runtime and model library must be imported.
+(\textit{File->New->Project->eTrice} select \textit{eTrice C runtime} / \textit{eTrice C modellib})
+
+The resulting workspace should look like this:
+
+\includegraphics{images/032-SetupWorkspaceC01.png}
+% !images/032-SetupWorkspaceC01.png!
+
+
+\section{Testing the environment}
+
+To verify the C tool chain you should generate and run the Hello World example program of the CDT.
+ Activate the \textit{C/C++} perspective.
+
+\includegraphics{images/032-SetupWorkspaceC03.png}
+% !images/032-SetupWorkspaceC03.png!
+
+From the main menu select \textit{File->New->C Project}.
+
+\includegraphics{images/032-SetupWorkspaceC02.png}
+% !images/032-SetupWorkspaceC02.png!
+
+Name the project. Select an \textit{Executable->Hello World ANSI C} as project type, \textit{MinGW GCC} as tool chain and click \textit{Finish}.
+
+\includegraphics{images/032-SetupWorkspaceC04.png}
+% !images/032-SetupWorkspaceC04.png!
+
+Select the new project and click the build button (or right click the project and select \textit{Build Project})
+
+\includegraphics{images/032-SetupWorkspaceC05.png}
+!images/032-SetupWorkspaceC05.png!
+
+The binary should be generated. Run the binary as \textit{Local C/C++ Application}.
+
+\includegraphics{images/032-SetupWorkspaceC06.png}
+% !images/032-SetupWorkspaceC06.png!
+
+Verify the output.
+
+\includegraphics{images/032-SetupWorkspaceC07.png}
+% !images/032-SetupWorkspaceC07.png!
+
+Remember these steps. In the following Tutorials these steps will be referenced as \textit{build and run}.
+
+
+\section{Building the C runtime system}
+
+The C runtime system contains some basic functionalities to run the generated models. The so called runtime is common for all C projects. The requirements for several projects may differ depending on the functionality of the model or the resources of the different platforms. Therefore the runtime is configurable in terms of message queue size, frequency and memory alignment. The configuration file \textit{etRuntimeConfig.h} is located in _src/config_.
+
+After changing the configuration, the runtime must be built.
+
+Open the properties of the \textit{org.eclipse.runtime.c} project and select \textit{C/C++ Build->Settings->Tool Settings_ and select _Includes}.
+
+\includegraphics{images/032-SetupWorkspaceC08.png}
+% !images/032-SetupWorkspaceC08.png!
+
+Verify the include paths
+
+_src/config_
+_src/common_
+_src/platforms/generic_
+
+Within the Setting dialog select the tab \textit{Build Artefact} and select \textit{Static Library}
+
+\includegraphics{images/032-SetupWorkspaceC09.png}
+% !images/032-SetupWorkspaceC09.png!
+
+Build the runtime by clicking
+
+\includegraphics{images/032-SetupWorkspaceC10.png}
+% !images/032-SetupWorkspaceC10.png!
+
+The runtime library should be created.
+
+\includegraphics{images/032-SetupWorkspaceC11.png}
+% !images/032-SetupWorkspaceC11.png!
+
+For the tutorials one runtime library should be sufficient. For embedded projects it might be necessary to build project specific runtime libraries. In this case a separate project for the runtime should be created. Symbolic links to the sources might be used to avoid duplicate files. Just the configuration file must be duplicated. A specific library file must exist within the project. Such specific runtime libraries might be referenced from several applications.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/034-getting-started_c.tex b/plugins/org.eclipse.etrice.doc/doc-tex/034-getting-started_c.tex
new file mode 100644
index 0000000..642730c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/034-getting-started_c.tex
@@ -0,0 +1,168 @@
+\chapter{Tutorial HelloWorld for C}
+
+\section{Scope}
+
+In this tutorial you will learn how to create a model for C from scratch. There are some more steps to do in C compared to Java. The goal is to get familiar with the additional steps. The Java tutorial is a prerequisite for the following explanations.
+You will perform the following steps:
+
+\begin{enumerate}
+\item create a new model from scratch for C
+\item create structure and behavior similar to Java
+\item create a launch configuration for the C code generator
+\item setup the C environment
+\item generate the source code
+\item run the model
+\end{enumerate}
+
+Make sure that you have set up the workspace as described in \textit{Setting up the Workspace for C Projects}.
+
+
+\section{Create a new model from scratch}
+
+Before you can create a new C-model, you have to create a new C project as described in \textit{Setting up the Workspace for C Projects}.
+Remember:
+\begin{itemize}
+\item select the \textit{C/C++} perspective
+\item From the main menue select \textit{File->New->C Project}
+\item Name the project \textit{HelloWorldC}
+\item Project type is \textit{Executable / Empty C Project}
+\item Toolchain is \textit{MinGW}
+\end{itemize}
+
+The workspace should look like this:
+
+\includegraphics{images/034-HelloWorldC01}
+% !images/034-HelloWorldC01.png!
+
+The next step is to add the model folder:
+Right click on the new project. Select \textit{New->Folder_ and name it _model}.
+
+\includegraphics{images/034-HelloWorldC02}
+% !images/034-HelloWorldC02.png!
+
+Add the model file to the folder. Right click on the new folder. Select \textit{New->file} and name it \textit{HelloWorldC.room}.
+
+\includegraphics{images/034-HelloWorldC03}
+% !images/034-HelloWorldC03.png!
+
+Due to the file ending \textit{.room}, the tool will ask you to add the Xtext nature. Answer with \textit{Yes}.
+
+\includegraphics{images/034-HelloWorldC04}
+% !images/034-HelloWorldC04.png!
+
+The workspace should look like this:
+
+\includegraphics{images/034-HelloWorldC05}
+% !images/034-HelloWorldC05.png!
+
+
+
+\section{Create the HelloWorld model}
+
+Once the model file is created and the Xtext nature is added, you can create the model as you did it for Java.
+Creating the model is not the focus of this tutorial. Therefore copy and paste the following code into your model file. Optionally you can open and layout the diagrams.
+Recognize the C specific parts:
+\begin{itemize}
+\item The action code contains C instead of Java. Later versions will contain a common action language, but for the moment the action language is target specific.
+\item The application must be shutdown on model level (see also \textit{etRuntimeConfig.h}).
+\end{itemize}
+
+\begin{verbatim}
+RoomModel HelloWorldCModel {
+ import room.basic.types.* from "../../org.eclipse.etrice.modellib.c/model/Types.room"
+ SubSystemClass HelloWorldCSubSysClass {
+ ActorRef HelloETriceTopRef:AHelloWorldCTop
+ }
+ ActorClass AHelloWorldCTop {
+ Structure { }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> state0 { }
+ State state0 {
+ entry {
+ "printf(\"HelloWorldC !\\n\");"
+ "SubSysClass_shutdown();"
+ "\t\t\t\t\t\t"
+ }
+ }
+ }
+ }
+ }
+}
+\end{verbatim}
+
+\section{Create a launch configuration to start the C code generator}
+
+Other than in Java a launch configuration for the C code generator must be created.
+
+From the \textit{Run} menu select \textit{Run Configurations}
+
+\includegraphics{images/034-HelloWorldC06}
+% !images/034-HelloWorldC06.png!
+
+Within the dialog select \textit{eTrice C Generator} and click the \textit{New} button to create a new launch configuration.
+
+\includegraphics{images/034-HelloWorldC07}
+% !images/034-HelloWorldC07.png!
+
+A new configuration should be created. Name it \textit{gen\_HelloWorldC} and add the model via one of the \textit{add} buttons.
+
+\includegraphics{images/034-HelloWorldC08}
+% !images/034-HelloWorldC08.png!
+
+In the \textit{Refresh} tab select \textit{The entire workspace}
+
+\includegraphics{images/034-HelloWorldC09}
+% !images/034-HelloWorldC09.png!
+
+In the \textit{Common} tab select \textit{Shared file} and add the \textit{HelloWorldC} project via the \textit{Browse} button.
+
+\includegraphics{images/034-HelloWorldC10}
+% !images/034-HelloWorldC10.png!
+
+Apply your changes. The new configuration should now exist in your workspace.
+
+\includegraphics{images/034-HelloWorldC11}
+% !images/034-HelloWorldC11.png!
+
+
+\section{Generate the code}
+
+Now you can generate the code as you know it from Java. Right click on the launch configuration and run it as _gen_HelloWorldC_.
+
+\includegraphics{images/034-HelloWorldC12}
+% !images/034-HelloWorldC12.png!
+
+The code should be generated.
+
+\includegraphics{images/034-HelloWorldC13}
+% !images/034-HelloWorldC13.png!
+
+\section{Setup the include path}
+
+Before you can build the application you must setup the include path for the runtime system. Right click the project and select \textit{Properties}. Add the include path as described in \textit{setting up the workspace}.
+
+\includegraphics{images/034-HelloWorldC14}
+% !images/034-HelloWorldC14.png!
+
+Add the runtime library.
+
+\includegraphics{images/034-HelloWorldC15}
+% !images/034-HelloWorldC15!
+
+Recognize the name of the library ("org.eclipse.etrice.runtime.c"). The library file on your disk is "liborg.eclipse.etrice.runtime.c.a".
+
+\section{Build and run the model}
+
+Now you can build the application. Click the build button to build the application.
+Run the application as \textit{Local C/C++ Application}.
+Verify the output.
+
+\includegraphics{images/034-HelloWorldC16}
+% !images/034-HelloWorldC16.png!
+
+\section{Summary}
+
+You are now familiar with all necessary steps to create, build and run an eTrice C model from scratch. You are able to create a launch configuration to start the code generator and to perform all necessary settings to compile and link the application.
+
+The next tutorial provides an exercise to get more familiar with these working steps.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/036-tutorial-remove-comment_c.tex b/plugins/org.eclipse.etrice.doc/doc-tex/036-tutorial-remove-comment_c.tex
new file mode 100644
index 0000000..8faa89a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/036-tutorial-remove-comment_c.tex
@@ -0,0 +1,130 @@
+\chapter{Tutorial Remove C-Comment ( C )}
+
+\section{Scope}
+
+In this tutorial you will create a more complex model. The model implements a simple parser that removes comments (block comments and line comments) from a C source file. Therefore we will create two actors. One actor is responsible to perform the file operations, while the second actor implements the parser.
+
+You will perform the following steps:
+
+\begin{enumerate}
+\item create a new model from scratch for C
+\item define a protocol
+\item define your own data type
+\item create the structure and the behavior by yourself
+\item generate, build and run the model
+\end{enumerate}
+
+Make sure that you have set up the workspace as described in \textit{Setting up the Workspace for C Projects}.
+
+\section{Create a new model from scratch}
+
+Remember the following steps from the previous tutorials:
+\begin{itemize}
+\item select the \textit{C/C++} perspective
+\item From the main menue select \textit{File->New->C Project}
+\item Name the project \textit{RemoveComment}
+\item Project type is \textit{Executable / Empty C Project}
+\item Toolchain is \textit{MinGW}
+\item Add the folder \textit{model}
+\item Add the model file and name it \textit{RemoveComment.room}
+\item Add the Xtext nature.
+\end{itemize}
+
+The workspace should look like this:
+
+\includegraphics{images/036-RemoveCommentC01.png}
+% !images/036-RemoveCommentC01.png!
+
+Create a launch configuration for the C generator and add the include path and library as described in \textit{HelloWorldC}.
+
+The workspace should look like this:
+
+\includegraphics{images/036-RemoveCommentC02.png}
+% !images/036-RemoveCommentC02.png!
+
+Now the model is created and all settings for the code generator, compiler and linker are done.
+
+
+\section{Create your own data type}
+
+The planed application should read a C source file and remove the comments. Therefore we need a file descriptor which is not part of the basic C types. The type for the file descriptor for MinGW is \textit{FILE}. To make this type available on the model level, you have to declare the type.
+
+Open the file \textit{Types.room} from \textit{org.eclipse.modellib.c} and take a look at the declaration of \textit{string} (last line) which is not a basic C type.
+
+\textit{PrimitiveType string:ptCharacter -> charPtr default "0"}
+
+With this declaration, you make the \textit{string} keyword available on model level as a primitive type. This type will be translated to \textit{charPtr} in your C sources. \textit{charPtr} is defined in \textit{etDatatypes.h}. This header file is platform specific (\textit{generic}). With this mechanism you can define your own type system on model level and map the model types to specific target/platform types.
+
+To not interfere with other models, we will declare the type direct in the model.
+Add the following line to your model:
+
+\begin{verbatim}
+RoomModel RemoveComment {
+ import room.basic.types.* from "../../../org.eclipse.etrice.modellib.c/model/Types.room"
+
+ PrimitiveType file:ptInteger -> FILE default "0"
+\end{verbatim}
+
+\textit{FILE} is the native type for MinGW. Therefore you donīt need a mapping within \textit{etDatatypes.h}. If your model should be portable across different platforms you should not take this shortcut.
+
+\section{Create the model}
+
+Due to the former tutorials you should be familiar with the steps to create the model with protocols, actors and state machines.
+
+The basic idea of the exercise is to create a file reader actor, which is responsible to open, close and read characters from the source file. Another actor receives the characters and filters the comments (parser). The remaining characters (pure source code) should be print out.
+
+Remember the logical steps:
+\begin{itemize}
+\item create the model by the help of content assist (CTRL Space)
+\item name the model, subsystem and top level actor
+\item define the protocol (in this case it should be able to send a char, and to request the next char from the file reader)
+\item create the structure (file reader and parser with an appropriate port, create the references and connect the ports)
+\item create the state machines
+\end{itemize}
+
+Try to create the model by yourself and take the following solution as an example.
+
+Structure:
+
+\includegraphics{images/036-RemoveCommentC04.png}
+% !images/036-RemoveCommentC04.png!
+
+File reader FSM:
+
+\includegraphics{images/036-RemoveCommentC05.png}
+% !images/036-RemoveCommentC05.png!
+
+Parser FSM:
+
+\includegraphics{images/036-RemoveCommentC06.png}
+% !images/036-RemoveCommentC06.png!
+
+The complete model can be found in \textit{org.eclipse.etrice.tutorials.c}
+
+Take a look at the file attribute of the file reader.
+
+\begin{verbatim}
+Attribute f:file ref
+\end{verbatim}
+
+\textit{fopen} expects a \textit{FILE *}. \textit{f:file ref} declares a variable \textit{f} from type reference to \textit{file}, which is a pointer to \textit{FILE}.
+
+
+\section{Generate, build and run the model}
+
+Before you can run the model you should copy one of the generated C source files into the project folder and name it \textit{test.txt}.
+
+\includegraphics{images/036-RemoveCommentC07.png}
+% !images/036-RemoveCommentC07.png!
+
+Generate, build and run the model.
+
+Your output should start like this:
+
+\includegraphics{images/036-RemoveCommentC08.png}
+% !images/036-RemoveCommentC08.png!
+
+
+\section{Summary}
+
+This tutorial should help you to train the necessary steps to create a C model. By the way you have seen how to create your own type system for a real embedded project. An additional aspect was to show how simple it is to separate different aspects of the required functionality by the use of actors and protocols and make them reusable.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/040-room-concepts.tex b/plugins/org.eclipse.etrice.doc/doc-tex/040-room-concepts.tex
new file mode 100644
index 0000000..c2219e0
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/040-room-concepts.tex
@@ -0,0 +1,510 @@
+\chapter{ROOM Concepts}
+
+This chapter gives an overview over the ROOM language elements and their textual and graphical notation.
+The formal ROOM grammar based on Xtext (EBNF) you can find here: "ROOM Grammar":http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/tree/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/Room.xtext
+
+\section{Actors}
+
+\subsection{Description}
+
+The actor is the basic structural building block for building systems with ROOM. An actor can be refined hierarchically and thus can be of arbitrarily large scope. Ports define the interface of an actor. An Actor can also have a behavior usually defined by a finite state machine.
+
+\subsection{Motivation}
+
+\begin{itemize}
+\item Actors enable the construction of hierarchical structures by composition and layering
+\item Actors have their own logical thread of execution
+\item Actors can be freely deployed
+\item Actors define potentially reusable blocks
+\end{itemize}
+
+\subsection{Notation}
+
+
+\begin{table}
+\caption{Actor Class Notation}
+\begin{tabular}{|l|l|l|}
+\hline
+ \textbf{Element} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ ActorClass & \includegraphics{images/040-ActorClassNotation.png} & \includegraphics{images/040-ActorClassTextualNotation.png} \\ \hline
+ ActorRef & \includegraphics{images/040-ActorReferenceNotation.png} & \includegraphics{images/040-ActorReferenceTextualNotation.png} \\ \hline
+\end{tabular}
+\end{table}
+
+% <table title="Actor Class Notation" frame="box" border="2" cellpadding="3" cellspacing="0" >
+ % <tr>
+ % <td align="center">*Element*</td>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>ActorClass</td>
+ % <td>!images/040-ActorClassNotation.png!</td>
+ % <td>!images/040-ActorClassTextualNotation.png!</td>
+ % </tr>
+ % <tr>
+ % <td>ActorRef</td>
+ % <td>!images/040-ActorReferenceNotation.png!</td>
+ % <td>!images/040-ActorReferenceTextualNotation.png!</td>
+ % </tr>
+% </table>
+
+
+\subsection{Details}
+
+\subsubsection{Actor Classes, Actor References, Ports and Bindings}
+
+An \textbf{ActorClass} defines the type (or blueprint) of an actor. Hierarchies are built by ActorClasses that contain \textbf{ActorReferences} which have another ActorClass as type. The interface of an ActorClass is always defined by Ports. The ActorClass can also contain Attributes, Operations and a finite state machine.
+
+\textbf{External Ports} define the external interface of an actor and are defined in the *Interface* section of the ActorClass.
+
+\textbf{Internal Ports} define the internal interface of an actor and are defined in the *Structure* section of the ActorClass.
+
+\textbf{Bindings} connect Ports inside an ActorClass.
+
+Example:
+
+\begin{table}
+\caption{Actor Class Example}
+\begin{tabular}{|l|l|l|}
+\hline
+ \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ \includegraphics{images/040-ActorClass.png} & \includegraphics{images/040-ActorClassExampleTextualNotation.png} \\ \hline
+ \end{tabular}
+ \end{table}
+
+% <table title="Actor Class Example" frame="box" border="2" cellpadding="3" cellspacing="0" >
+ % <tr>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>!images/040-ActorClass.png!</td>
+ % <td>!images/040-ActorClassExampleTextualNotation.png!</td>
+ % </tr>
+% </table>
+
+\begin{itemize}
+\item \textbf{ActorClass1} contains two ActorReferences (of ActorClass2 and ActorClass3)
+\item \textit{port1} is a \textbf{External End Port}. Since it connects external Actors with the behavior of the ActorClass, it is defined in the \textbf{Interface} section and the \textbf{Structure} section of the ActorClass.
+\item \textit{port2} and \textit{port3} are \textbf{Internal End Ports} and can only be connected to the ports of contained ActorReferences. Internal End Ports connect the Behavior of an ActorClass with its contained ActorReferences.
+\item \textit{port4} is a relay port and connects external Actors to contained ActorReferences. This port can not be accessed by the behavior of the ActorClass.
+\item \textit{port5} through \textit{port9} are Ports of contained ActorReferences. \textit{port8} and \textit{port9} can communicate without interference with the containing ActorClass.
+\item \textbf{Bindings} can connect ports of the ActorClass and its contained ActorReferences.
+\end{itemize}
+
+\subsubsection{Attributes}
+
+Attributes are part of the Structure of an ActorClass. They can be of a PrimitiveType or a DataClass.
+
+Example:
+
+\includegraphics{images/040-ActorClassAttributes.png}
+% !images/040-ActorClassAttributes.png!
+
+\subsubsection{Operations}
+
+Operations are part of the Behavior of an ActorClass. Arguments and return values can be of a PrimitiveType or a DataClass. DataClasses can be passed by value (implicit) or by reference (keyword \textbf{ref}).
+
+Example:
+
+\includegraphics{images/040-ActorClassOperations.png}
+% !images/040-ActorClassOperations.png!
+
+\section{Protocols}
+
+\subsection{Description}
+
+A ProtocolClass defines a set of incoming and outgoing messages that can be exchanged between two ports.
+The exact semantics of a message is defined by the execution model.
+
+\subsection{Motivation}
+
+\begin{itemize}
+\item ProtocolClasses provide a reusable interface specification for ports
+\item ProtocolClasses can optionally specify valid message exchange sequences
+\end{itemize}
+
+\subsection{Notation}
+
+ProtocolClasses have only textual notation.
+The example defines a ProtocolClass with 2 incoming and two outgoing messages. Messages can have data attached. The data can be of a primitive type (e.g. int32, float64, ...) or a DataClass.
+
+\includegraphics{images/040-ProtocolClassTextualNotation.png}
+!images/040-ProtocolClassTextualNotation.png!
+
+\section{Ports}
+
+\subsection{Description}
+
+Ports are the only interfaces of actors. A port has always a protocol assigned.
+Service Access Points (SAP) and Service Provision Points (SPP) are specialized ports that are used to define layering.
+
+\subsection{Motivation}
+
+\begin{itemize}
+\item Ports decouple interface definition (Protocols) from interface usage
+\item Ports decouple the logical interface from the transport
+\end{itemize}
+
+\subsection{Notation}
+
+\subsubsection{Class Ports}
+
+These symbols can only appear on the border of an actor class symbol.
+
+Ports that define an external interface of the ActorClass, are defined in the \textit{Interface}. Ports that define an internal interface are defined in the \textit{Structure} (e.g. internal ports).
+\begin{itemize}
+\item \textbf{External End Ports} are defined in the Interface and the Structure
+\item \textbf{Internal End Ports} are only defined in the Structure
+\item \textbf{Relay Ports} are only defined in the Interface
+\item \textbf{End Ports} are always connected to the internal behavior of the ActorClass
+\item \textbf{Replicated Ports} can be defined with a fixed replication factor ( e.g. \textit{Port port18 [ 5 ]: ProtocolClass1} ) or a variable replication factor (e.g. \textit{Port port18[ * ]: ProtocolClass1} )
+\end{itemize}
+
+\begin{table}
+\caption{Class Port Notation}
+\begin{tabular}{|l|l|l|}
+\hline
+ \textbf{Element} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ Class End Port & \includegraphics{images/040-ClassEndPort.png} & \\ \hline
+ Class End Port & \includegraphics{images/040-ConjugatedClassEndPort.png} & \\ \hline
+ Class Relay Port & \includegraphics{images/040-ClassRelayPort.png} & \\ \hline
+ Conjugated Class Relay Port & \includegraphics{images/040-ConjugatedClassRelayPort.png} & \\ \hline
+ Replicated Class End Port & \includegraphics{images/040-ReplicatedClassEndPort.png} & \\ \hline
+ Conjugated Replicated Class End Port & \includegraphics{images/040-ConjugatedReplicatedClassEndPort.png} & \\ \hline
+ Replicated Class Relay Port & \includegraphics{images/040-ReplicatedClassRelayPort.png} & \\ \hline
+ Conjugated Replicated Class Relay Port & \includegraphics{images/040-ConjugatedReplicatedClassRelayPort.png} & \\ \hline
+\end{tabular}
+\end{table}
+
+% <table title="Class Port Notation" frame="box" border="2" cellpadding="3" cellspacing="0">
+ % <tr>
+ % <td align="center">*Element*</td>
+ % <td align="center" width="15%">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>Class End Port</td>
+ % <td align="center">!images/040-ClassEndPort.png!</td>
+ % <td>
+ % *External Class End Port:*
+ % !images/040-ClassEndPortTextual.png!
+ % *Internal Class End Port:*
+ % !images/040-ClassEndPortInternalTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Class End Port</td>
+ % <td align="center">!images/040-ConjugatedClassEndPort.png!</td>
+ % <td>
+ % *External Conjugated Class End Port:*
+ % !images/040-ConjugatedClassEndPortTextual.png!
+ % *Internal Conjugated Class End Port:*
+ % !images/040-ConjugatedClassEndPortInternalTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Class Relay Port</td>
+ % <td align="center">!images/040-ClassRelayPort.png!</td>
+ % <td>
+ % !images/040-ClassRelayPortTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Class Relay Port</td>
+ % <td align="center">!images/040-ConjugatedClassRelayPort.png!</td>
+ % <td>
+ % !images/040-ConjugatedClassRelayPortTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Replicated Class End Port</td>
+ % <td align="center">!images/040-ReplicatedClassEndPort.png!</td>
+ % <td>
+ % *External Replicated Class End Port:*
+ % !images/040-ReplicatedClassEndPortTextual.png!
+ % *Internal Replicated Class End Port:*
+ % !images/040-ReplicatedClassEndPortInternalTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Replicated Class End Port</td>
+ % <td align="center">!images/040-ConjugatedReplicatedClassEndPort.png!</td>
+ % <td>
+ % *External Conjugated Replicated Class End Port:*
+ % !images/040-ConjugatedReplicatedClassEndPortTextual.png!
+ % *Internal Conjugated Replicated Class End Port:*
+ % !images/040-ConjugatedReplicatedClassEndPortInternalTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Replicated Class Relay Port</td>
+ % <td align="center">!images/040-ReplicatedClassRelayPort.png!</td>
+ % <td>
+ % !images/040-ReplicatedClassRelayPortTextual.png!
+ % </td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Replicated Class Relay Port</td>
+ % <td align="center">!images/040-ConjugatedReplicatedClassRelayPort.png!</td>
+ % <td>
+ % !images/040-ConjugatedReplicatedClassRelayPortTextual.png!
+ % </td>
+ % </tr>
+% </table>
+
+\subsubsection{Reference Ports}
+
+These symbols can only appear on the border of an ActorReference symbol. Since the type of port is defined in the ActorClass, no textual notation for the Reference Ports exists.
+
+\begin{table}
+\caption{Title}
+\begin{tabular}{|c|c|c|}
+\hline
+ \textbf{Element} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ Reference Port & \includegraphics{images/040-ReferencePort.png} & \textit{implicit} \\ \hline
+ Conjugated Reference Port & \includegraphics{images/040-ConjugatedReferencePort.png} & \textit{implicit} \\ \hline
+ Replicated Reference Port & \includegraphics{images/040-ReplicatedReferencePort.png} & \textit{implicit} \\ \hline
+ Conjugated Replicated Reference Port & \includegraphics{images/040-ConjugatedReplicatedReferencePort.png} & \textit{implicit} \\ \hline
+\end{tabular}
+\end{table}
+
+
+% <table title="Title" frame="box" border="2" cellpadding="3" cellspacing="0">
+ % <tr>
+ % <td align="center">*Element*</td>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>Reference Port</td>
+ % <td align="center">!images/040-ReferencePort.png!</td>
+ % <td align="center">_implicit_</td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Reference Port</td>
+ % <td align="center">!images/040-ConjugatedReferencePort.png!</td>
+ % <td align="center">_implicit_</td>
+ % </tr>
+ % <tr>
+ % <td>Replicated Reference Port</td>
+ % <td align="center">!images/040-ReplicatedReferencePort.png!</td>
+ % <td align="center">_implicit_</td>
+ % </tr>
+ % <tr>
+ % <td>Conjugated Replicated Reference Port</td>
+ % <td align="center">!images/040-ConjugatedReplicatedReferencePort.png!</td>
+ % <td align="center">_implicit_</td>
+ % </tr>
+% </table>
+
+\section{DataClass}
+
+\subsection{Description}
+
+The DataClass enables the modeling of hierarchical complex datatypes and operations on them. The DataClass is the equivalent to a Class in languages like Java or C++, but has less features. The content of a DataClass can always be sent via message between actors (defined as message data in ProtocolClass).
+
+\subsection{Notation}
+
+Example: DataClass using PrimitiveTypes
+
+\includegraphics{images/040-DataClass1.png}
+% !images/040-DataClass1.png!
+
+Example: DataClass using other DataClasses:
+
+\includegraphics{images/040-DataClass2.png}
+% !images/040-DataClass2.png!
+
+\section{Layering}
+
+\subsection{Description}
+
+In addition to the Actor containment hierarchies, Layering provides another method to hierarchically structure a software system. Layering and actor hierarchies with port to port connections can be mixed on every level of granularity.
+\begin{enumerate}
+\item an ActorClass can define a Service Provision Point (SPP) to publish a specific service, defined by a ProtocolClass
+\item an ActorClass can define a Service Access Point (SAP) if it needs a service, defined by a ProtocolClass
+\item for a given Actor hierarchy, a LayerConnection defines which SAP will be satisfied by (connected to) which SPP
+\end{enumerate}
+
+\subsection{Notation}
+
+\begin{table}
+\begin{tabular}{|c|c|c|}
+\hline
+ \textbf{Description} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ The Layer Connections in this model define which services are provided by the \textit{ServiceLayer} (\textit{digitalIO} and \textit{timer}) & \includegraphics{images/040-LayeringModel.png} & \includegraphics{images/040-LayeringModelTextual.png} \\ \hline
+ The implementation of the services (SPPs) can be delegated to sub actors. In this case the actor \textit{ServiceLayer} relays (delegates) the implementation services \textit{digitalIO} and \textit{timer} to sub actors & \includegraphics{images/040-LayeringServiceLayer.png} & \includegraphics{images/040-LayeringServiceLayerTextual.png} \\ \hline
+ Every Actor inside the \textit{ApplicationLayer} that contains an SAP with the same Protocol as \textit{timer} or \textit{digitalIO} will be connected to the specified SPP & \includegraphics{images/040-LayeringApplicationLayer.png} & \includegraphics{images/040-LayeringApplicationLayerTextual.png} \\ \hline
+\end{tabular}
+\end{table}
+
+% <table title="Title" frame="box" border="2" cellpadding="3" cellspacing="0">
+ % <tr>
+ % <td align="center">*Description*</td>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>The Layer Connections in this model define which services are provided by the _ServiceLayer_ (_digitalIO_ and _timer_)</td>
+ % <td>!images/040-LayeringModel.png!</td>
+ % <td>!images/040-LayeringModelTextual.png!</td>
+ % </tr>
+ % <tr>
+ % <td>The implementation of the services (SPPs) can be delegated to sub actors. In this case the actor _ServiceLayer_ relays (delegates) the implementation services _digitalIO_ and _timer_ to sub actors</td>
+ % <td>!images/040-LayeringServiceLayer.png!</td>
+ % <td>!images/040-LayeringServiceLayerTextual.png!</td>
+ % </tr>
+ % <tr>
+ % <td>Every Actor inside the _ApplicationLayer_ that contains an SAP with the same Protocol as _timer_ or _digitalIO_ will be connected to the specified SPP</td>
+ % <td>!images/040-LayeringApplicationLayer.png!</td>
+ % <td>!images/040-LayeringApplicationLayerTextual.png!</td>
+ % </tr>
+% </table>
+
+\section{Finite State Machines}
+
+\subsection{Description}
+
+Definition from "Wikipedia":http://en.wikipedia.org/wiki/Finite-state\_machine:
+
+\begin{verbatim}
+A finite-state machine (FSM) or finite-state automaton (plural: automata), or simply a state machine, is a mathematical model used to design computer programs and digital logic circuits. It is conceived as an abstract machine that can be in one of a finite number of states. The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition, this is called a transition. A particular FSM is defined by a list of the possible states it can transition to from each state, and the triggering condition for each transition.
+
+In ROOM each actor class can implement its behavior using a state machine. Events occurring at the end ports of an actor will be forwarded to and processed by the state machine. Events possibly trigger state transitions.
+\end{verbatim}
+
+\subsection{Motivation}
+
+For event driven systems a finite state machine is ideal for processing the stream of events. Typically during processing new events are produced which are sent to peer actors.
+
+We distinguish flat and hierarchical state machines.
+
+\subsection{Notation}
+
+\subsubsection{Flat Finite State Machine}
+
+The simpler flat finite state machines are composed of the following elements:
+
+\begin{table}
+\caption{Title}
+\begin{tabular}{|c|c|c|}
+\hline
+ \textbf{Description} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ State & \includegraphics{images/040-State.jpg} & \includegraphics{images/040-StateTextual.jpg} \\ \hline
+ InitialPoint & \includegraphics{images/040-InitialPoint.jpg} & \textit{implicit} \\ \hline
+ TransitionPoint & \includegraphics{images/040-TransitionPoint.jpg} & \includegraphics{images/040-TransitionPointTextual.jpg} \\ \hline
+ ChoicePoint & \includegraphics{images/040-ChoicePoint.jpg} & \includegraphics{images/040-ChoicePointTextual.jpg} \\ \hline
+ Initial Transition & \includegraphics{images/040-InitialTransition.jpg} & \includegraphics{images/040-InitialTransitionTextual.jpg} \\ \hline
+ Triggered Transition & \includegraphics{images/040-TriggeredTransition.jpg} & \includegraphics{images/040-TriggeredTransitionTextual.jpg} \\ \hline
+\end{tabular}
+\end{table}
+% <table title="Title" frame="box" border="2" cellpadding="3" cellspacing="0">
+ % <tr>
+ % <td align="center">*Description*</td>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>State</td>
+ % <td>!images/040-State.jpg!</td>
+ % <td>!images/040-StateTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>InitialPoint</td>
+ % <td>!images/040-InitialPoint.jpg!</td>
+ % <td>_implicit_</td>
+ % </tr>
+ % <tr>
+ % <td>TransitionPoint</td>
+ % <td>!images/040-TransitionPoint.jpg!</td>
+ % <td>!images/040-TransitionPointTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>ChoicePoint</td>
+ % <td>!images/040-ChoicePoint.jpg!</td>
+ % <td>!images/040-ChoicePointTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>Initial Transition</td>
+ % <td>!images/040-InitialTransition.jpg!</td>
+ % <td>!images/040-InitialTransitionTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>Triggered Transition</td>
+ % <td>!images/040-TriggeredTransition.jpg!</td>
+ % <td>!images/040-TriggeredTransitionTextual.jpg!</td>
+ % </tr>
+% </table>
+
+
+\subsubsection{Hierarchical Finite State Machine}
+
+The hierarchical finite state machine adds the notion of a sub state machine nested in a state.
+A few modeling elements are added to the set listed above:
+
+\begin{table}
+\caption{Title}
+\begin{tabular}{|c|c|c|}
+\hline
+ \textbf{Description} & \textbf{Graphical Notation} & \textbf{Textual Notation} \\ \hline
+ State with sub state machine & & \includegraphics{images/040-StateWithSubFSMTextual.jpg} \\ \hline
+ Entry Point & & \includegraphics{images/040-EntryPointTextual.jpg} \\ \hline
+ Exit Point & & \includegraphics{images/040-ExitPointTextual.jpg} \\ \hline
+\end{tabular}
+\end{table}
+
+% <table title="Title" frame="box" border="2" cellpadding="3" cellspacing="0">
+ % <tr>
+ % <td align="center">*Description*</td>
+ % <td align="center">*Graphical Notation*</td>
+ % <td align="center">*Textual Notation*</td>
+ % </tr>
+ % <tr>
+ % <td>State with sub state machine</td>
+ % <td>Parent State
+ % !images/040-StateWithSubFSM.jpg!
+ % Sub state machine
+ % !images/040-SubFSM.jpg!</td>
+ % <td>!images/040-StateWithSubFSMTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>Entry Point</td>
+ % <td>In sub state machine
+ % !images/040-EntryPoint.jpg!
+ % On parent state
+ % !images/040-EntryPointRef.jpg!</td>
+ % <td>!images/040-EntryPointTextual.jpg!</td>
+ % </tr>
+ % <tr>
+ % <td>Exit Point</td>
+ % <td>In sub state machine
+ % !images/040-ExitPoint.jpg!
+ % On parent state
+ % !images/040-ExitPointRef.jpg!</td>
+ % <td>!images/040-ExitPointTextual.jpg!</td>
+ % </tr>
+% </table>
+
+
+\subsection{Examples}
+
+\subsubsection{Example of a flat finite state machine:}
+
+% !images/040-FlatFSM.jpg!
+\includegraphics{images/040-FlatFSM.jpg}
+
+\subsubsection{Example of a hierarchical finite state machine:}
+
+Top level
+% !images/040-HierarchicalFSMTop.jpg!
+\includegraphics{images/040-HierarchicalFSMTop.jpg}
+
+Sub state machine of Initializing
+% !images/040-HierarchicalFSMInitializing.jpg!
+\includegraphics{images/040-HierarchicalFSMInitializing.jpg}
+
+Sub state machine of Running
+% !images/040-HierarchicalFSMRunning.jpg!
+\includegraphics{images/040-HierarchicalFSMRunning.jpg} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/050-etrice-features.tex b/plugins/org.eclipse.etrice.doc/doc-tex/050-etrice-features.tex
new file mode 100644
index 0000000..06e2e80
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/050-etrice-features.tex
@@ -0,0 +1,10 @@
+\chapter{eTrice Features}
+
+\section{Codegenerators}
+
+\subsection{Java Generator}
+
+\subsection{C++ Generator}
+
+\subsection{C Generator}
+
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/060-codegenerators.tex b/plugins/org.eclipse.etrice.doc/doc-tex/060-codegenerators.tex
new file mode 100644
index 0000000..402f103
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/060-codegenerators.tex
@@ -0,0 +1 @@
+\chapter{Codegenerators} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/070-runtimes.tex b/plugins/org.eclipse.etrice.doc/doc-tex/070-runtimes.tex
new file mode 100644
index 0000000..2a9fa75
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/070-runtimes.tex
@@ -0,0 +1 @@
+\chapter{Runtimes} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/080-etrice-models.tex b/plugins/org.eclipse.etrice.doc/doc-tex/080-etrice-models.tex
new file mode 100644
index 0000000..d549a89
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/080-etrice-models.tex
@@ -0,0 +1,60 @@
+\chapter{eTrice Models and Their Relations}
+
+eTrice comprises several models:
+
+\begin{itemize}
+\item the ROOM model (*.room) -- defines model classes and the logical structure of the model
+\item Config model (*.config) -- defines configuration values for attributes
+\item Physical model (*.etphys) -- defines the structure and properties of the physical system
+\item Mapping model (*.etmap) -- defines a mapping from logical elements to physical elements
+\end{itemize}
+
+In the following diagram the models and their relations are depicted. The meaning of the arrows is: uses/references.
+
+\includegraphics{images/080-models.jpg}
+% !{width:50%}images/080-models.jpg!
+
+In the following sections we will describe those models with emphasis of their cross relations.
+
+\section{The ROOM Model}
+
+The ROOM model defines classes for Data, Protocols, Actors, SubSystems and LogicalSystems.
+Thereby the three latter form a hierarchy. The @LogicalSystem@ is the top level element of the structure. It contains references to \texttt{SubSystemClass} elements. The \texttt{SubSystemClass} in turn contain references to \texttt{ActorClass} elements which again contain (recursively) references to \texttt{ActorClass} elements. The complete structural hierarchy implies a tree which has the \texttt{LogicalSystem} as root and where each reference stands for a new node with possibly further branches.
+
+Let's consider a simple example. It doesn't implement any meaningful and completely omits behavioral and other aspects.
+
+\includegraphics{images/080-room.jpg}
+% !images/080-room.jpg!
+
+When a \texttt{LogicalSstem} is instantiated then recursively all of the contained referenced elements are instantiated as instances of the corresponding class. Thus the instance tree of above example looks like this (the third line in the white boxes shows some mapping information, s.b.):
+
+\includegraphics{images/080-instances.jpg}
+!{width:40%}images/080-instances.jpg!
+
+
+\section{The Config Model}
+
+Once we have the ROOM class model we can configure values using the Config model. This can be done on the class level and/or on the instance level. Values defined for class attributes are used for all instances unless there is an instance value configured for the same attribute.
+
+!images/080-config.jpg!
+
+\section{The Physical Model}
+
+The physical model defines the physical resources onto which the logical system will be deployed. It is possible to define runtime classes which (currently) only defines the overall execution model of the platform.
+
+\includegraphics{images/080-runtimes.jpg}
+% !images/080-runtimes.jpg!
+
+The physical system is composed of @Node@ references where each @Node@ is defined as a class referencing a @RuntimeClass@ and defining @Threads@.
+
+\includegraphics{images/080-phys.jpg}
+% !images/080-phys.jpg!
+
+\section{The Mapping Model}
+
+The last model finally combines all this information by mapping logical to physical entities.
+
+\includegraphics{images/080-map.jpg}
+!images/080-map.jpg!
+
+The result of the mapping is also depicted in above tree diagram of the instances. All actor instances (the white boxes) are mapped to a node and a thread running on this node (shown as @ \textit{node} : \textit{thread}).
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/200-dev-reference.tex b/plugins/org.eclipse.etrice.doc/doc-tex/200-dev-reference.tex
new file mode 100644
index 0000000..00aa411
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/200-dev-reference.tex
@@ -0,0 +1,230 @@
+\chapter{eTrice Developer's Reference}
+
+\section{Architecture}
+
+The basic components of eTrice are depicted in the following diagram.
+
+\includegraphics{images/200-components.jpg}
+% !{width:50%}images/200-components.jpg!
+
+Additional to that the eTrice project comprises runtime libraries and unit tests which are treated in subsequent sections.
+
+\subsection{Editor and Generator Components}
+
+\begin{itemize}
+\item core
+
+\begin{itemize}
+\item core.room is an Xtext based language called Room. It consists of the plug-in \textit{org.eclipse.etrice.core.room}. Room is the basic modeling language of eTrice.
+\item core.config is an Xtext based language called Config. It consists of the plug-in \textit{org.eclipse.etrice.core.config}. Config is a language designed for the data configuration of model elements. E.g. class and instance attributes can be specified.
+\item core.genmodel is an EMF based aggregation layer for Room models. It consists of the plugin \textit{org.eclipse.etrice.core.genmodel}. a Room model can be transformed into a genmodel which allows easy access to implicit relations of the Room model.
+\end{itemize}
+
+\item ui
+\begin{itemize}
+\item textual
+\begin{itemize}
+
+\item room.ui is the ui counterpart of core.room. It consists of the plug-in \textit{org.eclipse.etrice.core.room.ui}. This plug-in realizes IDE concepts like content assist, error markers and navigation by hyper links for the Room language.
+\item config.ui is the ui counterpart of core.config. It consists of the plug-in \textit{org.eclipse.etrice.core.config.ui}. This plug-in realizes IDE concepts like content assist, error markers and navigation by hyper links for the Config language.
+\end{itemize}
+
+\item graphical
+\begin{itemize}
+\item ui.common is a set of common code for the two diagram editors. It consists of the plug-in \textit{org.eclipse.etrice.ui.common}.
+\item ui.commands encapsulates some commands related to the navigation between eTrice editors. It consists of the plug-in \textit{org.eclipse.etrice.ui.commands}.
+\item ui.structure is the Graphiti based editor for the Actor structure. It consists of the plug-in \textit{org.eclipse.etrice.ui.structure}.
+\item ui.behavior is the Graphiti based editor for the Actor behavior. It consists of the plug-in \textit{org.eclipse.etrice.ui.behavior}.
+\end{itemize}
+\end{itemize}
+
+\item generators
+\begin{itemize}
+\item generator is a set of general classes and language independent parts of all generators. It consists of the plug-in \textit{org.eclipse.etrice.generator}.
+\item generator.c is the generator for the ANSI-C target language. It consists of the plug-in \textit{org.eclipse.etrice.generator.c}.
+\item generator.java is the generator for the Java target language. It consists of the plug-in \textit{org.eclipse.etrice.generator.java}.
+\item generator.doc is the generator for the model documentation. It consists of the plug-in \textit{org.eclipse.etrice.generator.doc}.
+\end{itemize}
+\end{itemize}
+
+\subsection{Runtimes}
+
+Currently eTrice ships with a C and a Java runtime. The runtimes are libraries written in the target language against which the generated code is compiled.
+
+\subsection{Unit Tests}
+
+Most plug-ins and other parts of the code have related unit tests.
+
+\section{Component Overview}
+
+\subsection{Room Language Overview}
+
+We assume that the reader is familiar with the Xtext concepts. So we concentrate on the details of our implementation that are worth to be pointed out.
+
+\subsubsection{Model Tweaks}
+
+The Room EMF model is inferred from the grammar. However, this powerful mechanism has to be tweaked at some places.
+This is done in the \textit{/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext} which is written in the legacy Xtend language.
+
+The following parts of the model are changed or added:
+\begin{itemize}
+\item the default \begin{verbatim}multiplicity\end{verbatim} of the \texttt{Port} is set to 1
+\item the operation \texttt{isReplicated} is added to the \texttt{Port}
+\item the default \texttt{size} of the \texttt{ActorRef} is set to 1
+\item an operation \texttt{getName} is add to the \texttt{State} class
+\item an operation \texttt{getName} is add to the \texttt{StateGraphItem} class
+\item an operation \texttt{getGeneralProtocol} is added to the \texttt{InterfaceItem}
+\end{itemize}
+
+\subsubsection{Imports by URI Using Namespaces}
+
+The import mechanism employed is based on URIs. This is configured for one part in the GenerateRoom.mwe2 model workflow by setting the fragments ImportURIScopingFragment and ImportUriValidator). For the other part it is configured in the Guice modules by binding
+\begin{itemize}
+\item \texttt{PlatformRelativeUriResolver} -- this class tries to convert the import URI into a platform relative URI. It also replaces environment variables written in \${} with their respective values.
+\item \texttt{ImportedNamespaceAwareLocalScopeProvider} -- this is a standard scope provider which is aware of namespaces
+\item \texttt{GlobalNonPlatformURIEditorOpener} -- this editor opener tries to convert general URIs into platform URIs because editors can only open platform URIs
+\item \texttt{ImportAwareHyperlinkHelper} -- turns the URI part of an import into a navigatable hyper link
+\end{itemize}
+
+\subsubsection{Naming}
+
+Two classes provide object names used for link resolution and for labels.
+The \texttt{RoomNameProvider} provides frequently used name strings, some of them are hierarchical like State paths.
+The \texttt{RoomFragmentProvider} serves a more formal purpose since it provides a link between EMF models (as used by the diagram editors) and the textual model representation used by Xtext.
+
+\subsubsection{Helpers}
+
+The \texttt{RoomHelpers} class provides a great deal of static methods that help retrieve frequently used information from the model.
+Among many, many others
+\begin{itemize}
+\item \texttt{getAllEndPorts(ActorClass)} - returns a list of all end ports of an actor class including inherited ones
+\item \texttt{getInheritedActionCode(Transition, ActorClass)} - get the inherited part of a transition's action code
+\item \texttt{getSignature(Operation)} - returns a string representing the operation signature suited for a label
+\end{itemize}
+
+\subsubsection{Validation}
+
+Validation is used from various places. Therefore all validation code is accumulated in the @ValidationUtil@ class. All methods are static and many of them return a Result object which contains information about the problem detected as well as object and feature as suited for most validation purposes.
+
+\subsection{Config Language Overview}
+
+\subsubsection{Model Tweaks}
+
+A couple of operations are added to the ConfigModel
+\begin{itemize}
+\item \texttt{getActorClassConfigs}
+\item \texttt{getActorInstanceConfigs}
+\item \texttt{getProtocolClassConfigs}
+\item \texttt{getSubSystemConfigs}
+\end{itemize}
+
+\subsubsection{Imports by URI Using Namespaces}
+
+Imports are treated similar than in the "Room language":ImportsbyURIUsingNamespaces.
+
+\subsubsection{Util}
+
+A set of static utility methods can be found in the \texttt{ConfigUtil} class.
+
+\subsection{Aggregation Layer Overview}
+
+The eTrice Generator Model (genmodel) serves as an aggregation layer. Its purpose is to allow easy access to information which is implicitly contained in the Room model but not simple to retrieve.
+Examples of this are the state machine with inherited items or a list of all triggers active at a state in the order in which they will be evaluated or the actual peer port of an end port (following bindings through relay ports).
+
+The Generator Model is created from a list of Room models by a call of the
+
+\begin{verbatim}createGeneratorModel(List<RoomModel>, boolean)\end{verbatim}
+
+method of the \texttt{GeneratorModelBuilder} class.
+
+The \texttt{Root} object of the resulting Generator Model provides chiefly two things:
+\begin{itemize}
+\item a tree of instances starting at each \texttt{SubSystem} with representations of each \texttt{ActorInstance} and \texttt{PortInstance}
+\item for each \texttt{ActorClass} a corresponding \texttt{ExpandedActorClass} with an explicit state machine containing all inherited state graph items
+\end{itemize}
+
+\subsubsection{The Instance Model}
+
+The instance model allows easy access to instances including their unique paths and object IDs. Also it is possible to get a list of all peer port instances for each port instance without having to bother about port and actor replication.
+
+\subsubsection{The Expanded Actor Class}
+
+The expanded actor class contains, as already mentioned, the complete state machine of the actor class. This considerably simplifies the task of state machine generation. Note that the generated code always contains the complete state machine of an actor. I.e. no target language inheritance is used to implement the state machine inheritance.
+Furthermore the \texttt{ExpandedActorClass} gives access to
+\begin{itemize}
+\item \texttt{getIncomingTransitions(StateGraphNode)} -- the set of incoming transition of a \texttt{StateGraphNode} (\texttt{State}, \texttt{ChoicePoint} or \texttt{TransitionPoint})
+\item \texttt{getOutgoingTransitions(StateGraphNode)} -- the set of outgoing transition of a \texttt{StateGraphNode}
+\item \texttt{getActiveTriggers(State)} -- the triggers that are active in this \texttt{State} in the order they are evaluated
+\end{itemize}
+
+\subsubsection{Transition Chains}
+
+By transition chains we denote a connected subset of the (hierarchical) state machine that starts with a transition starting at a state and continues over transitional state graph nodes (choice points and transition points) and continuation transitions until a state is reached. In general a transition chain starts at one state and ends in several states (the chain may branch in choice points).
+A \texttt{TransitionChain} of a transition is retrieved by a call of \texttt{getChain(Transition)} of the \texttt{ExpandedActorClass}.
+The \texttt{TransitionChain} accepts an \texttt{ITransitionChainVisitor} which is called along the chain to generate the action codes of involved transitions and the conditional statements arising from the involved choice points.
+
+\subsection{Generator Overview}
+
+There is one plug-in that consists of base classes and some generic generator parts which are re-used by all language specific generators
+
+\subsubsection{Base Classes and Interfaces}
+
+We just want to mention the most important classes and interfaces.
+
+\begin{itemize}
+\item \texttt{ITranslationProvider} -- this interface is used by the @DetailCodeTranslator@ for the language dependent translation of e.g. port.message() notation in detail code
+\item \texttt{AbstractGenerator} -- concrete language generators should derive from this base class
+\item \texttt{DefaultTranslationProvider} -- a stub implementation of \texttt{ITranslationProvider} from which clients may derive
+\item \texttt{Indexed} -- provides an indexed iterable of a given iterable
+\item \texttt{GeneratorBaseModule} -- a Google Guice module that binds a couple of basic services. Concrete language generators should use a module that derives from this
+\end{itemize}
+
+\subsubsection{Generic Generator Parts}
+
+The generic generator parts provide code generation blocks on a medium granularity. The language dependent top level generators embed those blocks in a larger context (file, class, ...). Language dependent low level constructs are provided by means of an \texttt{ILanguageExtension}. This extension and other parts of the generator be configured using Google Guice dependency injection.
+
+\paragraph{GenericActorClassGenerator}
+
+The \texttt{GenericActorClassGenerator} generates constants for the interface items of a actor. Those constants are used by the generated state machine.
+
+\paragraph{GenericProtocolClassGenerator}
+
+The \texttt{GenericProtocolClassGenerator} generates message ID constants for a protocol.
+
+\paragraph{GenericStateMachineGenerator}
+
+The \texttt{GenericStateMachineGenerator} generates the complete state machine implementation. The skeleton of the generated code is
+
+\begin{itemize}
+\item definition state ID constants
+\item definition of transition chain constants
+\item definition of trigger constants
+\item entry, exit and action code methods
+\item the \texttt{exitTo} method
+\item the \texttt{executeTransitionChain} method
+\item the \texttt{enterHistory} method
+\item the \texttt{executeInitTransition} method
+\item the \texttt{receiveEvent} method
+\end{itemize}
+
+The state machine works as follows. The main entry method is the \texttt{receiveEvent} method. This is the case for both, data driven (polled) and event driven state machines. Then a number of nested switch/case statements evaluates trigger conditions and derives the transition chain that is executed. If a trigger fires then the \texttt{exitTo} method is called to execute all exit codes involved. Then the transition chain action codes are executed and the choice point conditions are evaluated in the \texttt{executeTransitionChain} method. Finally the history of the state where the chain ends is entered and all entry codes are executed by \texttt{enterHistory}.
+
+\subsubsection{The Java Generator}
+
+The Java generator employs the generic parts of the generator. The \texttt{JavaTranslationProvider} is very simple and only handles the case of sending a message from a distinct replicated port: \texttt{replPort[2].message()}. Other cases are handled by the base class by returning the original text.
+
+The \texttt{DataClassGen} uses Java inheritance for the generated data classes. Otherwise it is pretty much straight forward.
+
+The \texttt{ProtocolClassGen} generates a class for the protocol with nested static classes for regular and conjugated ports and similar for replicated ports.
+
+The \texttt{ActorClassGen} uses Java inheritance for the generated actor classes. So ports, SAPs and attributes and detail code methods are inherited. Not inherited is the state machine implementation.
+
+\subsubsection{The ANSI-C Generator}
+
+The C generator translates data, protocol and actor classes into structs together with a set of methods that operate on them and receive a pointer to those data (called \texttt{self} in analogy to the implicit C++ \texttt{this} pointer).
+No dynamic memory allocation is employed. All actor instances are statically initialized.
+One of the design goals for the generated C code was an optimized footprint in terms of memory and performance to be able to utilize modeling with ROOM also for tiny low end micro controllers.
+
+\subsubsection{The Documentation Generator}
+
+The documentation generator creates documentation in LaTex format which can be converted into PDF and many other formats.
diff --git a/plugins/org.eclipse.etrice.doc/doc-tex/etrice-doc.tex b/plugins/org.eclipse.etrice.doc/doc-tex/etrice-doc.tex
new file mode 100644
index 0000000..ea046e7
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/doc-tex/etrice-doc.tex
@@ -0,0 +1,21 @@
+\documentclass{book}
+\usepackage{hyperref}
+\usepackage{graphicx}
+\begin{document}
+\include{000-etrice-introduction}
+\include{012-room-introduction}
+\include{013-setting-up-the-workspace}
+\include{015-getting-started}
+\include{020-tutorial-blinky}
+\include{025-tutorial-sending-data}
+\include{030-tutorial-ped-lights}
+\include{032-setting-up-the-workspace-c}
+\include{034-getting-started-c}
+\include{036-tutorial-remove-comment_c}
+\include{040-room-concepts}
+\include{050-etrice-features}
+\include{060-codegenerators}
+\include{070-runtimes}
+\include{080-etrice-models}
+\include{200-dev-reference}
+\end{document} \ No newline at end of file