svghmi/parse_labels.ysl2
changeset 3593 122b1094b8e6
parent 3592 b2bdb8b433e0
child 3594 30f7eade322f
--- a/svghmi/parse_labels.ysl2	Fri Aug 12 09:34:24 2022 +0200
+++ b/svghmi/parse_labels.ysl2	Fri Aug 19 10:22:16 2022 +0200
@@ -2,7 +2,7 @@
 
 
 //  Parses:
-//  "HMI:WidgetType|freq:param1:param2@path1,path1min,path1max@path2"
+//  "HMI:WidgetType|freq:param1:param2@path1,path1min,path1max@path2#"
 //
 //  Into:
 //  widget type="WidgetType" id="blah456" {
@@ -75,7 +75,18 @@
                 attrib "value" > «.»
             }
         }
-        const "paths", "substring-after($declaration,'@')";
+        const "tail", "substring-after($declaration,'@')";
+        const "taillen","string-length($tail)";
+        const "has_enable", "substring($tail,$taillen,1)='#'";
+        const "paths" choose{
+            when "$has_enable" {
+               value "substring($tail,1,$taillen - 1)";
+            }
+            otherwise value "$tail";
+        }
+        if "$has_enable" {
+            attrib "has_enable" > yes
+        }
         foreach "str:split($paths, '@')" {
             if "string-length(.) > 0" path {
                 // 1 : global match