equal
deleted
inserted
replaced
111 |
111 |
112 """ |
112 """ |
113 |
113 |
114 # Filter known HMI types |
114 # Filter known HMI types |
115 hmi_types_instances = [v for v in varlist if v["derived"] in HMI_TYPES] |
115 hmi_types_instances = [v for v in varlist if v["derived"] in HMI_TYPES] |
116 # TODO XXX !!! filter intermediate variables added for FBD feedback loop |
116 |
117 |
117 hmi_tree_root = HMITreeNode(None, "/", "HMI_ROOT") |
118 hmi_tree_root = HMITreeNode(None, "hmi0", "HMI_ROOT") |
|
119 |
118 |
120 # TODO add always available variables here ? |
119 # TODO add always available variables here ? |
121 # - plc status |
120 # - plc status |
122 # - current page |
121 # - current page |
123 # - ... |
122 # - ... |
124 |
123 |
125 # deduce HMI tree from PLC HMI_* instances |
124 # deduce HMI tree from PLC HMI_* instances |
126 for v in hmi_types_instances: |
125 for v in hmi_types_instances: |
127 path = v["IEC_path"].split(".") |
126 path = v["IEC_path"].split(".") |
|
127 # ignores variables starting with _TMP_ |
|
128 if path[-1].startswith("_TMP_"): |
|
129 continue |
128 new_node = HMITreeNode(path, path[-1], v["derived"]) |
130 new_node = HMITreeNode(path, path[-1], v["derived"]) |
129 hmi_tree_root.place_node(new_node) |
131 hmi_tree_root.place_node(new_node) |
130 |
132 |
131 print(hmi_tree_root.pprint()) |
133 print(hmi_tree_root.pprint()) |
132 |
134 |