SVGHMI: HMI:Switch now accepts boolean values 'true' and 'false' svghmi
authorEdouard Tisserant
Tue, 31 Mar 2020 13:20:15 +0200
branchsvghmi
changeset 2907 1695122a5e16
parent 2906 3b4a1319da09
child 2908 01352aca1cae
SVGHMI: HMI:Switch now accepts boolean values 'true' and 'false'
svghmi/gen_index_xhtml.xslt
svghmi/widget_switch.ysl2
--- a/svghmi/gen_index_xhtml.xslt	Mon Mar 30 14:26:42 2020 +0200
+++ b/svghmi/gen_index_xhtml.xslt	Tue Mar 31 13:20:15 2020 +0200
@@ -1249,7 +1249,7 @@
 </xsl:text>
     <xsl:text>    choices: [
 </xsl:text>
-    <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+)(#.*)?$'"/>
+    <xsl:variable name="regex" select="'^(&quot;[^&quot;].*&quot;|\-?[0-9]+|false|true)(#.*)?$'"/>
     <xsl:for-each select="$hmi_element/*[regexp:test(@inkscape:label,$regex)]">
       <xsl:variable name="literal" select="regexp:match(@inkscape:label,$regex)[2]"/>
       <xsl:text>        {
--- a/svghmi/widget_switch.ysl2	Mon Mar 30 14:26:42 2020 +0200
+++ b/svghmi/widget_switch.ysl2	Tue Mar 31 13:20:15 2020 +0200
@@ -16,7 +16,7 @@
     |         // Hello Switch
     |     },
     |     choices: [
-    const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+)(#.*)?$'"!;
+    const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
     foreach "$hmi_element/*[regexp:test(@inkscape:label,$regex)]" {
         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
     |         {