{ "custom": { "activityLogger": { "alt_pageid": "alarms", "pageid": "alarms/ActiveAlarms", "start_time": { "$": [ "ts", 192, 1748425447154 ], "$ts": 1748425447154 } } }, "params": { "page_name": "Alarms-RealTime", "table_type": "value" }, "propConfig": { "custom.activityLogger": { "persistent": true }, "params.page_name": { "paramDirection": "input", "persistent": true }, "params.table_type": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "height": 1080, "width": 1920 } }, "root": { "children": [ { "children": [ { "children": [ { "children": [ { "children": [ { "meta": { "name": "Label_0" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027critical\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"\n\n" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_4" }, "position": { "basis": "125px" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({this.custom.background_on}\u003d\"true\",1,0)" }, "transforms": [ { "fallback": "", "inputType": "scalar", "mappings": [ { "input": 1, "output": "Alarms-Styles/Critical" }, { "input": 0, "output": "Buttons/PB_1" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } } }, "props": { "image": { "icon": { "color": "#FFFFFF", "path": "material/error" } }, "style": { "margin": 15 }, "text": "Critical" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-filters", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background\n\t", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "custom": { "Severity": "High", "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027high\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_0" }, "position": { "basis": "120px" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))" }, "transforms": [ { "fallback": "", "inputType": "scalar", "mappings": [ { "input": 0, "output": "" }, { "input": 1, "output": "Alarms-Styles/High" }, { "input": 2, "output": "Alarms-Styles/Alt-Colours/High" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } } }, "props": { "image": { "icon": { "path": "material/priority_high" } }, "primary": false, "style": { "margin": 15 }, "text": "High" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-filters", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label_1" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "meta": { "name": "Label_4" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "Severity": "Medium", "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027medium\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_1" }, "position": { "basis": "120px" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))" }, "transforms": [ { "fallback": "Buttons/PB_1", "inputType": "scalar", "mappings": [ { "input": 0, "output": "" }, { "input": 1, "output": "Alarms-Styles/Medium" }, { "input": 2, "output": "Alarms-Styles/Alt-Colours/Medium" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } } }, "props": { "image": { "icon": { "path": "material/priority_high" } }, "primary": false, "style": { "margin": 15 }, "text": "Medium" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-filters", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label_2" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "Severity": "Low", "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027low\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_2" }, "position": { "basis": "120px" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))" }, "transforms": [ { "fallback": "Buttons/PB_1", "inputType": "scalar", "mappings": [ { "input": 0, "output": "" }, { "input": 1, "output": "Alarms-Styles/Low" }, { "input": 2, "output": "Alarms-Styles/Alt-Colours/Low" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } } }, "props": { "image": { "icon": { "path": "material/low_priority" } }, "primary": false, "style": { "margin": 15 }, "text": "Low" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-filters", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label_3" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "Severity": "Diagnostic", "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027diagnostic\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_3" }, "position": { "basis": "120px" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))" }, "transforms": [ { "fallback": "Buttons/PB_1", "inputType": "scalar", "mappings": [ { "input": 0, "output": "" }, { "input": 1, "output": "Alarms-Styles/Diagnostic" }, { "input": 2, "output": "Alarms-Styles/Alt-Colours/Diagnostic" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } } }, "props": { "image": { "icon": { "path": "material/warning" } }, "primary": false, "style": { "margin": 15 }, "text": "Diagnostic" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-filters", "pageScope": true, "script": "\t# implement your handler here\n\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "700px", "shrink": 0 }, "propConfig": { "custom.priorities": { "binding": { "config": { "bidirectional": true, "path": ".../FlexContainer_0/AlarmStatusTable.props.filters.active.priorities" }, "type": "property" } } }, "props": { "style": { "padding": 0 } }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "20px" }, "type": "ia.display.label" }, { "custom": { "Severity": "Critical", "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpayload \u003d {}\n\tfilter_on \u003d \"false\"\n\tpayload[\"reset\"] \u003d filter_on\n\tsystem.perspective.sendMessage(\"reset-filters\", payload \u003dpayload, scope \u003d \"page\")\n\tdefault_priorities \u003d {\n\t \"critical\": False,\n\t \"high\": False,\n\t \"medium\": False,\n\t \"low\": False,\n\t \"diagnostic\": False\n\t}\n\tself.parent.parent.getChild(\"FlexContainer\").custom.priorities \u003d default_priorities" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button" }, "position": { "basis": "120px" }, "props": { "image": { "icon": { "color": "#000000", "path": "material/clear" } }, "primary": false, "style": { "margin": 15 }, "text": "Reset" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "button-severity-indicator", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"severity\"]\n\tbutton_severity \u003d self.custom.Severity\n\tif severity \u003d\u003d button_severity:\n\t\tbackground \u003d \"true\"\n\telse:\n\t\tbackground \u003d \"false\"\n\t\n\tself.custom.background_on \u003d background\n\t", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label_2" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "Severity": "High", "background_on": "true", "update_on": false }, "events": { "component": { "onActionPerformed": { "config": { "script": " \n alarm_table \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmStatusTable\")\n \n try:\n # Get the filtered data (what\u0027s currently visible in the table)\n filtered_data \u003d alarm_table.props.filters.active.results.data\n \n # Create CSV content\n csv_content \u003d \"Active Time,Name,Display Path,Priority\\n\"\n \n if filtered_data and len(filtered_data) \u003e 0:\n for alarm_data in filtered_data:\n row_data \u003d [\n str(alarm_data.get(\u0027activeTime\u0027, \u0027\u0027) if isinstance(alarm_data, dict) else getattr(alarm_data, \u0027activeTime\u0027, \u0027\u0027)),\n str(alarm_data.get(\u0027name\u0027, \u0027\u0027) if isinstance(alarm_data, dict) else getattr(alarm_data, \u0027name\u0027, \u0027\u0027)),\n str(alarm_data.get(\u0027source\u0027, \u0027\u0027) if isinstance(alarm_data, dict) else getattr(alarm_data, \u0027source\u0027, \u0027\u0027)),\n str(alarm_data.get(\u0027priority\u0027, \u0027\u0027) if isinstance(alarm_data, dict) else getattr(alarm_data, \u0027priority\u0027, \u0027\u0027))\n ]\n \n # Escape commas in data\n row_data \u003d [field.replace(\u0027,\u0027, \u0027;\u0027) for field in row_data]\n csv_content +\u003d \",\".join(row_data) + \"\\n\"\n else:\n csv_content +\u003d \"No alarms visible in current view\\n\"\n \n except Exception as e:\n system.perspective.print(\"Error: \" + str(e))\n csv_content \u003d \"Error accessing filtered alarms\\n\"\n \n # Convert to bytes and download\n csv_bytes \u003d csv_content.encode(\u0027utf-8\u0027)\n system.perspective.download(\"active_alarms.csv\", csv_bytes)\n " }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_1" }, "position": { "basis": "120px" }, "props": { "image": { "icon": { "path": "material/import_export" } }, "primary": false, "style": { "margin": 15 }, "text": "Export" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "button-severity-indicator", "pageScope": true, "script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"severity\"]\n\tbutton_severity \u003d self.custom.Severity\n\tif severity \u003d\u003d button_severity:\n\t\tbackground \u003d \"true\"\n\telse:\n\t\tbackground \u003d \"false\"\n\t\n\tself.custom.background_on \u003d background", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label_0" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "meta": { "name": "Label_1" }, "position": { "basis": "10px" }, "type": "ia.display.label" }, { "custom": { "alarms_to_shelve": [ { "style": { "classes": "Alarms-Styles/Medium" }, "value": { "Alarm_id": { "value": 13 }, "Duration": { "value": 10495 }, "Expiration": { "value": { "$": [ "ts", 0, 1704730823344 ], "$ts": 0 } }, "Message": { "value": "Photo eye blocked" }, "Priority": { "value": "3. Medium" }, "Shelve": { "value": false }, "SourceId": { "value": "PLC09/1210_07_44/B830_3" }, "State": { "value": "Active" }, "Timestamp": { "value": { "$": [ "ts", 0, 1704730823344 ], "$ts": 1704720394486 } }, "Unshelve": { "value": false } } } ] }, "events": { "component": { "onActionPerformed": { "config": { "script": "\t\n\tselected_alarms \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmStatusTable\").props.selection.active.data\n\t\n\tif len(selected_alarms) \u003d\u003d 0:\n\t\tself.props.value \u003d None\n\t\treturn\n\t\n\tduration \u003d self.props.value\n\t\n\tfor alarm in selected_alarms:\n\t\tsystem.alarm.shelve(alarm[\"source\"], duration * 60) #60 - seconds.\n\t\n\tself.props.value \u003d None" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Dropdown" }, "position": { "basis": "120px" }, "propConfig": { "props.enabled": { "binding": { "config": { "path": "session.custom.fc" }, "enabled": false, "transforms": [ { "code": "\twhid \u003d value.lower()\n\tWHID \u003d value.upper()\n\tsiterole \u003d \u0027Authenticated/Roles/rme-ignition-\u0027+whid+\u0027-alarm-shelving\u0027\n\tSITErole \u003d \u0027Authenticated/Roles/rme-ignition-\u0027+WHID+\u0027-alarm-shelving\u0027\n# Example: rme-ignition-BRS1-alarm-shelving\n\troles \u003d [\u0027Authenticated/Roles/eurme-ignition-admins\u0027, siterole, SITErole]\n\tauth \u003d system.perspective.isAuthorized(False, securityLevels\u003droles)\n\treturn auth", "type": "script" } ], "type": "property" } } }, "props": { "options": [ { "label": "15 mins", "value": 15 }, { "label": "30 min", "value": 30 }, { "label": "45 min", "value": 45 }, { "label": "1 hr", "value": 60 }, { "label": "2 hr", "value": 120 }, { "label": "4 hr", "value": 240 }, { "label": "8 hr", "value": 480 }, { "label": "1 Day", "value": 1440 }, { "label": "2 Days", "value": 2880 }, { "label": "1 week", "value": 10080 }, { "label": "2 weeks", "value": 20160 }, { "label": "Out of Service", "value": 263000 } ], "placeholder": { "color": "#000000", "icon": { "color": "#000000", "path": "material/archive", "style": { "classes": "" } }, "text": "Shelve" }, "search": { "enabled": false }, "showClearIcon": true, "style": { "borderBottomLeftRadius": "5px", "borderBottomRightRadius": "5px", "borderTopLeftRadius": "5px", "borderTopRightRadius": "5px", "classes": "Dropdown/DropDownBox", "margin": 15 }, "value": null }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "alarms-to-shelve", "pageScope": true, "script": "\t# implement your handler here\n\tself.custom.alarms_to_shelve \u003d payload", "sessionScope": false, "viewScope": true } ] }, "type": "ia.input.dropdown" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "513px", "shrink": 0 }, "props": { "style": { "padding": 0 } }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "70px", "shrink": 0 }, "props": { "alignContent": "flex-start", "style": { "overflow": "visible" } }, "type": "ia.container.flex" }, { "children": [ { "custom": { "shelvedAlarms": "value" }, "meta": { "name": "AlarmStatusTable" }, "position": { "basis": "973px" }, "props": { "columns": { "active": { "activeTime": { "field": "hello", "header": "sss" }, "displayPath": { "order": 2 }, "name": { "order": 1 }, "priority": { "order": 3 }, "source": { "enabled": false }, "state": { "enabled": false } } }, "enableAcknowledge": false, "enableDetails": false, "enableShelve": false, "enableUnshelve": false, "filters": { "active": { "priorities": { "critical": false, "high": false, "low": false, "medium": false }, "results": { "data": [ { "ackNotes": "", "ackPipeline": "", "ackTime": "", "ackUser": "", "activePipeline": "", "activeTime": "2025-06-10 10:46:16.547+0400", "clearPipeline": "", "clearTime": "2025-06-10 10:48:20.462+0400", "deadband": "0.0", "displayPath": "System/close_socket/papapapa", "eventId": "bb8d48cb-a61e-4e31-a44f-340466686cc7", "eventTime": "2025-06-10 10:48:20.462+0400", "eventValue": "false", "isAcked": "false", "isActive": "false", "isClear": "true", "label": "papapapa", "name": "papapapa", "notes": "", "priority": "Low", "source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa", "state": "Cleared, Unacknowledged" }, { "ackNotes": "", "ackPipeline": "", "ackTime": "", "ackUser": "", "activePipeline": "", "activeTime": "2025-06-10 10:48:22.466+0400", "clearPipeline": "", "clearTime": "2025-06-10 10:50:24.652+0400", "deadband": "0.0", "displayPath": "System/close_socket/papapapa", "eventId": "479900cc-da53-43f8-8fcc-2f2278b01ccd", "eventTime": "2025-06-10 10:50:24.652+0400", "eventValue": "false", "isAcked": "false", "isActive": "false", "isClear": "true", "label": "papapapa", "name": "papapapa", "notes": "", "priority": "Low", "source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa", "state": "Cleared, Unacknowledged" }, { "ackNotes": "", "ackPipeline": "", "ackTime": "", "ackUser": "", "activePipeline": "", "activeTime": "2025-06-10 10:44:18.146+0400", "clearPipeline": "", "clearTime": "2025-06-10 10:44:24.496+0400", "deadband": "0.0", "displayPath": "System/close_socket/papapapa", "eventId": "4ff749a9-0a6b-4818-95e0-96ceb3c7d50a", "eventTime": "2025-06-10 10:44:24.496+0400", "eventValue": "false", "isAcked": "false", "isActive": "false", "isClear": "true", "label": "papapapa", "name": "papapapa", "notes": "", "priority": "Low", "source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa", "state": "Cleared, Unacknowledged" }, { "ackNotes": "", "ackPipeline": "", "ackTime": "", "ackUser": "", "activePipeline": "", "activeTime": "2025-06-10 10:42:13.975+0400", "clearPipeline": "", "clearTime": "2025-06-10 10:44:16.145+0400", "deadband": "0.0", "displayPath": "System/close_socket/papapapa", "eventId": "2f522dec-f2fc-4c05-8acf-a3208aa048c9", "eventTime": "2025-06-10 10:44:16.145+0400", "eventValue": "false", "isAcked": "false", "isActive": "false", "isClear": "true", "label": "papapapa", "name": "papapapa", "notes": "", "priority": "Low", "source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa", "state": "Cleared, Unacknowledged" }, { "ackNotes": "", "ackPipeline": "", "ackTime": "", "ackUser": "", "activePipeline": "", "activeTime": "2025-06-10 10:50:26.655+0400", "clearPipeline": "", "clearTime": "", "deadband": "0.0", "displayPath": "System/close_socket/papapapa", "eventId": "887b4132-0bfd-4902-9db3-a10b581ca073", "eventTime": "2025-06-10 10:50:26.655+0400", "eventValue": "true", "isAcked": "false", "isActive": "true", "isClear": "false", "label": "papapapa", "name": "papapapa", "notes": "", "priority": "Low", "source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa", "state": "Active, Unacknowledged" } ], "enabled": true }, "states": { "clearAcked": true } }, "shelved": { "results": { "enabled": true } } }, "responsive": { "enabled": true }, "rowStyles": { "clearAcked": { "base": { "display": "none" } }, "clearUnacked": { "base": { "display": "none" } } }, "toolbar": { "enableActiveTab": false, "enableConfiguration": false, "enableFilter": false, "enablePreFilters": false, "enableShelvedTab": false, "enabled": false } }, "type": "ia.display.alarmstatustable" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "480px", "grow": 1 }, "props": { "direction": "column" }, "type": "ia.container.flex" } ], "meta": { "name": "Active_tab" }, "props": { "direction": "column", "justify": "space-evenly" }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "children": [ { "events": { "component": { "onActionPerformed": { "config": { "script": "\tshelved_alarm_table \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\")\n\t\n\tselected_alarms \u003d shelved_alarm_table.props.selection.data\n\tif(len(selected_alarms)\u003d\u003d0):\n\t\treturn\n\t\n\tfor alarm in selected_alarms:\n\t\tsystem.alarm.unshelve(alarm.path)\n\t\t\n\tshelved_alarm_table.props.data \u003d []" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button" }, "position": { "basis": "153px" }, "props": { "image": { "icon": { "color": "#000000", "path": "material/archive" } }, "style": { "classes": "Dropdown/DropDownBox" }, "text": "Unshelve", "value": "" }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "alarms-to-shelve", "pageScope": true, "script": "\t# implement your handler here\n\tself.props.enabled \u003d True\n\tself.custom.alarms_to_shelve \u003d payload", "sessionScope": false, "viewScope": true } ] }, "type": "ia.input.button" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "450px", "shrink": 0 }, "props": { "style": { "padding": 5 } }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "40px", "shrink": 0 }, "props": { "alignContent": "flex-start", "style": { "overflow": "visible" } }, "type": "ia.container.flex" }, { "children": [ { "custom": { "shelvedAlarmsData": null }, "meta": { "name": "AlarmsTable" }, "position": { "basis": "1080px", "grow": 1 }, "propConfig": { "props.data": { "binding": { "config": { "path": "...../TabContainer.custom.shelvedAlarms" }, "type": "property" } }, "props.editingCell": { "onChange": { "enabled": null, "script": "\tall_alarms \u003d system.alarm.queryStatus(includeShelved\u003dTrue)\n\tshelved_alarms \u003d [alarm for alarm in all_alarms if alarm.isShelved()]\n\t\n\t# Build dataset for table\n\theaders \u003d [\u0027ID\u0027, \u0027StartTimestamp\u0027, \u0027EndTimestamp\u0027, \u0027Duration\u0027, \u0027Description\u0027, \u0027Priority\u0027, \u0027Tag\u0027, \u0027MCM\u0027]\n\tdata \u003d []\n\t\n\tfor alarm in shelved_alarms:\n\t # Calculate duration (time since shelved)\n\t if alarm.activeTime:\n\t duration_ms \u003d system.date.now().getTime() - alarm.activeTime.getTime()\n\t duration_seconds \u003d duration_ms / 1000\n\t hours \u003d int(duration_seconds / 3600)\n\t minutes \u003d int((duration_seconds % 3600) / 60)\n\t seconds \u003d int(duration_seconds % 60)\n\t duration \u003d \"%02d:%02d:%02d\" % (hours, minutes, seconds)\n\t else:\n\t duration \u003d \"00:00:00\"\n\t \n\t # Extract tag name from source\n\t tag_name \u003d alarm.source.split(\u0027/\u0027)[-1] if \u0027/\u0027 in alarm.source else alarm.source\n\t \n\t row \u003d [\n\t str(alarm.id) if hasattr(alarm, \u0027id\u0027) else \u0027\u0027,\n\t alarm.activeTime if alarm.activeTime else system.date.now(),\n\t None, # End timestamp (shelved alarms don\u0027t have end time yet)\n\t duration,\n\t alarm.displayPath if alarm.displayPath else alarm.source,\n\t alarm.priority.name if alarm.priority else \u0027Unknown\u0027,\n\t tag_name,\n\t \u0027System\u0027 # Adjust based on your source format\n\t ]\n\t data.append(row)\n\t\n\t# Create dataset and update the custom property\n\tdataset \u003d system.dataset.toDataSet(headers, data)\n\tself.custom.shelvedAlarmsData \u003d dataset" } }, "props.selection": { "persistent": true } }, "props": { "columns": [ { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "name", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "value", "dateFormat": "MM-DD-YYYY HH:mm:ss", "editable": false, "field": "path", "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": "Start Timestamp" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "none", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM-DD-YYYY HH:mm:ss", "editable": false, "field": "activeTime", "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": "center", "style": { "classes": "" }, "title": "Active Time" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "expirationTime", "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": "center", "style": { "classes": "" }, "title": "Expiration Time" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "none", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "priority", "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": "center", "style": { "classes": "" }, "title": "" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": true }, "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" } ], "emptyMessage": { "noData": { "text": "No Shelved Alarms" } }, "enableFooter": true, "selection": { "mode": "multiple interval" } }, "type": "ia.display.table" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "500px", "grow": 1 }, "type": "ia.container.flex" } ], "meta": { "name": "Shelved tab" }, "position": { "tabIndex": 1 }, "props": { "direction": "column", "justify": "space-evenly" }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "children": [ { "custom": { "SetFilter": true }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpayload \u003d {}\n\tif self.custom.SetFilter \u003d\u003d True:\n\t\tpayload[\"data\"] \u003d False\n\t\tself.custom.SetFilter \u003d False\n\t\t\n\t\n\telif self.custom.SetFilter \u003d\u003d False:\n\t\tpayload[\"data\"] \u003d True\n\t\tself.custom.SetFilter \u003d True\n\t\n\tsystem.perspective.sendMessage(\"show-historical-filters\", payload \u003d payload, scope \u003d \"page\")\n\t" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button", "tooltip": { "enabled": true, "style": { "background-color": "white", "borderColor": "#000000", "borderStyle": "solid", "borderWidth": "1px", "box-shadow": "5px 5px 5px grey", "color": "#000000", "fontFamily": "Arial", "fontWeight": "normal" }, "text": "Show Filters" } }, "position": { "basis": "120px" }, "props": { "image": { "icon": { "path": "material/filter_alt" }, "position": "center" }, "primary": false, "style": { "margin": 15, "marginLeft": 20 }, "text": "" }, "type": "ia.input.button" }, { "meta": { "name": "Label" }, "position": { "basis": "281px" }, "props": { "style": { "color": "#FF0000", "margin-left": "20px" }, "text": "ALL TIMESTAMPS ARE IN UTC" }, "type": "ia.display.label" } ], "meta": { "name": "Show filters" }, "position": { "basis": "70px", "shrink": 0 }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "meta": { "name": "Label_1" }, "position": { "basis": "100px" }, "props": { "style": { "fontFamily": "Arial", "fontWeight": "bold", "textAlign": "center" }, "text": "Period:" }, "type": "ia.display.label" }, { "custom": { "customTime": true, "endDate": { "$": [ "ts", 192, 1749543336268 ], "$ts": 1749543336268 }, "startDate": { "$": [ "ts", 192, 1749543336268 ], "$ts": 1749541536268 } }, "meta": { "name": "Dropdown" }, "position": { "basis": "200px" }, "propConfig": { "props.value": { "onChange": { "enabled": null, "script": "\n\tstart \u003d \"\"\n\tend \u003d \"\"\n\tnow \u003d system.date.now()\n\tpreviousDay \u003d system.date.addDays(now, -1)\n\tvalue \u003d currentValue.value \n\n\tif value \u003d\u003d \"custom\":\n\t\tself.custom.customTime \u003d True\n\t\treturn\n\telif value \u003d\u003d \"currentDay\":\n\t\tstart \u003d system.date.setTime(now, 0, 0, 0)\n\t\tend \u003d now\n\telif value \u003d\u003d \"morning\":\n\t\tstart \u003d system.date.setTime(now, 2, 30, 0)\n\t\tend \u003d system.date.setTime(now, 7, 30, 0)\n\telif value \u003d\u003d \"daylight\":\n\t\tstart \u003d system.date.setTime(now, 7, 30, 0)\n\t\tend \u003d system.date.setTime(now, 13, 0, 0)\n\telif value \u003d\u003d \"twilight\":\n\t\tstart \u003d system.date.setTime(now, 13, 0, 0)\n\t\tend \u003d now\n\telif value \u003d\u003d \"night\":\n\t\tstart \u003d system.date.setTime(previousDay, 18, 30, 0)\n\t\tend \u003d system.date.setTime(previousDay, 23, 30, 0)\n\telif value \u003d\u003d \"wrapDown\":\n\t\tstart \u003d system.date.setTime(previousDay, 23, 30, 0)\n\t\tend \u003d system.date.setTime(now, 2, 30, 0)\n\telif value \u003d\u003d \"currentShot\":\n\t\tstart \u003d system.date.setTime(now, 13, 0, 0)\n\t\tend \u003d now\n\telse:\n\t\tstart \u003d system.date.addMinutes(now, -int(value))\n\t\tend \u003d now\n\n\tself.custom.customTime \u003d False\n\tself.custom.startDate \u003d start\n\tself.custom.endDate \u003d end" }, "persistent": false } }, "props": { "options": [ { "label": "Past 30 Min", "value": 30 }, { "label": "Past Hour", "value": 60 }, { "label": "Past 2 Hour", "value": 120 }, { "label": "Past 4 Hour", "value": 240 }, { "label": "Past 8 Hour", "value": 480 }, { "label": "Current Day", "value": "currentDay" }, { "label": "Morning", "value": "morning" }, { "label": "Daylight", "value": "daylight" }, { "label": "Twilight", "value": "twilight" }, { "label": "Night", "value": "night" }, { "label": "Wrap Down", "value": "wrapDown" }, { "label": "Current Shot", "value": "currentShot" }, { "label": "Custom", "value": "custom" } ], "style": { "margin": 15 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-historical-filters", "pageScope": true, "script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.dropdown" }, { "meta": { "name": "Label" }, "position": { "basis": "100px" }, "props": { "style": { "fontFamily": "Arial", "fontWeight": "bold", "textAlign": "center" }, "text": "Start Date" }, "type": "ia.display.label" }, { "custom": { "max_duration_days": 10 }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tmessaging.message_handler.set_time_from_filters(self)\n\t" }, "scope": "G", "type": "script" } } }, "meta": { "name": "DateTimeInput", "tooltip": { "enabled": true } }, "position": { "basis": "200px" }, "propConfig": { "props.enabled": { "binding": { "config": { "path": "../Dropdown.custom.customTime" }, "type": "property" } }, "props.maxDate": { "binding": { "config": { "expression": "now()" }, "type": "expr" } }, "props.minDate": { "access": "PUBLIC", "binding": { "config": { "expression": "addDays(now(),-{this.custom.max_duration_days})" }, "type": "expr" } }, "props.value": { "binding": { "config": { "path": "../Dropdown.custom.startDate" }, "type": "property" }, "onChange": { "enabled": null, "script": "\tmessaging.message_handler.set_time_from_filters(self)" } } }, "props": { "formattedValue": "Jun 10, 2025 11:45 AM", "style": { "margin": 15 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-historical-filters", "pageScope": true, "script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.date-time-input" }, { "meta": { "name": "Label_0" }, "position": { "basis": "89px" }, "props": { "style": { "fontFamily": "Arial", "fontWeight": "bold", "textAlign": "center" }, "text": "End Date" }, "type": "ia.display.label" }, { "meta": { "name": "DateTimeInput_0" }, "position": { "basis": "200px" }, "propConfig": { "props.enabled": { "binding": { "config": { "path": "../Dropdown.custom.customTime" }, "type": "property" } }, "props.maxDate": { "binding": { "config": { "expression": "now()" }, "enabled": false, "type": "expr" } }, "props.minDate": { "binding": { "config": { "expression": "addDays(now(),-10)" }, "type": "expr" } }, "props.value": { "binding": { "config": { "path": "../Dropdown.custom.endDate" }, "type": "property" }, "onChange": { "enabled": null, "script": "\tmessaging.message_handler.set_time_to_filters(self)" }, "persistent": true } }, "props": { "formattedValue": "Jun 11, 2025 12:15 PM", "maxDate": { "$": [ "ts", 192, 1749542669794 ], "$ts": 1749715452000 }, "style": { "margin": 15 }, "value": { "$": [ "ts", 0, 1749543373731 ], "$ts": 1749629736000 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-historical-filters", "pageScope": true, "script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.date-time-input" } ], "meta": { "name": "Time" }, "position": { "basis": "70px", "shrink": 0 }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "100px" }, "props": { "style": { "fontFamily": "Arial", "fontWeight": "bold", "textAlign": "center" }, "text": "Priority" }, "type": "ia.display.label" }, { "events": { "component": { "onActionPerformed": { "config": { "script": "\tmessaging.message_handler.set_priority_filters(self)" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Dropdown" }, "position": { "basis": "490px" }, "propConfig": { "props.value": { "persistent": false } }, "props": { "options": [ { "label": "Diagnostic", "value": "diagnostic" }, { "label": "Low", "value": "low" }, { "label": "Medium", "value": "medium" }, { "label": "High", "value": "high" }, { "label": "All", "value": "" } ], "style": { "margin": 15 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "reset-historical-filters", "pageScope": true, "script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.dropdown" } ], "meta": { "name": "Priority" }, "position": { "basis": "70px", "shrink": 0 }, "type": "ia.container.flex" } ], "custom": { "ShowFilters": true }, "meta": { "name": "Filters" }, "position": { "basis": "180px", "grow": 1, "shrink": 0 }, "propConfig": { "position.display": { "binding": { "config": { "path": "this.custom.ShowFilters" }, "type": "property" }, "persistent": true } }, "props": { "direction": "column", "style": { "borderStyle": "solid", "borderWidth": "1px", "box-shadow": "0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)", "marginBottom": 10, "marginLeft": 20, "marginRight": 20, "marginTop": 10 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "show-historical-filters", "pageScope": true, "script": "\tshow \u003d payload[\"data\"]\n\tself.custom.ShowFilters \u003d show", "sessionScope": false, "viewScope": false } ] }, "type": "ia.container.flex" }, { "children": [ { "custom": { "initial_data": [], "max_duration": { "$": [ "ts", 192, 1748426336635 ], "$ts": 1747562336635 }, "priority_filters": "", "time_from_filter": { "$": [ "ts", 192, 1749543368762 ], "$ts": 1749541536000 }, "time_to_filter": { "$": [ "ts", 192, 1749543373742 ], "$ts": 1749629736000 } }, "meta": { "name": "Table" }, "position": { "basis": "1920px", "grow": 1 }, "propConfig": { "props.columns[1].filter.date.value": { "binding": { "config": { "path": "this.custom.time_from_filter" }, "type": "property" } }, "props.columns[2].filter.date.value": { "binding": { "config": { "path": "this.custom.time_to_filter" }, "type": "property" } }, "props.columns[2].filter.number.value": { "binding": { "config": { "path": "this.custom.time_to_filter" }, "enabled": false, "type": "property" } }, "props.columns[5].filter.string.value": { "binding": { "config": { "path": "this.custom.priority_filters" }, "type": "property" } }, "props.data": { "binding": { "config": { "polling": { "enabled": true, "rate": "3" }, "queryPath": "GetAlarms" }, "type": "query" } } }, "props": { "box-shadow": "0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)", "columns": [ { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "ID", "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": "center", "style": { "classes": "", "paddingLeft": 12 }, "title": "" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, "field": "StartTimestamp", "filter": { "boolean": { "condition": "" }, "date": { "condition": "later than date time" }, "enabled": true, "number": { "condition": "", "value": "" }, "string": { "condition": "", "value": "" }, "visible": "never" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "Start Timestamp" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "none", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, "field": "EndTimestamp", "filter": { "boolean": { "condition": "" }, "date": { "condition": "earlier than date time" }, "enabled": true, "number": { "condition": "", "value": "" }, "string": { "condition": "", "value": "" }, "visible": "never" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "End Timestamp" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "Duration", "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": "center", "style": { "classes": "", "paddingLeft": 12 }, "title": "" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "none", "editable": false, "field": "Description", "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": "center", "style": { "classes": "" }, "title": "" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Priority", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": true, "number": { "condition": "", "value": "" }, "string": { "condition": "contains" }, "visible": "never" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "Severity" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "MCM", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": true, "number": { "condition": "", "value": "" }, "string": { "condition": "equals", "value": "" }, "visible": "never" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Tag", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": true, "number": { "condition": "", "value": "" }, "string": { "condition": "contains", "value": "" }, "visible": "never" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "" }, "justify": "center", "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": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" } ], "enabled": true, "filter": { "enabled": true }, "pager": { "bottom": false }, "selection": { "data": [ { "Description": "alm:papapapa - papapapa", "Duration": "00:02:02", "EndTimestamp": 1749543629000, "ID": 155, "MCM": "System", "Priority": "Low", "StartTimestamp": 1749543507000, "Tag": "alm:papapapa" } ], "selectedColumn": "EndTimestamp", "selectedRow": 1 }, "style": { "margin": 20 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "update-first-request", "pageScope": true, "script": "\tdata \u003d payload[\"data\"]\n\tinitial_data \u003d payload[\"initial_data\"]\n\tself.props.data \u003d data\n\tself.custom.initial_data \u003d initial_data", "sessionScope": false, "viewScope": false }, { "messageType": "update-historical-data", "pageScope": true, "script": "\thistorical_data \u003d payload[\"data\"]\n\tself.props.data \u003d historical_data", "sessionScope": false, "viewScope": false }, { "messageType": "load_initial_data", "pageScope": true, "script": "\trequest \u003d payload[\"data\"]\n\tsystem.perspective.print(\"initial message received\")\n\tif request \u003d\u003d True:\n\t\tself.props.data \u003d self.custom.initial_data", "sessionScope": false, "viewScope": false }, { "messageType": "reset-historical-filters", "pageScope": true, "script": "\treset \u003d payload[\"data\"]\n\tif reset \u003d\u003d \"reset\":\n\t\tself.props.data \u003d []\n\t\tself.custom.device_filters \u003d None\n\t\tself.custom.priority_filters \u003d None\n\t\tself.custom.source_id_filters \u003d None\n\t\tself.custom.time_from_filter \u003d None\n\t\tself.custom.time_to_filter \u003d None\n\t\tself.custom.type_filters \u003d None\n\t\tself.custom.duration_filter \u003d None\n\t\tself.props.enabled \u003dTrue", "sessionScope": false, "viewScope": false }, { "messageType": "set-source-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.source_id_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-device-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.device_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-priority-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.priority_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-from-filters", "pageScope": true, "script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_from_filter \u003d time", "sessionScope": false, "viewScope": false }, { "messageType": "set-to-filters", "pageScope": true, "script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_to_filter \u003d time", "sessionScope": false, "viewScope": false }, { "messageType": "set-type-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.type_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-duration-filters", "pageScope": true, "script": "\tduration \u003d payload[\"data\"]\n\tself.custom.duration_filter \u003d duration", "sessionScope": false, "viewScope": false } ] }, "type": "ia.display.table" } ], "meta": { "name": "Table" }, "position": { "basis": "980px", "grow": 1 }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "update-historical-data", "pageScope": true, "script": "#\tdata \u003d payload[\"data\"]\n#\tself.getChild(\"Table\").props.data \u003d data", "sessionScope": false, "viewScope": false } ] }, "type": "ia.container.flex" }, { "children": [ { "custom": { "download_in_progress": true, "enable_timeout": false, "priority_filters": "", "time_from_filter": { "$": [ "ts", 192, 1749543368762 ], "$ts": 1749541536000 }, "time_to_filter": { "$": [ "ts", 192, 1749543373742 ], "$ts": 1749629736000 }, "type_filters": null }, "events": { "component": { "onActionPerformed": { "config": { "script": "\twhid \u003d self.session.custom.fc\n\tsession_id \u003d self.session.props.id\n\t\n\tfilters \u003d AWS.build_url_http.get_filters_2(sources \u003d self.custom.source_id_filters, \n\t\t\t\t\t\t\t\t\t\t\t\tdevices \u003d self.custom.device_filters,\n\t\t\t\t\t\t\t\t\t\t\t\tpriorities \u003d self.custom.priority_filters, \n\t\t\t\t\t\t\t\t\t\t\t\ttypes \u003d self.custom.type_filters,\n\t\t\t\t\t\t\t\t\t\t\t\tstart \u003d self.custom.time_from_filter,\n\t\t\t\t\t\t\t\t\t\t\t\tend \u003d self.custom.time_to_filter, \n\t\t\t\t\t\t\t\t\t\t\t\tduration \u003d self.custom.duration_filter)\n\t\n\tCommands.button_commands.send_download_request(whid, filters, session_id)\n\tself.custom.enable_timeout \u003d True\n\tself.custom.download_in_progress \u003d True" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Export" }, "position": { "basis": "120px", "shrink": 0 }, "propConfig": { "custom.disable": { "binding": { "config": { "expression": "if(isNull({this.custom.start_time}), False, secondsBetween({this.custom.start_time}, {this.custom.time_now}))" }, "transforms": [ { "code": "\tif value \u003e 60:\n\t\tself.custom.enable_timeout \u003d False\n\t\treturn False\n\telse:\n\t\treturn True", "type": "script" } ], "type": "expr" } }, "custom.download_complete": { "binding": { "config": { "path": "session.custom.downloads" }, "transforms": [ { "code": "\tif value \u003d\u003d True:\n\t\tself.custom.download_in_progress \u003d False", "type": "script" } ], "type": "property" } }, "custom.priority_filters": { "persistent": true }, "custom.start_time": { "binding": { "config": { "expression": "{this.custom.enable_timeout}" }, "transforms": [ { "code": "\tif value \u003d\u003d True:\n\t\treturn self.custom.time_now", "type": "script" } ], "type": "expr" } }, "custom.time_from_filter": { "persistent": true }, "custom.time_now": { "binding": { "config": { "expression": "now()" }, "type": "expr" } }, "custom.time_to_filter": { "persistent": true }, "props.enabled": { "binding": { "config": { "expression": "!{this.custom.enable_timeout} || !{this.custom.download_in_progress} " }, "type": "expr" } }, "props.text": { "binding": { "config": { "expression": "if(!{this.custom.enable_timeout}, \"Export\",\r\nif({this.custom.download_in_progress}, \"Exporting...\",\r\n\"Export\"))" }, "type": "expr" } } }, "props": { "image": { "icon": { "path": "material/import_export" } }, "primary": false, "style": { "margin": 15, "marginLeft": 20 } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "set-source-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.source_id_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-device-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.device_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-message-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.message_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-priority-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.priority_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-from-filters", "pageScope": true, "script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_from_filter \u003d time", "sessionScope": false, "viewScope": false }, { "messageType": "set-to-filters", "pageScope": true, "script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_to_filter \u003d time", "sessionScope": false, "viewScope": false }, { "messageType": "reset-historical-filters", "pageScope": true, "script": "\taction \u003d payload[\"data\"]\n\tif action \u003d\u003d \"reset\":\n\t\tself.custom.device_filters \u003d None\n\t\tself.custom.priority_filters \u003d None\n\t\tself.custom.source_id_filters \u003d None\n\t\tself.custom.time_from_filter \u003d None\n\t\tself.custom.time_to_filter \u003d None\n\t\tself.custom.type_filters \u003d None\n\t\tself.custom.duration_filter \u003d None\n\t\tself.props.enabled \u003dTrue\n\t\t", "sessionScope": false, "viewScope": false }, { "messageType": "set-type-filters", "pageScope": true, "script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.type_filters \u003d filters", "sessionScope": false, "viewScope": false }, { "messageType": "set-duration-filters", "pageScope": true, "script": "\tduration \u003d payload[\"data\"]\n\tself.custom.duration_filter \u003d duration", "sessionScope": false, "viewScope": false } ] }, "type": "ia.input.button" }, { "meta": { "name": "Label" }, "position": { "basis": "580px", "grow": 1 }, "type": "ia.display.label" } ], "meta": { "name": "Paginate" }, "position": { "basis": "70px", "shrink": 0 }, "props": { "justify": "space-evenly" }, "type": "ia.container.flex" } ], "meta": { "name": "root" }, "props": { "direction": "column", "style": { "classes": "Background-Styles/Grey-Background" } }, "type": "ia.container.flex" } ], "meta": { "name": "Historical_tab" }, "position": { "tabIndex": 2 }, "props": { "direction": "column", "justify": "space-evenly" }, "type": "ia.container.flex" } ], "custom": { "shelvedAlarms": [ { "activeTime": "2025-06-10 11:03:10", "expirationTime": "Tue Jun 24 10:46:41 GET 2025", "name": "NEEEWWWW", "path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/DBConnected:/alm:NEEEWWWW", "priority": "Low" }, { "activeTime": "2025-06-10 11:03:16", "expirationTime": "Tue Jun 24 10:46:41 GET 2025", "name": "Alarm", "path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/wbsckt_logging:/alm:Alarm", "priority": "Critical" } ] }, "meta": { "name": "TabContainer" }, "position": { "basis": "300px", "grow": 1 }, "propConfig": { "props.currentTabIndex": { "onChange": { "enabled": null, "script": "\n\tif self.props.currentTabIndex !\u003d 0:\n\t\tpayload \u003d {}\n\t\tfilter_on \u003d \"false\"\n\t\tpayload[\"reset\"] \u003d filter_on\n\t\tsystem.perspective.sendMessage(\"reset-filters\", payload \u003dpayload, scope \u003d \"page\")\n\t\t\n\tif currentValue.value \u003d\u003d 1:\n\t shelved_info \u003d system.alarm.getShelvedPaths()\n\t alarms \u003d system.alarm.queryStatus(includeShelved\u003dTrue)\n\t \n\t tableData \u003d []\n\t \n\t for alarm in alarms:\n\t if alarm.isShelved() and not alarm.isAcked() and not alarm.isCleared():\n\t # Get alarm path as string\n\t alarm_path \u003d str(alarm.getSource())\n\t \n\t # Get active time\n\t activeData \u003d alarm.getActiveData()\n\t startTime \u003d activeData.getTimestamp() if activeData else None\n\t \n\t # Find shelved info for this alarm\n\t shelveEntry \u003d \"\"\n\t \n\t for shelved_item in shelved_info:\n\t shelved_str \u003d str(shelved_item)\n\t \n\t if alarm_path in shelved_str:\n\t # Extract the value part (after the first comma)\n\t if \",\" in shelved_str:\n\t start_idx \u003d shelved_str.find(\",\")\n\t shelveEntry \u003d shelved_str[start_idx + 1:].rstrip(\"}\")\n\t break\n\t \n\t # Parse shelved information\n\t expiration \u003d \"\"\n\t \n\t if shelveEntry:\n\t \n\t # Extract expiration (between \"expiration:\" and \",\")\n\t if \"expiration:\" in shelveEntry:\n\t exp_part \u003d shelveEntry.split(\"expiration:\")[1]\n\t if \",\" in exp_part:\n\t expiration \u003d exp_part.split(\",\")[0].strip()\n\t else:\n\t expiration \u003d exp_part.strip()\n\t \n\t tableData.append({\n\t \"name\": alarm.getName(),\n\t \"path\": alarm_path,\n\t \"activeTime\": system.date.format(system.date.fromMillis(startTime), \"yyyy-MM-dd HH:mm:ss\"),\n\t \"expirationTime\": expiration,\n\t \"priority\": str(alarm.getPriority())\n\t })\n\t \n\t self.custom.shelvedAlarms \u003d tableData\n\t \n\t\t\n\ttry:\n\t\tpageid \u003d self.view.custom.activityLogger.alt_pageid + \u0027/\u0027+ self.props.tabs[previousValue.value]\n\t\tpageid \u003d pageid.replace(\u0027 \u0027,\u0027\u0027)\n\t\tpayload \u003d activityLog.productMetrics.createActivityPayload(self.view, \u0027page\u0027, pageid, pageid)\n\t\tself.view.custom.activityLogger.start_time \u003d system.date.now()\n\t\tif payload:\n\t\t\tsystem.perspective.sendMessage(\u0027activityLogger-TabChanged\u0027, payload \u003d payload, scope \u003d \u0027page\u0027)\n\texcept:\n\t\tpass" } } }, "props": { "contentStyle": { "classes": "Background-Styles/Grey-Background" }, "currentTabIndex": 2, "menuType": "modern", "style": { "classes": "Background-Styles/Grey-Background" }, "tabSize": { "width": 140 }, "tabStyle": { "active": { "backgroundColor": "#EEEEEE", "borderLeftColor": "#7FFF00", "borderLeftStyle": "solid", "borderLeftWidth": 5, "borderTopLeftRadius": 5, "borderTopRightRadius": 5, "color": "#000000", "fontFamily": "Arial", "fontWeight": "bold", "outlineStyle": "none", "textDecoration": "underline" }, "inactive": { "backgroundColor": "#D7D7D7", "borderLeftColor": "#FFFFFF", "borderTopLeftRadius": 5, "borderTopRightRadius": 5, "color": "#969696", "fontFamily": "Arial" } }, "tabs": [ "Active Alarms", "Shelved Alarms", "Historical" ] }, "type": "ia.container.tab" } ], "meta": { "name": "root" }, "props": { "style": { "classes": "Background-Styles/Main-Background" } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "activityLogger-TabChanged", "pageScope": true, "script": "\t# implement your handler here\n\tif payload:\n\t\tactivityLog.productMetrics.callActivityLoggerAPI(payload)", "sessionScope": false, "viewScope": false } ] }, "type": "ia.container.flex" } }