/** * ----------------------------------------------------------------------------- * @package smartVISU * @author Martin Gleiß * @copyright 2012 * @license GPL * ----------------------------------------------------------------------------- */ /** * Element: Positioning a Object/Widget * * @param unique id for this widget * @param title of the element (optional) * @param icon position from left side * @param icon position from top side * @param a content * @param width (optional) * @param height (optional) * @param hide on mobile displays (optional value 1) */ {% macro e (id, info, left, top, content, width, height, hide) %}
{{ content }}
{% endmacro %} /** * Background picture * * @param unique id for this widget * @param picture * */ {% macro background (id, picture) %} {% endmacro %} /** * Pagelink * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon position from left side * @param icon position from top side * @param the pagelink (for example: index.php?page=room_xyz -> without .html!) * @param text printed on the button (optional) * @param a icon or a inline pic: 'arrow-l', 'arrow-r', 'arrow-u', 'arrow-d', 'delete', 'plus', 'minus', 'check', 'gear', 'refresh', 'forward', 'back', 'grid', 'star', 'alert', 'info', 'home', 'search' (optional) * @param type: 'micro', 'mini', 'midi' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro pagelink (id, info, left, top, pagelink, txt, pic, type, hide) %} {{ txt|e }} {% elseif pic|slice(-4, 4) != '.svg' and not txt %} data-icon="{{ pic }}" data-iconpos="notext"> {% elseif pic|slice(-4, 4) != '.svg' and txt %} data-icon="{{ pic }}" data-iconpos="top">{{ txt|e }} {% elseif type == 'midi' and txt %}>
{{ txt|e }}
{% else %} data-iconpos="center"> {% endif %}
{% endmacro %} /** * Shutter * * @param unique id for this widget * @param title of the shutter (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item for the up- and down- movement * @param a gad/item for stopping the movement (optional) * @param a gad/item for the position of the shutters * @param a gad/item to move the shutters to the shade position (optional) * @param a gad/item to display the window status (optional) * @param type: 'micro', 'mini', 'midi', 'icon' (optional, default: micro) * @param hide on mobile displays (optional value 1) */ {% macro shutter (id, txt, left, top, gad_move, gad_stop, gad_pos, gad_shade, gad_window, type, hide) %} {% import "basic.html" as basic %} {% import "icon.html" as icon %} {% set uid = uid(page, id) %} {% set min = 0 %} {% set max = 100 %} {% if gad_pos %} {% else %} {% if gad_window %} {{ basic.symbol(id~'icon_open', gad_window, '', 'fts_window_1w_open.svg', 2, '', 'icon1') }} {{ basic.symbol(id~'icon_tilt', gad_window, '', 'fts_window_1w_tilt.svg', 1, '', 'icon1') }} {{ basic.symbol(id~'icon_close', gad_window, '', 'fts_window_1w.svg', 0) }} {% else %} {% endif %} {% endif %}
{% if gad_window %} {{ basic.symbol(id~'popup-icon_open', gad_window, '', 'fts_window_1w_open.svg', 2, '', 'icon1') }} {{ basic.symbol(id~'popup-icon_tilt', gad_window, '', 'fts_window_1w_tilt.svg', 1, '', 'icon1') }} {{ basic.symbol(id~'popup-icon_close', gad_window, '', 'fts_window_1w.svg', 0) }} {% endif %} {{ txt|e }}
{{ basic.button(id~'up', gad_move, '', 'control_arrow_up.svg', 0, 'mini') }} {{ basic.button(id~'down', gad_move, '', 'control_arrow_down.svg', 1, 'mini') }} {% if gad_stop %}{{ basic.button(id~'stop', gad_stop, '', 'audio_stop.svg', 1, 'mini') }}{% endif %} {% if gad_shade %}{{ basic.button(id~'shade', gad_shade, '', 'fts_shutter_50.svg', 1, 'mini') }}{% endif %}
{% if gad_pos %}
{{ basic.slider(id~'slider', gad_pos, 0 , 100 , 5 ) }}
{% endif %} Schließen
{% endmacro %} /** * Dimmer * * @param unique id for this widget * @param title of the dimmer (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item for switching * @param a gad/item for dimming * @param the minimum value if the slider is moved to total left (optional, default 0) * @param the maximum value if the slider is moved to total right (optional, default 255) * @param step between two values (optional, default 5) * @param type: 'micro', 'mini', 'midi', 'icon' (optional, default: micro) * @param hide on mobile displays (optional value 1) */ {% macro dimmer (id, txt, left, top, gad_switch, gad_value, min, max, step, type, hide) %} {% import "basic.html" as basic %} {% import "icon.html" as icon %} {% set uid = uid(page, id) %}
{{ icon.light(id~'-light', gad_switch, gad_value, min, max) }}
{{ icon.light(id~'-light2', gad_switch, gad_value, min, max) }}

