BNA8/.resources/13ff96ddd53ec8d45450ef5a2a56241a8474b67059ab141276590b792d482d4a

49 lines
1.2 KiB
Plaintext

def handleClick(data):
if not data or len(data) != 1:
return
row = data[0]
clickedTagPath = row.get("FullTag", "")
MCM = row.get("Location", "")
MCM_Pages_Map = {
"MCM01": "Detailed-Views/MCM01 Fluid Inbound Merges 1-4",
"MCM02": "Detailed-Views/MCM02 Fluid Inbound Merges 5-7",
"MCM03": "Detailed-Views/MCM03 Non Con",
"MCM04": "Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM05": "Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM06": "Detailed-Views/MCM06 Non Con",
"MCM07": "Detailed-Views/MCM07 Bypass",
}
page = MCM_Pages_Map.get(MCM)
if not page:
return
device = row.get("Device", "")
if not device or not clickedTagPath:
return
pathToDevice = ""
# check for the mcm
if "MCM" in device:
parts = clickedTagPath.split("/")
pathToDevice = "/".join(parts[:3])
else:
index = clickedTagPath.find(device)
if index == -1:
return
pathToDevice = clickedTagPath[:index + len(device)]
priority = row.get("Priority", "")
#combining with priority
combined = pathToDevice + "||" + priority
# Navigate to target view, passing the tag to highlight
system.perspective.navigate(view = page, params = {'highlightTagPath': str(combined)})