diff --git a/MTN6_SCADA/ignition/script-python/utils/code.py b/MTN6_SCADA/ignition/script-python/utils/code.py index 3b8d075..546a465 100644 --- a/MTN6_SCADA/ignition/script-python/utils/code.py +++ b/MTN6_SCADA/ignition/script-python/utils/code.py @@ -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 \ No newline at end of file + return foundMatch \ No newline at end of file diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Navigation-Views/Docked-South/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Navigation-Views/Docked-South/view.json index 41e5e65..add594e 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Navigation-Views/Docked-South/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Navigation-Views/Docked-South/view.json @@ -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"