Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Sirius/Tutorials/Mindstorms/DomainModel"

(Installing the solution)
(Installing the solution)
Line 40: Line 40:
  
 
==Installing the solution==
 
==Installing the solution==
* Import the three existing Eclipse projects contained in the archive '''solution1.zip'''
+
===Import the solution===
** Use the menu and options '''Import... > Existing Project into Workspace > Select archive file'''
+
Download '''solution1.zip'''.
** These projects define the Mindstorms metamodel
+
 
 +
Use the menu and options '''Import... > Existing Project into Workspace > Select archive file''' to import the three existing Eclipse projects contained in this archive.
 +
 
 +
These projects define the Mindstorms metamodel
 +
 
 +
=== Launch a new runtime===
 +
Create and launch a new '''Eclipse Launch Configuration'''to simulate the installation of the Mindstorms metamodel and make it available for execution
 +
* Click on '''Run > Run Configuration…'''     
  
* 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…'''     
 
 
[[File:Mindstorms-2-2.png]]
 
[[File:Mindstorms-2-2.png]]
** Select '''Eclipse Application''', click on '''New'''
+
 
 +
* Select '''Eclipse Application''', click on '''New'''
 
[[File:Mindstorms-2-3.png]]
 
[[File:Mindstorms-2-3.png]]
** Then click on '''Run'''
+
 
 +
 
 +
* Then click on '''Run'''
  
 
* In the new runtime, import the Eclipse project contained in the archive '''sample.zip'''
 
* In the new runtime, import the Eclipse project contained in the archive '''sample.zip'''

Revision as of 12:09, 13 September 2018

Domain Model

Objectives

Define the concepts used by the Mindstorms modeling tool

Mindstorms-2-1.png

Video

Watch the video (12'46)

MindstormsVideo2.png

Detailed script

  • Launch Obeo Designer
  • Create an Ecore Modeling Project
    • Name = fr.obeo.dsl.tuto.mindstorms
    • Ns URI = http://www.obeo.fr/dsl/mindstorms/1.0.0
    • 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
    • Right-click on the diagram and select the menu Generate
      • Generate the Model code
      • Generate the Edit code
      • Generate the Editor code
  • 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.zip (provided with the tutorial resources)
    • Replace the getImage method of the class RotateItemProvider.java<code> (in <code>fr.obeo.dsl.tuto.mindstorms.edit) by the one defined in methods.txt (provided with the tutorial resources)

Installing the solution

Import the solution

Download solution1.zip.

Use the menu and options Import... > Existing Project into Workspace > Select archive file to import the three existing Eclipse projects contained in this archive.

These projects define the Mindstorms metamodel

Launch a new runtime

Create and launch a new Eclipse Launch Configurationto simulate the installation of the Mindstorms metamodel and make it available for execution

  • Click on Run > Run Configuration…

Mindstorms-2-2.png

  • Select Eclipse Application, click on New

Mindstorms-2-3.png


  • Then click on Run
  • In the new runtime, import the Eclipse project contained in the archive sample.zip
    • Use the menu and options Import... > Archive File
    • 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:

Mindstorms-2-4.png

Back to the top