diff --git a/BNA8/ignition/script-python/autStand/Utils/code.py b/BNA8/ignition/script-python/autStand/Utils/code.py index 546a465b..ab79332e 100644 --- a/BNA8/ignition/script-python/autStand/Utils/code.py +++ b/BNA8/ignition/script-python/autStand/Utils/code.py @@ -24,12 +24,12 @@ def handleTagHighlight(view, currentValue): if "MCM" in deviceName: Docked_East_View = Docked_East_Map["MCM"] - components = view.rootContainer.getChildren() + components = view.rootContainer.getChildren()[0].getChildren() priority = parts[1] foundMatch = False - + # clear all highlights and apply new one when found for child in components: params = child.props.get("params", {}) diff --git a/BNA8/ignition/script-python/autStand/config/project_config/code.py b/BNA8/ignition/script-python/autStand/config/project_config/code.py index b776b3a4..8b7f1aca 100644 --- a/BNA8/ignition/script-python/autStand/config/project_config/code.py +++ b/BNA8/ignition/script-python/autStand/config/project_config/code.py @@ -5,8 +5,8 @@ global_project_page_ids = {} def get_project_config(): """ Scan each view.json under Detailed_Views (no recursion), - read top-level children, extract tagProps[0], - and store as {source_id: view_folder_name}. + go one level deeper (coordinateContainer), extract tagProps[0] + from children, and store as {source_id: view_folder_name}. """ global global_project_page_ids global_project_page_ids.clear() @@ -21,7 +21,7 @@ def get_project_config(): ) if not os.path.exists(base_path): - system.perspective.print("❌ Path not found: " + base_path) + system.perspective.print("Path not found: " + base_path) return {} for view_folder in os.listdir(base_path): @@ -32,8 +32,16 @@ def get_project_config(): with open(json_file, "r") as fh: view_json = json.load(fh) - # only top-level children - children = (view_json.get("root") or {}).get("children") or [] + # go one level deeper: root -> children[0] (coordinateContainer) -> its children + root_children = (view_json.get("root") or {}).get("children") or [] + if not root_children: + continue + + # assume first child is the coordinateContainer + container = root_children[0] + children = container.get("children") or [] + + # now loop through these children to get tagProps for child in children: props = child.get("props") or {} params = props.get("params") or {} @@ -42,7 +50,7 @@ def get_project_config(): if isinstance(tag_props, list) and len(tag_props) > 0: source_id = str(tag_props[0]) global_project_page_ids[source_id] = view_folder - + system.perspective.print("Found: {} -> {}".format(source_id, view_folder)) except: whid = system.tag.readBlocking("Configuration/FC")[0].value