SVGHMI: More build time optimization : def_by_label now takes far less time. svghmi
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 24 Feb 2021 15:36:37 +0100
branchsvghmi
changeset 3162 fbe1ffaa56cf
parent 3161 edd558965f58
child 3164 ea4a61b4a325
SVGHMI: More build time optimization : def_by_label now takes far less time.
svghmi/widgets_common.ysl2
--- a/svghmi/widgets_common.ysl2	Tue Feb 23 10:07:21 2021 +0100
+++ b/svghmi/widgets_common.ysl2	Wed Feb 24 15:36:37 2021 +0100
@@ -347,6 +347,7 @@
 
 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]";
+const "result_widgets","$result_svg_ns//*[@id = $hmi_widgets/@id]";
 
 emit "declarations:hmi-elements" {
     | var hmi_widgets = {
@@ -362,7 +363,7 @@
     const "widget_type","@type";
     foreach "str:split($labels)" {
         const "name",".";
-        const "elt","$result_svg_ns//*[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]";
+        const "elt","$result_widgets[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]";
         choose {
             when "not($elt/@id)" {
                 if "$mandatory='yes'" {