# HG changeset patch # User Edouard Tisserant # Date 1584428433 -3600 # Node ID b67af0b8dc72fd9daffcab47493ec48d0b525e6c # Parent 022db76c3bffd6b83e9c372ba7d0bc91b5d01327 SVGHMI: more debug code moved to hmi_tree.ysl2 diff -r 022db76c3bff -r b67af0b8dc72 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Tue Mar 17 07:39:50 2020 +0100 +++ b/svghmi/gen_index_xhtml.xslt Tue Mar 17 08:00:33 2020 +0100 @@ -215,6 +215,36 @@ + + + + + + + + + =" + + " + + + + + + + + + + + Raw HMI tree + + + + + Indexed HMI tree + + + @@ -345,10 +375,13 @@ - - - - + + + debug_hmitree: + + + + Detachable : @@ -1468,26 +1501,6 @@ //})(); - - - - - - - - - =" - - " - - - - - - - - - diff -r 022db76c3bff -r b67af0b8dc72 svghmi/gen_index_xhtml.ysl2 --- a/svghmi/gen_index_xhtml.ysl2 Tue Mar 17 07:39:50 2020 +0100 +++ b/svghmi/gen_index_xhtml.ysl2 Tue Mar 17 08:00:33 2020 +0100 @@ -264,16 +264,9 @@ comment > Made with SVGHMI. https://beremiz.org // use python to call all debug output from included definitions - // '&bug' is a workaround for old pyPEG that choke on empty python results - !"&bug "+"\n".join(["comment {|\n| %s:\n call \"%s\";\n| \n}"%(n,n) for n in debug_output_calls])! - - // TODO - comment { - apply "$hmitree", mode="testtree"; - } - comment { - apply "$indexed_hmitree", mode="testtree"; - } + // '&bug' is a workaround for pyPEG that choke on yml2 python results not parsing to a single call + !"&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"{ @@ -514,17 +507,6 @@ // } - /**/ - template "*", mode="testtree"{ - param "indent", "''"; - > «$indent» «local-name()» - foreach "@*" > «local-name()»="«.»" - > \n - apply "*", mode="testtree" { - with "indent" value "concat($indent,'>')" - }; - } - /**/ function "defs_by_labels" { param "labels","''"; diff -r 022db76c3bff -r b67af0b8dc72 svghmi/hmi_tree.ysl2 --- a/svghmi/hmi_tree.ysl2 Tue Mar 17 07:39:50 2020 +0100 +++ b/svghmi/hmi_tree.ysl2 Tue Mar 17 08:00:33 2020 +0100 @@ -45,3 +45,22 @@ with "parentpath" > «$parentpath» } } + +// Debug data +template "*", mode="testtree"{ + param "indent", "''"; + > «$indent» «local-name()» + foreach "@*" > «local-name()»="«.»" + > \n + apply "*", mode="testtree" { + with "indent" value "concat($indent,'>')" + }; +} +function "debug_hmitree" { + | Raw HMI tree + apply "$hmitree", mode="testtree"; + | + | Indexed HMI tree + apply "$indexed_hmitree", mode="testtree"; +} +!debug_output_calls.append("debug_hmitree")