--- a/svghmi/svghmi.py Tue Aug 20 10:08:11 2019 +0200
+++ b/svghmi/svghmi.py Tue Aug 20 10:30:59 2019 +0200
@@ -55,16 +55,17 @@
def place_node(self, node):
- for child in self.children:
- for child_path_item, node_path_item in izip(child.path, node.path):
- if child_path_item == node_path_item:
- if in_common > known_best_match:
- known_best_match = in_common
+ for child in self.children : + if child.path is not None: + for child_path_item, node_path_item in izip(child.path, node.path): + if child_path_item == node_path_item: + if in_common > known_best_match: + known_best_match = in_common if best_child is not None and best_child.nodetype == "HMI_LABEL":
best_child.place_node(node)
@@ -116,10 +117,10 @@
hmi_tree_root = HMITreeNode(None, "/", "HMI_ROOT")
- # TODO add always available variables here ?
+ map(lambda (n,t): hmi_tree_root.children.append(HMITreeNode(None,n,t)), [ + ("plc_status", "HMI_PLC_STATUS"), + ("current_page", "HMI_CURRENT_PAGE")]) # deduce HMI tree from PLC HMI_* instances
for v in hmi_types_instances: