BNA8/.resources/e94ead458bfb7b55e017eb6e0ff6f1890297e0fc5f642cf524c00a860680b87c

382 lines
12 KiB
Plaintext

{
"custom": {},
"params": {
"deviceType": "",
"props": {
"config": {
"enableHighlight": true,
"isClickable": false
},
"status": {
"color": "#aaa",
"showAlways": true,
"tagPath": "",
"tooltip": ""
}
}
},
"propConfig": {
"params.deviceType": {
"paramDirection": "input",
"persistent": true
},
"params.props": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 280
}
},
"root": {
"children": [
{
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\tparams \u003d {\n\t\t\"deviceType\": event.value[\"deviceType\"],\n\t\t\"props\": {\n\t\t\t\"status\": {\n\t\t\t\t\"tagPath\": event.value[\"tagPath\"]\n\t\t\t}\n\t\t},\n\t\t\"meta\": {\n\t\t\t\"name\": event.value[\"device\"]\n\t\t},\n\t\t\"tabs\": [\"Status\"]\n\t}\n\t# Close the current popup:\n\t# NOTE: We close before opening the new popup because the pageId changes when opening a new popup\n\tif not self.session.custom.isMobile:\n\t\t#system.perspective.closePopup(\"\")\n\t\tpass\n\t# Open new popup:\n\tpopups.openDevice(params, event.value[\"device\"], self.session.custom.isMobile)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Table"
},
"position": {
"height": "100%",
"width": "100%"
},
"propConfig": {
"custom.devices": {
"binding": {
"config": {
"path": "view.params.props.status.tagPath"
},
"transforms": [
{
"code": "\tif self.view.params.deviceType \u003d\u003d \"mcp\":\n\t\treturn tags.getSiblingDevices(value, [\"conveyor\", \"conveyorcurve\", \"gaylord\"])\n\telif self.view.params.deviceType \u003d\u003d \"chutedestination\":\n\t\treturn tags.getSiblingDevices(value + \"/Chute\", filterTagPath\u003dFalse)\n\telif self.view.params.deviceType \u003d\u003d \"spiralchute\":\n\t\treturn tags.getSiblingDevices(value + \"/CH\", filterTagPath\u003dFalse)\n\telif self.view.params.deviceType \u003d\u003d \"divchute\":\n\t\treturn tags.getSiblingDevices(value + \"/Conv\", filterTagPath\u003dFalse)\n\telse:\n\t\treturn tags.getSiblingDevices(value)",
"type": "script"
}
],
"type": "property"
}
},
"props.data": {
"binding": {
"config": {
"expression": "if(toBoolean(now(5000), false),\r\n\t{this.custom.devices},\r\n\t{this.custom.devices}\r\n)"
},
"overlayOptOut": true,
"transforms": [
{
"code": "\theaders \u003d [\"device\", \"status\", \"tagPath\", \"deviceType\"]\n\tresult \u003d reports.readJsonTable(headers, value)\n\treturn result[\"data\"]",
"type": "script"
}
],
"type": "expr"
}
}
},
"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": "device",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Device"
},
"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,
"sortable": true,
"strictWidth": true,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 225
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "status",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Status"
},
"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": false,
"style": {
"classes": "",
"minWidth": "250px"
},
"toggleSwitch": {
"color": {
"selected": "#2196F3",
"unselected": "#FFFFFF"
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 200
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "tagPath",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Tag"
},
"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": false,
"width": 150
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"editable": false,
"field": "deviceType",
"footer": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": "table/column-header"
},
"title": "Type"
},
"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": false,
"width": 150
}
],
"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": [],
"messageHandlers": [
{
"messageType": "export-data",
"pageScope": true,
"script": "\tname \u003d utils.extractName(self.view.params.props.status)\n\tutils.downloadCSV(self, \"[\"+name+\"]Devices\")",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.display.table"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.coord"
}
}