Merge pull request 'MTN6-266 MTN6-265 MTN6-264' (#146) from guga into main

Reviewed-on: #146
This commit is contained in:
gigi.mamaladze 2025-06-30 12:59:51 +00:00
commit 1c6a331ae7
24 changed files with 1492 additions and 124 deletions

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:59:17Z"
},
"lastModificationSignature": "c4aa68a4f62571cf6d849a47e59b28d57bd61ae5a604537c041dddf156ae7caf"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(88, 158, 249, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(88, 158, 249, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(88, 158, 249, 0.3)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:59:24Z"
},
"lastModificationSignature": "9249bad3cbdc85047473a1dde64734fa94bfdd65db0f489fd951f0418fca8784"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(245, 95, 89, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(245, 95, 89, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(245, 95, 89, 0.3)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:59:29Z"
},
"lastModificationSignature": "1e87ebc5c34bb669001223707c04ff8f9bed1fdb1af60f1183e3b61922cec1fc"
}
}

View File

@ -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)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:59:34Z"
},
"lastModificationSignature": "acb0a55e90b90b5eec32cd4df512cb08aedbf6cf7b758579f9c6865c2346976b"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(247, 160, 96, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(247, 160, 96, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(247, 160, 96, 0.3)"
}
}
}
}
}

View File

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

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:56:25Z"
},
"lastModificationSignature": "18bf39c86653c9dd5c4664422b3c1d40aa96d3931f0cd93cb0b7295c21817949"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(88, 158, 249, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(88, 158, 249, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(88, 158, 249, 0.3)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:58:30Z"
},
"lastModificationSignature": "f1be0638b51c37c24199bd33a7e875748cfa79940cb30b1b5ccf32e9e47936a7"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(245, 95, 89, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(245, 95, 89, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(245, 95, 89, 0.3)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:52:14Z"
},
"lastModificationSignature": "a27450cbd46150b09478dea57dc320cbb8435e455ebb5cc12d4e190540d59b9c"
}
}

View File

@ -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)"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"style.json"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T15:57:29Z"
},
"lastModificationSignature": "91e91a98d401979733d172ccf64ea9605a06ec782fb929a21dbb582441acb784"
}
}

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(247, 160, 96, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(247, 160, 96, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(247, 160, 96, 0.3)"
}
}
}
}
}

View File

