SVGHMI: cosmetic changes svghmi
authorEdouard Tisserant
Thu, 19 Mar 2020 09:57:26 +0100
branchsvghmi
changeset 2887 30cea13267b4
parent 2886 6c82fad8be65
child 2888 7beddc62a388
SVGHMI: cosmetic changes
svghmi/detachable_pages.ysl2
svghmi/gen_index_xhtml.xslt
--- a/svghmi/detachable_pages.ysl2	Thu Mar 19 09:31:07 2020 +0100
+++ b/svghmi/detachable_pages.ysl2	Thu Mar 19 09:57:26 2020 +0100
@@ -1,18 +1,16 @@
 // detachable_pages.ysl2
 //
 // compute what elements are required by pages
-// and decide where to cut when removing/attaching 
+// and decide where to cut when removing/attaching
 // pages elements on page switch
 
-const "hmi_pages_ids", "$parsed_widgets/widget[@type = 'Page']/@id";
-const "hmi_pages", "$hmi_elements[@id = $hmi_pages_ids]";
+const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
+const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
 
 const "default_page" choose {
     when "count($hmi_pages) > 1" {
-        const "Home_page", 
-            "$hmi_pages[func:widget(@id)/arg[1]/@value = 'Home']";
         choose {
-            when "$Home_page" > Home
+            when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
             otherwise {
                 error "No Home page defined!";
             }
--- a/svghmi/gen_index_xhtml.xslt	Thu Mar 19 09:31:07 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Thu Mar 19 09:57:26 2020 +0100
@@ -242,14 +242,13 @@
     <xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
     <func:result select="$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or &#10;                          (not(@Id = $groups/@id) and (func:intersect($g, .) &gt; 0 ))]"/>
   </func:function>
-  <xsl:variable name="hmi_pages_ids" select="$parsed_widgets/widget[@type = 'Page']/@id"/>
-  <xsl:variable name="hmi_pages" select="$hmi_elements[@id = $hmi_pages_ids]"/>
+  <xsl:variable name="hmi_pages_descs" select="$parsed_widgets/widget[@type = 'Page']"/>
+  <xsl:variable name="hmi_pages" select="$hmi_elements[@id = $hmi_pages_descs/@id]"/>
   <xsl:variable name="default_page">
     <xsl:choose>
       <xsl:when test="count($hmi_pages) &gt; 1">
-        <xsl:variable name="Home_page" select="$hmi_pages[func:widget(@id)/arg[1]/@value = 'Home']"/>
         <xsl:choose>
-          <xsl:when test="$Home_page">
+          <xsl:when test="$hmi_pages_descs/arg[1]/@value = 'Home'">
             <xsl:text>Home</xsl:text>
           </xsl:when>
           <xsl:otherwise>