svghmi/svghmi.py
branchsvghmi
changeset 2775 3b93409ba22c
parent 2772 3f1dd8312710
child 2779 75c6a31caca6
--- a/svghmi/svghmi.py	Thu Sep 12 12:56:47 2019 +0200
+++ b/svghmi/svghmi.py	Mon Sep 16 10:54:15 2019 +0200
@@ -170,6 +170,7 @@
         variable_decl_array = []
         extern_variables_declarations = []
         buf_index = 0
+        item_count = 0
         for node in hmi_tree_root.traverse():
             if hasattr(node, "iectype"):
                 sz = DebugTypesSize.get(node.iectype, 0)
@@ -183,6 +184,7 @@
                     }[node.vartype] + ", " +
                     str(buf_index) + ", 0, }"]
                 buf_index += sz
+                item_count += 1
                 if len(node.path) == 1:
                     extern_variables_declarations += [
                         "extern __IEC_" + node.iectype + "_" +
@@ -208,6 +210,7 @@
             "variable_decl_array": ",\n".join(variable_decl_array),
             "extern_variables_declarations": "\n".join(extern_variables_declarations),
             "buffer_size": buf_index,
+            "item_count": item_count,
             "var_access_code": targets.GetCode("var_access.c"),
             "PLC_ticktime": self.GetCTR().GetTicktime()
             }