Skip to main content
Jump to: navigation, search


< ETrice‎ | Development
Revision as of 04:12, 1 July 2013 by (Talk | contribs) (Prepare Eclipse and build eTrice)

Prepare Eclipse and build eTrice

  1. get the sources (see how)
  2. download the latest release of Eclipse Modeling Tools (cf.
  3. start eclipse
  4. Install additional Plugins (if not already installed)
    1. Graphiti for the Graphical Editors
      1. select Help -> Install New Software -> Kepler -
      2. select Graphiti 0.10.0
    2. Xtext and Xtend for the DSL development and the code generators
      1. Help -> Install New Software -> Kepler -
      2. select Xtext 2.4.2 (from Modeling) and Xtend 2.4.2 (from Languages)
    3. Apache Commons IO for file operations (e.g. for incremental code generator)
      1. Help -> Install New Software : (the link is a p2 update site of Orbit)
      2. Apache Commons IO 2.0.1
    4. Google Guava (needed for Kieler Plugins)
      1. Help -> Install New Software : Guava -
      2. deselect "show only the latest versions of available software", because we need an older version
      3. select Guava 8.0.0
    5. Kieler for automatic layout of graphical editors
      1. Help -> Install New Software :
      2. if "there are no categorized items" in the list, de-select "Group items by category" -> do not forget to -> select after installation
      3. select all Kieler Plugins
  5. import all projects from your local GIT clone to your Workspace (with EGit plugin)
    1. Git Repositories View
    2. Add Repository (local GIT clone)
    3. Context Menu of Working Directory -> Import Projects
    4. Import all Projects
  6. make sure you are using a JDK (in Eclipse: Window->Preferences->Java->Installed JREs->e.g. jdk1.6.0_24), attention: do not use jdk1.6.0_18 or jdk1.6.0_22!

Getting Started with eTrice

Setting up Runtime Workspace

  • start the runtime workspace: -> eTrice-rt.launch (contextmenu -> Run As)
  • check out the runtime projects from your local GIT clone
    • org.eclipse.etrice.tutorials
    • org.eclipse.etrice.modellib

Editing the Model

  • the first model you find in org.eclipse.etrice.doc.tutorials/model/scratch/ (doubleclick for editor)
  • if the room editor has the focus, you can see all your model elements in the outline view
  • with a right click on an actor (e.g. MrPingActor) you can
    • Edit Structure
    • Edit Behavior
  • Important: You have to save every "dirty" editor before opening another editor

Code Generator

  • org.eclipse.etrice.doc.tutorials -> genAllTutorials.mwe2.launch -> (contextmenu)Run As -> genAllModels.mwe2
  • you will find the generated code in org.eclipse.etrice.doc.tutorials/src-gen
  • you can see the generated instance tree of your actor org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPong.jpg
    • Precondition: install the current version of graphviz and add the path to dot.exe to you system or user PATH variable


  • start generated application: org.eclipse.etrice.doc.tutorials/src-gen/PingPong/ -> Run As -> Java Application
  • in the View Console you can see the debugging output of the running model
  • enter "quit" and <enter> in the Console to stop the running application (you should see *** T H E E N D *** )


  • in org.eclipse.etrice.doc.tutorials/tmp/log you will find the generated Message Sequence Chart of your application: SubSystem_PingPong_Async.seq (MSC)
  • you can debug the generated code like any other Java Project. The main function is located in
  • be aware that all actors communication via message queue, so the regular sourcecode debugging is sometimes not sufficient

Deriving from an Existing Generator

There is a minimal example that shows how a generator can be derived from the existing eTrice Java generator. The example shows how the derived DetailCodeTranslator handles an additional tag.

The example consist of two plugins:

  • examples/my.etrice.generator
  • examples/my.etrice.generator.launch

You will find the examples in the eTrice GIT repository:

The first one overrides the Java generator, the second one overrides the Java launch configuration to launch the derived generator. Please have a look at the comments marked with EXAMPLE: (you can add that as a Java task tag in the preferences and use the Tasks View to locate these comments).

Copyright © Eclipse Foundation, Inc. All Rights Reserved.