DisplayLine Element
The DisplayLineElement enables drawing a simple fixed line on a display supporting pixel based graphics.
Displays that do not support pixel based drawings may not include this Element into the sketch.
The DisplayLineElement is included in the collection of Display-Draw elements and can be used on pixel based displays only.
It is possible to draw a line in any direction. The Bounding Box of the Element will be adjusted to used the correct order where (x <= x1) and (y <= y1).
Element Configuration
The following properties are available for configuration of the element.
x1 – Specifies the ending x position of the line.
y1 – Specifies the ending y position of the line.
The DisplayOutputElement
captures the parameters for defining a visual Element on the display. Tis is common for
multiple Elements even when they are not used by the element.
The following properties are available for configuration:
x – Specifies the x position of the Element.
y – Specifies the y position of the Element.
w or width – Specifies the width of the Element.
h or height – Specifies the height of the Element.
align – The alignment of the text. Possible values are “left” (default), “center” and “right”. This configuration is used by the DisplayTextBox Element only
fontsize – Specifies the size of the text used for drawing the Element. This configuration is used by the DisplayTextBox Element only
stroke or color – Specifies the stroke color of the Element. When no color is specified on the element the default stroke color from the display is used.
fill or background – Specifies the background color of the Element. When no color is specified on the element the default fill color from the display is used.
border – Specifies the border color of the Element. When no color is specified on the element the default color from the display is used.
value – Specifies a value for the Element. This is used for some Output Elements only.
clear – The value is cleared.
From the base element implementation the following properties are available for configuration:
title – Caption text for the element. Used by the element specific cards on the dash boards.
description – A line of text that gives a short description of the device used in the web UI.
room – The location of the device.
loglevel – This property holds the element specific log level. The default value is LOGGER_LEVEL_ERR == 1.
startup – This property can be used to start the element using a different initialization phase. Possible values are “sys”, “net”, “time”. See The Startup sequence.
Element Actions
The following actions can be sent to the element:
redraw – The display is updated.
Configuration Example
This example shows how to configure this element:
{
"displayline": {
"l": {
"x": 0,
"y": 12,
"x1": 127,
"y1": 12,
"description": "Display a line"
}
}
}
Element State
The following properties are available with the current values at runtime
active - Is set to true when the element is active.
Example State
{
"displayline/l": {
"active": "true"
}
}