Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "ETrice/Development/GettingStartedWithEtrice"

(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Preconditions =
+
= Quick Development Setup =
* get the sources ([[ETrice/Development/Repository | work with GIT repository ]])  
+
# Java Setup
* download the latest version of Eclipse Modeling Tools (e.g. http://eclipse.org/downloads/packages/eclipse-modeling-tools-includes-incubating-components/indigom7)
+
#* Lastest [http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Java SE Development Kit 7 - JDK 7] (recommended 64bit)
* 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!
+
# Eclipse Setup
* check out all projects from your local GIT clone to your Workspace (with EGit plugin)
+
#* [https://www.eclipse.org/downloads/packages/release/Luna/SR2 Eclipse Luna SR2] (recommended Modeling Tools)
* build eTrice with our target platform ([[ETrice/Development/TargetPlatform | target platform ]])
+
#* Download [http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/plain/team/LunaSoftwareItems.p2f LunaSoftwareItems.p2f] to install plugins (Import -> Install -> Install Software Items from File)
 +
# Clone eTrice sources into workspace (see [[ETrice/Development/Repository |Git and eTrice]])  
 +
# (To be added) Settings
  
= Getting Started =
+
 
== Setting up Runtime Workspace ==
+
----
 +
 
 +
 
 +
= Development Setup with with all eTrice features =
 +
# get the sources ([[ETrice/Development/Repository |see how]])
 +
# download the [http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/lunasr2 Eclipse Modeling Tools package] from Luna SR2
 +
# start Eclipse
 +
# Install additional Plugins (if not already installed)
 +
## might be already there: Apache Commons IO for file operations (e.g. for incremental code generator)
 +
### Help -> Install New Software : http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/ (the link is a p2 update site of Orbit)
 +
### Apache Commons IO 2.0.1
 +
## Google Guava (needed for Kieler Plugins)
 +
### Help -> Install New Software : Guava - http://guava-osgi.googlecode.com/svn/trunk/repository/
 +
### deselect "show only the latest versions of available software", because we need an older version
 +
### select Guava 8.0.0
 +
## Kieler for automatic layout of graphical editors
 +
### Help -> Install New Software : http://download.eclipse.org/etrice/KIELER/kieler-0.7.1
 +
### if "there are no categorized items" in the list, de-select "Group items by category" -> do not forget to -> select after installation
 +
### select all Kieler Plugins
 +
# import all projects from your local GIT clone to your Workspace (with EGit plugin)
 +
## Git Repositories View
 +
## Add Repository (local GIT clone)
 +
## Context Menu of Working Directory -> Import Projects
 +
## Import all Projects
 +
# make sure you are using a JDK (in Eclipse: Window->Preferences->Java->Installed JREs->e.g. jdk1.6.0_24), <b>attention</b>: do not use jdk1.6.0_18 or jdk1.6.0_22!
 +
 
 +
= Working in the Runtime Workspace =
 
* start the runtime workspace: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
 
* start the runtime workspace: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
* check out the runtime projects from your local GIT clone
+
* follow the steps in the Tutorials chapter of the eTrice online help (use Eclipse: Help > Help Contents or view the 0.3 documentation in [http://eclipse.org/etrice/documentation/doc/etrice-doc.html HTML] or as [http://eclipse.org/etrice/documentation/manual/etrice.pdf PDF])
** org.eclipse.etrice.doc.tutorials
+
 
** org.eclipse.etrice.modellib
+
= Deriving from an Existing Generator =
** org.eclipse.etrice.runtime.java
+
  
== Editing the Model ==
+
There is a minimal example that shows how a generator can be derived from the existing eTrice Java generator.
* the first model you find in org.eclipse.etrice.doc.tutorials/model/scratch/PingPong.room (doubleclick for editor)
+
The example shows how the derived DetailCodeTranslator handles an additional tag.
* 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 ==
+
The example consist of two plugins:
* org.eclipse.etrice.doc.tutorials -> genAllTutorials.mwe2.launch -> (contextmenu)Run As -> genAllModels.mwe2
+
* examples/my.etrice.generator
* you will find the generated code in org.eclipse.etrice.doc.tutorials/src-gen
+
* examples/my.etrice.generator.launch
* you can see the generated instance tree of your actor  org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPong.jpg
+
You will find the examples in the eTrice GIT repository: http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/tree/examples
** Precondition: install the current version of graphviz and add the path to dot.exe to you system or user PATH variable
+
  
== Run ==
+
The first one overrides the Java generator, the second one overrides the Java launch configuration to launch the derived generator.
* start generated application: org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java -> Run As -> Java Application
+
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).
* 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  *** )
+
  
== Debug ==
+
[[Category:eTrice]]
* 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 view the MSC with the Open Source tool Trace2UML:
+
*** Project home: http://trace2uml.tigris.org/
+
*** Download for Windows: http://trace2uml.tigris.org/files/documents/2995/47472/Trace2UML-setup-1.1.0.exe
+
*** Download for Linux: http://apt.astade.de
+
* you can debug the generated code like any other Java Project. The main function is located in SubSystem_PingPongRunner.java
+
* be aware that all actors communication via message queue, so the regular sourcecode debugging is sometimes not sufficient
+

Revision as of 15:44, 14 June 2015

Quick Development Setup

  1. Java Setup
  2. Eclipse Setup
  3. Clone eTrice sources into workspace (see Git and eTrice)
  4. (To be added) Settings




Development Setup with with all eTrice features

  1. get the sources (see how)
  2. download the Eclipse Modeling Tools package from Luna SR2
  3. start Eclipse
  4. Install additional Plugins (if not already installed)
    1. might be already there: Apache Commons IO for file operations (e.g. for incremental code generator)
      1. Help -> Install New Software : http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/ (the link is a p2 update site of Orbit)
      2. Apache Commons IO 2.0.1
    2. Google Guava (needed for Kieler Plugins)
      1. Help -> Install New Software : Guava - http://guava-osgi.googlecode.com/svn/trunk/repository/
      2. deselect "show only the latest versions of available software", because we need an older version
      3. select Guava 8.0.0
    3. Kieler for automatic layout of graphical editors
      1. Help -> Install New Software : http://download.eclipse.org/etrice/KIELER/kieler-0.7.1
      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!

Working in the Runtime Workspace

  • start the runtime workspace: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
  • follow the steps in the Tutorials chapter of the eTrice online help (use Eclipse: Help > Help Contents or view the 0.3 documentation in HTML or as PDF)

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: http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/tree/examples

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).

Back to the top