svghmi/widgets_common.ysl2
branchwxPython4
changeset 3688 c2992796a859
parent 3686 a3c509e66695
child 3702 6dc619fa28aa
--- a/svghmi/widgets_common.ysl2	Sun Nov 20 18:36:13 2022 +0100
+++ b/svghmi/widgets_common.ysl2	Wed Nov 23 14:18:25 2022 +0100
@@ -134,7 +134,7 @@
     |   "«@id»": new «$widget/@type»Widget ("«@id»",«$freq»,[«$args»],[«$variables»],«$enable_expr»,{
     if "$widget/@enable_expr" {
 
-    |       assignments: [],
+    |       enable_assignments: [],
     |       compute_enable: function(value, oldval, varnum) {
     |         let result = false;
     |         do {
@@ -142,8 +142,8 @@
             const "varid","generate-id()";
             const "varnum","position()-1";
             if "@assign" foreach "$widget/path[@assign]" if "$varid = generate-id()" {
-    |           if(varnum == «$varnum») this.assignments[«position()-1»] = value;
-    |           let «@assign» = this.assignments[«position()-1»];
+    |           if(varnum == «$varnum») this.enable_assignments[«position()-1»] = value;
+    |           let «@assign» = this.enable_assignments[«position()-1»];
     |           if(«@assign» == undefined) break;
             }
         }
@@ -600,12 +600,14 @@
 }
 
 const "included_ids","$parsed_widgets/widget[not(@type = $excluded_types) and not(@id = $discardable_elements/@id)]/@id";
+const "page_ids","$parsed_widgets/widget[@type = 'Page']/@id";
 const "hmi_widgets","$hmi_elements[@id = $included_ids]";
+const "page_widgets","$hmi_elements[@id = $page_ids]";
 const "result_widgets","$result_svg_ns//*[@id = $hmi_widgets/@id]";
 
 emit "declarations:hmi-elements" {
     | var hmi_widgets = {
-    apply "$hmi_widgets", mode="hmi_widgets";
+    apply "$hmi_widgets | $page_widgets", mode="hmi_widgets";
     | }
     |
 }