Merge pull request 'Alarm click events' (#143) from guga into main

Reviewed-on: #143
This commit is contained in:
gigi.mamaladze 2025-06-26 14:25:58 +00:00
commit f06f72bfcf
17 changed files with 970 additions and 220 deletions

View File

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

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "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": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -18254,6 +18266,40 @@
"path": "Symbol-Views/Equipment-Views/Status" "path": "Symbol-Views/Equipment-Views/Status"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "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": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -11740,6 +11752,40 @@
"path": "Symbol-Views/Equipment-Views/Status" "path": "Symbol-Views/Equipment-Views/Status"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -3218,6 +3230,40 @@
"path": "Symbol-Views/Equipment-Views/ControlCabinet" "path": "Symbol-Views/Equipment-Views/ControlCabinet"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -6684,6 +6696,40 @@
"path": "Custom-Views/Area_Nav_Button" "path": "Custom-Views/Area_Nav_Button"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -15144,6 +15156,40 @@
"path": "Symbol-Views/Equipment-Views/JR_Button" "path": "Symbol-Views/Equipment-Views/JR_Button"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "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": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -17644,6 +17656,40 @@
"path": "Symbol-Views/Equipment-Views/JR_Button" "path": "Symbol-Views/Equipment-Views/JR_Button"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "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": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -9794,6 +9806,40 @@
"path": "Symbol-Views/Equipment-Views/JR_Button" "path": "Symbol-Views/Equipment-Views/JR_Button"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -1,6 +1,18 @@
{ {
"custom": {}, "custom": {},
"params": {}, "params": {
"highlightTagPath": ""
},
"propConfig": {
"params.highlightTagPath": {
"onChange": {
"enabled": null,
"script": "\tutils.handleTagHighlight(self.view, currentValue)"
},
"paramDirection": "input",
"persistent": true
}
},
"props": { "props": {
"defaultSize": { "defaultSize": {
"height": 1028, "height": 1028,
@ -14075,6 +14087,40 @@
"path": "Symbol-Views/Equipment-Views/Button" "path": "Symbol-Views/Equipment-Views/Button"
}, },
"type": "ia.display.view" "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": { "meta": {

View File

@ -0,0 +1,40 @@
def handleTagHighlight(view, currentValue):
tag = currentValue.value
if tag == "":
return
splitedTag = str(tag).split("/")
deviceName = splitedTag[-1]
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"
if "MCM" in deviceName:
Docked_East_View = Docked_East_Map["MCM"]
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.style["classes"] = "Highlight/Pulse"
system.perspective.openDock(Docked_East_View, params={'tagProps': tagProps})
return True
return False

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

@ -13,16 +13,10 @@
} }
} }
}, },
"params": { "params": {},
"page_name": "Alarms-RealTime"
},
"propConfig": { "propConfig": {
"custom.activityLogger": { "custom.activityLogger": {
"persistent": true "persistent": true
},
"params.page_name": {
"paramDirection": "input",
"persistent": true
} }
}, },
"props": { "props": {
@ -691,6 +685,17 @@
{ {
"children": [ "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\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"
}
}
},
"meta": { "meta": {
"name": "Table" "name": "Table"
}, },
@ -1179,7 +1184,7 @@
}, },
"render": "auto", "render": "auto",
"resizable": true, "resizable": true,
"sort": "none", "sort": "ascending",
"sortable": true, "sortable": true,
"strictWidth": false, "strictWidth": false,
"style": { "style": {
@ -1379,6 +1384,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": {
@ -1396,7 +1587,74 @@
} }
}, },
"selection": { "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" "type": "ia.display.table"
@ -2900,7 +3158,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750755617512 1750938073345
], ],
"$ts": 1750435156149 "$ts": 1750435156149
}, },
@ -2908,7 +3166,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750755617511 1750938073345
], ],
"$ts": 1750436956149 "$ts": 1750436956149
} }
@ -3856,7 +4114,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750755617512 1750938073345
], ],
"$ts": 1750435156149 "$ts": 1750435156149
}, },
@ -3864,7 +4122,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750755617511 1750938073345
], ],
"$ts": 1750436956149 "$ts": 1750436956149
}, },
@ -4123,7 +4381,6 @@
"contentStyle": { "contentStyle": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"
}, },
"currentTabIndex": 2,
"menuType": "modern", "menuType": "modern",
"style": { "style": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"

View File

@ -6,9 +6,9 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750766217642 1750943397562
], ],
"$ts": 1750766217641 "$ts": 1750943397562
} }
} }
}, },
@ -251,7 +251,7 @@
"height": 30, "height": 30,
"mode": "fill" "mode": "fill"
}, },
"source": "/system/images/Builtin/amazon_rme_logo.png" "source": null
}, },
"type": "ia.display.image" "type": "ia.display.image"
}, },
@ -823,7 +823,7 @@
}, },
"transforms": [ "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" "type": "script"
} }
], ],
@ -882,158 +882,178 @@
"type": "ia.display.label" "type": "ia.display.label"
}, },
{ {
"custom": { "children": [
"covert": true {
}, "custom": {
"events": { "covert": true
"dom": { },
"onClick": { "events": {
"config": { "dom": {
"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()" "onClick": {
}, "config": {
"scope": "G", "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()"
"type": "script" },
} "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"
} }
], }
"type": "tag" },
} "meta": {
}, "name": "Icon_2",
"custom.wbsckt_running": { "tooltip": {
"binding": { "enabled": true
"config": { }
"fallbackDelay": 2.5, },
"mode": "indirect", "position": {
"references": { "basis": "30px"
"fc": "{session.custom.fc}" },
}, "propConfig": {
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running" "custom.heartbeat_received": {
}, "binding": {
"transforms": [ "config": {
{ "fallbackDelay": 2.5,
"expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)", "mode": "indirect",
"type": "expression" "references": {
} "fc": "{session.custom.fc}"
],
"type": "tag"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "websocket running"
}, },
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_heartbeat_interval"
},
"transforms": [
{ {
"input": false, "expression": "if(secondsBetween(todate({value}),todate(now())) \u003e 70, False, True)",
"output": "websocket disconnected" "type": "expression"
} }
], ],
"outputType": "scalar", "type": "tag"
"type": "map"
} }
],
"type": "property"
}
},
"props.color": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
}, },
"transforms": [ "custom.wbsckt_running": {
{ "binding": {
"fallback": "#000000", "config": {
"inputType": "scalar", "fallbackDelay": 2.5,
"mappings": [ "mode": "indirect",
{ "references": {
"input": false, "fc": "{session.custom.fc}"
"output": "#FF4747"
}, },
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running"
},
"transforms": [
{ {
"input": true, "expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)",
"output": "#FFFFFF" "type": "expression"
} }
], ],
"outputType": "color", "type": "tag"
"type": "map"
} }
], },
"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": { "meta": {
"name": "Label" "name": "FlexContainer_2"
}, },
"position": { "position": {
"basis": "50px" "basis": "200px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "Configuration/FC"
},
"type": "tag"
}
}
}, },
"props": { "props": {
"icon": "material/building",
"style": { "style": {
"borderWidth": "0.25px", "overflow": "hidden"
"color": "#FFFFFF",
"textAlign": "",
"textIndent": 10
} }
}, },
"type": "ia.display.label" "type": "ia.container.flex"
}, },
{ {
"meta": { "meta": {
@ -1094,6 +1114,7 @@
"name": "Sign In" "name": "Sign In"
}, },
"position": { "position": {
"basis": "50px",
"shrink": 0 "shrink": 0
}, },
"propConfig": { "propConfig": {

View File

@ -1,9 +1,10 @@
{ {
"custom": { "custom": {
"alarm_message": null,
"covert_mode": true, "covert_mode": true,
"disconnected": true, "disconnected": true,
"display_icon": true, "display_icon": true,
"plc": "value", "plc": "System",
"priority": 0, "priority": 0,
"priority_string": "No Active Alarms", "priority_string": "No Active Alarms",
"running": false, "running": false,
@ -17,7 +18,7 @@
"forceFaultStatus": null, "forceFaultStatus": null,
"forceRunningStatus": null, "forceRunningStatus": null,
"tagProps": [ "tagProps": [
"value", "System/MCM01/Conveyor/UL1_3_VFD1",
"value", "value",
"value", "value",
"value", "value",

View File

@ -1,60 +1,62 @@
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, NOW()) AS duration_seconds TIMESTAMPDIFF(SECOND, ae.eventtime, NOW()) AS duration_seconds
FROM alarm_events ae FROM alarm_events ae
WHERE ae.eventtype = 0 WHERE ae.eventtype = 0
AND NOT EXISTS ( AND NOT EXISTS (
SELECT 1 FROM alarm_events ae_clear SELECT 1 FROM alarm_events ae_clear
WHERE ae_clear.eventid = ae.eventid WHERE ae_clear.eventid = ae.eventid
AND ae_clear.eventtype = 1 AND ae_clear.eventtype = 1
) )
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%'
-- Priority filter using FIND_IN_SET for comma-separated values -- Priority filter using FIND_IN_SET for comma-separated values
AND ( AND (
:priorityList IS NULL :priorityList IS NULL
OR :priorityList = '' OR :priorityList = ''
OR FIND_IN_SET(ae.priority, :priorityList) > 0 OR FIND_IN_SET(ae.priority, :priorityList) > 0
) )
GROUP BY ae.id GROUP BY ae.id
), ),
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 GROUP BY aed.id
) )
SELECT SELECT
Active.id AS ID, Active.id AS ID,
Active.eventtime AS StartTimestamp, Active.eventtime AS StartTimestamp,
NULL AS EndTimestamp, -- no end time since it's still active NULL AS EndTimestamp, -- no end time since it's still active
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 ,
FROM Active aed.strValue AS FullTag,
LEFT JOIN SingleMyTag aed Active.displaypath as Device
ON aed.id = Active.id FROM Active
LEFT JOIN SingleMyTag aed
ON aed.id = Active.id
ORDER BY Active.eventtime DESC; ORDER BY Active.eventtime DESC;