SVGHMI: moved debug code svghmi
authorEdouard Tisserant
Tue, 17 Mar 2020 10:34:26 +0100
branchsvghmi
changeset 2876 d2adbc273125
parent 2875 6a12e1084deb
child 2877 682bce953795
SVGHMI: moved debug code
svghmi/detachable_elements.ysl2
svghmi/gen_index_xhtml.xslt
svghmi/gen_index_xhtml.ysl2
--- a/svghmi/detachable_elements.ysl2	Tue Mar 17 09:29:04 2020 +0100
+++ b/svghmi/detachable_elements.ysl2	Tue Mar 17 10:34:26 2020 +0100
@@ -73,3 +73,9 @@
 const "_detachable_elements", "func:detachable_elements($hmi_pages)";
 const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
 
+function "debug_detachables" {
+    foreach "$detachable_elements"{
+        |  «@id»
+    }
+}
+!debug_output_calls.append("debug_detachables")
--- a/svghmi/gen_index_xhtml.xslt	Tue Mar 17 09:29:04 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Tue Mar 17 10:34:26 2020 +0100
@@ -156,6 +156,14 @@
   </func:function>
   <xsl:variable name="_detachable_elements" select="func:detachable_elements($hmi_pages)"/>
   <xsl:variable name="detachable_elements" select="$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]"/>
+  <xsl:template name="debug_detachables">
+    <xsl:for-each select="$detachable_elements">
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@id"/>
+      <xsl:text>
+</xsl:text>
+    </xsl:for-each>
+  </xsl:template>
   <xsl:variable name="hmitree" select="ns:GetHMITree()"/>
   <xsl:variable name="_indexed_hmitree">
     <xsl:apply-templates mode="index" select="$hmitree"/>
@@ -377,6 +385,15 @@
     <xsl:comment>
       <xsl:text>
 </xsl:text>
+      <xsl:text>debug_detachables:
+</xsl:text>
+      <xsl:call-template name="debug_detachables"/>
+      <xsl:text>
+</xsl:text>
+    </xsl:comment>
+    <xsl:comment>
+      <xsl:text>
+</xsl:text>
       <xsl:text>debug_hmitree:
 </xsl:text>
       <xsl:call-template name="debug_hmitree"/>
@@ -384,24 +401,6 @@
 </xsl:text>
     </xsl:comment>
     <xsl:comment>
-      <xsl:text>Detachable :
-</xsl:text>
-      <xsl:for-each select="$detachable_elements">
-        <xsl:value-of select="@id"/>
-        <xsl:text>
-</xsl:text>
-      </xsl:for-each>
-    </xsl:comment>
-    <xsl:comment>
-      <xsl:text>Discardable :
-</xsl:text>
-      <xsl:for-each select="$discardable_elements">
-        <xsl:value-of select="@id"/>
-        <xsl:text>
-</xsl:text>
-      </xsl:for-each>
-    </xsl:comment>
-    <xsl:comment>
       <xsl:text>Unlinked :
 </xsl:text>
       <xsl:for-each select="$to_unlink">
--- a/svghmi/gen_index_xhtml.ysl2	Tue Mar 17 09:29:04 2020 +0100
+++ b/svghmi/gen_index_xhtml.ysl2	Tue Mar 17 10:34:26 2020 +0100
@@ -198,18 +198,6 @@
         !"&bug {"+"\n".join(["comment {\n| \n| %s:\n call \"%s\";\n| \n}"%(n,n) for n in debug_output_calls]) +"}"!
 
         comment {
-            | Detachable :
-            foreach "$detachable_elements"{
-                | «@id»
-            }
-        }
-        comment {
-            | Discardable :
-            foreach "$discardable_elements"{
-                | «@id»
-            }
-        }
-        comment {
             | Unlinked :
             foreach "$to_unlink"{
                 | «@id»