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 "Sirius/Tutorials/Mindstorms/DomainModel"

(Created page with "==Objectives== Define the concepts used by the Mindstorms modeling tool ==Instructions== * Launch Obeo Designer * Create an Ecore Modeling Project named fr.obeo.dsl.tuto.min...")
 
(Detailed script)
 
(16 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
=Domain Model=
 +
 
==Objectives==
 
==Objectives==
 
Define the concepts used by the Mindstorms modeling tool
 
Define the concepts used by the Mindstorms modeling tool
+
 
==Instructions==
+
[[File:Mindstorms-2-1.png]]
* Launch Obeo Designer
+
 
* Create an Ecore Modeling Project named fr.obeo.dsl.tuto.mindstorms
+
==Video==
** Use the Palette to create the EClasses: Choreography, Instruction, Action, Grab, Release, Rotate and GoForward
+
Watch the [https://youtu.be/3rnBmG4DN4w video] (12'46)
*** Set Instruction and Action as abstract
+
 
** Use the Palette to create SuperType relations:  
+
[[File:MindstormsVideo2.png]]
*** from Grab, Release, Rotate and GoForward to Action
+
 
*** from Action and Choreography to Instruction
+
==Detailed script==
** Use the Palette to create a Composition relation named instructions between Choreography and Instruction
+
* Launch '''Obeo Designer'''
** Use the Palette to create EAttributes:
+
* Create an '''Ecore Modeling Project'''
 +
** '''Name''' = <code>fr.obeo.dsl.tuto.mindstorms</code>
 +
** '''Ns URI''' = <code>http://www.obeo.fr/dsl/mindstorms/1.0.0</code>
 +
** Use the Palette to create the EClasses: <code>Choreography</code>, <code>Instruction</code>, <code>Action</code>, <code>Grab</code>, <code>Release</code>, <code>Rotate</code> and <code>GoForward</code>.
 +
*** Set <code>Instruction</code> and <code>Action</code> as <code>abstract</code>
 +
** Use the Palette to create '''SuperType''' relations:  
 +
*** from <code>Grab</code>, <code>Release</code>, <code>Rotate</code> and <code>GoForward</code> to <code>Action</code>
 +
*** from <code>Action</code> and <code>Choreography</code> to <code>Instruction</code>
 +
** Use the Palette to create a '''Composition''' relation named <code>instructions</code> between <code>Choreography</code> and <code>Instruction</code>
 +
** Use the Palette to create '''EAttributes''':
 
*** Choreography
 
*** Choreography
**** name: EString
+
**** <code>name: EString</code>
 
*** Rotate
 
*** Rotate
**** degrees: EInt
+
**** <code>degrees: EInt</code>
**** random: EBoolean
+
**** <code>random: EBoolean</code>
 
*** GoForward
 
*** GoForward
**** cm: EInt
+
**** <code>cm: EInt</code>
** Right-click on the diagram and select the menu Generate
+
** Right-click on the diagram and select the menu '''Generate'''
*** Generate the Model code
+
*** Generate the '''Model''' code
*** Generate the Edit code
+
*** Generate the '''Edit''' code
*** Generate the Editor code
+
*** Generate the '''Editor''' code
 +
 
 +
* Edit the <code>fr.obeo.dsl.tuto.mindstorms.edit</code> generated project to improve the default labels and icons
 +
** Replace the icons contained in <code>icons/full/obj16</code> by those from [http://eclipse.org/sirius/resources/mindstorms-tutorial/icons-metamodel.zip icons-metamodel.zip]
 +
*** Use the menu '''Import... > General > Archive File'''
 +
** Replace the <code>getImage</code> method of the class <code>RotateItemProvider.java</code> (in <code>fr.obeo.dsl.tuto.mindstorms.edit</code>) by the one defined in [http://eclipse.org/sirius/resources/mindstorms-tutorial/methods.txt methods.txt]
 +
 
 +
==Installing the solution==
 +
===Import the solution===
 +
Download [http://eclipse.org/sirius/resources/mindstorms-tutorial/solution1.zip 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 Configuration'''to simulate the installation of the Mindstorms metamodel and make it available for execution
 +
* Click on '''Run > Run Configuration…'''     
 +
 
 +
[[File:Mindstorms-2-2.png]]
 +
 
 +
* Select '''Eclipse Application''', click on '''New'''
 +
[[File:Mindstorms-2-3.png]]
  
* 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)
+
* Then click on '''Run'''
  
** Click on Run / Run Configuration…     
+
* In the new runtime, import the Eclipse project contained in the archive [http://eclipse.org/sirius/resources/mindstorms-tutorial/sample.zip sample.zip]
** Select Eclipse Application, click on New
+
** Use the menu and options '''Import... > Archive File'''
** 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
 
** 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
 
** You can open this model with the default editor generated by EMF
  
 
 
* Your environment should look like this:
 
* Your environment should look like this:
 +
[[File:Mindstorms-2-4.png]]

Latest revision as of 10:23, 17 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
      • Use the menu Import... > General > Archive File
    • Replace the getImage method of the class RotateItemProvider.java (in fr.obeo.dsl.tuto.mindstorms.edit) by the one defined in methods.txt

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