From 0abb58ffdd54c8495cb0931602db6e9569904e0a Mon Sep 17 00:00:00 2001 From: guga kakhadze Date: Thu, 26 Jun 2025 14:03:40 +0400 Subject: [PATCH 1/5] first version of showing the alarm in the detailed view when clicking on it in the alarms table --- .../MCM01 Fluid Inbound Merges 1-4/view.json | 48 +++- .../MCM02 Fluid Inbound Merges 5-7/view.json | 48 +++- .../MCM02 Fluid Inbound Upper/view.json | 48 +++- .../Detailed-Views/MCM03 Non Con/view.json | 48 +++- .../Detailed-Views/MCM04 Chutes/view.json | 48 +++- .../view.json | 14 +- .../Detailed-Views/MCM05 Chutes/view.json | 48 +++- .../view.json | 14 +- .../Detailed-Views/MCM06 Non Con/view.json | 48 +++- .../Detailed-Views/MCM07 Bypass/view.json | 48 +++- .../ignition/script-python/utils/code.py | 25 ++ .../views/Alarm-Views/RealTime/view.json | 217 ++++++++++++++++-- .../Equipment-Views/Status/view.json | 32 ++- 13 files changed, 661 insertions(+), 25 deletions(-) create mode 100644 MTN6_SCADA/ignition/script-python/utils/code.py diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM01 Fluid Inbound Merges 1-4/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM01 Fluid Inbound Merges 1-4/view.json index 1848e5a..20924e5 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM01 Fluid Inbound Merges 1-4/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM01 Fluid Inbound Merges 1-4/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\n\tutils.handleTagHighlight(self.view, currentValue)\n\n\t" + }, + "paramDirection": "inout", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -18254,6 +18266,40 @@ "path": "Symbol-Views/Equipment-Views/Status" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "FL2078_2" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 153.37, + "y": 233.80263412475585 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": false, + "isHighlighted": false, + "tagProps": [ + "System/MCM01/Conveyor/FL2078_2_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Merges 5-7/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Merges 5-7/view.json index a8e6e35..e5cacfa 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Merges 5-7/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Merges 5-7/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tfound \u003d utils.handleTagHighlight(self.view, currentValue)\n\tif not found:\n\t\tMCM02_upper \u003d \"Detailed-Views/MCM02 Fluid Inbound Upper\"\n\t\tsystem.perspective.navigate(view \u003d MCM02_upper, params \u003d {\u0027highlightTagPath\u0027:currentValue})\n\t\t" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -11740,6 +11752,40 @@ "path": "Symbol-Views/Equipment-Views/Status" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL1_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 153.37, + "y": 233.8 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM02/Conveyor/UL11_4_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Upper/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Upper/view.json index 344a202..c99fbf6 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Upper/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM02 Fluid Inbound Upper/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -3218,6 +3230,40 @@ "path": "Symbol-Views/Equipment-Views/ControlCabinet" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL1_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 462.25543701171875, + "y": 144.8 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM02/Conveyor/UL1_4_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM03 Non Con/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM03 Non Con/view.json index 48f4b11..ed2f035 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM03 Non Con/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM03 Non Con/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -6684,6 +6696,40 @@ "path": "Custom-Views/Area_Nav_Button" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL21_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 925.26, + "y": 368.2377040863037 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM03/Conveyor/UL21_4_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 Chutes/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 Chutes/view.json index e2f6615..35df43b 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 Chutes/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 Chutes/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -15144,6 +15156,40 @@ "path": "Symbol-Views/Equipment-Views/JR_Button" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL31_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 238.53, + "y": 229.05 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM04/Conveyor/UL31_3_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve/view.json index 6e3f960..fe08a56 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tfound \u003d utils.handleTagHighlight(self.view, currentValue)\n\tif not found:\n\t\tMCM04_Chutes \u003d \"Detailed-Views/MCM04 Chutes\"\n\t\tsystem.perspective.navigate(view \u003d MCM04_Chutes, params \u003d {\u0027highlightTagPath\u0027:currentValue})" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 Chutes/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 Chutes/view.json index cf527ff..924de3c 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 Chutes/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 Chutes/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -17644,6 +17656,40 @@ "path": "Symbol-Views/Equipment-Views/JR_Button" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL41_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 817.5041870117187, + "y": 398.6770935058594 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": true, + "tagProps": [ + "System/MCM05/Conveyor/UL41_4_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve/view.json index 8c62d80..0726060 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tfound \u003d utils.handleTagHighlight(self.view, currentValue)\n\tif not found:\n\t\tMCM05_Chutes \u003d \"Detailed-Views/MCM05 Chutes\"\n\t\tsystem.perspective.navigate(view \u003d MCM05_Chutes, params \u003d {\u0027highlightTagPath\u0027:currentValue})" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM06 Non Con/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM06 Non Con/view.json index a68aa58..7f700a7 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM06 Non Con/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM06 Non Con/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -9794,6 +9806,40 @@ "path": "Symbol-Views/Equipment-Views/JR_Button" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL51_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 477.18125, + "y": 287.8645935058594 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM06/Conveyor/UL51_4_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM07 Bypass/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM07 Bypass/view.json index c1352e2..6c9452e 100644 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM07 Bypass/view.json +++ b/MTN6_SCADA/com.inductiveautomation.perspective/views/Detailed-Views/MCM07 Bypass/view.json @@ -1,6 +1,18 @@ { "custom": {}, - "params": {}, + "params": { + "highlightTagPath": "" + }, + "propConfig": { + "params.highlightTagPath": { + "onChange": { + "enabled": null, + "script": "\tutils.handleTagHighlight(self.view, currentValue)" + }, + "paramDirection": "input", + "persistent": true + } + }, "props": { "defaultSize": { "height": 1028, @@ -14075,6 +14087,40 @@ "path": "Symbol-Views/Equipment-Views/Button" }, "type": "ia.display.view" + }, + { + "meta": { + "name": "UL61_4" + }, + "position": { + "height": 20.05, + "width": 19.98, + "x": 506.78416793823243, + "y": 218.8391774749756 + }, + "props": { + "params": { + "directionLeft": false, + "forceFaultStatus": null, + "forceRunningStatus": null, + "has_state": true, + "isHighlighted": false, + "tagProps": [ + "System/MCM07/Conveyor/UL61_3_VFD1", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value", + "value" + ] + }, + "path": "Symbol-Views/Equipment-Views/Status" + }, + "type": "ia.display.view" } ], "meta": { diff --git a/MTN6_SCADA/ignition/script-python/utils/code.py b/MTN6_SCADA/ignition/script-python/utils/code.py new file mode 100644 index 0000000..8d65268 --- /dev/null +++ b/MTN6_SCADA/ignition/script-python/utils/code.py @@ -0,0 +1,25 @@ +def handleTagHighlight(view, currentValue): + tag = currentValue.value + + if tag == "": + return + + 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}) + break + return True + + return False \ No newline at end of file diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json index 8281b2c..8798b42 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json @@ -13,16 +13,10 @@ } } }, - "params": { - "page_name": "Alarms-RealTime" - }, + "params": {}, "propConfig": { "custom.activityLogger": { "persistent": true - }, - "params.page_name": { - "paramDirection": "input", - "persistent": true } }, "props": { @@ -488,6 +482,7 @@ ], "custom": { "priorities": { + "critical": false, "diagnostic": false, "high": false, "low": false, @@ -691,6 +686,17 @@ { "children": [ { + "events": { + "component": { + "onRowClick": { + "config": { + "script": "\tdata \u003d self.props.selection.data\n\tif not data or len(data) !\u003d 1:\n\t return\n\t\n\trow \u003d data[0]\n\tclickedTagPath \u003d row.get(\"FullTag\", \"\")\n\tMCM \u003d row.get(\"Location\", \"\")\n\t\n\tMCM_Pages_Map \u003d {\n\t\t\"MCM01\": \"Detailed-Views/MCM01 Fluid Inbound Merges 1-4\",\n\t\t\"MCM02\": \"Detailed-Views/MCM02 Fluid Inbound Merges 5-7\",\n\t\t\"MCM03\": \"Detailed-Views/MCM03 Non Con\",\n\t\t\"MCM04\": \"Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM05\": \"Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM06\": \"Detailed-Views/MCM06 Non Con\",\n\t\t\"MCM07\": \"Detailed-Views/MCM07 Bypass\",\n\t}\n\t\n\n\tpage \u003d MCM_Pages_Map.get(MCM)\n\t\n\tif not page:\n\t return\n\t\t\n\tdevice \u003d row.get(\"Device\", \"\")\n\t\n\tif not device or not clickedTagPath:\n\t\treturn\n\n\tindex \u003d clickedTagPath.find(device)\n\tif index \u003d\u003d -1:\n\t\treturn\n\t\n\tpathToDevice \u003d clickedTagPath[:index + len(device)]\n\t\t\n\t# Navigate to target view, passing the tag to highlight\n\tsystem.perspective.navigate(view \u003d page, params \u003d {\u0027highlightTagPath\u0027:pathToDevice})\n\t\n\t\n" + }, + "scope": "G", + "type": "script" + } + } + }, "meta": { "name": "Table" }, @@ -1179,7 +1185,7 @@ }, "render": "auto", "resizable": true, - "sort": "none", + "sort": "ascending", "sortable": true, "strictWidth": false, "style": { @@ -1379,6 +1385,192 @@ "viewPath": "", "visible": true, "width": 80 + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "FullTag", + "filter": { + "boolean": { + "condition": "" + }, + "date": { + "condition": "", + "value": "" + }, + "enabled": false, + "number": { + "condition": "", + "value": "" + }, + "string": { + "condition": "", + "value": "" + }, + "visible": "on-hover" + }, + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "justify": "auto", + "nullFormat": { + "includeNullStrings": false, + "nullFormatValue": "", + "strict": false + }, + "number": "value", + "numberFormat": "0,0.##", + "progressBar": { + "bar": { + "color": "", + "style": { + "classes": "" + } + }, + "max": 100, + "min": 0, + "track": { + "color": "", + "style": { + "classes": "" + } + }, + "value": { + "enabled": true, + "format": "0,0.##", + "justify": "center", + "style": { + "classes": "" + } + } + }, + "render": "auto", + "resizable": true, + "sort": "none", + "sortable": true, + "strictWidth": false, + "style": { + "classes": "", + "display": "none" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "Device", + "filter": { + "boolean": { + "condition": "" + }, + "date": { + "condition": "", + "value": "" + }, + "enabled": false, + "number": { + "condition": "", + "value": "" + }, + "string": { + "condition": "", + "value": "" + }, + "visible": "on-hover" + }, + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "justify": "auto", + "nullFormat": { + "includeNullStrings": false, + "nullFormatValue": "", + "strict": false + }, + "number": "value", + "numberFormat": "0,0.##", + "progressBar": { + "bar": { + "color": "", + "style": { + "classes": "" + } + }, + "max": 100, + "min": 0, + "track": { + "color": "", + "style": { + "classes": "" + } + }, + "value": { + "enabled": true, + "format": "0,0.##", + "justify": "center", + "style": { + "classes": "" + } + } + }, + "render": "auto", + "resizable": true, + "sort": "none", + "sortable": true, + "strictWidth": false, + "style": { + "classes": "", + "display": "none" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" } ], "emptyMessage": { @@ -2900,7 +3092,7 @@ "$": [ "ts", 192, - 1750755617512 + 1750866213319 ], "$ts": 1750435156149 }, @@ -2908,7 +3100,7 @@ "$": [ "ts", 192, - 1750755617511 + 1750866213319 ], "$ts": 1750436956149 } @@ -3856,7 +4048,7 @@ "$": [ "ts", 192, - 1750755617512 + 1750866213319 ], "$ts": 1750435156149 }, @@ -3864,7 +4056,7 @@ "$": [ "ts", 192, - 1750755617511 + 1750866213319 ], "$ts": 1750436956149 }, @@ -4123,7 +4315,6 @@ "contentStyle": { "classes": "Background-Styles/Grey-Background" }, - "currentTabIndex": 2, "menuType": "modern", "style": { "classes": "Background-Styles/Grey-Background" diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json index aad4fcb..2e8dcef 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json @@ -1,9 +1,10 @@ { "custom": { + "alarm_message": null, "covert_mode": true, "disconnected": true, "display_icon": true, - "plc": "value", + "plc": "System", "priority": 0, "priority_string": "No Active Alarms", "running": false, @@ -16,8 +17,9 @@ "directionLeft": false, "forceFaultStatus": null, "forceRunningStatus": null, + "isHighlighted": false, "tagProps": [ - "value", + "System/MCM01/Conveyor/UL1_3_VFD1", "value", "value", "value", @@ -300,6 +302,10 @@ "paramDirection": "input", "persistent": true }, + "params.isHighlighted": { + "paramDirection": "input", + "persistent": true + }, "params.tagProps": { "paramDirection": "inout", "persistent": true @@ -502,6 +508,28 @@ ], "type": "property" } + }, + "props.style.classes": { + "binding": { + "config": { + "expression": "{view.params.isHighlighted}" + }, + "transforms": [ + { + "fallback": "", + "inputType": "scalar", + "mappings": [ + { + "input": true, + "output": "State-Styles/State101" + } + ], + "outputType": "style-list", + "type": "map" + } + ], + "type": "expr" + } } }, "props": { From f98724dad6b34edb8e72fff77e44e32d476bfb18 Mon Sep 17 00:00:00 2001 From: guga kakhadze Date: Thu, 26 Jun 2025 15:48:03 +0400 Subject: [PATCH 2/5] when clicking on the photoeye alarm highlighting the conveyor it is based on --- MTN6_SCADA/ignition/script-python/utils/code.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MTN6_SCADA/ignition/script-python/utils/code.py b/MTN6_SCADA/ignition/script-python/utils/code.py index 8d65268..29d8067 100644 --- a/MTN6_SCADA/ignition/script-python/utils/code.py +++ b/MTN6_SCADA/ignition/script-python/utils/code.py @@ -3,6 +3,17 @@ def handleTagHighlight(view, currentValue): 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() @@ -19,7 +30,6 @@ def handleTagHighlight(view, currentValue): if tag == tagPath: child.props.params["isHighlighted"] = True system.perspective.openDock('Docked-East-VFD', params={'tagProps': tagProps}) - break return True return False \ No newline at end of file From 6ad1847adc33d678d4c4ccf4b6e3e70bc17ad47e Mon Sep 17 00:00:00 2001 From: guga kakhadze Date: Thu, 26 Jun 2025 17:06:50 +0400 Subject: [PATCH 3/5] Modified the alarm row click event to handle the case when alarm comes from the MCM. Now highliting the component is universal and no longer requires params or extra bindings. --- .../style-classes/Highlight/Pulse/style.json | 19 +++++ .../ignition/script-python/utils/code.py | 17 ++-- .../style-classes/Highlight/Pulse/style.json | 18 +++++ .../views/Alarm-Views/RealTime/view.json | 80 +++++++++++++++++-- .../Equipment-Views/Status/view.json | 27 ------- 5 files changed, 121 insertions(+), 40 deletions(-) create mode 100644 MTN6_SCADA/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json create mode 100644 SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json b/MTN6_SCADA/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json new file mode 100644 index 0000000..17f5fde --- /dev/null +++ b/MTN6_SCADA/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json @@ -0,0 +1,19 @@ +{ + "base": { + "animation": { + "duration": "2.5s", + "timingFunction": "ease-in-out", + "keyframes": { + "0%": { + "boxShadow": "0 0 12px 5px rgba(255, 255, 0, 0.8)" + }, + "50%": { + "boxShadow": "0 0 20px 8px rgba(255, 255, 0, 1)" + }, + "100%": { + "boxShadow": "0 0 5px 2px rgba(255, 255, 0, 0.3)" + } + } + } + } +} \ No newline at end of file diff --git a/MTN6_SCADA/ignition/script-python/utils/code.py b/MTN6_SCADA/ignition/script-python/utils/code.py index 29d8067..a8f08cb 100644 --- a/MTN6_SCADA/ignition/script-python/utils/code.py +++ b/MTN6_SCADA/ignition/script-python/utils/code.py @@ -7,13 +7,18 @@ def handleTagHighlight(view, currentValue): splitedTag = str(tag).split("/") deviceName = splitedTag[-1] - system.perspective.print(splitedTag) - - tagCopy = tag + Docked_East_Map = { + "VFD" : "Docked-East-VFD", + "MCM" : "Docked-East-MCM" + } + + Docked_East_View = Docked_East_Map["VFD"] if "PE" in deviceName: tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1" - system.perspective.print(tag) + + if "MCM" in deviceName: + Docked_East_View = Docked_East_Map["MCM"] components = view.rootContainer.getChildren() @@ -28,8 +33,8 @@ def handleTagHighlight(view, currentValue): tagPath = tagsList[0] if tag == tagPath: - child.props.params["isHighlighted"] = True - system.perspective.openDock('Docked-East-VFD', params={'tagProps': tagProps}) + child.props.style["classes"] = "Highlight/Pulse" + system.perspective.openDock(Docked_East_View, params={'tagProps': tagProps}) return True return False \ No newline at end of file diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json new file mode 100644 index 0000000..825d919 --- /dev/null +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/style-classes/Highlight/Pulse/style.json @@ -0,0 +1,18 @@ +{ + "base": { + "animation": { + "duration": "2.5s", + "keyframes": { + "0%": { + "boxShadow": "0 0 12px 5px rgba(255, 255, 0, 0.8)" + }, + "50%": { + "boxShadow": "0 0 20px 8px rgba(255, 255, 0, 1)" + }, + "100%": { + "boxShadow": "0 0 5px 2px rgba(255, 255, 0, 0.3)" + } + } + } + } +} \ No newline at end of file diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json index 8798b42..8649208 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Alarm-Views/RealTime/view.json @@ -482,7 +482,6 @@ ], "custom": { "priorities": { - "critical": false, "diagnostic": false, "high": false, "low": false, @@ -690,7 +689,7 @@ "component": { "onRowClick": { "config": { - "script": "\tdata \u003d self.props.selection.data\n\tif not data or len(data) !\u003d 1:\n\t return\n\t\n\trow \u003d data[0]\n\tclickedTagPath \u003d row.get(\"FullTag\", \"\")\n\tMCM \u003d row.get(\"Location\", \"\")\n\t\n\tMCM_Pages_Map \u003d {\n\t\t\"MCM01\": \"Detailed-Views/MCM01 Fluid Inbound Merges 1-4\",\n\t\t\"MCM02\": \"Detailed-Views/MCM02 Fluid Inbound Merges 5-7\",\n\t\t\"MCM03\": \"Detailed-Views/MCM03 Non Con\",\n\t\t\"MCM04\": \"Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM05\": \"Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM06\": \"Detailed-Views/MCM06 Non Con\",\n\t\t\"MCM07\": \"Detailed-Views/MCM07 Bypass\",\n\t}\n\t\n\n\tpage \u003d MCM_Pages_Map.get(MCM)\n\t\n\tif not page:\n\t return\n\t\t\n\tdevice \u003d row.get(\"Device\", \"\")\n\t\n\tif not device or not clickedTagPath:\n\t\treturn\n\n\tindex \u003d clickedTagPath.find(device)\n\tif index \u003d\u003d -1:\n\t\treturn\n\t\n\tpathToDevice \u003d clickedTagPath[:index + len(device)]\n\t\t\n\t# Navigate to target view, passing the tag to highlight\n\tsystem.perspective.navigate(view \u003d page, params \u003d {\u0027highlightTagPath\u0027:pathToDevice})\n\t\n\t\n" + "script": "\tdata \u003d self.props.selection.data\n\tif not data or len(data) !\u003d 1:\n\t return\n\t\n\trow \u003d data[0]\n\tclickedTagPath \u003d row.get(\"FullTag\", \"\")\n\tMCM \u003d row.get(\"Location\", \"\")\n\t\n\tMCM_Pages_Map \u003d {\n\t\t\"MCM01\": \"Detailed-Views/MCM01 Fluid Inbound Merges 1-4\",\n\t\t\"MCM02\": \"Detailed-Views/MCM02 Fluid Inbound Merges 5-7\",\n\t\t\"MCM03\": \"Detailed-Views/MCM03 Non Con\",\n\t\t\"MCM04\": \"Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM05\": \"Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM06\": \"Detailed-Views/MCM06 Non Con\",\n\t\t\"MCM07\": \"Detailed-Views/MCM07 Bypass\",\n\t}\n\t\n\n\tpage \u003d MCM_Pages_Map.get(MCM)\n\t\n\tif not page:\n\t return\n\t\t\n\tdevice \u003d row.get(\"Device\", \"\")\n\t\n\tif not device or not clickedTagPath:\n\t\treturn\n\n\tpathToDevice \u003d \"\"\n\n#\tcheck for the mcm\n\tif \"MCM\" in device:\n\t\tparts \u003d clickedTagPath.split(\"/\")\n\t\tpathToDevice \u003d \"/\".join(parts[:3])\n\n\telse:\n\t\tindex \u003d clickedTagPath.find(device)\n\t\tif index \u003d\u003d -1:\n\t\t\treturn\n\t\tpathToDevice \u003d clickedTagPath[:index + len(device)]\n\n\t\t\n\t# Navigate to target view, passing the tag to highlight\n\tsystem.perspective.navigate(view \u003d page, params \u003d {\u0027highlightTagPath\u0027:pathToDevice})\n\t\n\t\n" }, "scope": "G", "type": "script" @@ -1588,7 +1587,74 @@ } }, "selection": { - "mode": "multiple interval" + "data": [ + { + "Description": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "MCM01 - Hello world" + }, + "Device": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "MCM01" + }, + "Duration": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "01:05:19" + }, + "FullTag": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "System/MCM01/MCM01/Beacon_Light" + }, + "ID": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": 12 + }, + "Location": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "MCM01" + }, + "Priority": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "High" + }, + "StartTimestamp": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": { + "$": [ + "ts", + 0, + 1750942947091 + ], + "$ts": 1750939070000 + } + }, + "Tag": { + "style": { + "classes": "Alarms-Styles/High" + }, + "value": "MCM01.HMI.Beacon_Light" + } + } + ], + "mode": "multiple interval", + "selectedColumn": "Location", + "selectedRow": 0 } }, "type": "ia.display.table" @@ -3092,7 +3158,7 @@ "$": [ "ts", 192, - 1750866213319 + 1750938073345 ], "$ts": 1750435156149 }, @@ -3100,7 +3166,7 @@ "$": [ "ts", 192, - 1750866213319 + 1750938073345 ], "$ts": 1750436956149 } @@ -4048,7 +4114,7 @@ "$": [ "ts", 192, - 1750866213319 + 1750938073345 ], "$ts": 1750435156149 }, @@ -4056,7 +4122,7 @@ "$": [ "ts", 192, - 1750866213319 + 1750938073345 ], "$ts": 1750436956149 }, diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json index 2e8dcef..4f1fc26 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Symbol-Views/Equipment-Views/Status/view.json @@ -17,7 +17,6 @@ "directionLeft": false, "forceFaultStatus": null, "forceRunningStatus": null, - "isHighlighted": false, "tagProps": [ "System/MCM01/Conveyor/UL1_3_VFD1", "value", @@ -302,10 +301,6 @@ "paramDirection": "input", "persistent": true }, - "params.isHighlighted": { - "paramDirection": "input", - "persistent": true - }, "params.tagProps": { "paramDirection": "inout", "persistent": true @@ -508,28 +503,6 @@ ], "type": "property" } - }, - "props.style.classes": { - "binding": { - "config": { - "expression": "{view.params.isHighlighted}" - }, - "transforms": [ - { - "fallback": "", - "inputType": "scalar", - "mappings": [ - { - "input": true, - "output": "State-Styles/State101" - } - ], - "outputType": "style-list", - "type": "map" - } - ], - "type": "expr" - } } }, "props": { From 1b4dfeffe20af8b223371c322ae5da91b2d1fe0e Mon Sep 17 00:00:00 2001 From: guga kakhadze Date: Thu, 26 Jun 2025 17:25:51 +0400 Subject: [PATCH 4/5] Fixed the header texts overlap. Fixed the active alarms showing null error --- .../views/Header/Header/view.json | 291 ++++++++++-------- 1 file changed, 156 insertions(+), 135 deletions(-) diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Header/Header/view.json b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Header/Header/view.json index e548308..56ca101 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Header/Header/view.json +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/com.inductiveautomation.perspective/views/Header/Header/view.json @@ -6,9 +6,9 @@ "$": [ "ts", 192, - 1750766217642 + 1750943397562 ], - "$ts": 1750766217641 + "$ts": 1750943397562 } } }, @@ -251,7 +251,7 @@ "height": 30, "mode": "fill" }, - "source": "/system/images/Builtin/amazon_rme_logo.png" + "source": null }, "type": "ia.display.image" }, @@ -823,7 +823,7 @@ }, "transforms": [ { - "code": "\tdata \u003d value\n\trows \u003d system.dataset.toPyDataSet(data)\n\t\n\ttotal \u003d sum(row[\"Count\"] for row in rows)\n\t\n\treturn total", + "code": "\tif value is None or not hasattr(system.dataset, \"toPyDataSet\"):\n\t\treturn \n\t\t\n\trows \u003d system.dataset.toPyDataSet(value)\n\t\n\ttotal \u003d sum(row[\"Count\"] for row in rows)\n\t\n\treturn total", "type": "script" } ], @@ -882,158 +882,178 @@ "type": "ia.display.label" }, { - "custom": { - "covert": true - }, - "events": { - "dom": { - "onClick": { - "config": { - "script": "\tdevice_list \u003d tags.tag_utilities.get_devices(self.session.custom.fc)\n\ttags.tag_utilities.reset_disconnect_tags(self.session.custom.fc, device_list)\n\tAWS.wbsckt_abort.close_websckt()" - }, - "scope": "G", - "type": "script" - } - } - }, - "meta": { - "name": "Icon_2", - "tooltip": { - "enabled": true - } - }, - "position": { - "basis": "30px" - }, - "propConfig": { - "custom.heartbeat_received": { - "binding": { - "config": { - "fallbackDelay": 2.5, - "mode": "indirect", - "references": { - "fc": "{session.custom.fc}" - }, - "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_heartbeat_interval" - }, - "transforms": [ - { - "expression": "if(secondsBetween(todate({value}),todate(now())) \u003e 70, False, True)", - "type": "expression" + "children": [ + { + "custom": { + "covert": true + }, + "events": { + "dom": { + "onClick": { + "config": { + "script": "\tdevice_list \u003d tags.tag_utilities.get_devices(self.session.custom.fc)\n\ttags.tag_utilities.reset_disconnect_tags(self.session.custom.fc, device_list)\n\tAWS.wbsckt_abort.close_websckt()" + }, + "scope": "G", + "type": "script" } - ], - "type": "tag" - } - }, - "custom.wbsckt_running": { - "binding": { - "config": { - "fallbackDelay": 2.5, - "mode": "indirect", - "references": { - "fc": "{session.custom.fc}" - }, - "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running" - }, - "transforms": [ - { - "expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)", - "type": "expression" - } - ], - "type": "tag" - } - }, - "meta.tooltip.text": { - "binding": { - "config": { - "path": "this.custom.wbsckt_running" - }, - "transforms": [ - { - "fallback": "", - "inputType": "scalar", - "mappings": [ - { - "input": true, - "output": "websocket running" + } + }, + "meta": { + "name": "Icon_2", + "tooltip": { + "enabled": true + } + }, + "position": { + "basis": "30px" + }, + "propConfig": { + "custom.heartbeat_received": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "fc": "{session.custom.fc}" }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_heartbeat_interval" + }, + "transforms": [ { - "input": false, - "output": "websocket disconnected" + "expression": "if(secondsBetween(todate({value}),todate(now())) \u003e 70, False, True)", + "type": "expression" } ], - "outputType": "scalar", - "type": "map" + "type": "tag" } - ], - "type": "property" - } - }, - "props.color": { - "binding": { - "config": { - "path": "this.custom.wbsckt_running" }, - "transforms": [ - { - "fallback": "#000000", - "inputType": "scalar", - "mappings": [ - { - "input": false, - "output": "#FF4747" + "custom.wbsckt_running": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "indirect", + "references": { + "fc": "{session.custom.fc}" }, + "tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running" + }, + "transforms": [ { - "input": true, - "output": "#FFFFFF" + "expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)", + "type": "expression" } ], - "outputType": "color", - "type": "map" + "type": "tag" } - ], - "type": "property" - } + }, + "meta.tooltip.text": { + "binding": { + "config": { + "path": "this.custom.wbsckt_running" + }, + "transforms": [ + { + "fallback": "", + "inputType": "scalar", + "mappings": [ + { + "input": true, + "output": "websocket running" + }, + { + "input": false, + "output": "websocket disconnected" + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "props.color": { + "binding": { + "config": { + "path": "this.custom.wbsckt_running" + }, + "transforms": [ + { + "fallback": "#000000", + "inputType": "scalar", + "mappings": [ + { + "input": false, + "output": "#FF4747" + }, + { + "input": true, + "output": "#FFFFFF" + } + ], + "outputType": "color", + "type": "map" + } + ], + "type": "property" + } + } + }, + "props": { + "path": "material/location_city", + "style": { + "cursor": "pointer" + } + }, + "type": "ia.display.icon" + }, + { + "meta": { + "name": "Label" + }, + "position": { + "basis": "50px", + "shrink": 0 + }, + "propConfig": { + "props.text": { + "binding": { + "config": { + "fallbackDelay": 2.5, + "mode": "direct", + "tagPath": "Configuration/FC" + }, + "type": "tag" + } + } + }, + "props": { + "icon": "material/building", + "style": { + "borderWidth": "0.25px", + "color": "#FFFFFF", + "textAlign": "", + "textIndent": 10 + }, + "textStyle": { + "lineBreak": "auto" + } + }, + "type": "ia.display.label" } - }, - "props": { - "path": "material/location_city", - "style": { - "cursor": "pointer" - } - }, - "type": "ia.display.icon" - }, - { + ], "meta": { - "name": "Label" + "name": "FlexContainer_2" }, "position": { - "basis": "50px" - }, - "propConfig": { - "props.text": { - "binding": { - "config": { - "fallbackDelay": 2.5, - "mode": "direct", - "tagPath": "Configuration/FC" - }, - "type": "tag" - } - } + "basis": "200px" }, "props": { - "icon": "material/building", "style": { - "borderWidth": "0.25px", - "color": "#FFFFFF", - "textAlign": "", - "textIndent": 10 + "overflow": "hidden" } }, - "type": "ia.display.label" + "type": "ia.container.flex" }, { "meta": { @@ -1094,6 +1114,7 @@ "name": "Sign In" }, "position": { + "basis": "50px", "shrink": 0 }, "propConfig": { From 729a1b6cdae6aa440383abb34d7097e05c6e5b61 Mon Sep 17 00:00:00 2001 From: guga kakhadze Date: Thu, 26 Jun 2025 17:29:58 +0400 Subject: [PATCH 5/5] getting device and fulltag from the database in active alarms, but not showing in the table. using them to find the highlight the component --- .../named-query/GetActiveAlarms/query.sql | 120 +++++++++--------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/SCADA_PERSPECTIVE_PARENT_PROJECT/ignition/named-query/GetActiveAlarms/query.sql b/SCADA_PERSPECTIVE_PARENT_PROJECT/ignition/named-query/GetActiveAlarms/query.sql index d3c2165..96d1372 100644 --- a/SCADA_PERSPECTIVE_PARENT_PROJECT/ignition/named-query/GetActiveAlarms/query.sql +++ b/SCADA_PERSPECTIVE_PARENT_PROJECT/ignition/named-query/GetActiveAlarms/query.sql @@ -1,60 +1,62 @@ -WITH Active AS ( - SELECT - ae.id, - ae.eventtime, - ae.eventid, - ae.source, - ae.priority, - ae.displaypath, - TIMESTAMPDIFF(SECOND, ae.eventtime, NOW()) AS duration_seconds - FROM alarm_events ae - WHERE ae.eventtype = 0 - AND NOT EXISTS ( - SELECT 1 FROM alarm_events ae_clear - WHERE ae_clear.eventid = ae.eventid - AND ae_clear.eventtype = 1 - ) - AND ae.displaypath NOT LIKE '%System Startup%' - AND ae.source NOT LIKE '%System Startup%' - -- Priority filter using FIND_IN_SET for comma-separated values - AND ( - :priorityList IS NULL - OR :priorityList = '' - OR FIND_IN_SET(ae.priority, :priorityList) > 0 - ) - GROUP BY ae.id -), -SingleMyTag AS ( - SELECT aed.id, aed.strValue - FROM alarm_event_data aed - WHERE aed.propname = 'myTag' - GROUP BY aed.id -) -SELECT - Active.id AS ID, - Active.eventtime AS StartTimestamp, - NULL AS EndTimestamp, -- no end time since it's still active - CONCAT( - LPAD(FLOOR(Active.duration_seconds / 3600), 2, '0'), ':', - LPAD(FLOOR((Active.duration_seconds % 3600) / 60), 2, '0'), ':', - LPAD(Active.duration_seconds % 60, 2, '0') - ) AS Duration, - CONCAT(Active.displaypath, ' - ', SUBSTRING_INDEX(Active.source, ':/alm:', -1)) AS Description, - CASE Active.priority - WHEN 0 THEN 'Diagnostic' - WHEN 1 THEN 'Low' - WHEN 2 THEN 'Medium' - WHEN 3 THEN 'High' - WHEN 4 THEN 'Critical' - ELSE 'Unknown' - END AS Priority, - CONCAT( - Active.displaypath, - '.HMI.', - SUBSTRING_INDEX(aed.strValue, '/', -1) - ) AS Tag, - SUBSTRING_INDEX(SUBSTRING_INDEX(aed.strValue, '/', 2), '/', -1) AS Location -FROM Active -LEFT JOIN SingleMyTag aed - ON aed.id = Active.id +WITH Active AS ( + SELECT + ae.id, + ae.eventtime, + ae.eventid, + ae.source, + ae.priority, + ae.displaypath, + TIMESTAMPDIFF(SECOND, ae.eventtime, NOW()) AS duration_seconds + FROM alarm_events ae + WHERE ae.eventtype = 0 + AND NOT EXISTS ( + SELECT 1 FROM alarm_events ae_clear + WHERE ae_clear.eventid = ae.eventid + AND ae_clear.eventtype = 1 + ) + AND ae.displaypath NOT LIKE '%System Startup%' + AND ae.source NOT LIKE '%System Startup%' + -- Priority filter using FIND_IN_SET for comma-separated values + AND ( + :priorityList IS NULL + OR :priorityList = '' + OR FIND_IN_SET(ae.priority, :priorityList) > 0 + ) + GROUP BY ae.id +), +SingleMyTag AS ( + SELECT aed.id, aed.strValue + FROM alarm_event_data aed + WHERE aed.propname = 'myTag' + GROUP BY aed.id +) +SELECT + Active.id AS ID, + Active.eventtime AS StartTimestamp, + NULL AS EndTimestamp, -- no end time since it's still active + CONCAT( + LPAD(FLOOR(Active.duration_seconds / 3600), 2, '0'), ':', + LPAD(FLOOR((Active.duration_seconds % 3600) / 60), 2, '0'), ':', + LPAD(Active.duration_seconds % 60, 2, '0') + ) AS Duration, + CONCAT(Active.displaypath, ' - ', SUBSTRING_INDEX(Active.source, ':/alm:', -1)) AS Description, + CASE Active.priority + WHEN 0 THEN 'Diagnostic' + WHEN 1 THEN 'Low' + WHEN 2 THEN 'Medium' + WHEN 3 THEN 'High' + WHEN 4 THEN 'Critical' + ELSE 'Unknown' + END AS Priority, + CONCAT( + Active.displaypath, + '.HMI.', + SUBSTRING_INDEX(aed.strValue, '/', -1) + ) AS Tag, + SUBSTRING_INDEX(SUBSTRING_INDEX(aed.strValue, '/', 2), '/', -1) AS Location , + aed.strValue AS FullTag, + Active.displaypath as Device +FROM Active +LEFT JOIN SingleMyTag aed + ON aed.id = Active.id ORDER BY Active.eventtime DESC; \ No newline at end of file