edouard@3235: <?xml version="1.0"?> edouard@3235: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:func="http://exslt.org/functions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn svg inkscape"> edouard@3235: <xsl:output method="xml"/> edouard@3235: <xsl:variable name="indexed_hmitree" select="/.."/> Edouard@3621: <xsl:variable name="pathregex" select="'^(\w+=)?([^,=]+)([-.\d,]*)$'"/> Edouard@3621: <xsl:variable name="newline"> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: </xsl:variable> Edouard@3621: <xsl:variable name="twonewlines" select="concat($newline,$newline)"/> edouard@3235: <xsl:template mode="parselabel" match="*"> edouard@3235: <xsl:variable name="label" select="@inkscape:label"/> Edouard@3621: <xsl:variable name="desc" select="svg:desc"/> Edouard@3621: <xsl:variable name="len" select="string-length($label)"/> Edouard@3621: <xsl:variable name="has_continuation" select="substring($label,$len,1)='\'"/> Edouard@3621: <xsl:variable name="full_decl"> Edouard@3621: <xsl:choose> Edouard@3621: <xsl:when test="$has_continuation"> Edouard@3621: <xsl:variable name="_continuation" select="substring-before($desc, $twonewlines)"/> Edouard@3621: <xsl:variable name="continuation"> Edouard@3621: <xsl:choose> Edouard@3621: <xsl:when test="$_continuation"> Edouard@3621: <xsl:value-of select="$_continuation"/> Edouard@3621: </xsl:when> Edouard@3621: <xsl:otherwise> Edouard@3621: <xsl:value-of select="$desc"/> Edouard@3621: </xsl:otherwise> Edouard@3621: </xsl:choose> Edouard@3621: </xsl:variable> Edouard@3621: <xsl:value-of select="concat(substring($label,1,$len - 1),translate($continuation,$newline,''))"/> Edouard@3621: </xsl:when> Edouard@3621: <xsl:otherwise> Edouard@3621: <xsl:value-of select="$label"/> Edouard@3621: </xsl:otherwise> Edouard@3621: </xsl:choose> Edouard@3621: </xsl:variable> edouard@3235: <xsl:variable name="id" select="@id"/> Edouard@3621: <xsl:variable name="declaration" select="substring-after($full_decl,'HMI:')"/> Edouard@3621: <xsl:variable name="_args" select="substring-before($declaration,'@')"/> edouard@3235: <xsl:variable name="args"> edouard@3235: <xsl:choose> edouard@3235: <xsl:when test="$_args"> edouard@3235: <xsl:value-of select="$_args"/> edouard@3235: </xsl:when> edouard@3235: <xsl:otherwise> Edouard@3621: <xsl:value-of select="$declaration"/> edouard@3235: </xsl:otherwise> edouard@3235: </xsl:choose> edouard@3235: </xsl:variable> Edouard@3410: <xsl:variable name="_typefreq" select="substring-before($args,':')"/> Edouard@3410: <xsl:variable name="typefreq"> Edouard@3410: <xsl:choose> Edouard@3410: <xsl:when test="$_typefreq"> Edouard@3410: <xsl:value-of select="$_typefreq"/> Edouard@3410: </xsl:when> Edouard@3410: <xsl:otherwise> Edouard@3410: <xsl:value-of select="$args"/> Edouard@3410: </xsl:otherwise> Edouard@3410: </xsl:choose> Edouard@3410: </xsl:variable> edouard@3414: <xsl:variable name="freq" select="substring-after($typefreq,'|')"/> Edouard@3410: <xsl:variable name="_type" select="substring-before($typefreq,'|')"/> edouard@3235: <xsl:variable name="type"> edouard@3235: <xsl:choose> edouard@3235: <xsl:when test="$_type"> edouard@3235: <xsl:value-of select="$_type"/> edouard@3235: </xsl:when> edouard@3235: <xsl:otherwise> Edouard@3410: <xsl:value-of select="$typefreq"/> edouard@3235: </xsl:otherwise> edouard@3235: </xsl:choose> edouard@3235: </xsl:variable> edouard@3235: <xsl:if test="$type"> edouard@3235: <widget> edouard@3235: <xsl:attribute name="id"> edouard@3235: <xsl:value-of select="$id"/> edouard@3235: </xsl:attribute> edouard@3235: <xsl:attribute name="type"> edouard@3235: <xsl:value-of select="$type"/> edouard@3235: </xsl:attribute> edouard@3414: <xsl:if test="$freq"> edouard@3478: <xsl:if test="not(regexp:test($freq,'^[0-9]*(\.[0-9]+)?[smh]?'))"> edouard@3478: <xsl:message terminate="yes"> edouard@3478: <xsl:text>Widget id:</xsl:text> edouard@3478: <xsl:value-of select="$id"/> edouard@3478: <xsl:text> label:</xsl:text> Edouard@3621: <xsl:value-of select="$full_decl"/> edouard@3478: <xsl:text> has wrong syntax of frequency forcing </xsl:text> edouard@3478: <xsl:value-of select="$freq"/> edouard@3478: </xsl:message> edouard@3478: </xsl:if> edouard@3414: <xsl:attribute name="freq"> Edouard@3410: <xsl:value-of select="$freq"/> Edouard@3410: </xsl:attribute> Edouard@3410: </xsl:if> Edouard@3621: <xsl:variable name="tail" select="substring-after($declaration,'@')"/> Edouard@3621: <xsl:variable name="taillen" select="string-length($tail)"/> Edouard@3621: <xsl:variable name="has_enable" select="contains($tail, '#')"/> Edouard@3621: <xsl:variable name="paths"> Edouard@3621: <xsl:choose> Edouard@3621: <xsl:when test="$has_enable"> Edouard@3621: <xsl:value-of select="substring-before($tail,'#')"/> Edouard@3621: </xsl:when> Edouard@3621: <xsl:otherwise> Edouard@3621: <xsl:value-of select="$tail"/> Edouard@3621: </xsl:otherwise> Edouard@3621: </xsl:choose> Edouard@3621: </xsl:variable> Edouard@3621: <xsl:if test="$has_enable"> Edouard@3621: <xsl:variable name="enable_expr" select="substring-after($tail,'#')"/> Edouard@3621: <xsl:attribute name="enable_expr"> Edouard@3621: <xsl:value-of select="$enable_expr"/> Edouard@3621: </xsl:attribute> Edouard@3621: </xsl:if> edouard@3235: <xsl:for-each select="str:split(substring-after($args, ':'), ':')"> edouard@3235: <arg> edouard@3235: <xsl:attribute name="value"> edouard@3235: <xsl:value-of select="."/> edouard@3235: </xsl:attribute> edouard@3235: </arg> edouard@3235: </xsl:for-each> edouard@3235: <xsl:for-each select="str:split($paths, '@')"> edouard@3235: <xsl:if test="string-length(.) > 0"> edouard@3235: <path> edouard@3235: <xsl:variable name="path_match" select="regexp:match(.,$pathregex)"/> Edouard@3621: <xsl:variable name="pathassign" select="substring-before($path_match[2],'=')"/> edouard@3235: <xsl:variable name="pathminmax" select="str:split($path_match[4],',')"/> Edouard@3621: <xsl:variable name="path" select="$path_match[3]"/> edouard@3235: <xsl:variable name="pathminmaxcount" select="count($pathminmax)"/> Edouard@3621: <xsl:if test="not($path)"> Edouard@3621: <xsl:message terminate="yes"> Edouard@3621: <xsl:text>Widget id:</xsl:text> Edouard@3621: <xsl:value-of select="$id"/> Edouard@3621: <xsl:text> label:</xsl:text> Edouard@3621: <xsl:value-of select="$full_decl"/> Edouard@3621: <xsl:text> has wrong syntax</xsl:text> Edouard@3621: </xsl:message> Edouard@3621: </xsl:if> edouard@3235: <xsl:attribute name="value"> edouard@3235: <xsl:value-of select="$path"/> edouard@3235: </xsl:attribute> Edouard@3621: <xsl:if test="$pathassign"> Edouard@3621: <xsl:attribute name="assign"> Edouard@3621: <xsl:value-of select="$pathassign"/> edouard@3235: </xsl:attribute> edouard@3235: </xsl:if> edouard@3235: <xsl:choose> edouard@3235: <xsl:when test="$pathminmaxcount = 2"> edouard@3235: <xsl:attribute name="min"> edouard@3235: <xsl:value-of select="$pathminmax[1]"/> edouard@3235: </xsl:attribute> edouard@3235: <xsl:attribute name="max"> edouard@3235: <xsl:value-of select="$pathminmax[2]"/> edouard@3235: </xsl:attribute> edouard@3235: </xsl:when> edouard@3235: <xsl:when test="$pathminmaxcount = 1 or $pathminmaxcount > 2"> edouard@3235: <xsl:message terminate="yes"> edouard@3235: <xsl:text>Widget id:</xsl:text> edouard@3235: <xsl:value-of select="$id"/> edouard@3235: <xsl:text> label:</xsl:text> Edouard@3621: <xsl:value-of select="$full_decl"/> edouard@3235: <xsl:text> has wrong syntax of path section </xsl:text> edouard@3235: <xsl:value-of select="$pathminmax"/> edouard@3235: </xsl:message> edouard@3235: </xsl:when> edouard@3235: </xsl:choose> edouard@3235: <xsl:if test="$indexed_hmitree"> edouard@3235: <xsl:choose> edouard@3235: <xsl:when test="regexp:test($path,'^\.[a-zA-Z0-9_]+$')"> edouard@3235: <xsl:attribute name="type"> edouard@3235: <xsl:text>PAGE_LOCAL</xsl:text> edouard@3235: </xsl:attribute> edouard@3235: </xsl:when> edouard@3235: <xsl:when test="regexp:test($path,'^[a-zA-Z0-9_]+$')"> edouard@3235: <xsl:attribute name="type"> edouard@3235: <xsl:text>HMI_LOCAL</xsl:text> edouard@3235: </xsl:attribute> edouard@3235: </xsl:when> edouard@3235: <xsl:otherwise> edouard@3235: <xsl:variable name="item" select="$indexed_hmitree/*[@hmipath = $path]"/> edouard@3235: <xsl:variable name="pathtype" select="local-name($item)"/> edouard@3235: <xsl:if test="$pathminmaxcount = 3 and not($pathtype = 'HMI_INT' or $pathtype = 'HMI_REAL')"> edouard@3235: <xsl:message terminate="yes"> edouard@3235: <xsl:text>Widget id:</xsl:text> edouard@3235: <xsl:value-of select="$id"/> edouard@3235: <xsl:text> label:</xsl:text> Edouard@3621: <xsl:value-of select="$full_decl"/> edouard@3235: <xsl:text> path section </xsl:text> edouard@3235: <xsl:value-of select="$pathminmax"/> edouard@3235: <xsl:text> use min and max on non mumeric value</xsl:text> edouard@3235: </xsl:message> edouard@3235: </xsl:if> edouard@3235: <xsl:if test="count($item) = 1"> edouard@3235: <xsl:attribute name="index"> edouard@3235: <xsl:value-of select="$item/@index"/> edouard@3235: </xsl:attribute> edouard@3235: <xsl:attribute name="type"> edouard@3235: <xsl:value-of select="$pathtype"/> edouard@3235: </xsl:attribute> edouard@3235: </xsl:if> edouard@3235: </xsl:otherwise> edouard@3235: </xsl:choose> edouard@3235: </xsl:if> edouard@3235: </path> edouard@3235: </xsl:if> edouard@3235: </xsl:for-each> Edouard@3621: <xsl:choose> Edouard@3621: <xsl:when test="$has_continuation"> Edouard@3621: <xsl:variable name="_continuation" select="substring-after($desc, $twonewlines)"/> Edouard@3621: <xsl:if test="$_continuation"> Edouard@3621: <desc> Edouard@3621: <xsl:value-of select="$_continuation"/> Edouard@3621: </desc> Edouard@3621: </xsl:if> Edouard@3621: </xsl:when> Edouard@3621: <xsl:otherwise> Edouard@3621: <xsl:if test="$desc"> Edouard@3621: <desc> Edouard@3621: <xsl:value-of select="$desc/text()"/> Edouard@3621: </desc> Edouard@3621: </xsl:if> Edouard@3621: </xsl:otherwise> Edouard@3621: </xsl:choose> edouard@3235: </widget> edouard@3235: </xsl:if> edouard@3235: </xsl:template> edouard@3235: <xsl:template mode="genlabel" match="arg"> edouard@3235: <xsl:text>:</xsl:text> edouard@3235: <xsl:value-of select="@value"/> edouard@3235: </xsl:template> edouard@3235: <xsl:template mode="genlabel" match="path"> edouard@3235: <xsl:text>@</xsl:text> edouard@3235: <xsl:value-of select="@value"/> edouard@3235: <xsl:if test="string-length(@min)>0 or string-length(@max)>0"> edouard@3235: <xsl:text>,</xsl:text> edouard@3235: <xsl:value-of select="@min"/> edouard@3235: <xsl:text>,</xsl:text> edouard@3235: <xsl:value-of select="@max"/> edouard@3235: </xsl:if> edouard@3235: </xsl:template> edouard@3235: <xsl:template mode="genlabel" match="widget"> edouard@3235: <xsl:text>HMI:</xsl:text> edouard@3235: <xsl:value-of select="@type"/> edouard@3235: <xsl:apply-templates mode="genlabel" select="arg"/> edouard@3235: <xsl:apply-templates mode="genlabel" select="path"/> edouard@3235: </xsl:template> edouard@3235: <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/> edouard@3241: <xsl:template match="widget[@type='AnimateRotation']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>AnimateRotation - DEPRECATED, do not use. edouard@3241: </xsl:text> edouard@3241: <xsl:text>Doesn't follow WYSIWYG principle, and forces user to add animateTransform tag in SVG (using inkscape XML editor for exemple) edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>AnimateRotation - DEPRECATED</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="speed" accepts="HMI_INT,HMI_REAL"> edouard@3241: <xsl:text>speed</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> Edouard@3629: <xsl:template match="widget[@type='Assign']" mode="widget_desc"> Edouard@3629: <type> Edouard@3629: <xsl:value-of select="@type"/> Edouard@3629: </type> Edouard@3629: <longdesc> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>Arguments are either: Edouard@3629: </xsl:text> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>- name=value: setting variable with literal value. Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>- name=other_name: copy variable content into another Edouard@3629: </xsl:text> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>"active"+"inactive" labeled elements can be provided to show feedback when pressed Edouard@3629: </xsl:text> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>Exemples: Edouard@3629: </xsl:text> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>HMI:Assign:notify=1@notify=/PLCVAR Edouard@3629: </xsl:text> Edouard@3629: <xsl:text>HMI:Assign:ack=2:notify=1@ack=.local_var@notify=/PLCVAR Edouard@3629: </xsl:text> Edouard@3629: <xsl:text> Edouard@3629: </xsl:text> Edouard@3629: </longdesc> Edouard@3629: <shortdesc> Edouard@3629: <xsl:text>Assign variables on click</xsl:text> Edouard@3629: </shortdesc> Edouard@3629: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Back']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Back widget brings focus back to previous page in history when clicked. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Jump to previous page</xsl:text> edouard@3241: </shortdesc> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Button']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Button widget takes one boolean variable path, and reflect current true edouard@3241: </xsl:text> edouard@3241: <xsl:text>or false value by showing "active" or "inactive" labeled element edouard@3241: </xsl:text> edouard@3241: <xsl:text>respectively. Pressing and releasing button changes variable to true and edouard@3241: </xsl:text> edouard@3241: <xsl:text>false respectively. Potential inconsistency caused by quick consecutive edouard@3241: </xsl:text> edouard@3241: <xsl:text>presses on the button is mitigated by using a state machine that wait for edouard@3241: </xsl:text> edouard@3241: <xsl:text>previous state change to be reflected on variable before applying next one. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Push button reflecting consistently given boolean variable</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="value" accepts="HMI_BOOL"> edouard@3241: <xsl:text>Boolean variable</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3414: <xsl:template name="generated_button_class"> edouard@3414: <xsl:param name="fsm"/> edouard@3414: <xsl:text> state = "init"; edouard@3414: </xsl:text> edouard@3414: <xsl:text> dispatch(value) { edouard@3414: </xsl:text> edouard@3414: <xsl:apply-templates mode="dispatch_transition" select="$fsm"/> edouard@3414: <xsl:text> } edouard@3414: </xsl:text> edouard@3414: <xsl:text> onmouseup(evt) { edouard@3414: </xsl:text> edouard@3414: <xsl:text> svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); edouard@3414: </xsl:text> edouard@3414: <xsl:apply-templates mode="mouse_transition" select="$fsm"> edouard@3414: <xsl:with-param name="position" select="'up'"/> edouard@3414: </xsl:apply-templates> edouard@3414: <xsl:text> } edouard@3414: </xsl:text> edouard@3414: <xsl:text> onmousedown(evt) { edouard@3414: </xsl:text> edouard@3414: <xsl:text> svg_root.addEventListener("pointerup", this.bound_onmouseup, true); edouard@3414: </xsl:text> edouard@3414: <xsl:apply-templates mode="mouse_transition" select="$fsm"> edouard@3414: <xsl:with-param name="position" select="'down'"/> edouard@3414: </xsl:apply-templates> edouard@3414: <xsl:text> } edouard@3414: </xsl:text> edouard@3414: <xsl:apply-templates mode="actions" select="$fsm"/> edouard@3414: <xsl:text> init() { edouard@3414: </xsl:text> edouard@3414: <xsl:text> this.bound_onmouseup = this.onmouseup.bind(this); edouard@3414: </xsl:text> edouard@3414: <xsl:text> this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); edouard@3414: </xsl:text> Edouard@3621: <xsl:text> this.activity_state = undefined; Edouard@3521: </xsl:text> edouard@3414: <xsl:text> } edouard@3414: </xsl:text> edouard@3414: </xsl:template> edouard@3241: <xsl:template match="widget[@type='CircularBar']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>CircularBar widget changes the end angle of a "path" labeled arc according edouard@3241: </xsl:text> edouard@3241: <xsl:text>to value of the single accepted variable. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>If "min" a "max" labeled texts are provided, then they are used as edouard@3241: </xsl:text> edouard@3241: <xsl:text>respective minimum and maximum value. Otherwise, value is expected to be edouard@3241: </xsl:text> edouard@3241: <xsl:text>in between 0 and 100. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Change end angle of Inkscape's arc</xsl:text> edouard@3241: </shortdesc> edouard@3331: <arg name="min" count="optional" accepts="int,real"> edouard@3331: <xsl:text>minimum value</xsl:text> edouard@3331: </arg> edouard@3331: <arg name="max" count="optional" accepts="int,real"> edouard@3331: <xsl:text>maximum value</xsl:text> edouard@3331: </arg> edouard@3241: <path name="value" accepts="HMI_INT,HMI_REAL"> edouard@3241: <xsl:text>Value to display</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='CircularSlider']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>CircularSlider - DEPRECATED, to be replaced by PathSlider edouard@3241: </xsl:text> edouard@3241: <xsl:text>This widget moves "handle" labeled group along "range" labeled edouard@3241: </xsl:text> edouard@3241: <xsl:text>arc, according to value of the single accepted variable. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>If "min" a "max" labeled texts are provided, or if first and second edouard@3241: </xsl:text> edouard@3241: <xsl:text>argument are given, then they are used as respective minimum and maximum edouard@3241: </xsl:text> edouard@3241: <xsl:text>value. Otherwise, value is expected to be in between 0 and 100. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>If "value" labeled text is found, then its content is replaced by value. edouard@3241: </xsl:text> edouard@3241: <xsl:text>During drag, "setpoint" labeled group is moved to position defined by user edouard@3241: </xsl:text> edouard@3241: <xsl:text>while "handle" reflects current value from variable. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>CircularSlider - DEPRECATED</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="min" count="optional" accepts="int,real"> edouard@3241: <xsl:text>minimum value</xsl:text> edouard@3241: </arg> edouard@3241: <arg name="min" count="optional" accepts="int,real"> edouard@3241: <xsl:text>maximum value</xsl:text> edouard@3241: </arg> edouard@3241: <path name="value" accepts="HMI_INT,HMI_REAL"> edouard@3241: <xsl:text>Value to display</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='CustomHtml']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>CustomHtml widget allows insertion of HTML code in a svg:foreignObject. edouard@3241: </xsl:text> edouard@3241: <xsl:text>Widget content is replaced by foreignObject. HTML code is obtained from edouard@3241: </xsl:text> edouard@3241: <xsl:text>"code" labeled text content. HTML insert position and size is given with edouard@3241: </xsl:text> edouard@3241: <xsl:text>"container" labeled element. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Custom HTML insert</xsl:text> edouard@3241: </shortdesc> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Display']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>If Display widget is a svg:text element, then text content is replaced by edouard@3241: </xsl:text> edouard@3241: <xsl:text>value of given variables, space separated. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Otherwise, if Display widget is a group containing a svg:text element edouard@3241: </xsl:text> edouard@3241: <xsl:text>labelled "format", then text content is replaced by printf-like formated edouard@3241: </xsl:text> edouard@3241: <xsl:text>string. In other words, if "format" labeled text is "%d %s %f", then 3 edouard@3241: </xsl:text> edouard@3241: <xsl:text>variables paths are expected : HMI_IN, HMI_STRING and HMI_REAL. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>In case Display widget is a svg::text element, it is also possible to give edouard@3241: </xsl:text> edouard@3241: <xsl:text>format string as first argument. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> Edouard@3525: <xsl:text>Printf-like formated text display</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="format" count="optional" accepts="string"> edouard@3241: <xsl:text>printf-like format string when not given as svg:text</xsl:text> edouard@3241: </arg> edouard@3241: <path name="fields" count="many" accepts="HMI_INT,HMI_REAL,HMI_STRING,HMI_BOOL"> edouard@3241: <xsl:text>variables to be displayed</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='DropDown']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>DropDown widget let user select an entry in a list of texts, given as edouard@3241: </xsl:text> edouard@3241: <xsl:text>arguments. Single variable path is index of selection. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3323: <xsl:text>It needs "text" (svg:text or svg:use referring to svg:text), edouard@3323: </xsl:text> edouard@3323: <xsl:text>"box" (svg:rect), "button" (svg:*), and "highlight" (svg:rect) edouard@3323: </xsl:text> edouard@3323: <xsl:text>labeled elements. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>When user clicks on "button", "text" is duplicated to display enties in the edouard@3241: </xsl:text> edouard@3241: <xsl:text>limit of available space in page, and "box" is extended to contain all edouard@3241: </xsl:text> edouard@3241: <xsl:text>texts. "highlight" is moved over pre-selected entry. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3323: <xsl:text>When only one argument is given and argment contains "#langs" then list of edouard@3323: </xsl:text> edouard@3323: <xsl:text>texts is automatically set to the human-readable list of supported edouard@3323: </xsl:text> edouard@3323: <xsl:text>languages by this HMI. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>If "text" labeled element is of type svg:use and refers to a svg:text edouard@3323: </xsl:text> edouard@3323: <xsl:text>element part of a TextList widget, no argument is expected. In that case edouard@3323: </xsl:text> edouard@3323: <xsl:text>list of texts is set to TextList content. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Let user select text entry in a drop-down menu</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="entries" count="many" accepts="string"> edouard@3241: <xsl:text>drop-down menu entries</xsl:text> edouard@3241: </arg> edouard@3241: <path name="selection" accepts="HMI_INT"> edouard@3241: <xsl:text>selection index</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='ForEach']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>ForEach widget is used to span a small set of widget over a larger set of edouard@3241: </xsl:text> edouard@3241: <xsl:text>repeated HMI_NODEs. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Idea is somewhat similar to relative page, but it all happens inside the edouard@3241: </xsl:text> edouard@3241: <xsl:text>ForEach widget, no page involved. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Together with relative Jump widgets it can be used to build a menu to reach edouard@3241: </xsl:text> edouard@3241: <xsl:text>relative pages covering many identical HMI_NODES siblings. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>ForEach widget takes a HMI_CLASS name as argument and a HMI_NODE path as edouard@3241: </xsl:text> edouard@3241: <xsl:text>variable. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Direct sub-elements can be either groups of widget to be spanned, labeled edouard@3241: </xsl:text> edouard@3241: <xsl:text>"ClassName:offset", or buttons to control the spanning, labeled edouard@3241: </xsl:text> edouard@3241: <xsl:text>"ClassName:+/-number". edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>span widgets over a set of repeated HMI_NODEs</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="class_name" accepts="string"> edouard@3241: <xsl:text>HMI_CLASS name</xsl:text> edouard@3241: </arg> edouard@3241: <path name="root" accepts="HMI_NODE"> edouard@3241: <xsl:text> where to find HMI_NODEs whose HMI_CLASS is class_name</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Input']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Input widget takes one variable path, and displays current value in edouard@3241: </xsl:text> edouard@3241: <xsl:text>optional "value" labeled sub-element. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Click on optional "edit" labeled element opens keypad to edit value. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Operation on current value is performed when click on sub-elements with edouard@3241: </xsl:text> edouard@3241: <xsl:text>label starting with '=', '+' or '-' sign. Value after sign is used as edouard@3241: </xsl:text> edouard@3241: <xsl:text>operand. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Input field with predefined operation buttons</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="format" accepts="string"> edouard@3241: <xsl:text>optional printf-like format </xsl:text> edouard@3241: </arg> edouard@3241: <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING"> edouard@3241: <xsl:text>single variable to edit</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='JsonTable']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Send given variables as POST to http URL argument, spread returned JSON in edouard@3241: </xsl:text> edouard@3241: <xsl:text>SVG sub-elements of "data" labeled element. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> Edouard@3387: <xsl:text>Documentation to be written. see svghmi exemple. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Http POST variables, spread JSON back</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="url" accepts="string"> edouard@3241: <xsl:text> </xsl:text> edouard@3241: </arg> edouard@3241: <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING"> edouard@3241: <xsl:text>single variable to edit</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Jump']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> Edouard@3621: <xsl:text>Jump widget brings focus to a different page. Mandatory first argument edouard@3241: </xsl:text> edouard@3241: <xsl:text>gives name of the page. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> Edouard@3621: <xsl:text>If first path is pointint to HMI_NODE variable is used as new reference Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>when jumping to a relative page. Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>Additional arguments are unordered options: Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>- Absolute: force page jump to be not relative even if first path is of type HMI_NODE Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>- name=value: Notify PLC about jump by setting variable with path having same name assigned edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>"active"+"inactive" labeled elements can be provided and reflect current edouard@3241: </xsl:text> edouard@3241: <xsl:text>page being shown. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> Edouard@3621: <xsl:text>Exemples: Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>Relative jump: Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:RelativePage@/PUMP9 Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:RelativePage@/PUMP9@role=.userrole#role=="admin" Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>Absolute jump: Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:AbsolutePage Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:AbsolutePage@role=.userrole#role=="admin" Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>Forced absolute jump: Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:AbsolutePage:Absolute@/PUMP9 Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:AbsolutePage:Absolute:notify=1@notify=/PUMP9 Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>Jump with feedback Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> Edouard@3621: </xsl:text> Edouard@3621: <xsl:text>HMI:Jump:AbsolutePage:notify=1@notify=.did_jump Edouard@3621: </xsl:text> Edouard@3621: <xsl:text> edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Jump to given page</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="page" accepts="string"> edouard@3241: <xsl:text>name of page to jump to</xsl:text> edouard@3241: </arg> edouard@3241: <path name="reference" count="optional" accepts="HMI_NODE"> edouard@3241: <xsl:text>reference for relative jump</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> Edouard@3621: <func:function name="func:is_relative_jump"> Edouard@3621: <xsl:param name="widget"/> Edouard@3621: <func:result select="$widget/path and $widget/path[1]/@type='HMI_NODE' and not($widget/arg[position()>1 and @value = 'Absolute'])"/> Edouard@3621: </func:function> edouard@3241: <xsl:template match="widget[@type='Keypad']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Keypad - to be written edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Keypad </xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="supported_types" accepts="string"> edouard@3241: <xsl:text>keypad can input those types </xsl:text> edouard@3241: </arg> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='List']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3323: <longdesc> edouard@3323: <xsl:text>List widget is a svg:group, list items are labeled elements edouard@3323: </xsl:text> edouard@3323: <xsl:text>in that group. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>To use a List, clone (svg:use) one of the items inside the widget that edouard@3323: </xsl:text> edouard@3323: <xsl:text>expects a List. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>Positions of items are relative to each other, and they must all be in the edouard@3323: </xsl:text> edouard@3323: <xsl:text>same place. In order to make editing easier it is therefore recommanded to edouard@3323: </xsl:text> edouard@3323: <xsl:text>make stacked clones of svg elements spread nearby the list. edouard@3323: </xsl:text> edouard@3323: </longdesc> edouard@3323: <shortdesc> edouard@3323: <xsl:text>A named list of named graphical elements</xsl:text> edouard@3323: </shortdesc> edouard@3323: <arg name="listname"/> edouard@3241: </xsl:template> Edouard@3387: <xsl:template match="widget[@type='ListSwitch']" mode="widget_desc"> Edouard@3387: <type> Edouard@3387: <xsl:value-of select="@type"/> Edouard@3387: </type> Edouard@3387: <longdesc> Edouard@3387: <xsl:text>ListSwitch widget displays one item of an HMI:List depending on value of Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>given variable. Main element of the widget must be a clone of the list or Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>of an item of that list. Edouard@3387: </xsl:text> Edouard@3387: <xsl:text> Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>Given variable's current value is compared to list items Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>label. For exemple if given variable type Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>is HMI_INT and value is 1, then item with label '1' will be displayed. Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>If matching variable of type HMI_STRING, then no quotes are needed. Edouard@3387: </xsl:text> Edouard@3387: <xsl:text>For exemple, 'hello' match HMI_STRING 'hello'. Edouard@3387: </xsl:text> Edouard@3387: </longdesc> Edouard@3387: <shortdesc> Edouard@3387: <xsl:text>Displays item of an HMI:List whose label matches value.</xsl:text> Edouard@3387: </shortdesc> Edouard@3387: <path name="value" accepts="HMI_INT,HMI_STRING"> Edouard@3387: <xsl:text>value to compare to labels</xsl:text> Edouard@3387: </path> Edouard@3387: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Meter']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Meter widget moves the end of "needle" labeled path along "range" labeled edouard@3241: </xsl:text> edouard@3241: <xsl:text>path, according to value of the single accepted variable. edouard@3241: </xsl:text> edouard@3241: <xsl:text> edouard@3241: </xsl:text> edouard@3241: <xsl:text>Needle is reduced to a single segment. If "min" a "max" labeled texts edouard@3241: </xsl:text> edouard@3241: <xsl:text>are provided, or if first and second argument are given, then they are used edouard@3241: </xsl:text> edouard@3241: <xsl:text>as respective minimum and maximum value. Otherwise, value is expected to be edouard@3241: </xsl:text> edouard@3241: <xsl:text>in between 0 and 100. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Moves "needle" along "range"</xsl:text> edouard@3241: </shortdesc> edouard@3241: <arg name="min" count="optional" accepts="int,real"> edouard@3241: <xsl:text>minimum value</xsl:text> edouard@3241: </arg> edouard@3241: <arg name="max" count="optional" accepts="int,real"> edouard@3241: <xsl:text>maximum value</xsl:text> edouard@3241: </arg> edouard@3241: <path name="value" accepts="HMI_INT,HMI_REAL"> edouard@3241: <xsl:text>Value to display</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> Edouard@3687: <xsl:template match="widget[@type='Page']" mode="widget_desc"> Edouard@3687: <type> Edouard@3687: <xsl:value-of select="@type"/> Edouard@3687: </type> Edouard@3687: <longdesc> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>Arguments are either: Edouard@3687: </xsl:text> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>- XXX reference path TODO Edouard@3687: </xsl:text> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>- name=value: setting variable with literal value. Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>- name=other_name: copy variable content into another Edouard@3687: </xsl:text> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>Exemples: Edouard@3687: </xsl:text> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>HMI:Page:notify=1@notify=/PLCVAR Edouard@3687: </xsl:text> Edouard@3687: <xsl:text>HMI:Page:ack=2:notify=1@ack=.local_var@notify=/PLCVAR Edouard@3687: </xsl:text> Edouard@3687: <xsl:text> Edouard@3687: </xsl:text> Edouard@3687: </longdesc> Edouard@3687: <shortdesc> Edouard@3687: <xsl:text>Page </xsl:text> Edouard@3687: </shortdesc> Edouard@3687: </xsl:template> edouard@3326: <xsl:template match="widget[@type='PathSlider']" mode="widget_desc"> edouard@3326: <type> edouard@3326: <xsl:value-of select="@type"/> edouard@3326: </type> edouard@3326: <longdesc> edouard@3478: <xsl:text>PathSlider - edouard@3326: </xsl:text> edouard@3326: </longdesc> edouard@3326: <shortdesc> edouard@3326: <xsl:text>Slide an SVG element along a path by dragging it</xsl:text> edouard@3326: </shortdesc> edouard@3326: <path name="value" accepts="HMI_INT,HMI_REAL"> edouard@3326: <xsl:text>value</xsl:text> edouard@3326: </path> edouard@3326: <path name="min" count="optional" accepts="HMI_INT,HMI_REAL"> edouard@3326: <xsl:text>min</xsl:text> edouard@3326: </path> edouard@3326: <path name="max" count="optional" accepts="HMI_INT,HMI_REAL"> edouard@3326: <xsl:text>max</xsl:text> edouard@3326: </path> edouard@3326: <arg name="min" count="optional" accepts="int,real"> edouard@3326: <xsl:text>minimum value</xsl:text> edouard@3326: </arg> edouard@3326: <arg name="max" count="optional" accepts="int,real"> edouard@3326: <xsl:text>maximum value</xsl:text> edouard@3326: </arg> edouard@3326: </xsl:template> edouard@3241: <xsl:template match="widget[@type='ScrollBar']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3326: <xsl:text>ScrollBar - svg:rect based scrollbar edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>ScrollBar</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="value" accepts="HMI_INT"> edouard@3241: <xsl:text>value</xsl:text> edouard@3241: </path> edouard@3241: <path name="range" accepts="HMI_INT"> edouard@3241: <xsl:text>range</xsl:text> edouard@3241: </path> edouard@3241: <path name="visible" accepts="HMI_INT"> edouard@3241: <xsl:text>visible</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Slider']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Slider - DEPRECATED - use ScrollBar or PathSlider instead edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Slider - DEPRECATED - use ScrollBar instead</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="value" accepts="HMI_INT"> edouard@3241: <xsl:text>value</xsl:text> edouard@3241: </path> edouard@3241: <path name="range" accepts="HMI_INT"> edouard@3241: <xsl:text>range</xsl:text> edouard@3241: </path> edouard@3241: <path name="visible" accepts="HMI_INT"> edouard@3241: <xsl:text>visible</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3241: <xsl:template match="widget[@type='Switch']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Switch widget hides all subelements whose label do not match given edouard@3241: </xsl:text> edouard@3241: <xsl:text>variable current value representation. For exemple if given variable type edouard@3241: </xsl:text> edouard@3241: <xsl:text>is HMI_INT and value is 1, then elements with label '1' will be displayed. edouard@3241: </xsl:text> edouard@3241: <xsl:text>Label can have comments, so '1#some comment' would also match. If matching edouard@3241: </xsl:text> edouard@3241: <xsl:text>variable of type HMI_STRING, then double quotes must be used. For exemple, edouard@3241: </xsl:text> edouard@3241: <xsl:text>'"hello"' or '"hello"#another comment' match HMI_STRING 'hello'. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> Edouard@3387: <xsl:text>Show elements whose label matches value.</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="value" accepts="HMI_INT,HMI_STRING"> edouard@3241: <xsl:text>value to compare to labels</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> edouard@3323: <xsl:template match="widget[@type='TextList']" mode="widget_desc"> edouard@3323: <type> edouard@3323: <xsl:value-of select="@type"/> edouard@3323: </type> edouard@3323: <longdesc> edouard@3323: <xsl:text>TextList widget is a svg:group, list items are labeled elements edouard@3323: </xsl:text> edouard@3323: <xsl:text>in that group. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>To use a TextList, clone (svg:use) one of the items inside the widget edouard@3323: </xsl:text> edouard@3323: <xsl:text>that expects a TextList. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>In this list, (translated) text content is what matters. Nevertheless edouard@3323: </xsl:text> edouard@3323: <xsl:text>text style of the cloned item will be applied in client widget. edouard@3323: </xsl:text> edouard@3323: </longdesc> edouard@3323: <shortdesc> edouard@3323: <xsl:text>A named list of ordered texts </xsl:text> edouard@3323: </shortdesc> edouard@3323: <arg name="listname"/> edouard@3323: </xsl:template> edouard@3323: <xsl:template match="widget[@type='TextStyleList']" mode="widget_desc"> edouard@3323: <type> edouard@3323: <xsl:value-of select="@type"/> edouard@3323: </type> edouard@3323: <longdesc> edouard@3323: <xsl:text>TextStyleList widget is a svg:group, list items are labeled elements edouard@3323: </xsl:text> edouard@3323: <xsl:text>in that group. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>To use a TextStyleList, clone (svg:use) one of the items inside the widget edouard@3323: </xsl:text> edouard@3323: <xsl:text>that expects a TextStyleList. edouard@3323: </xsl:text> edouard@3323: <xsl:text> edouard@3323: </xsl:text> edouard@3323: <xsl:text>In this list, only style matters. Text content is ignored. edouard@3323: </xsl:text> edouard@3323: </longdesc> edouard@3323: <shortdesc> edouard@3323: <xsl:text>A named list of named texts</xsl:text> edouard@3323: </shortdesc> edouard@3323: <arg name="listname"/> edouard@3323: </xsl:template> edouard@3241: <xsl:template match="widget[@type='ToggleButton']" mode="widget_desc"> edouard@3241: <type> edouard@3241: <xsl:value-of select="@type"/> edouard@3241: </type> edouard@3241: <longdesc> edouard@3241: <xsl:text>Button widget takes one boolean variable path, and reflect current true edouard@3241: </xsl:text> edouard@3241: <xsl:text>or false value by showing "active" or "inactive" labeled element edouard@3241: </xsl:text> edouard@3241: <xsl:text>respectively. Clicking or touching button toggles variable. edouard@3241: </xsl:text> edouard@3241: </longdesc> edouard@3241: <shortdesc> edouard@3241: <xsl:text>Toggle button reflecting given boolean variable</xsl:text> edouard@3241: </shortdesc> edouard@3241: <path name="value" accepts="HMI_BOOL"> edouard@3241: <xsl:text>Boolean variable</xsl:text> edouard@3241: </path> edouard@3241: </xsl:template> Edouard@3506: <xsl:template match="widget[@type='XYGraph']" mode="widget_desc"> Edouard@3506: <type> Edouard@3506: <xsl:value-of select="@type"/> Edouard@3506: </type> Edouard@3506: <longdesc> Edouard@3506: <xsl:text>XYGraph draws a cartesian trend graph re-using styles given for axis, Edouard@3506: </xsl:text> Edouard@3506: <xsl:text>grid/marks, legends and curves. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> Edouard@3506: </xsl:text> Edouard@3506: <xsl:text>Elements labeled "x_axis" and "y_axis" are svg:groups containg: Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> - "axis_label" svg:text gives style an alignment for axis labels. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> - "interval_major_mark" and "interval_minor_mark" are svg elements to be Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> duplicated along axis line to form intervals marks. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> - "axis_line" svg:path is the axis line. Paths must be intersect and their Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> bounding box is the chart wall. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> Edouard@3506: </xsl:text> Edouard@3506: <xsl:text>Elements labeled "curve_0", "curve_1", ... are paths whose styles are used Edouard@3506: </xsl:text> Edouard@3506: <xsl:text>to draw curves corresponding to data from variables passed as HMI tree paths. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text>"curve_0" is mandatory. HMI variables outnumbering given curves are ignored. Edouard@3506: </xsl:text> Edouard@3506: <xsl:text> Edouard@3506: </xsl:text> Edouard@3506: </longdesc> Edouard@3506: <shortdesc> Edouard@3506: <xsl:text>Cartesian trend graph showing values of given variables over time</xsl:text> Edouard@3506: </shortdesc> Edouard@3506: <path name="value" count="1+" accepts="HMI_INT,HMI_REAL"> Edouard@3506: <xsl:text>value</xsl:text> Edouard@3506: </path> Edouard@3507: <arg name="xrange" accepts="int,time"> Edouard@3507: <xsl:text>X axis range expressed either in samples or duration.</xsl:text> Edouard@3506: </arg> Edouard@3506: <arg name="xformat" count="optional" accepts="string"> Edouard@3506: <xsl:text>format string for X label</xsl:text> Edouard@3506: </arg> Edouard@3506: <arg name="yformat" count="optional" accepts="string"> Edouard@3506: <xsl:text>format string for Y label</xsl:text> Edouard@3506: </arg> Edouard@3506: </xsl:template> Edouard@3510: <func:function name="func:check_curves_label_consistency"> Edouard@3510: <xsl:param name="curve_elts"/> Edouard@3510: <xsl:param name="number_to_check"/> Edouard@3510: <xsl:variable name="res"> Edouard@3510: <xsl:choose> Edouard@3510: <xsl:when test="$curve_elts[@inkscape:label = concat('curve_', string($number_to_check))]"> Edouard@3510: <xsl:if test="$number_to_check > 0"> Edouard@3510: <xsl:value-of select="func:check_curves_label_consistency($curve_elts, $number_to_check - 1)"/> Edouard@3510: </xsl:if> Edouard@3510: </xsl:when> Edouard@3510: <xsl:otherwise> Edouard@3510: <xsl:value-of select="concat('missing curve_', string($number_to_check))"/> Edouard@3510: </xsl:otherwise> Edouard@3510: </xsl:choose> Edouard@3510: </xsl:variable> Edouard@3510: <func:result select="$res"/> Edouard@3510: </func:function> edouard@3241: <xsl:template mode="document" match="@* | node()"> edouard@3241: <xsl:copy> edouard@3241: <xsl:apply-templates mode="document" select="@* | node()"/> edouard@3241: </xsl:copy> edouard@3241: </xsl:template> edouard@3241: <xsl:template mode="document" match="widget"> edouard@3241: <xsl:copy> edouard@3241: <xsl:apply-templates mode="document" select="@* | node()"/> edouard@3241: <defs> edouard@3241: <xsl:apply-templates mode="widget_desc" select="."/> edouard@3241: </defs> edouard@3241: </xsl:copy> edouard@3241: </xsl:template> edouard@3235: <xsl:template match="/"> edouard@3241: <xsl:variable name="widgets"> edouard@3241: <xsl:apply-templates mode="parselabel" select="$hmi_elements"/> edouard@3241: </xsl:variable> edouard@3241: <xsl:variable name="widget_ns" select="exsl:node-set($widgets)"/> edouard@3235: <widgets> edouard@3241: <xsl:apply-templates mode="document" select="$widget_ns"/> edouard@3235: </widgets> edouard@3235: </xsl:template> edouard@3235: </xsl:stylesheet>