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/Introduction"

(Created page with "=Introduction= ==Video== ==Objectives== The tutorial is based on a simplified version of a modeling tool that we have developed to pilot a Mindstorms Robot. File:Mindstor...")
 
(Sirius and EMF basics)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Introduction=
 
=Introduction=
 
==Video==
 
==Video==
 +
Watch the [https://youtu.be/uKBGVwmRzi0 video] (3'03)
  
==Objectives==
+
[[File:Mindstorms-video1.png|link=https://youtu.be/uKBGVwmRzi0]]
 +
 
 +
==Detailed script==
 
The tutorial is based on a simplified version of a modeling tool that we have developed to pilot a Mindstorms Robot.  
 
The tutorial is based on a simplified version of a modeling tool that we have developed to pilot a Mindstorms Robot.  
  
Line 40: Line 43:
 
During this tutorial, we will use [https://www.obeodesigner.com/en/download Obeo Designer], a free Eclipse package which includes [https://www.eclipse.org/sirius/ Sirius] and [https://www.eclipse.org/ecoretools/ Ecore Tools]. Once the domain model has been defined, we will launch a second Eclipse directly from the first one, by using a new Launch Configuration. It will simulate the deployment of the Domain Model and allow us to use it for defining and testing the modeling tool.  
 
During this tutorial, we will use [https://www.obeodesigner.com/en/download Obeo Designer], a free Eclipse package which includes [https://www.eclipse.org/sirius/ Sirius] and [https://www.eclipse.org/ecoretools/ Ecore Tools]. Once the domain model has been defined, we will launch a second Eclipse directly from the first one, by using a new Launch Configuration. It will simulate the deployment of the Domain Model and allow us to use it for defining and testing the modeling tool.  
  
[[File:MindstormsRuntime|600px]]
+
[[File:MindstormsRuntime.png|600px]]
 
+
  
 
==Sirius expressions syntaxes==
 
==Sirius expressions syntaxes==

Latest revision as of 11:57, 13 September 2018

Introduction

Video

Watch the video (3'03)

Mindstorms-video1.png

Detailed script

The tutorial is based on a simplified version of a modeling tool that we have developed to pilot a Mindstorms Robot.

Mindstorms.png


This Robot can execute a sequence of instructions to catch some objects on a playground.

The set of instructions, that we call a choreography, is composed of basic instructions such as going forward, rotating, grabing or releasing an object. A choreography can also be composed of several other choreographies.

To specify this instructions we can write a Java program and upload it into the EV3 module which equips the Robot.

MindstormsJava.png

The modeling tool that we are going to create allows to graphically specify exactly the same kind of choreography.

MindstormsTool.png


If you combine it with an Acceleo generator you can generate the corresponding Java source code. In this tutorial we will focus on the definition of the domain model and the creation of the graphical modeling tool.

MindstormsToolchain.png

Sirius and EMF basics

The domain model, that we will define with the Ecore language, allows the end user to create an EMF model which defines choregographies composed of instructions. This model is stored in a file having the mindstorms extension.

Mindstorms-2-1.png


On top of the Mindstorms domain model we will use Sirius to create a graphical editor. This graphical editor will allow the end_user to visualize and edit a Mindstorms model. The graphical representations are stored in a specific file in order to separate the data from the views.

SiriusPrinciples.png


During this tutorial, we will use Obeo Designer, a free Eclipse package which includes Sirius and Ecore Tools. Once the domain model has been defined, we will launch a second Eclipse directly from the first one, by using a new Launch Configuration. It will simulate the deployment of the Domain Model and allow us to use it for defining and testing the modeling tool.

MindstormsRuntime.png

Sirius expressions syntaxes

Dynamic parts of a modeling tool created with Sirius require you to write expressions that will be evaluated at runtime.

Some of these expressions return model elements while others simply produce text.

Sirius proposes four main syntaxes to write these queries:

  • var:
    • allows Sirius to evaluate a variable
    • examples:
      • var:self
      • var:container
  • feature:
    • allows Sirius to evaluate an EMF feature (property or reference) on the current context
    • examples:
      • feature:name
      • feature:instructions
  • service:
    • allows Sirius to evaluate a Java method defined in a Class declared as an extension
    • examples:
      • service:getNextInstruction()
      • service:setNextInstruction(i)
  • aql:

Back to the top