{{ txt|e }}

{{ basic.slider(id~'-slider', gad_value, min, max, step) }}
Schließen
{% endmacro %} /** * Button * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item * @param text printed on the button (optional) * @param a icon or a inline pic: 'arrow-l', 'arrow-r', 'arrow-u', 'arrow-d', 'delete', 'plus', 'minus', 'check', 'gear', 'refresh', 'forward', 'back', 'grid', 'star', 'alert', 'info', 'home', 'search' (optional) * @param value send if the button is pressed (optional, default 1) * @param type: 'micro', 'mini', 'midi', 'icon' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro button (id, info, left, top, gad, txt, pic, val, type, hide) %} {% import "basic.html" as basic %}
{{ txt|e }} {% elseif pic|slice(-4, 4) != '.svg' and not txt %} data-icon="{{ pic }}" data-iconpos="notext"> {% elseif pic|slice(-4, 4) != '.svg' and txt %} data-icon="{{ pic }}" data-iconpos="top">{{ txt|e }} {% elseif type == 'midi' and txt %} >
{{ txt|e }}
{% else %} data-iconpos="center"> {% endif %}
{% endmacro %} /** * Dual * * @param unique id for this widget * @param popup-info of the dual button (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item * @param the pic for the 'on' state (optional) * @param the pic for the 'off' state (optional) * @param value send for the 'on' state (optional, default 1) * @param value send for the 'off' state (optional, default 0) * @param type: 'micro', 'mini', 'midi', 'icon' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro dual (id, info, left, top, gad, pic_on, pic_off, val_on, val_off, type, hide) %} {% set uid = uid(page, id) %} {% import "basic.html" as basic %}
{% endmacro %} /** * Displays a rgb-selector * * @param unique id for this widget * @param popup-info of the rgb-selector (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item for on/off switching * @param text for the 'on' state (optional, default 'On') * @param text for the 'off' state (optional, default 'Off') * @param a gad/item for the r - value (0-255) * @param a gad/item for the g - value (0-255) * @param a gad/item for the b - value (0-255) * @param the minimum value if the light is off (optional, for future use) * @param the maximum value if the light is full on (optional, default 255) * @param the granularity of the rings (optional, default 8) * @param the number of colored segments (optional, default 10) * @param type: 'micro', 'mini', 'midi' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro rgb (id, info, left, top, gad, txt_on, txt_off, gad_r, gad_g, gad_b, min, max, step, colors, type, hide) %} {% set uid = uid(page, id) %} {% import "basic.html" as basic %}
{{ basic.flip("{{ id }}-flip", gad, txt_on, txt_off) }}{% if info %} {{ info }} {% endif %}
 
Schließen
{% endmacro %} /** * Displays a colordisc-rgb-selector * * @param unique id for this widget * @param popup-info of the colordisc (optional) * @param icon position from left side * @param icon position from top side * @param a gad/item for on/off switching * @param text for the 'on' state (optional, default 'On') * @param text for the 'off' state (optional, default 'Off') * @param a gad/item for the r - value (0-255) * @param a gad/item for the g - value (0-255) * @param a gad/item for the b - value (0-255) * @param the minimum value if the light is off (optional, for future use) * @param the maximum value if the light is full on (optional, default 255) * @param the granularity of the rings (optional, default 8) * @param the number of colored segments (optional, default 10) * @param type: 'micro', 'mini', 'midi' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro colordisc (id, info, left, top, gad, txt_on, txt_off, gad_r, gad_g, gad_b, min, max, step, colors, type, hide) %} {% set uid = uid(page, id) %} {% import "basic.html" as basic %}
Schließen
{{ basic.flip("{{ id }}-flip", gad, txt_on, txt_off) }}{% if info %} {{ info }} {% endif %}
{% endmacro %} /** * Float: Displays a value as float * * @param unique id for this widget * @param popup-info of the float value (optional) * @param icon position from left side * @param icon position from top side * @param unique id for the popup * @param a gad/item * @param a unit, tries to get the format for that unit from the language-file (optional) * @param hide on mobile displays (optional value 1) */ {% macro float (id, info, left, top, id_popup, gad, unit, hide) %} -.- {{ unit }} {% endmacro %} /** * A symbol, with no writing to knx, only displayed when the value of gad is equal to val. Symbols may be used in menus. * If more than one gad is given, they will be combined with mode ('or' / 'and). * * @param unique id for this widget * @param icon position from left side * @param icon position from top side * @param one or more gad(s)/item(s). More gads/items in array form: [ item1 , item2 ] * @param the text, printed when gad has value val (optional) * @param the pic, shown when gad has value val * @param value (default 1) * @param the mode, 'or', 'and' (default 'or') * @param the color 'icon1' or e. g. '#f00' for red (default 'icon0' of the design) * @param hide on mobile displays (optional value 1) */ {% macro symbol(id, left, top, items, txt, pic, val, mode, color, hide) %} {% if color is empty %} {% elseif color == 'icon1' %} {% else %} {% endif %} {{ txt }} {% endmacro %} /** * Period: A simple popup-widget for plotting charts * to use together with the symbol-Widget * * @param unique id for this popup-widget * @param title of the chart (optional) * @param series of item/s. More item/s in array form: [ item1 , item2 ] * @param the mode: 'avg', 'sum', 'min', 'max' * @param the minimum time (x-axis): '1h', '2h'... (duration-format) * @param the maximum time (x-axis): '', '1h', '2h'... (duration-format, default: now) * @param the minimum y-axis (optional) * @param the maximum y-axis (optional) * @param the step between two time-points (optional, only for 'offline'-driver) * @param label/s for each series (optional) * @param color/s for each series e. g. '#f00' for red (optional, default: sutiable for design) * @param type/s for each series: 'line', 'stair', 'spline', 'area', 'areaspline', 'column' (optional, default 'line') * @param title/s for the x-axis and y-axis * @param minimum time while zooming in sec (optional, duration-format) * * @see misc/fundamentals#Array-Form * @see misc/fundamentals#Duration-Format */ {% macro period (id, txt, gad, mode, tmin, tmax, ymin, ymax, step, label, color, exposure, axes, zoom) %}
Schließen {% if txt %}
{{ txt }}
{% endif %}
{% endmacro %} /** * Camera * * @param unique id for this widget * @param title of the camera (optional) * @param icon position from left side * @param icon position from top side * @param stream url * @param video width * @param video height * @param type: 'micro', 'mini', 'midi', 'icon' (optional, default: micro) * @param hide on mobile displays (optional value 1) */ {% macro camera (id, txt, left, top, stream, width, height, type, hide) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
Schließen {% if txt %}
{{ txt }}
{% endif %}
{% endmacro %} /** * url: Popup to a external page * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon position from left side * @param icon position from top side * @param the url to open in a popup (for example: http://www.google.de) * @param text printed on the button (optional) * @param a icon or a inline pic: 'arrow-l', 'arrow-r', 'arrow-u', 'arrow-d', 'delete', 'plus', 'minus', 'check', 'gear', 'refresh', 'forward', 'back', 'grid', 'star', 'alert', 'info', 'home', 'search' (optional) * @param width of the popup * @param height of the popup * @param type: 'micro', 'mini', 'midi' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro url (id, info, left, top, url, txt, pic, width, height, type, hide) %} {% set uid = uid(page, id) %} {{ txt|e }} {% elseif pic|slice(-4, 4) != '.svg' and not txt %} data-icon="{{ pic }}" data-iconpos="notext"> {% elseif pic|slice(-4, 4) != '.svg' and txt %} data-icon="{{ pic }}" data-iconpos="top">{{ txt|e }} {% elseif type == 'midi' and txt %}>
{{ txt|e }}
{% else %} data-iconpos="center"> {% endif %}
Schließen {% if info %}
{{ info }}
{% endif %}
{% endmacro %} /** * scene: Select a scene * * @param unique id for this widget * @param a item * @param text printed on the button (optional) * @param position from left side * @param position from top side * @param a icon or a inline pic: 'arrow-l', 'arrow-r', 'arrow-u', 'arrow-d', 'delete', 'plus', 'minus', 'check', 'gear', 'refresh', 'forward', 'back', 'grid', 'star', 'alert', 'info', 'home', 'search' (optional) * @param array for labels * @param array for values to send (same order as labels) * @param type: 'micro', 'mini', 'midi' (optional, default: mini) * @param hide on mobile displays (optional value 1) */ {% macro scene (id, gad, txt, left, top, pic, labels, values, type, hide) %} {% set uid = uid(page, id) %} {{ txt|e }} {% elseif pic|slice(-4, 4) != '.svg' and not txt %} data-icon="{{ pic }}" data-iconpos="notext"> {% elseif pic|slice(-4, 4) != '.svg' and txt %} data-icon="{{ pic }}" data-iconpos="top">{{ txt|e }} {% elseif type == 'midi' and txt %}>
{{ txt|e }}
{% else %} data-iconpos="center"> {% endif %}
{% endmacro %}