{ "custom": { "activityLogger": { "alt_pageid": "alarms", "pageid": "alarms/ActiveAlarms", "start_time": { "$": [ "ts", 192, 1748425447154 ], "$ts": 1748425447154 } } }, "params": {}, "propConfig": { "custom.activityLogger": { "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": { "background_on": "false" }, "events": { "component": { "onActionPerformed": { "config": { "script": "\tpriority \u003d \u0027diagnostic\u0027\n\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" } ], "custom": { "priorities": { "diagnostic": false, "high": false, "low": false, "medium": false } }, "events": { "system": { "onStartup": { "config": { "script": "\tself.custom.priorities \u003d {\n\t \"diagnostic\": False,\n\t \"low\": False,\n\t \"medium\": False,\n\t \"high\": False,\n\t}" }, "scope": "G", "type": "script" } } }, "meta": { "name": "FlexContainer" }, "position": { "basis": "700px", "shrink": 0 }, "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 \"diagnostic\": False,\n\t \"low\": False,\n\t \"medium\": False,\n\t \"high\": False,\n\t \"critical\": False\n\t}\n\tself.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\").props.filter.text \u003d \"\"\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": "\tfrom datetime import datetime\n\ttry:\n\t # Get table data\n\t data \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\").props.data\n\t \n\t column_order \u003d [\n\t \"ID\",\n\t \"StartTimestamp\", \n\t \"Duration\",\n\t \"Priority\",\n\t \"Location\",\n\t \"Description\",\n\t \"Tag\"\n\t ]\n\t\n\t # CSV header\n\t csv_content \u003d \",\".join(column_order) + \"\\n\"\n\t \n\t def unwrap(v):\n\t\t\tif hasattr(v, \u0027value\u0027):\n\t\t\t\treturn str(v.value)\n\t \t\n\t\t\treturn v\n\t \n\t if data and len(data) \u003e 0:\n\t for item in data:\n\t row_data \u003d []\n\t \n\t for col in column_order:\n\t # Look for the column in the current item\n\t if col in item:\n\t cell \u003d item[col]\n\t # Extract the value from the nested structure\n\t if isinstance(cell, dict) and \"value\" in cell:\n\t raw_value \u003d cell[\"value\"]\n\t else:\n\t raw_value \u003d cell\n\t else:\n\t raw_value \u003d \"\"\n\t \n\t # Process and clean the value\n\t processed_value \u003d unwrap(raw_value).replace(\",\", \";\")\n\t row_data.append(processed_value)\n\t \n\t csv_content +\u003d \",\".join(row_data) + \"\\n\"\n\t else:\n\t csv_content +\u003d \"No alarms in current view\\n\"\n\t\n\texcept Exception as e:\n\t system.perspective.print(\"Export Error: \" + str(e))\n\t csv_content \u003d \"Export failed\\n\"\n\t\n\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\tsystem.perspective.download(\"active_alarms.csv\", csv_bytes) \n\t \n\t \n\t \n\t\n#\t if data and len(data) \u003e 0:\n#\t for row in data:\n#\t val \u003d row.get(\"value\", {})\n#\t row_data \u003d [\n#\t str(val.get(\"NumberID\", \"\")),\n#\t str(val.get(\"EventTimestamp\", \"\")),\n#\t str(val.get(\"Duration\", \"\")),\n#\t str(val.get(\"Priority\", \"\")),\n#\t str(val.get(\"Description\", \"\")),\n#\t str(val.get(\"Tag\", \"\"))\n#\t ]\n#\t\n#\t # Escape commas for CSV safety\n#\t row_data \u003d [field.replace(\",\", \";\") for field in row_data]\n#\t csv_content +\u003d \",\".join(row_data) + \"\\n\"\n#\t else:\n#\t csv_content +\u003d \"No alarms in current view\\n\"\n#\t\n#\texcept Exception as e:\n#\t system.perspective.print(\"Error during CSV export: \" + str(e))\n#\t csv_content \u003d \"Error exporting alarm data\\n\"\n#\t\n#\t# Convert to bytes and trigger download\n#\tcsv_bytes \u003d csv_content.encode(\u0027utf-8\u0027)\n#\tsystem.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" } ], "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": [ { "events": { "component": { "onRowDoubleClick": { "config": { "script": "\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)\n\t\n\t" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Table" }, "position": { "basis": "972.9px" }, "propConfig": { "custom.priorities": { "binding": { "config": { "path": ".../FlexContainer/FlexContainer.custom.priorities" }, "transforms": [ { "code": "\t\n\tpriority_to_number \u003d {\n\t \"critical\": 4,\n\t \"high\": 3,\n\t \"medium\": 2,\n\t \"low\": 1,\n\t \"diagnostic\": 0\n\t}\n\t\n\t\n\t# Collect enabled priorities\n\tenabled \u003d [str(priority_to_number[k]) for k, v in value.items() if v]\n\t\n\tresult \u003d \",\".join(enabled)\n\t\n\tif not result:\n\t\treturn \"\"\n\t\n\treturn result\n\t\n", "type": "script" } ], "type": "property" } }, "props.data": { "binding": { "config": { "parameters": { "priorityList": "{this.custom.priorities}" }, "polling": { "enabled": true, "rate": "3" }, "queryPath": "GetActiveAlarms" }, "transforms": [ { "code": "\n\tfrom system.dataset import toPyDataSet\n\n\tds \u003d toPyDataSet(value)\n\tdata \u003d []\n\n\tcolumn_names \u003d [col for col in ds.columnNames if col !\u003d \"EndTimestamp\"]\n\t\n\n\tfor row in ds:\n\t\tpriority \u003d row[\"Priority\"]\n\n\t\t# Use style class names from Perspective\n\t\tif priority \u003d\u003d \"High\":\n\t\t\tclassName \u003d \"Alarms-Styles/High\"\n\t\telif priority \u003d\u003d \"Medium\":\n\t\t\tclassName \u003d \"Alarms-Styles/Medium\"\n\t\telif priority \u003d\u003d \"Low\":\n\t\t\tclassName \u003d \"Alarms-Styles/Low\"\n\t\telif priority \u003d\u003d \"Diagnostic\":\n\t\t\tclassName \u003d \"Alarms-Styles/Diagnostic\"\n\t\telse:\n\t\t\tclassName \u003d \"Alarms-Styles/NoAlarm\"\n\n\t\t# Apply the style class to all cells in the row\n\t\trow_dict \u003d {\n\t\t\tcol: {\n\t\t\t\t\"value\": row[col],\n\t\t\t\t\"style\": { \"classes\": className }\n\t\t\t} for col in column_names\n\t\t}\n\t\tdata.append(row_dict)\n\n\treturn data", "type": "script" } ], "type": "query" } } }, "props": { "columns": [ { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "NumberID", "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": "Number (ID)" }, "justify": "left", "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": 70 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, "field": "StartTimestamp", "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": "Event Timestamp" }, "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": 70 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Duration", "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": "string", "resizable": true, "sort": "none", "sortable": true, "strictWidth": false, "style": { "classes": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": 70 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "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": 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": 70 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Location", "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": "ascending", "sortable": true, "strictWidth": false, "style": { "classes": "" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": 70 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "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": 150 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Tag", "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": 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": { "noData": { "text": "No Active Alarms" }, "noFilterResults": { "text": "No Active Alarms" } }, "filter": { "enabled": true, "results": { "enabled": true } } }, "type": "ia.display.table" } ], "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": [ { "events": { "component": { "onActionPerformed": { "config": { "script": "\tfrom datetime import datetime\n\t\n\ttry:\n\t data \u003d self.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\").props.data\n\t\n\t column_order \u003d [\n\t \"FirstTimestamp\",\n\t \"LastTimestamp\", \n\t \"Count\",\n\t \"Duration\",\n\t \"Priority\",\n\t \"Location\",\n\t \"Description\",\n\t \"Tag\"\n\t ]\n\t\n\t csv_content \u003d \",\".join(column_order) + \"\\n\"\n\t \t\n\t def unwrap(v):\n\t\t\tif hasattr(v, \u0027value\u0027):\n\t\t\t\treturn str(v.value)\n\t \t\n\t\t\treturn v\n\t \t\n\t if data and len(data) \u003e 0:\n\t for item in data:\n\t row_data \u003d []\n\t \n\t for col in column_order:\n\t # Look for the column in the current item\n\t if col in item:\n\t cell \u003d item[col]\n\t # Extract the value from the nested structure\n\t if isinstance(cell, dict) and \"value\" in cell:\n\t raw_value \u003d cell[\"value\"]\n\t else:\n\t raw_value \u003d cell\n\t else:\n\t raw_value \u003d \"\"\n\t \n\t # Process and clean the value\n\t processed_value \u003d unwrap(raw_value).replace(\",\", \";\")\n\t row_data.append(processed_value)\n\t \n\t csv_content +\u003d \",\".join(row_data) + \"\\n\"\n\t else:\n\t csv_content +\u003d \"No alarms in current view\\n\"\n\t\n\texcept Exception as e:\n\t system.perspective.print(\"Export Error: \" + str(e))\n\t csv_content \u003d \"Export failed\\n\"\n\t\n\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\tsystem.perspective.download(\"active_alarms.csv\", csv_bytes)" }, "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": "FlexContainer" }, "position": { "basis": "70px" }, "props": { "alignContent": "flex-start", "style": { "overflow": "visible" } }, "type": "ia.container.flex" }, { "children": [ { "events": { "component": { "onRowDoubleClick": { "config": { "script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)" }, "scope": "G", "type": "script" } } }, "meta": { "name": "AlarmsTable" }, "position": { "basis": "1080px", "grow": 1 }, "propConfig": { "props.data": { "binding": { "config": { "polling": { "enabled": true, "rate": "3" }, "queryPath": "GetAlarmsWithCount" }, "transforms": [ { "code": "\n\tfrom system.dataset import toPyDataSet\n\n\tds \u003d toPyDataSet(value)\n\tdata \u003d []\n\n\tcolumn_names \u003d list(ds.columnNames)\n\n\tfor row in ds:\n\t\tpriority \u003d row[\"Priority\"]\n\n\t\t# Use style class names from Perspective\n\t\tif priority \u003d\u003d \"High\":\n\t\t\tclassName \u003d \"Alarms-Styles/High\"\n\t\telif priority \u003d\u003d \"Medium\":\n\t\t\tclassName \u003d \"Alarms-Styles/Medium\"\n\t\telif priority \u003d\u003d \"Low\":\n\t\t\tclassName \u003d \"Alarms-Styles/Low\"\n\t\telif priority \u003d\u003d \"Diagnostic\":\n\t\t\tclassName \u003d \"Alarms-Styles/Diagnostic\"\n\t\telse:\n\t\t\tclassName \u003d \"Alarms-Styles/NoAlarm\"\n\n\t\t# Apply the style class to all cells in the row\n\t\trow_dict \u003d {\n\t\t\tcol: {\n\t\t\t\t\"value\": row[col],\n\t\t\t\t\"style\": { \"classes\": className }\n\t\t\t} for col in column_names\n\t\t}\n\t\tdata.append(row_dict)\n\n\treturn data\n", "type": "script" } ], "type": "query" } }, "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": "MM/DD/YYYY HH:mm:ss", "editable": false, "field": "FirstTimestamp", "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": { "backgroundColor": "#FFFEFE", "classes": "" }, "title": "First Timestamp" }, "justify": "left", "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": "LastTimestamp", "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": "Last 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": "Count", "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": "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": "" }, "title": "" }, "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", "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": 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": "Location", "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": "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": 150 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Tag", "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": "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": { "noData": { "text": "No Alarms" }, "noFilterResults": { "text": "No Alarms" } }, "filter": { "enabled": true, "results": { "enabled": true } }, "pager": { "activeOption": 5 } }, "type": "ia.display.table" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "500px", "grow": 1 }, "type": "ia.container.flex" } ], "meta": { "name": "Hit_List" }, "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": false, "endDate": { "$": [ "ts", 192, 1750436956149 ], "$ts": 1750436956149 }, "startDate": { "$": [ "ts", 192, 1750436956149 ], "$ts": 1750435156149 } }, "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 20, 2025 7:59 PM", "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 20, 2025 8:29 PM", "maxDate": { "$": [ "ts", 192, 1749542669794 ], "$ts": 1749715452000 }, "style": { "margin": 15 }, "value": { "$": [ "ts", 201, 1750436956149 ], "$ts": 1750436956149 } }, "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": { "max_duration": { "$": [ "ts", 192, 1748426336635 ], "$ts": 1747562336635 }, "priority_filters": "", "time_from_filter": { "$": [ "ts", 192, 1754319546080 ], "$ts": 1750435156149 }, "time_to_filter": { "$": [ "ts", 192, 1754319546081 ], "$ts": 1750436956149 } }, "events": { "component": { "onRowDoubleClick": { "config": { "script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)" }, "scope": "G", "type": "script" } } }, "meta": { "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" }, "transforms": [ { "code": "\n\tfrom system.dataset import toPyDataSet\n\n\tds \u003d toPyDataSet(value)\n\tdata \u003d []\n\n\tcolumn_names \u003d list(ds.columnNames)\n\n\tfor row in ds:\n\t\tpriority \u003d row[\"Priority\"]\n\n\t\t# Use style class names from Perspective\n\t\tif priority \u003d\u003d \"High\":\n\t\t\tclassName \u003d \"Alarms-Styles/High\"\n\t\telif priority \u003d\u003d \"Medium\":\n\t\t\tclassName \u003d \"Alarms-Styles/Medium\"\n\t\telif priority \u003d\u003d \"Low\":\n\t\t\tclassName \u003d \"Alarms-Styles/Low\"\n\t\telif priority \u003d\u003d \"Diagnostic\":\n\t\t\tclassName \u003d \"Alarms-Styles/Diagnostic\"\n\t\telse:\n\t\t\tclassName \u003d \"Alarms-Styles/NoAlarm\"\n\n\t\t# Apply the style class to all cells in the row\n\t\trow_dict \u003d {\n\t\t\tcol: {\n\t\t\t\t\"value\": row[col],\n\t\t\t\t\"style\": { \"classes\": className }\n\t\t\t} for col in column_names\n\t\t}\n\t\tdata.append(row_dict)\n\n\treturn data", "type": "script" } ], "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": "" }, "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": "Location", "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": "" }, { "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": { "noData": { "text": "No Alarms" }, "noFilterResults": { "text": "No Alarms" } }, "enabled": true, "filter": { "enabled": true, "results": { "enabled": true } }, "pager": { "bottom": false }, "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, 1754319546080 ], "$ts": 1750435156149 }, "time_to_filter": { "$": [ "ts", 192, 1754319546080 ], "$ts": 1750436956149 }, "type_filters": null }, "events": { "component": { "onActionPerformed": { "config": { "script": "\n from datetime import datetime\n def format_date(value):\n\t\tif isinstance(value, (int, long)) and value \u003e 10000000:\n\t\t\ttimestamp \u003d system.date.fromMillis(value)\n\t\t\treturn system.date.format(timestamp, \"yyyy-MM-dd HH:mm:ss\")\n\t\t\t\n\t\t# If value is not a valid timestamp, return as-is\n\t\treturn str(value)\n \n try:\n\n # Get filtered data\n table \u003d self.parent.parent.getChild(\"Table\").getChild(\"Table\")\n filtered_data \u003d table.props.filter.results.data\n\n if not filtered_data or len(filtered_data) \u003d\u003d 0:\n system.perspective.print(\"No filtered data to export.\")\n return\n\n # Get correct column order from the table\u0027s column config\n column_order \u003d [col[\"field\"] for col in table.props.columns if \"field\" in col]\n\n csv_content \u003d \",\".join(column_order) + \"\\n\"\n\n # Build rows\n for row_dict in filtered_data:\n row \u003d []\n for col in column_order:\n raw_val \u003d row_dict.get(col, \"\")\n value \u003d format_date(raw_val)\n value \u003d value.replace(\",\", \";\") # CSV safety\n row.append(value)\n csv_content +\u003d \",\".join(row) + \"\\n\"\n\n # Export CSV\n csv_bytes \u003d csv_content.encode(\"utf-8\")\n system.perspective.download(\"filtered_alarms_history.csv\", csv_bytes)\n\n system.perspective.print(\"CSV export completed successfully. Exported %d records.\" % len(filtered_data))\n\n except Exception as e:\n system.perspective.print(\"Export failed: \" + str(e))" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Export", "tooltip": { "enabled": true, "text": "Exports the data displayed in the table." } }, "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": [] }, "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" }, "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", "Alarm Hit List", "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" } }