SVGHMI: Prevent excluded widget to appear in generated pages' widget list. svghmi
authorEdouard Tisserant
Tue, 02 Feb 2021 10:59:00 +0100
branchsvghmi
changeset 3121 8094494113b6
parent 3119 17a9c7a334f7
child 3122 229795c03e11
SVGHMI: Prevent excluded widget to appear in generated pages' widget list.
svghmi/detachable_pages.ysl2
svghmi/widgets_common.ysl2
--- a/svghmi/detachable_pages.ysl2	Tue Jan 26 11:17:08 2021 +0100
+++ b/svghmi/detachable_pages.ysl2	Tue Feb 02 10:59:00 2021 +0100
@@ -109,7 +109,7 @@
 }
 
 const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
-const "forEach_widgets", "$hmi_elements[@id = $forEach_widgets_ids]";
+const "forEach_widgets", "$hmi_widgets[@id = $forEach_widgets_ids]";
 const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
 
 template "svg:*", mode="page_desc" {
@@ -121,7 +121,7 @@
 
     const "page_all_elements", "func:all_related_elements($page)";
 
-    const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]";
+    const "all_page_widgets","$hmi_widgets[@id = $page_all_elements/@id and @id != $page/@id]";
     const "page_managed_widgets","$all_page_widgets[not(@id=$in_forEach_widget_ids)]";
     const "page_relative_widgets",
         "$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
--- a/svghmi/widgets_common.ysl2	Tue Jan 26 11:17:08 2021 +0100
+++ b/svghmi/widgets_common.ysl2	Tue Feb 02 10:59:00 2021 +0100
@@ -288,12 +288,13 @@
 }
 ||
 
-const "excluded_types", "str:split('Page Lang VarInit')";
+const "excluded_types", "str:split('Page VarInit')";
 const "included_ids","$parsed_widgets/widget[not(@type = $excluded_types) and not(@id = $discardable_elements/@id)]/@id";
+const "hmi_widgets","$hmi_elements[@id = $included_ids]";
 
 emit "declarations:hmi-elements" {
     | var hmi_widgets = {
-    apply "$hmi_elements[@id = $included_ids]", mode="hmi_widgets";
+    apply "$hmi_widgets", mode="hmi_widgets";
     | }
 }