clearing previous highlights from the view

This commit is contained in:
guga kakhadze 2025-06-30 13:58:42 +04:00
parent ad11f16062
commit ae38f1a21c
2 changed files with 11 additions and 160 deletions

View File

@ -25,12 +25,12 @@ def handleTagHighlight(view, currentValue):
Docked_East_View = Docked_East_Map["MCM"]
components = view.rootContainer.getChildren()
priority = parts[1]
# if priority == "":
# priority = "Default"
foundMatch = False
# clear all highlights and apply new one when found
for child in components:
params = child.props.get("params", {})
tagProps = params.get("tagProps", {})
@ -39,11 +39,13 @@ def handleTagHighlight(view, currentValue):
if len(tagsList) == 0:
continue
tagPath = tagsList[0]
child.props.style.classes = ""
tagPath = tagsList[0]
if tag == tagPath:
child.props.style["classes"] = "Highlight/Pulse-" + priority
system.perspective.openDock(Docked_East_View, params={'tagProps': tagProps})
return True
foundMatch = True
return False
return foundMatch

View File

@ -69,7 +69,7 @@
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tdata \u003d self.props.selection.data\n\t\n\tsystem.perspective.print(alarms.alarm_click.handleClick(data))\n\t\n\tsystem.perspective.print(\"clicked\")"
"script": "\tdata \u003d self.props.selection.data\n\t\n\talarms.alarm_click.handleClick(data)"
},
"scope": "G",
"type": "script"
@ -969,75 +969,6 @@
},
"pager": {
"bottom": false
},
"selection": {
"data": [
{
"Description": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "FL2078_2_VFD1 - Voltage"
},
"Device": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "FL2078_2_VFD1"
},
"Duration": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "07:38:49"
},
"FullTag": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "System/MCM01/Conveyor/FL2078_2_VFD1/Voltage"
},
"ID": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": 8
},
"Location": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "MCM01"
},
"Priority": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "Diagnostic"
},
"StartTimestamp": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": {
"$": [
"ts",
0,
1750964284885
],
"$ts": 1750936755000
}
},
"Tag": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "FL2078_2_VFD1.HMI.Voltage"
}
}
],
"selectedColumn": "ID",
"selectedRow": 2
}
},
"type": "ia.display.table"
@ -2047,88 +1978,6 @@
"pager": {
"activeOption": 5,
"bottom": false
},
"selection": {
"data": [
{
"Count": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": 1
},
"Description": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "UL1_4_VFD1 - Voltage"
},
"Device": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "UL1_4_VFD1"
},
"Duration": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "07:39:06"
},
"FirstTimestamp": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": {
"$": [
"ts",
0,
1750964283987
],
"$ts": 1750936737000
}
},
"FullTag": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "System/MCM02/Conveyor/UL1_4_VFD1/Voltage"
},
"LastTimestamp": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": {
"$": [
"ts",
0,
1750964283987
],
"$ts": 1750936737000
}
},
"Location": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "MCM02"
},
"Priority": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "Diagnostic"
},
"Tag": {
"style": {
"classes": "Alarms-Styles/Diagnostic"
},
"value": "UL1_4_VFD1.HMI.Voltage"
}
}
],
"selectedColumn": "FirstTimestamp",
"selectedRow": 3
}
},
"type": "ia.display.table"