# HG changeset patch # User Edouard Tisserant # Date 1584529610 -3600 # Node ID f398896b7ebf13fb06d5af5513299cda5eead3ac # Parent 50b9832c51fc2e53cdd3a2c9cb4f83542e682131 SVGHMI: intermediate untested state. Excluded ForEach widget from pages handled widgets. diff -r 50b9832c51fc -r f398896b7ebf svghmi/detachable_pages.ysl2 --- a/svghmi/detachable_pages.ysl2 Wed Mar 18 09:37:26 2020 +0100 +++ b/svghmi/detachable_pages.ysl2 Wed Mar 18 12:06:50 2020 +0100 @@ -1,4 +1,4 @@ -// detachable_elements.ysl2 +// detachable_pages.ysl2 // // compute what elements are required by pages // and decide where to cut when removing/attaching @@ -98,6 +98,7 @@ result "string-length($ancest) > 0 and starts-with($descend,$ancest)"; } + template "svg:*", mode="page_desc" { const "desc", "func:parselabel(@inkscape:label)/widget"; const "page", "."; @@ -105,7 +106,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_elements[@id = $page_all_elements/@id and @id != $page/@id][not(func:parselabels(ancestor::svg:*)/widget/@type = 'ForEach')]"; const "page_relative_widgets", "$all_page_widgets[func:is_descendant_path(func:parselabel(@inkscape:label)/widget/path/@value, $desc/path/@value)]"; diff -r 50b9832c51fc -r f398896b7ebf svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Wed Mar 18 09:37:26 2020 +0100 +++ b/svghmi/gen_index_xhtml.xslt Wed Mar 18 12:06:50 2020 +0100 @@ -133,6 +133,17 @@ + + + + + + + + + + + @@ -314,7 +325,7 @@ - + " diff -r 50b9832c51fc -r f398896b7ebf svghmi/hmi_tree.ysl2 --- a/svghmi/hmi_tree.ysl2 Wed Mar 18 09:37:26 2020 +0100 +++ b/svghmi/hmi_tree.ysl2 Wed Mar 18 12:06:50 2020 +0100 @@ -101,6 +101,18 @@ result "exsl:node-set($ast)"; } +def "func:parselabels" { + param "nodes"; + choose{ + when "$nodes"{ + result """func:parselabel($nodes[1]/@inkscape:label) + | func:parselabels($nodes[position()!=1])"""; + }otherwise{ + result "/.."; + } + } +} + // Debug data template "*", mode="testtree"{ param "indent", "''";