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

Vorto / Code Generators

This page provides information about existing Vorto code generators.


Code Generators on Virtual Developer

The Virtual Developer Platform lets you execute code generators on a server. We (Generative Software GmbH) are going to provide an integration of Vorto with Virtual Developer that provides you with an easy way to use Vorto models for your own code generators. In this PDF document you can already see the possible integration scenarios.

Integration-Scenario-Virtual-Developer-Vorto.png

The Generative Software GmbH is participant member of the Eclipse IoT Working Group and we are in the process of developing code generators to create IoT solutions. We will add more information here as soon as there are the first code generators available that run on Virtual Developer and use Vorto information models.

Java Code Generator

The Java Code Generator allows to transform an Information Model and all related Functionblocks, Entities, and Enums into corresponding Java classes. For example the Entity

namespace examples.datatypes.measurement
version 1.0.0
description "Data type for describing a temperature."
using examples.datatypes.measurement.units.TemperatureUnit ; 1.0.0

entity Temperature {
	mandatory value as float "The value representing the temperature."
       mandatory measurementUnit as TemperatureUnit "The measurement unit for the temperature."
}

is transformed into

package entities; 

/**
* Data type for describing a temperature.
*/
public class Temperature { 

	/**
	* The value representing the temperature.
	*/
	private float value;
	
	/**
	* The measurement unit for the temperature.
	*/
	private TemperatureUnit measurementUnit;
	
	/**
	* Getter for value.
	*/
	public float getValue() {
		return this.value;
	}
	
	/**
	* Setter for value.
	*/
	public void setValue(float value) {
		this.value = value;
	}
	
	/**
	* Getter for measurementUnit.
	*/
	public TemperatureUnit getMeasurementUnit() {
		return this.measurementUnit;
	}
	
	/**
	* Setter for measurementUnit.
	*/
	public void setMeasurementUnit(TemperatureUnit measurementUnit) {
		this.measurementUnit = measurementUnit;
	}
	
}

Markdown Code Generator

The Markdown Code Generator allows to easily create documentation for an Information Model. The "Temperature" Entity for example is transformed into:

## Entity *Temperature*
### Unique Identification
 
<table>
 	<tr><td>Name:</td><td>Temperature</td></tr>
 	<tr><td>Namespace:</td><td>examples.datatypes.measurement</td></tr>
 	<tr><td>Version:</td><td>1.0.0</td></tr>
 </table>
 ### Description
 Data type for describing a temperature. 
 
 ### Properties
 <table>
 	<tr><td>Name</td><td>Type</td><td>Description</td></tr>
 	<tr><td>value</td><td>float</td><td>The value representing the temperature.</td></tr>
 	<tr><td>measurementUnit</td><td>TemperatureUnit</td><td>The measurement unit for the temperature.</td></tr>
 </table>

When using a Markdown editor this looks like:

20151111 Vorto Markdown Example.png

Web Device Code Generator

The Web Device Code Generator creates a simple web application providing a UI to the related Information Model. The application can for example be deployed in a Jetty. An example for a simple multi sensor looks like:

20151111 Vorto MultiSensor WebApp Screenshot.png


iOS Code Generator

The iOS Code Generator currently supports the generation of BlueTooth Low Energy specific Swift code in order to bind your device to BLE. Note that this generator requires additional mapping files. Please find more information here.

Back to the top