@ -687,9 +687,9 @@
{ {
"events": { "events": {
"component": { "component": {
"onRowClick": { "onRowDoubleClick": {
"config": { "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\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" "script": "\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)\n\t\n\t"
}, },
"scope": "G", "scope": "G",
"type": "script" "type": "script"
@ -1591,70 +1591,69 @@
{ {
"Description": { "Description": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "MCM01 - Hello world" "value": "FL2078_2_VFD1 - Voltage"
}, },
"Device": { "Device": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "MCM01" "value": "FL2078_2_VFD1"
}, },
"Duration": { "Duration": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "01:05:19" "value": "07:05:16"
}, },
"FullTag": { "FullTag": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "System/MCM01/MCM01/Beacon_Light" "value": "System/MCM01/Conveyor/FL2078_2_VFD1/Voltage"
}, },
"ID": { "ID": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": 12 "value": 8
}, },
"Location": { "Location": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "MCM01" "value": "MCM01"
}, },
"Priority": { "Priority": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "High" "value": "Diagnostic"
}, },
"StartTimestamp": { "StartTimestamp": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": { "value": {
"$": [ "$": [
"ts", "ts",
0, 0,
1750942947091 1750962272012
], ],
"$ts": 1750939070000 "$ts": 1750936755000
} }
}, },
"Tag": { "Tag": {
"style": { "style": {
"classes": "Alarms-Styles/High" "classes": "Alarms-Styles/Diagnostic"
}, },
"value": "MCM01.HMI.Beacon_Light" "value": "FL2078_2_VFD1.HMI.Voltage"
} }
} }
], ],
"mode": "multiple interval", "selectedColumn": "Duration",
"selectedColumn": "Location", "selectedRow": 2
"selectedRow": 0
} }
}, },
"type": "ia.display.table" "type": "ia.display.table"
@ -1749,6 +1748,17 @@
{ {
"children": [ "children": [
{ {
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": { "meta": {
"name": "AlarmsTable" "name": "AlarmsTable"
}, },
@ -2523,6 +2533,192 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"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": { "emptyMessage": {
@ -2541,10 +2737,6 @@
}, },
"pager": { "pager": {
"activeOption": 5 "activeOption": 5
},
"selection": {
"enableRowSelection": false,
"mode": "multiple interval"
} }
}, },
"type": "ia.display.table" "type": "ia.display.table"
@ -3171,6 +3363,17 @@
"$ts": 1750436956149 "$ts": 1750436956149
} }
}, },
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": { "meta": {
"name": "Table" "name": "Table"
}, },
@ -3732,7 +3935,7 @@
"style": { "style": {
"classes": "" "classes": ""
}, },
"title": "Severity" "title": ""
}, },
"justify": "center", "justify": "center",
"nullFormat": { "nullFormat": {
@ -3968,6 +4171,192 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"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": { "emptyMessage": {
@ -3989,7 +4378,22 @@
"bottom": false "bottom": false
}, },
"selection": { "selection": {
"enableRowSelection": false "data": [
{
"Description": "MCM01 - Hello world",
"Device": "MCM01",
"Duration": "06:30:56",
"EndTimestamp": null,
"FullTag": "System/MCM01/MCM01/Beacon_Light",
"ID": 12,
"Location": "MCM01",
"Priority": "High",
"StartTimestamp": "Thu Jun 26 2025 15:57:50 GMT+0400 (Georgia Standard Time)",
"Tag": "MCM01.HMI.Beacon_Light"
}
],
"selectedColumn": "EndTimestamp",
"selectedRow": 0
}, },
"style": { "style": {
"margin": 20 "margin": 20
@ -4381,6 +4785,7 @@
"contentStyle": { "contentStyle": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"
}, },
"currentTabIndex": 1,
"menuType": "modern", "menuType": "modern",
"style": { "style": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"

View File

@ -819,11 +819,12 @@
"enabled": true, "enabled": true,
"rate": "3" "rate": "3"
}, },
"queryPath": "GetActiveAlarmsByLocationAndPriority" "queryPath": "GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
}, },
"transforms": [ "transforms": [
{ {
"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", "code": "\ttotal \u003d sum(row[\"Count\"] for row in value if \"Count\" in row and row[\"Count\"] is not None)\n\treturn total",
"type": "script" "type": "script"
} }
], ],

View File

