SVGHMI: Fixed support for frequency parsing in widget label
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 19 Jan 2022 08:51:45 +0100
changeset 3412 04c4835ca376
parent 3411 3e162ea3c726
child 3413 2e84a2782295
SVGHMI: Fixed support for frequency parsing in widget label
svghmi/parse_labels.ysl2
svghmi/widgets_common.ysl2
--- a/svghmi/parse_labels.ysl2	Tue Jan 18 11:35:05 2022 +0100
+++ b/svghmi/parse_labels.ysl2	Wed Jan 19 08:51:45 2022 +0100
@@ -34,7 +34,7 @@
         otherwise value "$args";
     }
 
-    const "freq", "substring-after($typefreq,':')";
+    const "freq", "substring-after($typefreq,'|')";
 
     const "_type", "substring-before($typefreq,'|')";
     const "type" choose {
@@ -44,7 +44,7 @@
     if "$type" widget {
         attrib "id" > «$id»
         attrib "type" > «$type»
-        if "freq" attrib "frequency" > «$freq»
+        if "$freq" attrib "freq" > «$freq»
         foreach "str:split(substring-after($args, ':'), ':')" {
             arg {
                 attrib "value" > «.»
--- a/svghmi/widgets_common.ysl2	Tue Jan 18 11:35:05 2022 +0100
+++ b/svghmi/widgets_common.ysl2	Wed Jan 19 08:51:45 2022 +0100
@@ -84,8 +84,8 @@
     }
 
     const "freq" choose {
-        when "$widget/freq"
-            > «$widget/freq»
+        when "$widget/@freq"
+            > «$widget/@freq»
         otherwise
             > undefined
     }