48 lines
1000 B
Plaintext
48 lines
1000 B
Plaintext
def handleClick(data):
|
|
if not data or len(data) != 1:
|
|
return
|
|
|
|
system.perspective.print(data)
|
|
|
|
|
|
row = data[0]
|
|
clickedTagPath = row.get("FullTag", "")
|
|
MCM = row.get("Location", "")
|
|
|
|
MCM_Pages_Map = {
|
|
"MCM01": "autStand/Detailed_Views/MCM01-FLUID INBOUND",
|
|
"MCM02": "autStand/Detailed_Views/MCM02-NON CON SORTER",
|
|
}
|
|
|
|
|
|
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)})
|