@ -1,18 +1,32 @@
{ {
"custom": { "custom": {
"MCM": "", "MCM": 1,
"currentTable": "HISTORY" "currentTable": "ACTIVE",
"page": "",
"view": ""
}, },
"params": {}, "params": {},
"propConfig": { "propConfig": {
"custom.MCM": { "custom.MCM": {
"binding": {
"config": {
"expression": "if({view.custom.view} !\u003d \"\", {view.custom.view}, {view.custom.page})"
},
"type": "expr"
},
"persistent": true
},
"custom.currentTable": {
"persistent": true
},
"custom.page": {
"binding": { "binding": {
"config": { "config": {
"path": "page.props.path" "path": "page.props.path"
}, },
"transforms": [ "transforms": [
{ {
"code": "\tpath \u003d value\n\ttry:\n\t\tif \"MCM\" in path:\n\t\t\tindex \u003d path.find(\"MCM\")\n\t\t\treturn path[index:index+5] # MCM + 2 digits\n\texcept:\n\t\t\tpass\n\treturn \"\"\n\t", "code": "\ttry:\n\t\tif \"MCM\" in value:\n\t\t\tindex \u003d value.find(\"MCM\")\n\t\t\treturn value[index:index+5] # MCM + 2 digits\n\texcept:\n\t\t\tpass\n\treturn \"\"",
"type": "script" "type": "script"
} }
], ],
@ -20,7 +34,19 @@
}, },
"persistent": true "persistent": true
}, },
"custom.currentTable": { "custom.view": {
"binding": {
"config": {
"path": "page.props.primaryView"
},
"transforms": [
{
"code": "\ttry:\n\t\tif \"MCM\" in value:\n\t\t\tindex \u003d value.find(\"MCM\")\n\t\t\treturn value[index:index+5] # MCM + 2 digits\n\texcept:\n\t\t\tpass\n\treturn \"\"",
"type": "script"
}
],
"type": "property"
},
"persistent": true "persistent": true
} }
}, },
@ -65,6 +91,17 @@
{ {
"children": [ "children": [
{ {
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tdata \u003d self.props.selection.data\n\t\n\talarms.alarm_click.handleClick(data)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": { "meta": {
"name": "active-table" "name": "active-table"
}, },
@ -755,6 +792,192 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 80 "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": { "emptyMessage": {
@ -772,14 +995,22 @@
}, },
"pager": { "pager": {
"bottom": false "bottom": false
},
"selection": {
"mode": "multiple interval"
} }
}, },
"type": "ia.display.table" "type": "ia.display.table"
}, },
{ {
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tdata \u003d self.props.selection.data\n\t\n\talarms.alarm_click.handleClick(data)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": { "meta": {
"name": "hitList-table" "name": "hitList-table"
}, },
@ -1569,6 +1800,192 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"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": { "emptyMessage": {
@ -1587,15 +2004,22 @@
"pager": { "pager": {
"activeOption": 5, "activeOption": 5,
"bottom": false "bottom": false
},
"selection": {
"enableRowSelection": false,
"mode": "multiple interval"
} }
}, },
"type": "ia.display.table" "type": "ia.display.table"
}, },
{ {
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tdata \u003d self.props.selection.data\n\t\n\talarms.alarm_click.handleClick(data)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": { "meta": {
"name": "historical-table" "name": "historical-table"
}, },
@ -2391,6 +2815,192 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"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": { "emptyMessage": {
@ -2409,9 +3019,6 @@
}, },
"pager": { "pager": {
"bottom": false "bottom": false
},
"selection": {
"enableRowSelection": false
} }
}, },
"scripts": { "scripts": {

View File

@ -1,69 +1,71 @@
WITH Active AS ( WITH Active AS (
SELECT SELECT
ae.id, ae.id,
ae.eventtime, ae.eventtime,
ae.eventid, ae.eventid,
ae.source, ae.source,
ae.priority, ae.priority,
ae.displaypath, ae.displaypath,
TIMESTAMPDIFF(SECOND, ae.eventtime, COALESCE(ae_clear.eventtime, NOW())) AS duration_seconds TIMESTAMPDIFF(SECOND, ae.eventtime, COALESCE(ae_clear.eventtime, NOW())) AS duration_seconds
FROM alarm_events ae FROM alarm_events ae
LEFT JOIN alarm_events ae_clear LEFT JOIN alarm_events ae_clear
ON ae.eventid = ae_clear.eventid AND ae_clear.eventtype = 1 ON ae.eventid = ae_clear.eventid AND ae_clear.eventtype = 1
WHERE ae.eventtype = 0 WHERE ae.eventtype = 0
AND ae.displaypath NOT LIKE '%System Startup%' AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%' AND ae.source NOT LIKE '%System Startup%'
GROUP BY ae.id -- Ensure one row per alarm GROUP BY ae.id -- Ensure one row per alarm
), ),
SingleMyTag AS ( SingleMyTag AS (
SELECT aed.id, aed.strValue SELECT aed.id, aed.strValue
FROM alarm_event_data aed FROM alarm_event_data aed
WHERE aed.propname = 'myTag' WHERE aed.propname = 'myTag'
GROUP BY aed.id -- Collapse duplicates by id GROUP BY aed.id -- Collapse duplicates by id
), ),
SingleClear AS ( SingleClear AS (
SELECT eventid, MIN(eventtime) AS eventtime SELECT eventid, MIN(eventtime) AS eventtime
FROM alarm_events FROM alarm_events
WHERE eventtype = 1 WHERE eventtype = 1
GROUP BY eventid GROUP BY eventid
) )
SELECT SELECT
Active.id AS ID, Active.id AS ID,
Active.eventtime AS StartTimestamp, Active.eventtime AS StartTimestamp,
Clear.eventtime AS EndTimestamp, Clear.eventtime AS EndTimestamp,
CONCAT( CONCAT(
LPAD(FLOOR(Active.duration_seconds / 3600), 2, '0'), ':', LPAD(FLOOR(Active.duration_seconds / 3600), 2, '0'), ':',
LPAD(FLOOR((Active.duration_seconds % 3600) / 60), 2, '0'), ':', LPAD(FLOOR((Active.duration_seconds % 3600) / 60), 2, '0'), ':',
LPAD(Active.duration_seconds % 60, 2, '0') LPAD(Active.duration_seconds % 60, 2, '0')
) AS Duration, ) AS Duration,
CONCAT(Active.displaypath, ' - ', SUBSTRING_INDEX(Active.source, ':/alm:', -1)) AS Description, CONCAT(Active.displaypath, ' - ', SUBSTRING_INDEX(Active.source, ':/alm:', -1)) AS Description,
CASE Active.priority CASE Active.priority
WHEN 0 THEN 'Diagnostic' WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low' WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium' WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High' WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical' WHEN 4 THEN 'Critical'
ELSE 'Unknown' ELSE 'Unknown'
END AS Priority, END AS Priority,
CONCAT( CONCAT(
Active.displaypath, Active.displaypath,
'.HMI.', '.HMI.',
SUBSTRING_INDEX(aed.strValue, '/', -1) SUBSTRING_INDEX(aed.strValue, '/', -1)
) AS Tag, ) AS Tag,
SUBSTRING_INDEX(SUBSTRING_INDEX(aed.strValue, '/', 2), '/', -1) AS Location SUBSTRING_INDEX(SUBSTRING_INDEX(aed.strValue, '/', 2), '/', -1) AS Location ,
aed.strValue AS FullTag,
FROM Active Active.displaypath as Device
LEFT JOIN SingleClear Clear FROM Active
ON Active.eventid = Clear.eventid
LEFT JOIN SingleClear Clear
LEFT JOIN SingleMyTag aed ON Active.eventid = Clear.eventid
ON aed.id = Active.id
LEFT JOIN SingleMyTag aed
ORDER BY Active.eventtime DESC; ON aed.id = Active.id
ORDER BY Active.eventtime DESC;

View File

@ -9,7 +9,7 @@ SELECT
'.HMI.', '.HMI.',
SUBSTRING_INDEX(aed.strValue, '/', -1) SUBSTRING_INDEX(aed.strValue, '/', -1)
) AS Tag, ) AS Tag,
CASE Active.priority CASE Active.priority
WHEN 0 THEN 'Diagnostic' WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low' WHEN 1 THEN 'Low'
@ -31,7 +31,11 @@ SELECT
) AS Duration, ) AS Duration,
-- Total number of activations -- Total number of activations
COUNT(*) AS Count COUNT(*) AS Count,
-- Newly added columns
aed.strValue AS FullTag,
Active.displaypath AS Device
FROM ( FROM (
SELECT SELECT

View File

@ -0,0 +1,49 @@
def handleClick(data):
if not data or len(data) != 1:
return
row = data[0]
clickedTagPath = row.get("FullTag", "")
MCM = row.get("Location", "")
MCM_Pages_Map = {
"MCM01": "Detailed-Views/MCM01 Fluid Inbound Merges 1-4",
"MCM02": "Detailed-Views/MCM02 Fluid Inbound Merges 5-7",
"MCM03": "Detailed-Views/MCM03 Non Con",
"MCM04": "Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM05": "Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM06": "Detailed-Views/MCM06 Non Con",
"MCM07": "Detailed-Views/MCM07 Bypass",
}
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)})

View File

@ -0,0 +1,17 @@
{
"scope": "A",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"code.py"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-06-26T18:22:20Z"
},
"hintScope": 2,
"lastModificationSignature": "b6ff9fb1f8b372d391f1e8e33122b287026821ab30ed938414fca2bd68f451a9"
}
}