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 "Vorto / Describing Devices / Entities"

(Created page with "Entities")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Entities
+
Eclipse Vorto supports defining arbitrary complex datatypes and enums. On one hand the purpose of this feature is to allow sharing and reusing them between functionblocks. On the other hand it is possible to create representations of specific data that contain additional semantic information. The datatypes (in Vorto they are called entities) can be created using a specific DSL.
 +
 
 +
'''Example: Temperature_Unit'''
 +
namespace vorto.examples.units
 +
version 1.0.0
 +
 +
enum Temperature_Unit {
 +
Celsius,
 +
Fahrenheit
 +
}
 +
 
 +
 
 +
'''Example: Temperature'''
 +
namespace vorto.examples.sensors
 +
version 1.0.0
 +
using vorto.examples.units.Temperature_Unit; 1.0.0
 +
 +
entity Temperature {
 +
mandatory value as float
 +
mandatory measurement_unit as Temperature_Unit
 +
}
 +
 
 +
 
 +
'''Example: RGBColor'''
 +
namespace vorto.examples.color
 +
version 1.0.0
 +
 +
entity RGBColor {
 +
    mandatory red as int <MIN 0, MAX 255>
 +
    mandatory green as int <MIN 0, MAX 255>
 +
    mandatory blue as int <MIN 0, MAX 255>
 +
}

Latest revision as of 02:40, 10 July 2015

Eclipse Vorto supports defining arbitrary complex datatypes and enums. On one hand the purpose of this feature is to allow sharing and reusing them between functionblocks. On the other hand it is possible to create representations of specific data that contain additional semantic information. The datatypes (in Vorto they are called entities) can be created using a specific DSL.

Example: Temperature_Unit

namespace vorto.examples.units
version 1.0.0

enum Temperature_Unit {
	Celsius,
	Fahrenheit
}


Example: Temperature

namespace vorto.examples.sensors
version 1.0.0
using vorto.examples.units.Temperature_Unit; 1.0.0

entity Temperature {
	mandatory value as float
	mandatory measurement_unit as Temperature_Unit
}


Example: RGBColor

namespace vorto.examples.color
version 1.0.0

entity RGBColor {
    mandatory red as int <MIN 0, MAX 255>
    mandatory green as int <MIN 0, MAX 255>
    mandatory blue as int <MIN 0, MAX 255>
}

Back to the top