35 lines
779 B
Python

def handleTagHighlight(view, currentValue):
tag = currentValue.value
if tag == "":
return
splitedTag = str(tag).split("/")
deviceName = splitedTag[-1]
system.perspective.print(splitedTag)
tagCopy = tag
if "PE" in deviceName:
tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1"
system.perspective.print(tag)
components = view.rootContainer.getChildren()
for child in components:
params = child.props.get("params", {})
tagProps = params.get("tagProps", {})
tagsList = list(tagProps)
if len(tagsList) == 0:
continue
tagPath = tagsList[0]
if tag == tagPath:
child.props.params["isHighlighted"] = True
system.perspective.openDock('Docked-East-VFD', params={'tagProps': tagProps})
return True
return False