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.
Difference between revisions of "Vorto / Describing Devices / Functionblocks"
< Vorto | Describing Devices
(Created page with "Functionblocks") |
|||
Line 1: | Line 1: | ||
− | Functionblocks | + | Functionblocks are reusable descriptions of device components. A functionblock is typically structured as follows: |
+ | |||
+ | *Properties | ||
+ | **Status | ||
+ | **Configuration | ||
+ | **Fault | ||
+ | *Events | ||
+ | *Operations | ||
+ | |||
+ | The following examples give an overview how the DSL look like and how simple functionblocks can be modeled. Please not that in the RGBColorPicker Example the RGBColor datatype is reused. | ||
+ | |||
+ | '''Example: Dimmer''' | ||
+ | functionblock Dimmer { | ||
+ | displayname "Dimmer" | ||
+ | description "Function block model for a standard dimmer" | ||
+ | namespace vorto.examples.functionblocks | ||
+ | category example | ||
+ | version 1.0.0 | ||
+ | |||
+ | status{ | ||
+ | mandatory percent as int | ||
+ | } | ||
+ | |||
+ | operations{ | ||
+ | increase(percent as int) | ||
+ | decrease(percent as int) | ||
+ | } | ||
+ | } | ||
+ | |||
+ | '''Example: RGBColorPicker''' | ||
+ | functionblock RGBColorPicker { | ||
+ | displayname "RGBColorPicker" | ||
+ | description "Function block model selecting RGB colors." | ||
+ | namespace vorto.examples.functionblocks | ||
+ | category example | ||
+ | version 1.0.0 | ||
+ | |||
+ | status{ | ||
+ | mandatory color as RGBColor | ||
+ | } | ||
+ | |||
+ | operations{ | ||
+ | setColor(color as RGBColor) | ||
+ | } | ||
+ | } | ||
+ | |||
+ | '''Example: Switch''' | ||
+ | functionblock Switch { | ||
+ | displayname "Switch" | ||
+ | description "Function block model for a standard switch" | ||
+ | namespace vorto.examples.functionblocks | ||
+ | category example | ||
+ | version 1.0.0 | ||
+ | |||
+ | status{ | ||
+ | mandatory on as boolean | ||
+ | } | ||
+ | |||
+ | operations{ | ||
+ | on() | ||
+ | off() | ||
+ | toggle() | ||
+ | } | ||
+ | } |
Revision as of 08:27, 9 July 2015
Functionblocks are reusable descriptions of device components. A functionblock is typically structured as follows:
- Properties
- Status
- Configuration
- Fault
- Events
- Operations
The following examples give an overview how the DSL look like and how simple functionblocks can be modeled. Please not that in the RGBColorPicker Example the RGBColor datatype is reused.
Example: Dimmer
functionblock Dimmer { displayname "Dimmer" description "Function block model for a standard dimmer" namespace vorto.examples.functionblocks category example version 1.0.0 status{ mandatory percent as int } operations{ increase(percent as int) decrease(percent as int) } }
Example: RGBColorPicker
functionblock RGBColorPicker { displayname "RGBColorPicker" description "Function block model selecting RGB colors." namespace vorto.examples.functionblocks category example version 1.0.0 status{ mandatory color as RGBColor } operations{ setColor(color as RGBColor) } }
Example: Switch
functionblock Switch { displayname "Switch" description "Function block model for a standard switch" namespace vorto.examples.functionblocks category example version 1.0.0 status{ mandatory on as boolean } operations{ on() off() toggle() } }