BNA8/.resources/a4c915247930024b7d74647eec8f2e35a2dbf05a7f373210968b0d2592a8bf19

706 lines
21 KiB
Plaintext

{
"custom": {
"class": 2
},
"params": {
"classDropdownValue": [
"Error"
],
"titleExtra": "0 rows"
},
"propConfig": {
"custom.class": {
"binding": {
"config": {
"path": "view.params.classDropdownValue"
},
"transforms": [
{
"code": "\tvalue \u003d list(value)\n\tif \"Message\" in value:\n\t\treturn 0\n\telif \"Warning\" in value:\n\t\treturn 1\n\telif \"Error\" in value:\n\t\treturn 2\n\telse:\n\t\treturn 0",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"params.classDropdownValue": {
"paramDirection": "input",
"persistent": true
},
"params.classDropdownValue[0]": {
"paramDirection": "input",
"persistent": true
},
"params.titleExtra": {
"paramDirection": "output",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 324,
"width": 1600
}
},
"root": {
"children": [
{
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tscreen \u003d alarms.resolveScreenBySource(event.value.source)\n\tif screen \u003c\u003e \"\":\n\t\twindow \u003d \"Windows/GraphicsWrapper\"\n\t\tparams \u003d {\"view\": screen}\n\t\tsystem.perspective.navigate(\"/\")\n\t\tsystem.perspective.navigate(view\u003dwindow, params\u003dparams)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Table"
},
"position": {
"height": "100%",
"width": "100%"
},
"propConfig": {
"props.data": {
"binding": {
"config": {
"parameters": {
"class": "{view.custom.class}",
"endDate": "{session.custom.timewidget.endDate}",
"priority": "if({view.custom.class} \u003e 0, 1, 0)",
"startDate": "{session.custom.timewidget.startDate}"
},
"queryPath": "Alarms/History"
},
"transforms": [
{
"code": "\tcou \u003d utils.getRowCount(value)\n\tast \u003d \"*\" if cou \u003e\u003d 2000 else \"\"\n\tself.view.params.titleExtra \u003d \"{:n}{} rows\".format(cou, ast)\n\t# Return data\n\treturn value",
"type": "script"
},
{
"code": "\toutput_json \u003d []\n\t# Transform dataset into json:\n\tfor row in range(value.getRowCount()):\n\t\trow_object \u003d {\"value\": {}}\n\t\t# Populate row values:\n\t\tfor col in range(value.getColumnCount()):\n\t\t\trow_object[\"value\"][value.getColumnName(col)] \u003d value.getValueAt(row, col)\n\t\t\t# Check if endtime isn\u0027t reached:\n\t\t\tif value.getColumnName(col) \u003d\u003d \u0027endtime\u0027 and value.getValueAt(row, col) in [None, \"\"]:\n\t\t\t\trow_object[\u0027style\u0027] \u003d {\"background\": \"#F4B084\"}\n\t\t# Append to json output:\n\t\toutput_json.append(row_object)\n\t# Return as json:\n\treturn output_json",
"type": "script"
}
],
"type": "query"
},
"persistent": true
}
},
"props": {
"cells": {
"style": {
"borderBottomColor": "#D5D5D5",
"borderBottomStyle": "solid",
"borderBottomWidth": "1px",
"borderRightColor": "#D5D5D5",
"borderRightStyle": "solid",
"borderRightWidth": "1px",
"fontFamily": "Helvetica",
"fontSize": "16px"
}
},
"columns": [
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "id",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Number (ID)"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": false,
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 125
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "starttime",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Start Timestamp"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": false,
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 175
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "endtime",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "End Timestamp"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": false,
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 175
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "duration",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Duration"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": false,
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 125
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "class",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Class"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": false,
"sort": "none",
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 125
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "device",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Location"
},
"justify": "center",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "description",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": "table/column-header"
},
"title": "Description"
},
"justify": "auto",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "plctag",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": "table/column-header"
},
"title": "Tag"
},
"justify": "auto",
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "#62A3F6",
"linecap": "round",
"width": 5
},
"max": 100,
"track": {
"color": "#DADADA",
"linecap": "round",
"width": 2
},
"value": {
"color": "#7D7D7D",
"show": true
}
},
"render": "auto",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "source",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"justify": "auto",
"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": false,
"width": ""
}
],
"filter": {
"enabled": true
},
"pager": {
"bottom": false
},
"rows": {
"highlight": {
"enabled": false
},
"striped": {
"enabled": false
},
"style": {
"classes": "table/highlight"
}
},
"style": {
"fontFamily": "Helvetica",
"fontSize": "16px",
"fontWeight": "bold",
"zoom": 1
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "export-data",
"pageScope": true,
"script": "\tutils.downloadCSV(self, \"Alarm History\")",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.display.table"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.coord"
}
}