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.
Difference between revisions of "ETrice/Development/GettingStartedWithEtrice"
< ETrice | Development
Ts.protos.de (Talk | contribs) (New page: = Preconditions = Get the sources ( work with GIT repository ) and build them ( target platform ). = Getting Star...) |
Ts.protos.de (Talk | contribs) |
||
(18 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = | + | = Prepare Eclipse and build eTrice = |
− | + | # get the sources ([[ETrice/Development/Repository |see how]]) | |
+ | # download the latest release of Eclipse Modeling Tools (cf. http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/junosr1) | ||
+ | # start eclipse | ||
+ | # Install additional Plugins (if not already installed) | ||
+ | ## Help -> Install New Software -> Juno - http://download.eclipse.org/releases/juno | ||
+ | ## select | ||
+ | ### Graphiti 0.9.1 | ||
+ | ### XText SDK 2.3.1 | ||
+ | ## select Programming Languages -> Xtend SDK 2.3.1 | ||
+ | # 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), attention: do not use jdk1.6.0_18 or jdk1.6.0_22! | ||
− | = Getting Started = | + | = Getting Started with eTrice = |
+ | == Setting up Runtime Workspace == | ||
+ | * 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 | ||
+ | ** org.eclipse.etrice.tutorials | ||
+ | ** org.eclipse.etrice.modellib | ||
+ | ** org.eclipse.etrice.runtime.java | ||
+ | |||
+ | == Editing the Model == | ||
+ | * the first model you find in org.eclipse.etrice.doc.tutorials/model/scratch/PingPong.room (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 | ||
+ | |||
+ | == Run == | ||
+ | * start generated application: org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java -> 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 *** ) | ||
+ | |||
+ | == Debug == | ||
+ | * 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 | ||
+ | |||
+ | = 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). |
Revision as of 17:06, 17 January 2013
Contents
Prepare Eclipse and build eTrice
- get the sources (see how)
- download the latest release of Eclipse Modeling Tools (cf. http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/junosr1)
- start eclipse
- Install additional Plugins (if not already installed)
- Help -> Install New Software -> Juno - http://download.eclipse.org/releases/juno
- select
- Graphiti 0.9.1
- XText SDK 2.3.1
- select Programming Languages -> Xtend SDK 2.3.1
- 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), 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: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
- check out the runtime projects from your local GIT clone
- org.eclipse.etrice.tutorials
- org.eclipse.etrice.modellib
- org.eclipse.etrice.runtime.java
Editing the Model
- the first model you find in org.eclipse.etrice.doc.tutorials/model/scratch/PingPong.room (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
Run
- start generated application: org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java -> 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 *** )
Debug
- 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 view the MSC with the Open Source tool Trace2UML:
- 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
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).