SVGHMI: Stop ignoring HMI_NODE in HMI tree, and count it as a BOOL. Soon we use those nodes as reference for relative page jump, and as an "enable" bit for features associated to an HMI tree fragment. svghmi
authorEdouard Tisserant
Thu, 12 Mar 2020 13:14:38 +0100
branchsvghmi
changeset 2866 59a855c17aa6
parent 2865 545902730141
child 2867 901c89c0cc08
SVGHMI: Stop ignoring HMI_NODE in HMI tree, and count it as a BOOL. Soon we use those nodes as reference for relative page jump, and as an "enable" bit for features associated to an HMI tree fragment.
svghmi/gen_index_xhtml.ysl2
svghmi/svghmi.py
--- a/svghmi/gen_index_xhtml.ysl2	Thu Mar 12 09:33:20 2020 +0100
+++ b/svghmi/gen_index_xhtml.ysl2	Thu Mar 12 13:14:38 2020 +0100
@@ -65,7 +65,6 @@
 
     const "_categories" {
         noindex > HMI_ROOT
-        noindex > HMI_NODE
         noindex > HMI_PLC_STATUS
         noindex > HMI_CURRENT_PAGE
     }
@@ -282,7 +281,10 @@
                         attrib "hmipath" > «$path»
                         foreach "@*" xsl:copy;
                     }
-                    /* no node expected below value nodes */
+                    apply "*[1]", mode="index"{
+                         with "index", "$index + 1";
+                         with "parentpath" > «$path»
+                    }
                 }
                 otherwise {
                     apply "*[1]", mode="index"{
--- a/svghmi/svghmi.py	Thu Mar 12 09:33:20 2020 +0100
+++ b/svghmi/svghmi.py	Thu Mar 12 13:14:38 2020 +0100
@@ -220,7 +220,7 @@
                 extern_variables_declarations += [
                     "#define heartbeat_index "+str(hmi_tree_hearbeat_index)
                 ]
-            if hasattr(node, "iectype") and node.nodetype != "HMI_NODE":
+            if hasattr(node, "iectype"):
                 sz = DebugTypesSize.get(node.iectype, 0)
                 variable_decl_array += [
                     "{&(" + node.cpath + "), " + node.iectype + {