svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3241 fe945f1f48b7
parent 3238 8a9d4c794cba
child 3242 f037e901a17c
equal deleted inserted replaced
3238:8a9d4c794cba 3241:fe945f1f48b7
  1962     <xsl:text>    }
  1962     <xsl:text>    }
  1963 </xsl:text>
  1963 </xsl:text>
  1964     <xsl:text>}
  1964     <xsl:text>}
  1965 </xsl:text>
  1965 </xsl:text>
  1966   </xsl:template>
  1966   </xsl:template>
       
  1967   <xsl:template match="widget[@type='AnimateRotation']" mode="widget_desc">
       
  1968     <type>
       
  1969       <xsl:value-of select="@type"/>
       
  1970     </type>
       
  1971     <longdesc>
       
  1972       <xsl:text>AnimateRotation - DEPRECATED, do not use.
       
  1973 </xsl:text>
       
  1974       <xsl:text>Doesn't follow WYSIWYG principle, and forces user to add animateTransform tag in SVG (using inkscape XML editor for exemple)
       
  1975 </xsl:text>
       
  1976     </longdesc>
       
  1977     <shortdesc>
       
  1978       <xsl:text>AnimateRotation - DEPRECATED</xsl:text>
       
  1979     </shortdesc>
       
  1980     <path name="speed" accepts="HMI_INT,HMI_REAL">
       
  1981       <xsl:text>speed</xsl:text>
       
  1982     </path>
       
  1983   </xsl:template>
  1967   <xsl:template match="widget[@type='AnimateRotation']" mode="widget_class">
  1984   <xsl:template match="widget[@type='AnimateRotation']" mode="widget_class">
  1968     <xsl:text>class </xsl:text>
  1985     <xsl:text>class </xsl:text>
  1969     <xsl:text>AnimateRotationWidget</xsl:text>
  1986     <xsl:text>AnimateRotationWidget</xsl:text>
  1970     <xsl:text> extends Widget{
  1987     <xsl:text> extends Widget{
  1971 </xsl:text>
  1988 </xsl:text>
  1993 </xsl:text>
  2010 </xsl:text>
  1994     <xsl:text>    animate(){
  2011     <xsl:text>    animate(){
  1995 </xsl:text>
  2012 </xsl:text>
  1996     <xsl:text>       // change animation properties
  2013     <xsl:text>       // change animation properties
  1997 </xsl:text>
  2014 </xsl:text>
       
  2015     <xsl:text>       // TODO : rewrite with proper es6
       
  2016 </xsl:text>
  1998     <xsl:text>       for(let child of this.element.children){
  2017     <xsl:text>       for(let child of this.element.children){
  1999 </xsl:text>
  2018 </xsl:text>
  2000     <xsl:text>            if(child.nodeName == "animateTransform"){
  2019     <xsl:text>            if(child.nodeName == "animateTransform"){
  2001 </xsl:text>
  2020 </xsl:text>
  2002     <xsl:text>                if(this.speed &gt; 0){
  2021     <xsl:text>                if(this.speed &gt; 0){
  2044     <xsl:text>    }
  2063     <xsl:text>    }
  2045 </xsl:text>
  2064 </xsl:text>
  2046     <xsl:text>}
  2065     <xsl:text>}
  2047 </xsl:text>
  2066 </xsl:text>
  2048   </xsl:template>
  2067   </xsl:template>
  2049   <xsl:template match="widget[@type='AnimateRotation']" mode="widget_defs">
  2068   <xsl:template match="widget[@type='Back']" mode="widget_desc">
  2050     <xsl:param name="hmi_element"/>
  2069     <type>
  2051     <xsl:param name="hmi_element"/>
  2070       <xsl:value-of select="@type"/>
  2052     <xsl:text>
  2071     </type>
  2053 </xsl:text>
  2072     <longdesc>
       
  2073       <xsl:text>Back widget brings focus back to previous page in history when clicked.
       
  2074 </xsl:text>
       
  2075     </longdesc>
       
  2076     <shortdesc>
       
  2077       <xsl:text>Jump to previous page</xsl:text>
       
  2078     </shortdesc>
  2054   </xsl:template>
  2079   </xsl:template>
  2055   <xsl:template match="widget[@type='Back']" mode="widget_class">
  2080   <xsl:template match="widget[@type='Back']" mode="widget_class">
  2056     <xsl:text>class </xsl:text>
  2081     <xsl:text>class </xsl:text>
  2057     <xsl:text>BackWidget</xsl:text>
  2082     <xsl:text>BackWidget</xsl:text>
  2058     <xsl:text> extends Widget{
  2083     <xsl:text> extends Widget{
  2077 </xsl:text>
  2102 </xsl:text>
  2078     <xsl:text>    }
  2103     <xsl:text>    }
  2079 </xsl:text>
  2104 </xsl:text>
  2080     <xsl:text>}
  2105     <xsl:text>}
  2081 </xsl:text>
  2106 </xsl:text>
       
  2107   </xsl:template>
       
  2108   <xsl:template match="widget[@type='Button']" mode="widget_desc">
       
  2109     <type>
       
  2110       <xsl:value-of select="@type"/>
       
  2111     </type>
       
  2112     <longdesc>
       
  2113       <xsl:text>Button widget takes one boolean variable path, and reflect current true
       
  2114 </xsl:text>
       
  2115       <xsl:text>or false value by showing "active" or "inactive" labeled element
       
  2116 </xsl:text>
       
  2117       <xsl:text>respectively. Pressing and releasing button changes variable to true and
       
  2118 </xsl:text>
       
  2119       <xsl:text>false respectively. Potential inconsistency caused by quick consecutive
       
  2120 </xsl:text>
       
  2121       <xsl:text>presses on the button is mitigated by using a state machine that wait for
       
  2122 </xsl:text>
       
  2123       <xsl:text>previous state change to be reflected on variable before applying next one.
       
  2124 </xsl:text>
       
  2125     </longdesc>
       
  2126     <shortdesc>
       
  2127       <xsl:text>Push button reflecting consistently given boolean variable</xsl:text>
       
  2128     </shortdesc>
       
  2129     <path name="value" accepts="HMI_BOOL">
       
  2130       <xsl:text>Boolean variable</xsl:text>
       
  2131     </path>
  2082   </xsl:template>
  2132   </xsl:template>
  2083   <xsl:variable name="_button_fsm">
  2133   <xsl:variable name="_button_fsm">
  2084     <fsm>
  2134     <fsm>
  2085       <state name="init">
  2135       <state name="init">
  2086         <on-dispatch value="false">
  2136         <on-dispatch value="false">
  2299     <xsl:text>}
  2349     <xsl:text>}
  2300 </xsl:text>
  2350 </xsl:text>
  2301   </xsl:template>
  2351   </xsl:template>
  2302   <xsl:template match="widget[@type='Button']" mode="widget_defs">
  2352   <xsl:template match="widget[@type='Button']" mode="widget_defs">
  2303     <xsl:param name="hmi_element"/>
  2353     <xsl:param name="hmi_element"/>
  2304     <xsl:param name="hmi_element"/>
       
  2305     <xsl:call-template name="defs_by_labels">
  2354     <xsl:call-template name="defs_by_labels">
  2306       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2355       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2307       <xsl:with-param name="labels">
  2356       <xsl:with-param name="labels">
  2308         <xsl:text>active inactive</xsl:text>
  2357         <xsl:text>active inactive</xsl:text>
  2309       </xsl:with-param>
  2358       </xsl:with-param>
  2310       <xsl:with-param name="mandatory" select="'no'"/>
  2359       <xsl:with-param name="mandatory" select="'no'"/>
  2311     </xsl:call-template>
  2360     </xsl:call-template>
  2312   </xsl:template>
  2361   </xsl:template>
       
  2362   <xsl:template match="widget[@type='CircularBar']" mode="widget_desc">
       
  2363     <type>
       
  2364       <xsl:value-of select="@type"/>
       
  2365     </type>
       
  2366     <longdesc>
       
  2367       <xsl:text>CircularBar widget changes the end angle of a "path" labeled arc according
       
  2368 </xsl:text>
       
  2369       <xsl:text>to value of the single accepted variable.
       
  2370 </xsl:text>
       
  2371       <xsl:text>
       
  2372 </xsl:text>
       
  2373       <xsl:text>If "min" a "max" labeled texts are provided, then they are used as
       
  2374 </xsl:text>
       
  2375       <xsl:text>respective minimum and maximum value. Otherwise, value is expected to be
       
  2376 </xsl:text>
       
  2377       <xsl:text>in between 0 and 100.
       
  2378 </xsl:text>
       
  2379       <xsl:text>
       
  2380 </xsl:text>
       
  2381       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
  2382 </xsl:text>
       
  2383     </longdesc>
       
  2384     <shortdesc>
       
  2385       <xsl:text>Change end angle of Inkscape's arc</xsl:text>
       
  2386     </shortdesc>
       
  2387     <path name="value" accepts="HMI_INT,HMI_REAL">
       
  2388       <xsl:text>Value to display</xsl:text>
       
  2389     </path>
       
  2390   </xsl:template>
  2313   <xsl:template match="widget[@type='CircularBar']" mode="widget_class">
  2391   <xsl:template match="widget[@type='CircularBar']" mode="widget_class">
  2314     <xsl:text>class </xsl:text>
  2392     <xsl:text>class </xsl:text>
  2315     <xsl:text>CircularBarWidget</xsl:text>
  2393     <xsl:text>CircularBarWidget</xsl:text>
  2316     <xsl:text> extends Widget{
  2394     <xsl:text> extends Widget{
  2317 </xsl:text>
  2395 </xsl:text>
  2409 </xsl:text>
  2487 </xsl:text>
  2410     <xsl:text>}
  2488     <xsl:text>}
  2411 </xsl:text>
  2489 </xsl:text>
  2412   </xsl:template>
  2490   </xsl:template>
  2413   <xsl:template match="widget[@type='CircularBar']" mode="widget_defs">
  2491   <xsl:template match="widget[@type='CircularBar']" mode="widget_defs">
  2414     <xsl:param name="hmi_element"/>
       
  2415     <xsl:param name="hmi_element"/>
  2492     <xsl:param name="hmi_element"/>
  2416     <xsl:call-template name="defs_by_labels">
  2493     <xsl:call-template name="defs_by_labels">
  2417       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2494       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2418       <xsl:with-param name="labels">
  2495       <xsl:with-param name="labels">
  2419         <xsl:text>path</xsl:text>
  2496         <xsl:text>path</xsl:text>
  2425         <xsl:text>value min max</xsl:text>
  2502         <xsl:text>value min max</xsl:text>
  2426       </xsl:with-param>
  2503       </xsl:with-param>
  2427       <xsl:with-param name="mandatory" select="'no'"/>
  2504       <xsl:with-param name="mandatory" select="'no'"/>
  2428     </xsl:call-template>
  2505     </xsl:call-template>
  2429   </xsl:template>
  2506   </xsl:template>
       
  2507   <xsl:template match="widget[@type='CircularSlider']" mode="widget_desc">
       
  2508     <type>
       
  2509       <xsl:value-of select="@type"/>
       
  2510     </type>
       
  2511     <longdesc>
       
  2512       <xsl:text>CircularSlider - DEPRECATED, to be replaced by PathSlider
       
  2513 </xsl:text>
       
  2514       <xsl:text>This widget moves "handle" labeled group along "range" labeled
       
  2515 </xsl:text>
       
  2516       <xsl:text>arc, according to value of the single accepted variable.
       
  2517 </xsl:text>
       
  2518       <xsl:text>
       
  2519 </xsl:text>
       
  2520       <xsl:text>If "min" a "max" labeled texts are provided, or if first and second
       
  2521 </xsl:text>
       
  2522       <xsl:text>argument are given, then they are used as respective minimum and maximum
       
  2523 </xsl:text>
       
  2524       <xsl:text>value. Otherwise, value is expected to be in between 0 and 100.
       
  2525 </xsl:text>
       
  2526       <xsl:text>
       
  2527 </xsl:text>
       
  2528       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
  2529 </xsl:text>
       
  2530       <xsl:text>During drag, "setpoint" labeled group is moved to position defined by user
       
  2531 </xsl:text>
       
  2532       <xsl:text>while "handle" reflects current value from variable.
       
  2533 </xsl:text>
       
  2534     </longdesc>
       
  2535     <shortdesc>
       
  2536       <xsl:text>CircularSlider - DEPRECATED</xsl:text>
       
  2537     </shortdesc>
       
  2538     <arg name="min" count="optional" accepts="int,real">
       
  2539       <xsl:text>minimum value</xsl:text>
       
  2540     </arg>
       
  2541     <arg name="min" count="optional" accepts="int,real">
       
  2542       <xsl:text>maximum value</xsl:text>
       
  2543     </arg>
       
  2544     <path name="value" accepts="HMI_INT,HMI_REAL">
       
  2545       <xsl:text>Value to display</xsl:text>
       
  2546     </path>
       
  2547   </xsl:template>
  2430   <xsl:template match="widget[@type='CircularSlider']" mode="widget_class">
  2548   <xsl:template match="widget[@type='CircularSlider']" mode="widget_class">
  2431     <xsl:text>class </xsl:text>
  2549     <xsl:text>class </xsl:text>
  2432     <xsl:text>CircularSliderWidget</xsl:text>
  2550     <xsl:text>CircularSliderWidget</xsl:text>
  2433     <xsl:text> extends Widget{
  2551     <xsl:text> extends Widget{
  2434 </xsl:text>
  2552 </xsl:text>
  2884 </xsl:text>
  3002 </xsl:text>
  2885     <xsl:text>}
  3003     <xsl:text>}
  2886 </xsl:text>
  3004 </xsl:text>
  2887   </xsl:template>
  3005   </xsl:template>
  2888   <xsl:template match="widget[@type='CircularSlider']" mode="widget_defs">
  3006   <xsl:template match="widget[@type='CircularSlider']" mode="widget_defs">
  2889     <xsl:param name="hmi_element"/>
       
  2890     <xsl:param name="hmi_element"/>
  3007     <xsl:param name="hmi_element"/>
  2891     <xsl:call-template name="defs_by_labels">
  3008     <xsl:call-template name="defs_by_labels">
  2892       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  3009       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2893       <xsl:with-param name="labels">
  3010       <xsl:with-param name="labels">
  2894         <xsl:text>handle range</xsl:text>
  3011         <xsl:text>handle range</xsl:text>
  2902       <xsl:with-param name="mandatory" select="'no'"/>
  3019       <xsl:with-param name="mandatory" select="'no'"/>
  2903     </xsl:call-template>
  3020     </xsl:call-template>
  2904     <xsl:text>
  3021     <xsl:text>
  2905 </xsl:text>
  3022 </xsl:text>
  2906   </xsl:template>
  3023   </xsl:template>
       
  3024   <xsl:template match="widget[@type='CustomHtml']" mode="widget_desc">
       
  3025     <type>
       
  3026       <xsl:value-of select="@type"/>
       
  3027     </type>
       
  3028     <longdesc>
       
  3029       <xsl:text>CustomHtml widget allows insertion of HTML code in a svg:foreignObject.
       
  3030 </xsl:text>
       
  3031       <xsl:text>Widget content is replaced by foreignObject. HTML code is obtained from
       
  3032 </xsl:text>
       
  3033       <xsl:text>"code" labeled text content. HTML insert position and size is given with
       
  3034 </xsl:text>
       
  3035       <xsl:text>"container" labeled element.
       
  3036 </xsl:text>
       
  3037     </longdesc>
       
  3038     <shortdesc>
       
  3039       <xsl:text>Custom HTML insert</xsl:text>
       
  3040     </shortdesc>
       
  3041   </xsl:template>
  2907   <xsl:template match="widget[@type='CustomHtml']" mode="widget_class">
  3042   <xsl:template match="widget[@type='CustomHtml']" mode="widget_class">
  2908     <xsl:text>class </xsl:text>
  3043     <xsl:text>class </xsl:text>
  2909     <xsl:text>CustomHtmlWidget</xsl:text>
  3044     <xsl:text>CustomHtmlWidget</xsl:text>
  2910     <xsl:text> extends Widget{
  3045     <xsl:text> extends Widget{
  2911 </xsl:text>
  3046 </xsl:text>
  2947 </xsl:text>
  3082 </xsl:text>
  2948     <xsl:text>}
  3083     <xsl:text>}
  2949 </xsl:text>
  3084 </xsl:text>
  2950   </xsl:template>
  3085   </xsl:template>
  2951   <xsl:template match="widget[@type='CustomHtml']" mode="widget_defs">
  3086   <xsl:template match="widget[@type='CustomHtml']" mode="widget_defs">
  2952     <xsl:param name="hmi_element"/>
       
  2953     <xsl:param name="hmi_element"/>
  3087     <xsl:param name="hmi_element"/>
  2954     <xsl:call-template name="defs_by_labels">
  3088     <xsl:call-template name="defs_by_labels">
  2955       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  3089       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2956       <xsl:with-param name="labels">
  3090       <xsl:with-param name="labels">
  2957         <xsl:text>container code</xsl:text>
  3091         <xsl:text>container code</xsl:text>
  2958       </xsl:with-param>
  3092       </xsl:with-param>
  2959     </xsl:call-template>
  3093     </xsl:call-template>
  2960   </xsl:template>
  3094   </xsl:template>
       
  3095   <xsl:template match="widget[@type='Display']" mode="widget_desc">
       
  3096     <type>
       
  3097       <xsl:value-of select="@type"/>
       
  3098     </type>
       
  3099     <longdesc>
       
  3100       <xsl:text>If Display widget is a svg:text element, then text content is replaced by
       
  3101 </xsl:text>
       
  3102       <xsl:text>value of given variables, space separated.
       
  3103 </xsl:text>
       
  3104       <xsl:text>
       
  3105 </xsl:text>
       
  3106       <xsl:text>Otherwise, if Display widget is a group containing a svg:text element
       
  3107 </xsl:text>
       
  3108       <xsl:text>labelled "format", then text content is replaced by printf-like formated
       
  3109 </xsl:text>
       
  3110       <xsl:text>string. In other words, if "format" labeled text is "%d %s %f", then 3
       
  3111 </xsl:text>
       
  3112       <xsl:text>variables paths are expected : HMI_IN, HMI_STRING and HMI_REAL.
       
  3113 </xsl:text>
       
  3114       <xsl:text>
       
  3115 </xsl:text>
       
  3116       <xsl:text>In case Display widget is a svg::text element, it is also possible to give
       
  3117 </xsl:text>
       
  3118       <xsl:text>format string as first argument.
       
  3119 </xsl:text>
       
  3120     </longdesc>
       
  3121     <shortdesc>
       
  3122       <xsl:text>Printf-like formated text display </xsl:text>
       
  3123     </shortdesc>
       
  3124     <arg name="format" count="optional" accepts="string">
       
  3125       <xsl:text>printf-like format string when not given as svg:text</xsl:text>
       
  3126     </arg>
       
  3127     <path name="fields" count="many" accepts="HMI_INT,HMI_REAL,HMI_STRING,HMI_BOOL">
       
  3128       <xsl:text>variables to be displayed</xsl:text>
       
  3129     </path>
       
  3130   </xsl:template>
  2961   <xsl:template match="widget[@type='Display']" mode="widget_class">
  3131   <xsl:template match="widget[@type='Display']" mode="widget_class">
  2962     <xsl:text>class </xsl:text>
  3132     <xsl:text>class </xsl:text>
  2963     <xsl:text>DisplayWidget</xsl:text>
  3133     <xsl:text>DisplayWidget</xsl:text>
  2964     <xsl:text> extends Widget{
  3134     <xsl:text> extends Widget{
  2965 </xsl:text>
  3135 </xsl:text>
  2975 </xsl:text>
  3145 </xsl:text>
  2976     <xsl:text>}
  3146     <xsl:text>}
  2977 </xsl:text>
  3147 </xsl:text>
  2978   </xsl:template>
  3148   </xsl:template>
  2979   <xsl:template match="widget[@type='Display']" mode="widget_defs">
  3149   <xsl:template match="widget[@type='Display']" mode="widget_defs">
  2980     <xsl:param name="hmi_element"/>
       
  2981     <xsl:param name="hmi_element"/>
  3150     <xsl:param name="hmi_element"/>
  2982     <xsl:variable name="format">
  3151     <xsl:variable name="format">
  2983       <xsl:call-template name="defs_by_labels">
  3152       <xsl:call-template name="defs_by_labels">
  2984         <xsl:with-param name="hmi_element" select="$hmi_element"/>
  3153         <xsl:with-param name="hmi_element" select="$hmi_element"/>
  2985         <xsl:with-param name="labels">
  3154         <xsl:with-param name="labels">
  3528     <xsl:text>}(); // eslint-disable-line    
  3697     <xsl:text>}(); // eslint-disable-line    
  3529 </xsl:text>
  3698 </xsl:text>
  3530     <xsl:text>
  3699     <xsl:text>
  3531 </xsl:text>
  3700 </xsl:text>
  3532   </xsl:template>
  3701   </xsl:template>
       
  3702   <xsl:template match="widget[@type='DropDown']" mode="widget_desc">
       
  3703     <type>
       
  3704       <xsl:value-of select="@type"/>
       
  3705     </type>
       
  3706     <longdesc>
       
  3707       <xsl:text>DropDown widget let user select an entry in a list of texts, given as
       
  3708 </xsl:text>
       
  3709       <xsl:text>arguments. Single variable path is index of selection.
       
  3710 </xsl:text>
       
  3711       <xsl:text>
       
  3712 </xsl:text>
       
  3713       <xsl:text>It needs "text" (svg:text), "box" (svg:rect), "button" (svg:*),
       
  3714 </xsl:text>
       
  3715       <xsl:text>and "highlight" (svg:rect) labeled elements.
       
  3716 </xsl:text>
       
  3717       <xsl:text>
       
  3718 </xsl:text>
       
  3719       <xsl:text>When user clicks on "button", "text" is duplicated to display enties in the
       
  3720 </xsl:text>
       
  3721       <xsl:text>limit of available space in page, and "box" is extended to contain all
       
  3722 </xsl:text>
       
  3723       <xsl:text>texts. "highlight" is moved over pre-selected entry.
       
  3724 </xsl:text>
       
  3725       <xsl:text>
       
  3726 </xsl:text>
       
  3727       <xsl:text>When only one argument is given, and argment contains "#langs" then list of
       
  3728 </xsl:text>
       
  3729       <xsl:text>texts is automatically set to the list of human-readable languages supported
       
  3730 </xsl:text>
       
  3731       <xsl:text>by this HMI. 
       
  3732 </xsl:text>
       
  3733     </longdesc>
       
  3734     <shortdesc>
       
  3735       <xsl:text>Let user select text entry in a drop-down menu</xsl:text>
       
  3736     </shortdesc>
       
  3737     <arg name="entries" count="many" accepts="string">
       
  3738       <xsl:text>drop-down menu entries</xsl:text>
       
  3739     </arg>
       
  3740     <path name="selection" accepts="HMI_INT">
       
  3741       <xsl:text>selection index</xsl:text>
       
  3742     </path>
       
  3743   </xsl:template>
  3533   <xsl:template match="widget[@type='DropDown']" mode="widget_class">
  3744   <xsl:template match="widget[@type='DropDown']" mode="widget_class">
  3534     <xsl:text>class </xsl:text>
  3745     <xsl:text>class </xsl:text>
  3535     <xsl:text>DropDownWidget</xsl:text>
  3746     <xsl:text>DropDownWidget</xsl:text>
  3536     <xsl:text> extends Widget{
  3747     <xsl:text> extends Widget{
  3537 </xsl:text>
  3748 </xsl:text>
  4189 </xsl:text>
  4400 </xsl:text>
  4190     <xsl:text>}
  4401     <xsl:text>}
  4191 </xsl:text>
  4402 </xsl:text>
  4192   </xsl:template>
  4403   </xsl:template>
  4193   <xsl:template match="widget[@type='DropDown']" mode="widget_defs">
  4404   <xsl:template match="widget[@type='DropDown']" mode="widget_defs">
  4194     <xsl:param name="hmi_element"/>
       
  4195     <xsl:param name="hmi_element"/>
  4405     <xsl:param name="hmi_element"/>
  4196     <xsl:call-template name="defs_by_labels">
  4406     <xsl:call-template name="defs_by_labels">
  4197       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  4407       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  4198       <xsl:with-param name="labels">
  4408       <xsl:with-param name="labels">
  4199         <xsl:text>text box button highlight</xsl:text>
  4409         <xsl:text>text box button highlight</xsl:text>
  4217       </xsl:otherwise>
  4427       </xsl:otherwise>
  4218     </xsl:choose>
  4428     </xsl:choose>
  4219     <xsl:text>,
  4429     <xsl:text>,
  4220 </xsl:text>
  4430 </xsl:text>
  4221   </xsl:template>
  4431   </xsl:template>
       
  4432   <xsl:template match="widget[@type='ForEach']" mode="widget_desc">
       
  4433     <type>
       
  4434       <xsl:value-of select="@type"/>
       
  4435     </type>
       
  4436     <longdesc>
       
  4437       <xsl:text>ForEach widget is used to span a small set of widget over a larger set of
       
  4438 </xsl:text>
       
  4439       <xsl:text>repeated HMI_NODEs. 
       
  4440 </xsl:text>
       
  4441       <xsl:text>
       
  4442 </xsl:text>
       
  4443       <xsl:text>Idea is somewhat similar to relative page, but it all happens inside the
       
  4444 </xsl:text>
       
  4445       <xsl:text>ForEach widget, no page involved.
       
  4446 </xsl:text>
       
  4447       <xsl:text>
       
  4448 </xsl:text>
       
  4449       <xsl:text>Together with relative Jump widgets it can be used to build a menu to reach
       
  4450 </xsl:text>
       
  4451       <xsl:text>relative pages covering many identical HMI_NODES siblings.
       
  4452 </xsl:text>
       
  4453       <xsl:text>
       
  4454 </xsl:text>
       
  4455       <xsl:text>ForEach widget takes a HMI_CLASS name as argument and a HMI_NODE path as
       
  4456 </xsl:text>
       
  4457       <xsl:text>variable.
       
  4458 </xsl:text>
       
  4459       <xsl:text>
       
  4460 </xsl:text>
       
  4461       <xsl:text>Direct sub-elements can be either groups of widget to be spanned, labeled
       
  4462 </xsl:text>
       
  4463       <xsl:text>"ClassName:offset", or buttons to control the spanning, labeled
       
  4464 </xsl:text>
       
  4465       <xsl:text>"ClassName:+/-number".
       
  4466 </xsl:text>
       
  4467     </longdesc>
       
  4468     <shortdesc>
       
  4469       <xsl:text>span widgets over a set of repeated HMI_NODEs</xsl:text>
       
  4470     </shortdesc>
       
  4471     <arg name="class_name" accepts="string">
       
  4472       <xsl:text>HMI_CLASS name</xsl:text>
       
  4473     </arg>
       
  4474     <path name="root" accepts="HMI_NODE">
       
  4475       <xsl:text> where to find HMI_NODEs whose HMI_CLASS is class_name</xsl:text>
       
  4476     </path>
       
  4477   </xsl:template>
  4222   <xsl:template match="widget[@type='ForEach']" mode="widget_defs">
  4478   <xsl:template match="widget[@type='ForEach']" mode="widget_defs">
  4223     <xsl:param name="hmi_element"/>
       
  4224     <xsl:param name="hmi_element"/>
  4479     <xsl:param name="hmi_element"/>
  4225     <xsl:if test="count(path) != 1">
  4480     <xsl:if test="count(path) != 1">
  4226       <xsl:message terminate="yes">
  4481       <xsl:message terminate="yes">
  4227         <xsl:text>ForEach widget </xsl:text>
  4482         <xsl:text>ForEach widget </xsl:text>
  4228         <xsl:value-of select="$hmi_element/@id"/>
  4483         <xsl:value-of select="$hmi_element/@id"/>
  4477       <xsl:value-of select="@type"/>
  4732       <xsl:value-of select="@type"/>
  4478     </type>
  4733     </type>
  4479     <longdesc>
  4734     <longdesc>
  4480       <xsl:text>Input widget takes one variable path, and displays current value in
  4735       <xsl:text>Input widget takes one variable path, and displays current value in
  4481 </xsl:text>
  4736 </xsl:text>
  4482       <xsl:text>optional "value" labeled sub-element. Click on optional "edit" labeled
  4737       <xsl:text>optional "value" labeled sub-element. 
  4483 </xsl:text>
  4738 </xsl:text>
  4484       <xsl:text>element opens keypad to edit value. Operation on current value is
  4739       <xsl:text>
  4485 </xsl:text>
  4740 </xsl:text>
  4486       <xsl:text>performed when click on sub-elements with label starting with '=', '+' 
  4741       <xsl:text>Click on optional "edit" labeled element opens keypad to edit value.
  4487 </xsl:text>
  4742 </xsl:text>
  4488       <xsl:text>or '-' sign. Value after sign is used as operand.
  4743       <xsl:text>
       
  4744 </xsl:text>
       
  4745       <xsl:text>Operation on current value is performed when click on sub-elements with
       
  4746 </xsl:text>
       
  4747       <xsl:text>label starting with '=', '+' or '-' sign. Value after sign is used as
       
  4748 </xsl:text>
       
  4749       <xsl:text>operand.
  4489 </xsl:text>
  4750 </xsl:text>
  4490     </longdesc>
  4751     </longdesc>
  4491     <shortdesc>
  4752     <shortdesc>
  4492       <xsl:text>Input field with predefined operation buttons</xsl:text>
  4753       <xsl:text>Input field with predefined operation buttons</xsl:text>
  4493     </shortdesc>
  4754     </shortdesc>
  4494     <arg accepts="string">
  4755     <arg name="format" accepts="string">
  4495       <xsl:text>optional printf-like format </xsl:text>
  4756       <xsl:text>optional printf-like format </xsl:text>
  4496     </arg>
  4757     </arg>
  4497     <path accepts="HMI_INT, HMI_REAL, HMI_STRING">
  4758     <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING">
  4498       <xsl:text>single variable to edit</xsl:text>
  4759       <xsl:text>single variable to edit</xsl:text>
  4499     </path>
  4760     </path>
  4500   </xsl:template>
  4761   </xsl:template>
  4501   <xsl:template match="widget[@type='Input']" mode="widget_class">
  4762   <xsl:template match="widget[@type='Input']" mode="widget_class">
  4502     <xsl:text>class </xsl:text>
  4763     <xsl:text>class </xsl:text>
  4648       <xsl:text>");
  4909       <xsl:text>");
  4649 </xsl:text>
  4910 </xsl:text>
  4650     </xsl:for-each>
  4911     </xsl:for-each>
  4651     <xsl:text>    },
  4912     <xsl:text>    },
  4652 </xsl:text>
  4913 </xsl:text>
       
  4914   </xsl:template>
       
  4915   <xsl:template match="widget[@type='JsonTable']" mode="widget_desc">
       
  4916     <type>
       
  4917       <xsl:value-of select="@type"/>
       
  4918     </type>
       
  4919     <longdesc>
       
  4920       <xsl:text>Send given variables as POST to http URL argument, spread returned JSON in
       
  4921 </xsl:text>
       
  4922       <xsl:text>SVG sub-elements of "data" labeled element.
       
  4923 </xsl:text>
       
  4924       <xsl:text>
       
  4925 </xsl:text>
       
  4926       <xsl:text>Documentation to be written. see svbghmi exemple.
       
  4927 </xsl:text>
       
  4928     </longdesc>
       
  4929     <shortdesc>
       
  4930       <xsl:text>Http POST variables, spread JSON back</xsl:text>
       
  4931     </shortdesc>
       
  4932     <arg name="url" accepts="string">
       
  4933       <xsl:text> </xsl:text>
       
  4934     </arg>
       
  4935     <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING">
       
  4936       <xsl:text>single variable to edit</xsl:text>
       
  4937     </path>
  4653   </xsl:template>
  4938   </xsl:template>
  4654   <xsl:template match="widget[@type='JsonTable']" mode="widget_class">
  4939   <xsl:template match="widget[@type='JsonTable']" mode="widget_class">
  4655     <xsl:text>class </xsl:text>
  4940     <xsl:text>class </xsl:text>
  4656     <xsl:text>JsonTableWidget</xsl:text>
  4941     <xsl:text>JsonTableWidget</xsl:text>
  4657     <xsl:text> extends Widget{
  4942     <xsl:text> extends Widget{
  5073     <xsl:text>        }
  5358     <xsl:text>        }
  5074 </xsl:text>
  5359 </xsl:text>
  5075   </xsl:template>
  5360   </xsl:template>
  5076   <xsl:template match="widget[@type='JsonTable']" mode="widget_defs">
  5361   <xsl:template match="widget[@type='JsonTable']" mode="widget_defs">
  5077     <xsl:param name="hmi_element"/>
  5362     <xsl:param name="hmi_element"/>
  5078     <xsl:param name="hmi_element"/>
       
  5079     <xsl:call-template name="defs_by_labels">
  5363     <xsl:call-template name="defs_by_labels">
  5080       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5364       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5081       <xsl:with-param name="labels">
  5365       <xsl:with-param name="labels">
  5082         <xsl:text>data</xsl:text>
  5366         <xsl:text>data</xsl:text>
  5083       </xsl:with-param>
  5367       </xsl:with-param>
  5118 </xsl:text>
  5402 </xsl:text>
  5119     </xsl:for-each>
  5403     </xsl:for-each>
  5120     <xsl:text>    }
  5404     <xsl:text>    }
  5121 </xsl:text>
  5405 </xsl:text>
  5122   </xsl:template>
  5406   </xsl:template>
       
  5407   <xsl:template match="widget[@type='Jump']" mode="widget_desc">
       
  5408     <type>
       
  5409       <xsl:value-of select="@type"/>
       
  5410     </type>
       
  5411     <longdesc>
       
  5412       <xsl:text>Jump widget brings focus to a different page. Mandatory single argument
       
  5413 </xsl:text>
       
  5414       <xsl:text>gives name of the page.
       
  5415 </xsl:text>
       
  5416       <xsl:text>
       
  5417 </xsl:text>
       
  5418       <xsl:text>Optional single path is used as new reference when jumping to a relative
       
  5419 </xsl:text>
       
  5420       <xsl:text>page, it must point to a HMI_NODE.
       
  5421 </xsl:text>
       
  5422       <xsl:text>
       
  5423 </xsl:text>
       
  5424       <xsl:text>"active"+"inactive" labeled elements can be provided and reflect current
       
  5425 </xsl:text>
       
  5426       <xsl:text>page being shown.
       
  5427 </xsl:text>
       
  5428       <xsl:text>
       
  5429 </xsl:text>
       
  5430       <xsl:text>"disabled" labeled element, if provided, is shown instead of "active" or
       
  5431 </xsl:text>
       
  5432       <xsl:text>"inactive" widget when pointed HMI_NODE is null.
       
  5433 </xsl:text>
       
  5434     </longdesc>
       
  5435     <shortdesc>
       
  5436       <xsl:text>Jump to given page</xsl:text>
       
  5437     </shortdesc>
       
  5438     <arg name="page" accepts="string">
       
  5439       <xsl:text>name of page to jump to</xsl:text>
       
  5440     </arg>
       
  5441     <path name="reference" count="optional" accepts="HMI_NODE">
       
  5442       <xsl:text>reference for relative jump</xsl:text>
       
  5443     </path>
       
  5444   </xsl:template>
  5123   <xsl:template match="widget[@type='Jump']" mode="widget_class">
  5445   <xsl:template match="widget[@type='Jump']" mode="widget_class">
  5124     <xsl:text>class </xsl:text>
  5446     <xsl:text>class </xsl:text>
  5125     <xsl:text>JumpWidget</xsl:text>
  5447     <xsl:text>JumpWidget</xsl:text>
  5126     <xsl:text> extends Widget{
  5448     <xsl:text> extends Widget{
  5127 </xsl:text>
  5449 </xsl:text>
  5235 </xsl:text>
  5557 </xsl:text>
  5236     <xsl:text>}
  5558     <xsl:text>}
  5237 </xsl:text>
  5559 </xsl:text>
  5238   </xsl:template>
  5560   </xsl:template>
  5239   <xsl:template match="widget[@type='Jump']" mode="widget_defs">
  5561   <xsl:template match="widget[@type='Jump']" mode="widget_defs">
  5240     <xsl:param name="hmi_element"/>
       
  5241     <xsl:param name="hmi_element"/>
  5562     <xsl:param name="hmi_element"/>
  5242     <xsl:variable name="activity">
  5563     <xsl:variable name="activity">
  5243       <xsl:call-template name="defs_by_labels">
  5564       <xsl:call-template name="defs_by_labels">
  5244         <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5565         <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5245         <xsl:with-param name="labels">
  5566         <xsl:with-param name="labels">
  5352     <xsl:text>
  5673     <xsl:text>
  5353 </xsl:text>
  5674 </xsl:text>
  5354     <xsl:text>
  5675     <xsl:text>
  5355 </xsl:text>
  5676 </xsl:text>
  5356   </xsl:template>
  5677   </xsl:template>
       
  5678   <xsl:template match="widget[@type='Keypad']" mode="widget_desc">
       
  5679     <type>
       
  5680       <xsl:value-of select="@type"/>
       
  5681     </type>
       
  5682     <longdesc>
       
  5683       <xsl:text>Keypad - to be written
       
  5684 </xsl:text>
       
  5685     </longdesc>
       
  5686     <shortdesc>
       
  5687       <xsl:text>Keypad </xsl:text>
       
  5688     </shortdesc>
       
  5689     <arg name="supported_types" accepts="string">
       
  5690       <xsl:text>keypad can input those types </xsl:text>
       
  5691     </arg>
       
  5692   </xsl:template>
  5357   <declarations:keypad/>
  5693   <declarations:keypad/>
  5358   <xsl:template match="declarations:keypad">
  5694   <xsl:template match="declarations:keypad">
  5359     <xsl:text>
  5695     <xsl:text>
  5360 </xsl:text>
  5696 </xsl:text>
  5361     <xsl:text>/* </xsl:text>
  5697     <xsl:text>/* </xsl:text>
  5582 </xsl:text>
  5918 </xsl:text>
  5583     <xsl:text>}
  5919     <xsl:text>}
  5584 </xsl:text>
  5920 </xsl:text>
  5585   </xsl:template>
  5921   </xsl:template>
  5586   <xsl:template match="widget[@type='Keypad']" mode="widget_defs">
  5922   <xsl:template match="widget[@type='Keypad']" mode="widget_defs">
  5587     <xsl:param name="hmi_element"/>
       
  5588     <xsl:param name="hmi_element"/>
  5923     <xsl:param name="hmi_element"/>
  5589     <xsl:call-template name="defs_by_labels">
  5924     <xsl:call-template name="defs_by_labels">
  5590       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5925       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5591       <xsl:with-param name="labels">
  5926       <xsl:with-param name="labels">
  5592         <xsl:text>Esc Enter BackSpace Keys Info Value</xsl:text>
  5927         <xsl:text>Esc Enter BackSpace Keys Info Value</xsl:text>
  5643     <xsl:text>, </xsl:text>
  5978     <xsl:text>, </xsl:text>
  5644     <xsl:value-of select="$g/@y"/>
  5979     <xsl:value-of select="$g/@y"/>
  5645     <xsl:text>],
  5980     <xsl:text>],
  5646 </xsl:text>
  5981 </xsl:text>
  5647   </xsl:template>
  5982   </xsl:template>
       
  5983   <xsl:template match="widget[@type='List']" mode="widget_desc">
       
  5984     <type>
       
  5985       <xsl:value-of select="@type"/>
       
  5986     </type>
       
  5987   </xsl:template>
  5648   <xsl:template match="widget[@type='List']" mode="widget_defs">
  5988   <xsl:template match="widget[@type='List']" mode="widget_defs">
  5649     <xsl:param name="hmi_element"/>
       
  5650     <xsl:param name="hmi_element"/>
  5989     <xsl:param name="hmi_element"/>
  5651     <xsl:text>    items: {
  5990     <xsl:text>    items: {
  5652 </xsl:text>
  5991 </xsl:text>
  5653     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  5992     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  5654       <xsl:text>        </xsl:text>
  5993       <xsl:text>        </xsl:text>
  5661     <xsl:text>    },
  6000     <xsl:text>    },
  5662 </xsl:text>
  6001 </xsl:text>
  5663   </xsl:template>
  6002   </xsl:template>
  5664   <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
  6003   <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
  5665     <xsl:param name="hmi_element"/>
  6004     <xsl:param name="hmi_element"/>
       
  6005   </xsl:template>
       
  6006   <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
  5666     <xsl:param name="hmi_element"/>
  6007     <xsl:param name="hmi_element"/>
  5667     <xsl:text>    styles: {
  6008     <xsl:text>    styles: {
  5668 </xsl:text>
  6009 </xsl:text>
  5669     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  6010     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  5670       <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/>
  6011       <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/>
  5676 </xsl:text>
  6017 </xsl:text>
  5677     </xsl:for-each>
  6018     </xsl:for-each>
  5678     <xsl:text>    },
  6019     <xsl:text>    },
  5679 </xsl:text>
  6020 </xsl:text>
  5680   </xsl:template>
  6021   </xsl:template>
       
  6022   <xsl:template match="widget[@type='Meter']" mode="widget_desc">
       
  6023     <type>
       
  6024       <xsl:value-of select="@type"/>
       
  6025     </type>
       
  6026     <longdesc>
       
  6027       <xsl:text>Meter widget moves the end of "needle" labeled path along "range" labeled
       
  6028 </xsl:text>
       
  6029       <xsl:text>path, according to value of the single accepted variable.
       
  6030 </xsl:text>
       
  6031       <xsl:text>
       
  6032 </xsl:text>
       
  6033       <xsl:text>Needle is reduced to a single segment. If "min" a "max" labeled texts
       
  6034 </xsl:text>
       
  6035       <xsl:text>are provided, or if first and second argument are given, then they are used
       
  6036 </xsl:text>
       
  6037       <xsl:text>as respective minimum and maximum value. Otherwise, value is expected to be
       
  6038 </xsl:text>
       
  6039       <xsl:text>in between 0 and 100.
       
  6040 </xsl:text>
       
  6041       <xsl:text>
       
  6042 </xsl:text>
       
  6043       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
  6044 </xsl:text>
       
  6045     </longdesc>
       
  6046     <shortdesc>
       
  6047       <xsl:text>Moves "needle" along "range"</xsl:text>
       
  6048     </shortdesc>
       
  6049     <arg name="min" count="optional" accepts="int,real">
       
  6050       <xsl:text>minimum value</xsl:text>
       
  6051     </arg>
       
  6052     <arg name="max" count="optional" accepts="int,real">
       
  6053       <xsl:text>maximum value</xsl:text>
       
  6054     </arg>
       
  6055     <path name="value" accepts="HMI_INT,HMI_REAL">
       
  6056       <xsl:text>Value to display</xsl:text>
       
  6057     </path>
       
  6058   </xsl:template>
  5681   <xsl:template match="widget[@type='Metter']" mode="widget_class">
  6059   <xsl:template match="widget[@type='Metter']" mode="widget_class">
  5682     <xsl:text>class </xsl:text>
  6060     <xsl:text>class </xsl:text>
  5683     <xsl:text>MetterWidget</xsl:text>
  6061     <xsl:text>MetterWidget</xsl:text>
  5684     <xsl:text> extends Widget{
  6062     <xsl:text> extends Widget{
  5685 </xsl:text>
  6063 </xsl:text>
  5737 </xsl:text>
  6115 </xsl:text>
  5738     <xsl:text>}
  6116     <xsl:text>}
  5739 </xsl:text>
  6117 </xsl:text>
  5740   </xsl:template>
  6118   </xsl:template>
  5741   <xsl:template match="widget[@type='Meter']" mode="widget_defs">
  6119   <xsl:template match="widget[@type='Meter']" mode="widget_defs">
  5742     <xsl:param name="hmi_element"/>
       
  5743     <xsl:param name="hmi_element"/>
  6120     <xsl:param name="hmi_element"/>
  5744     <xsl:call-template name="defs_by_labels">
  6121     <xsl:call-template name="defs_by_labels">
  5745       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  6122       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  5746       <xsl:with-param name="labels">
  6123       <xsl:with-param name="labels">
  5747         <xsl:text>needle range</xsl:text>
  6124         <xsl:text>needle range</xsl:text>
  5753         <xsl:text>value min max</xsl:text>
  6130         <xsl:text>value min max</xsl:text>
  5754       </xsl:with-param>
  6131       </xsl:with-param>
  5755       <xsl:with-param name="mandatory" select="'no'"/>
  6132       <xsl:with-param name="mandatory" select="'no'"/>
  5756     </xsl:call-template>
  6133     </xsl:call-template>
  5757   </xsl:template>
  6134   </xsl:template>
       
  6135   <xsl:template match="widget[@type='MultiState']" mode="widget_defs">
       
  6136     <xsl:param name="hmi_element"/>
       
  6137     <longdesc>
       
  6138       <xsl:text>Mutlistateh widget hides all subelements whose label do not match given
       
  6139 </xsl:text>
       
  6140       <xsl:text>variable value representation. For exemple if given variable type
       
  6141 </xsl:text>
       
  6142       <xsl:text>is HMI_INT and value is 1, then elements with label '1' will be displayed.
       
  6143 </xsl:text>
       
  6144       <xsl:text>Label can have comments, so '1#some comment' would also match. If matching
       
  6145 </xsl:text>
       
  6146       <xsl:text>variable of type HMI_STRING, then double quotes must be used. For exemple,
       
  6147 </xsl:text>
       
  6148       <xsl:text>'"hello"' or '"hello"#another comment' match HMI_STRING 'hello'.
       
  6149 </xsl:text>
       
  6150       <xsl:text>
       
  6151 </xsl:text>
       
  6152       <xsl:text>Click on widget changes variable value to next value in given list, or to
       
  6153 </xsl:text>
       
  6154       <xsl:text>first one if not initialized to value already part of the list.
       
  6155 </xsl:text>
       
  6156     </longdesc>
       
  6157     <shortdesc>
       
  6158       <xsl:text>Show elements whose label match value.</xsl:text>
       
  6159     </shortdesc>
       
  6160     <path name="value" accepts="HMI_INT,HMI_STRING">
       
  6161       <xsl:text>value to compare to labels</xsl:text>
       
  6162     </path>
       
  6163   </xsl:template>
  5758   <xsl:template match="widget[@type='MultiState']" mode="widget_class">
  6164   <xsl:template match="widget[@type='MultiState']" mode="widget_class">
  5759     <xsl:text>class </xsl:text>
  6165     <xsl:text>class </xsl:text>
  5760     <xsl:text>MultiStateWidget</xsl:text>
  6166     <xsl:text>MultiStateWidget</xsl:text>
  5761     <xsl:text> extends Widget{
  6167     <xsl:text> extends Widget{
  5762 </xsl:text>
  6168 </xsl:text>
  5838 </xsl:text>
  6244 </xsl:text>
  5839     <xsl:text>}
  6245     <xsl:text>}
  5840 </xsl:text>
  6246 </xsl:text>
  5841   </xsl:template>
  6247   </xsl:template>
  5842   <xsl:template match="widget[@type='MultiState']" mode="widget_defs">
  6248   <xsl:template match="widget[@type='MultiState']" mode="widget_defs">
  5843     <xsl:param name="hmi_element"/>
       
  5844     <xsl:param name="hmi_element"/>
  6249     <xsl:param name="hmi_element"/>
  5845     <xsl:text>    choices: [
  6250     <xsl:text>    choices: [
  5846 </xsl:text>
  6251 </xsl:text>
  5847     <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+|false|true)(#.*)?$'"/>
  6252     <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+|false|true)(#.*)?$'"/>
  5848     <xsl:for-each select="$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]">
  6253     <xsl:for-each select="$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]">
  5869 </xsl:text>
  6274 </xsl:text>
  5870     </xsl:for-each>
  6275     </xsl:for-each>
  5871     <xsl:text>    ],
  6276     <xsl:text>    ],
  5872 </xsl:text>
  6277 </xsl:text>
  5873   </xsl:template>
  6278   </xsl:template>
       
  6279   <xsl:template match="widget[@type='ScrollBar']" mode="widget_desc">
       
  6280     <type>
       
  6281       <xsl:value-of select="@type"/>
       
  6282     </type>
       
  6283     <longdesc>
       
  6284       <xsl:text>ScrollBar - documentation to be written
       
  6285 </xsl:text>
       
  6286     </longdesc>
       
  6287     <shortdesc>
       
  6288       <xsl:text>ScrollBar</xsl:text>
       
  6289     </shortdesc>
       
  6290     <path name="value" accepts="HMI_INT">
       
  6291       <xsl:text>value</xsl:text>
       
  6292     </path>
       
  6293     <path name="range" accepts="HMI_INT">
       
  6294       <xsl:text>range</xsl:text>
       
  6295     </path>
       
  6296     <path name="visible" accepts="HMI_INT">
       
  6297       <xsl:text>visible</xsl:text>
       
  6298     </path>
       
  6299   </xsl:template>
  5874   <xsl:template match="widget[@type='ScrollBar']" mode="widget_class">
  6300   <xsl:template match="widget[@type='ScrollBar']" mode="widget_class">
  5875     <xsl:text>class </xsl:text>
  6301     <xsl:text>class </xsl:text>
  5876     <xsl:text>ScrollBarWidget</xsl:text>
  6302     <xsl:text>ScrollBarWidget</xsl:text>
  5877     <xsl:text> extends Widget{
  6303     <xsl:text> extends Widget{
  5878 </xsl:text>
  6304 </xsl:text>
  6050 </xsl:text>
  6476 </xsl:text>
  6051     <xsl:text>}
  6477     <xsl:text>}
  6052 </xsl:text>
  6478 </xsl:text>
  6053   </xsl:template>
  6479   </xsl:template>
  6054   <xsl:template match="widget[@type='ScrollBar']" mode="widget_defs">
  6480   <xsl:template match="widget[@type='ScrollBar']" mode="widget_defs">
  6055     <xsl:param name="hmi_element"/>
       
  6056     <xsl:param name="hmi_element"/>
  6481     <xsl:param name="hmi_element"/>
  6057     <xsl:call-template name="defs_by_labels">
  6482     <xsl:call-template name="defs_by_labels">
  6058       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  6483       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  6059       <xsl:with-param name="labels">
  6484       <xsl:with-param name="labels">
  6060         <xsl:text>cursor range</xsl:text>
  6485         <xsl:text>cursor range</xsl:text>
  6082 </xsl:text>
  6507 </xsl:text>
  6083     </xsl:if>
  6508     </xsl:if>
  6084     <xsl:text>    },
  6509     <xsl:text>    },
  6085 </xsl:text>
  6510 </xsl:text>
  6086   </xsl:template>
  6511   </xsl:template>
       
  6512   <xsl:template match="widget[@type='Slider']" mode="widget_desc">
       
  6513     <type>
       
  6514       <xsl:value-of select="@type"/>
       
  6515     </type>
       
  6516     <longdesc>
       
  6517       <xsl:text>Slider - DEPRECATED - use ScrollBar or PathSlider instead
       
  6518 </xsl:text>
       
  6519     </longdesc>
       
  6520     <shortdesc>
       
  6521       <xsl:text>Slider - DEPRECATED - use ScrollBar instead</xsl:text>
       
  6522     </shortdesc>
       
  6523     <path name="value" accepts="HMI_INT">
       
  6524       <xsl:text>value</xsl:text>
       
  6525     </path>
       
  6526     <path name="range" accepts="HMI_INT">
       
  6527       <xsl:text>range</xsl:text>
       
  6528     </path>
       
  6529     <path name="visible" accepts="HMI_INT">
       
  6530       <xsl:text>visible</xsl:text>
       
  6531     </path>
       
  6532   </xsl:template>
  6087   <xsl:template match="widget[@type='Slider']" mode="widget_class">
  6533   <xsl:template match="widget[@type='Slider']" mode="widget_class">
  6088     <xsl:text>class </xsl:text>
  6534     <xsl:text>class </xsl:text>
  6089     <xsl:text>SliderWidget</xsl:text>
  6535     <xsl:text>SliderWidget</xsl:text>
  6090     <xsl:text> extends Widget{
  6536     <xsl:text> extends Widget{
  6091 </xsl:text>
  6537 </xsl:text>
  6761 </xsl:text>
  7207 </xsl:text>
  6762     <xsl:text>}
  7208     <xsl:text>}
  6763 </xsl:text>
  7209 </xsl:text>
  6764   </xsl:template>
  7210   </xsl:template>
  6765   <xsl:template match="widget[@type='Slider']" mode="widget_defs">
  7211   <xsl:template match="widget[@type='Slider']" mode="widget_defs">
  6766     <xsl:param name="hmi_element"/>
       
  6767     <xsl:param name="hmi_element"/>
  7212     <xsl:param name="hmi_element"/>
  6768     <xsl:call-template name="defs_by_labels">
  7213     <xsl:call-template name="defs_by_labels">
  6769       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  7214       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  6770       <xsl:with-param name="labels">
  7215       <xsl:with-param name="labels">
  6771         <xsl:text>handle range</xsl:text>
  7216         <xsl:text>handle range</xsl:text>
  6777         <xsl:text>value min max setpoint</xsl:text>
  7222         <xsl:text>value min max setpoint</xsl:text>
  6778       </xsl:with-param>
  7223       </xsl:with-param>
  6779       <xsl:with-param name="mandatory" select="'no'"/>
  7224       <xsl:with-param name="mandatory" select="'no'"/>
  6780     </xsl:call-template>
  7225     </xsl:call-template>
  6781   </xsl:template>
  7226   </xsl:template>
       
  7227   <xsl:template match="widget[@type='Switch']" mode="widget_desc">
       
  7228     <type>
       
  7229       <xsl:value-of select="@type"/>
       
  7230     </type>
       
  7231     <longdesc>
       
  7232       <xsl:text>Switch widget hides all subelements whose label do not match given
       
  7233 </xsl:text>
       
  7234       <xsl:text>variable current value representation. For exemple if given variable type
       
  7235 </xsl:text>
       
  7236       <xsl:text>is HMI_INT and value is 1, then elements with label '1' will be displayed.
       
  7237 </xsl:text>
       
  7238       <xsl:text>Label can have comments, so '1#some comment' would also match. If matching
       
  7239 </xsl:text>
       
  7240       <xsl:text>variable of type HMI_STRING, then double quotes must be used. For exemple,
       
  7241 </xsl:text>
       
  7242       <xsl:text>'"hello"' or '"hello"#another comment' match HMI_STRING 'hello'.
       
  7243 </xsl:text>
       
  7244     </longdesc>
       
  7245     <shortdesc>
       
  7246       <xsl:text>Show elements whose label match value.</xsl:text>
       
  7247     </shortdesc>
       
  7248     <path name="value" accepts="HMI_INT,HMI_STRING">
       
  7249       <xsl:text>value to compare to labels</xsl:text>
       
  7250     </path>
       
  7251   </xsl:template>
  6782   <xsl:template match="widget[@type='Switch']" mode="widget_class">
  7252   <xsl:template match="widget[@type='Switch']" mode="widget_class">
  6783     <xsl:text>class </xsl:text>
  7253     <xsl:text>class </xsl:text>
  6784     <xsl:text>SwitchWidget</xsl:text>
  7254     <xsl:text>SwitchWidget</xsl:text>
  6785     <xsl:text> extends Widget{
  7255     <xsl:text> extends Widget{
  6786 </xsl:text>
  7256 </xsl:text>
  6806 </xsl:text>
  7276 </xsl:text>
  6807     <xsl:text>}
  7277     <xsl:text>}
  6808 </xsl:text>
  7278 </xsl:text>
  6809   </xsl:template>
  7279   </xsl:template>
  6810   <xsl:template match="widget[@type='Switch']" mode="widget_defs">
  7280   <xsl:template match="widget[@type='Switch']" mode="widget_defs">
  6811     <xsl:param name="hmi_element"/>
       
  6812     <xsl:param name="hmi_element"/>
  7281     <xsl:param name="hmi_element"/>
  6813     <xsl:text>    choices: [
  7282     <xsl:text>    choices: [
  6814 </xsl:text>
  7283 </xsl:text>
  6815     <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+|false|true)(#.*)?$'"/>
  7284     <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+|false|true)(#.*)?$'"/>
  6816     <xsl:variable name="subelts" select="$result_widgets[@id = $hmi_element/@id]//*"/>
  7285     <xsl:variable name="subelts" select="$result_widgets[@id = $hmi_element/@id]//*"/>
  6840 </xsl:text>
  7309 </xsl:text>
  6841     </xsl:for-each>
  7310     </xsl:for-each>
  6842     <xsl:text>    ],
  7311     <xsl:text>    ],
  6843 </xsl:text>
  7312 </xsl:text>
  6844   </xsl:template>
  7313   </xsl:template>
       
  7314   <xsl:template match="widget[@type='ToggleButton']" mode="widget_desc">
       
  7315     <type>
       
  7316       <xsl:value-of select="@type"/>
       
  7317     </type>
       
  7318     <longdesc>
       
  7319       <xsl:text>Button widget takes one boolean variable path, and reflect current true
       
  7320 </xsl:text>
       
  7321       <xsl:text>or false value by showing "active" or "inactive" labeled element
       
  7322 </xsl:text>
       
  7323       <xsl:text>respectively. Clicking or touching button toggles variable.
       
  7324 </xsl:text>
       
  7325     </longdesc>
       
  7326     <shortdesc>
       
  7327       <xsl:text>Toggle button reflecting given boolean variable</xsl:text>
       
  7328     </shortdesc>
       
  7329     <path name="value" accepts="HMI_BOOL">
       
  7330       <xsl:text>Boolean variable</xsl:text>
       
  7331     </path>
       
  7332   </xsl:template>
  6845   <xsl:template match="widget[@type='ToggleButton']" mode="widget_class">
  7333   <xsl:template match="widget[@type='ToggleButton']" mode="widget_class">
  6846     <xsl:text>class </xsl:text>
  7334     <xsl:text>class </xsl:text>
  6847     <xsl:text>ToggleButtonWidget</xsl:text>
  7335     <xsl:text>ToggleButtonWidget</xsl:text>
  6848     <xsl:text> extends Widget{
  7336     <xsl:text> extends Widget{
  6849 </xsl:text>
  7337 </xsl:text>
  6923 </xsl:text>
  7411 </xsl:text>
  6924     <xsl:text>}
  7412     <xsl:text>}
  6925 </xsl:text>
  7413 </xsl:text>
  6926   </xsl:template>
  7414   </xsl:template>
  6927   <xsl:template match="widget[@type='ToggleButton']" mode="widget_defs">
  7415   <xsl:template match="widget[@type='ToggleButton']" mode="widget_defs">
  6928     <xsl:param name="hmi_element"/>
       
  6929     <xsl:param name="hmi_element"/>
  7416     <xsl:param name="hmi_element"/>
  6930     <xsl:call-template name="defs_by_labels">
  7417     <xsl:call-template name="defs_by_labels">
  6931       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  7418       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  6932       <xsl:with-param name="labels">
  7419       <xsl:with-param name="labels">
  6933         <xsl:text>active inactive</xsl:text>
  7420         <xsl:text>active inactive</xsl:text>