Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Sirius/Tutorials/Mindstorms/DomainModel"
< Sirius | Tutorials | Mindstorms
(→Solution) |
(→Solution) |
||
Line 36: | Line 36: | ||
** Click on Run / Run Configuration… | ** Click on Run / Run Configuration… | ||
− | [[File:Mindstorms-2-2]] | + | [[File:Mindstorms-2-2.png]] |
** Select Eclipse Application, click on New | ** Select Eclipse Application, click on New | ||
− | [[File:Mindstorms-2-3]] | + | [[File:Mindstorms-2-3.png]] |
** Then click on Run | ** Then click on Run | ||
Line 48: | Line 48: | ||
* Your environment should look like this: | * Your environment should look like this: | ||
− | [[File:Mindstorms-2-4]] | + | [[File:Mindstorms-2-4.png]] |
Revision as of 12:41, 12 September 2018
Objectives
Define the concepts used by the Mindstorms modeling tool
Instructions
- Launch Obeo Designer
- Create an Ecore Modeling Project named fr.obeo.dsl.tuto.mindstorms
- Use the Palette to create the EClasses: Choreography, Instruction, Action, Grab, Release, Rotate and GoForward
- Set Instruction and Action as abstract
- Use the Palette to create SuperType relations:
- from Grab, Release, Rotate and GoForward to Action
- from Action and Choreography to Instruction
- Use the Palette to create a Composition relation named instructions between Choreography and Instruction
- Use the Palette to create EAttributes:
- Choreography
- name: EString
- Rotate
- degrees: EInt
- random: EBoolean
- GoForward
- cm: EInt
- Choreography
- Right-click on the diagram and select the menu Generate
- Generate the Model code
- Generate the Edit code
- Generate the Editor code
- Use the Palette to create the EClasses: Choreography, Instruction, Action, Grab, Release, Rotate and GoForward
- Edit the fr.obeo.dsl.tuto.mindstorms.edit generated project to improve the default labels and icons
- Replace the icons contained in icons/full/obj16 by those from icons-metamodel
- Replace the getImage method of the class RotateItemProvider.java (in fr.obeo.dsl.tuto.mindstorms.edit) by the one defined in methods.txt.
Solution
- Import the three existing Eclipse projects contained in the archive solution1.zip
- They define the Mindstorms metamodel
- Create and launch a new Eclipse Launch Configuration (In this new runtime, the Mindstorms metamodel will be available for execution)
- Click on Run / Run Configuration…
- Select Eclipse Application, click on New
- Then click on Run
- In the new runtime, import the Eclipse project contained in the archive sample.zip
- It contains a sample Mindstorms model that will be used to test your modeling tool
- You can open this model with the default editor generated by EMF
- Your environment should look like this: