932 lines
35 KiB
Plaintext
932 lines
35 KiB
Plaintext
{
|
|
"custom": {},
|
|
"params": {},
|
|
"props": {
|
|
"defaultSize": {
|
|
"width": 1255
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onKeyDown": {
|
|
"config": {
|
|
"script": "\tif event.key \u003d\u003d \"Enter\":\n\t\tself.getSibling(\"Button\").findtags(self.props.text)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "TextField"
|
|
},
|
|
"position": {
|
|
"basis": "183px",
|
|
"grow": 1,
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"placeholder": "Tag Name"
|
|
},
|
|
"type": "ia.input.text-field"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tself.findtags(self.getSibling(\"TextField\").props.text)\t\n\tself.parent.parent.getChild(\"Table\").props.data \u003d []\n\tsearchText \u003d self.getSibling(\"TextField\").props.text\n\t\n\tdef doSucc(message):\n\t\tself.parent.parent.getChild(\"Table\").props.data +\u003d message\n\tdef doFail(message):\n\t\tsystem.perspective.print(\"FAILED %s\"%message)\n\n\t_res \u003d []\n\tif len(searchText) \u003e 2:\t\n\t\tfor gw in [\"Ignition-SATB1-IO1\",\"Ignition-SATB1-IO2\", \"Ignition-SATB1-IO3\",\"Ignition-SATB1-IO6\"]:\n\t\t\thndlr \u003d system.util.sendRequestAsync(\"global\", \"FindTags\", payload\u003d{\"search\":searchText}, remoteServer\u003dgw,\n\t\t\tonSuccess\u003ddoSucc, onError\u003ddoFail)\n\t\t\t_res+\u003dsystem.util.sendRequest(\"global\", \"FindTags\", payload\u003d{\"search\":searchText}, remoteServer\u003dgw)\n\t\n\tself.parent.parent.getChild(\"Table\").props.data \u003d _res\t\n\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button"
|
|
},
|
|
"position": {
|
|
"basis": "40px"
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/search"
|
|
}
|
|
},
|
|
"text": ""
|
|
},
|
|
"scripts": {
|
|
"customMethods": [
|
|
{
|
|
"name": "findtags",
|
|
"params": [
|
|
"searchText"
|
|
],
|
|
"script": "\tself.parent.parent.getChild(\"Table\").props.data \u003d []\n\t\n\tdef doSucc(message):\n\t\tself.parent.parent.getChild(\"Table\").props.data +\u003d message\n\tdef doFail(message):\n\t\tsystem.perspective.print(\"FAILED %s\"%message)\n\n\t_res \u003d []\n\tif len(searchText) \u003e 2:\t\n\t\tfor gw in [\"Ignition-SATB1-IO1\",\"Ignition-SATB1-IO2\",\"Ignition-SATB1-IO3\",\n\t\t\t\t\"Ignition-SATB1-IO6\"]:\n#\t\t\thndlr \u003d system.util.sendRequestAsync(\"global\", \"FindTags\", payload\u003d{\"search\":searchText}, remoteServer\u003dgw,\n#\t\t\tonSuccess\u003ddoSucc, onError\u003ddoFail)\n\t\t\t_res+\u003dsystem.util.sendRequest(\"global\", \"FindTags\", payload\u003d{\"search\":searchText}, remoteServer\u003dgw)\n\t\n\tself.parent.parent.getChild(\"Table\").props.data \u003d _res\t"
|
|
}
|
|
],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": []
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "30px"
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Table"
|
|
},
|
|
"position": {
|
|
"basis": "400px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.data": {
|
|
"persistent": false
|
|
}
|
|
},
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "fullPath",
|
|
"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": false,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "partialPath",
|
|
"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": ""
|
|
}
|
|
],
|
|
"enableHeader": false,
|
|
"pager": {
|
|
"bottom": false
|
|
},
|
|
"rows": {
|
|
"style": {
|
|
"fontSize": 12
|
|
}
|
|
},
|
|
"selection": {
|
|
"mode": "multiple interval"
|
|
}
|
|
},
|
|
"type": "ia.display.table"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "TagSelect"
|
|
},
|
|
"position": {
|
|
"basis": "325px"
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"overflow": "visible",
|
|
"paddingLeft": "5px",
|
|
"paddingRight": "5px",
|
|
"paddingTop": "80px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "Mode"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "36px"
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "Historical",
|
|
"value": "historical"
|
|
},
|
|
{
|
|
"label": "Realtime",
|
|
"value": "realtime"
|
|
}
|
|
],
|
|
"value": "historical"
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Mode"
|
|
},
|
|
"position": {
|
|
"basis": "150px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "Start Date"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "DateTimeInput"
|
|
},
|
|
"position": {
|
|
"basis": "36px"
|
|
},
|
|
"propConfig": {
|
|
"props.value": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "addDays({.../EndDate/DateTimeInput.props.value}, -1)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"formattedValue": "Sep 22, 2025 8:06 AM",
|
|
"inputProps": {
|
|
"style": {
|
|
"fontSize": 12
|
|
}
|
|
}
|
|
},
|
|
"type": "ia.input.date-time-input"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "StartDate"
|
|
},
|
|
"position": {
|
|
"basis": "160px",
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"position.display": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{../Mode/Dropdown.props.value} \u003d \"historical\""
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "End Date"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "DateTimeInput"
|
|
},
|
|
"position": {
|
|
"basis": "36px"
|
|
},
|
|
"propConfig": {
|
|
"props.value": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "addDays(now(0),-1)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"formattedValue": "Sep 23, 2025 8:06 AM",
|
|
"inputProps": {
|
|
"style": {
|
|
"fontSize": 12
|
|
}
|
|
}
|
|
},
|
|
"type": "ia.input.date-time-input"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "EndDate"
|
|
},
|
|
"position": {
|
|
"basis": "160px",
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"position.display": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{../Mode/Dropdown.props.value} \u003d \"historical\""
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "Most Recent"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "NumericEntryField"
|
|
},
|
|
"position": {
|
|
"basis": "40px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"format": 0,
|
|
"value": 1
|
|
},
|
|
"type": "ia.input.numeric-entry-field"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "256px"
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "min",
|
|
"value": "minutes"
|
|
},
|
|
{
|
|
"label": "hour",
|
|
"value": "hours"
|
|
},
|
|
{
|
|
"label": "day",
|
|
"value": "days"
|
|
}
|
|
],
|
|
"value": "hours"
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "37px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"gap": "1px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "RealTime"
|
|
},
|
|
"position": {
|
|
"basis": "145px",
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"position.display": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{../Mode/Dropdown.props.value} \u003d \"realtime\""
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "Interval"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "NumericEntryField"
|
|
},
|
|
"position": {
|
|
"basis": "32px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"format": 0,
|
|
"value": 1
|
|
},
|
|
"type": "ia.input.numeric-entry-field"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "256px"
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "min",
|
|
"value": "min"
|
|
},
|
|
{
|
|
"label": "hour",
|
|
"value": "hour"
|
|
},
|
|
{
|
|
"label": "day",
|
|
"value": "day"
|
|
}
|
|
],
|
|
"value": "min"
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "37px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"gap": "1px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Interval"
|
|
},
|
|
"position": {
|
|
"basis": "135px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "32px"
|
|
},
|
|
"props": {
|
|
"text": "Calculation"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "36px"
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "Last Value",
|
|
"value": "LastValue"
|
|
},
|
|
{
|
|
"label": "Average",
|
|
"value": "SimpleAverage"
|
|
},
|
|
{
|
|
"label": "Time Weighted Avg",
|
|
"value": "Average"
|
|
},
|
|
{
|
|
"label": "Minimum",
|
|
"value": "Minimum"
|
|
},
|
|
{
|
|
"label": "Maximum",
|
|
"value": "Maximum"
|
|
},
|
|
{
|
|
"label": "Sum",
|
|
"value": "Sum"
|
|
},
|
|
{
|
|
"label": "Range",
|
|
"value": "Range"
|
|
},
|
|
{
|
|
"label": "Variance",
|
|
"value": "Variance"
|
|
},
|
|
{
|
|
"label": "Std Dev",
|
|
"value": "StdDev"
|
|
},
|
|
{
|
|
"label": "Min Max",
|
|
"value": "MinMax"
|
|
}
|
|
],
|
|
"value": "LastValue"
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Calculation"
|
|
},
|
|
"position": {
|
|
"basis": "175px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"gap": "5px",
|
|
"paddingRight": "3px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tspp \u003d self.parent.parent\n\n\thistMode \u003d spp.getChild(\"Mode\").getChild(\"Dropdown\").props.value\n\tstartDate \u003d spp.getChild(\"StartDate\").getChild(\"DateTimeInput\").props.value\n\tendDate \u003d spp.getChild(\"EndDate\").getChild(\"DateTimeInput\").props.value\n\trecUnit \u003d spp.getChild(\"RealTime\").getChild(\"FlexContainer\").getChild(\"NumericEntryField\").props.value\n\trecMeasure \u003d spp.getChild(\"RealTime\").getChild(\"FlexContainer\").getChild(\"Dropdown\").props.value\n\tintervalUnit \u003d spp.getChild(\"Interval\").getChild(\"FlexContainer\").getChild(\"NumericEntryField\").props.value\n\tintervalMeasure \u003d spp.getChild(\"Interval\").getChild(\"FlexContainer\").getChild(\"Dropdown\").props.value\n\taggMethod \u003d spp.getChild(\"Calculation\").getChild(\"Dropdown\").props.value\n\t\n\tpaths \u003d [row[\"fullPath\"] for row in self.parent.parent.parent.parent.getChild(\"TagSelect\").getChild(\"Table\").props.selection.data]\n\tif histMode \u003d\u003d \"realtime\":\n\t\tendDate \u003d system.date.now()\n\t\tif recMeasure \u003d\u003d \"hours\":\n\t\t\trecUnit \u003d 60 * recUnit\n\t\telif recMeasure \u003d\u003d \"days\":\n\t\t\trecUnit \u003d 1440 * recUnit\n\t\tstartDate \u003d system.date.addMinutes(endDate, -(recUnit))\n\t\n\tintervalMinutes \u003d intervalUnit\n\tif intervalMeasure\u003d\u003d \"hour\":\n\t\tintervalMinutes \u003d intervalUnit * 60\n\telif intervalMeasure \u003d\u003d \"day\":\n\t\tintervalMinutes \u003d intervalUnit * 1440\n#\tsystem.perspective.print(system.tag.queryTagHistory(paths, startDate, endDate, -1, aggMethod, intervalMinutes\u003dintervalMinutes))\n\tspp.parent.getChild(\"Table\").props.data \u003d system.tag.queryTagHistory(paths, startDate, endDate, -1, aggMethod, intervalMinutes\u003dintervalMinutes)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
},
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tspp \u003d self.parent.parent\n\thistMode \u003d spp.getChild(\"Mode\").getChild(\"Dropdown\").props.value\n\tstartDate \u003d spp.getChild(\"StartDate\").getChild(\"DateTimeInput\").props.value\n\tendDate \u003d spp.getChild(\"EndDate\").getChild(\"DateTimeInput\").props.value\n\trecUnit \u003d spp.getChild(\"RealTime\").getChild(\"FlexContainer\").getChild(\"NumericEntryField\").props.value\n\trecMeasure \u003d spp.getChild(\"RealTime\").getChild(\"FlexContainer\").getChild(\"Dropdown\").props.value\n\tintervalUnit \u003d spp.getChild(\"Interval\").getChild(\"FlexContainer\").getChild(\"NumericEntryField\").props.value\n\tintervalMeasure \u003d spp.getChild(\"Interval\").getChild(\"FlexContainer\").getChild(\"Dropdown\").props.value\n\taggMethod \u003d spp.getChild(\"Calculation\").getChild(\"Dropdown\").props.value\n\t\n\tpaths \u003d[point[\"data\"][\"source\"] for point in self.view.params.selectedPens]\n\t\n\tif histMode \u003d\u003d \"realtime\":\n\t\tendDate \u003d system.date.now()\n\t\tif recMeasure \u003d\u003d \"hours\":\n\t\t\trecUnit \u003d 60 * recUnit\n\t\telif recMeasure \u003d\u003d \"days\":\n\t\t\trecUnit \u003d 1440 * recUnit\n\t\tstartDate \u003d system.date.addMinutes(endDate, -(recUnit))\n\telse:\n\t\tpass\n\t\n\tintervalMinutes \u003d intervalUnit\n\tif intervalMeasure\u003d\u003d \"hour\":\n\t\tintervalMinutes \u003d intervalUnit * 60\n\telif intervalMeasure \u003d\u003d \"day\":\n\t\tintervalMinutes \u003d intervalUnit * 1440\n#\tsystem.perspective.print(system.tag.queryTagHistory(paths, startDate, endDate, -1, aggMethod, intervalMinutes\u003dintervalMinutes))\n\tspp.parent.getChild(\"Table\").props.data \u003d system.tag.queryTagHistory(paths, startDate, endDate, -1, aggMethod, intervalMinutes\u003dintervalMinutes)"
|
|
},
|
|
"enabled": false,
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Set"
|
|
},
|
|
"position": {
|
|
"basis": "34px"
|
|
},
|
|
"props": {
|
|
"text": "Set"
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tds \u003d self.parent.parent.parent.getChild(\"Table\").props.data\n\tbyteData \u003d system.dataset.toExcel(True, [ds], [\"Trend\"])\n\tfName \u003d \"EQ Data Export.xls\"%()\n\tsystem.perspective.download(fName, byteData)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Export"
|
|
},
|
|
"position": {
|
|
"basis": "34px"
|
|
},
|
|
"props": {
|
|
"text": "Export"
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Buttons"
|
|
},
|
|
"position": {
|
|
"basis": "114px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"justify": "space-around"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Settings"
|
|
},
|
|
"position": {
|
|
"basis": "85px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Table"
|
|
},
|
|
"position": {
|
|
"basis": "400px",
|
|
"grow": 1,
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"props.columns": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.props.data"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\timport copy\n\tallCols \u003d []\n\ttry:\n\t\theaders \u003d system.dataset.getColumnHeaders(value)\n\t\ttemplate \u003d {\n\t\t\t \"field\": \"\",\n\t\t\t \"visible\": True,\n\t\t\t \"editable\": False,\n\t\t\t \"render\": \"auto\",\n\t\t\t \"justify\": \"auto\",\n\t\t\t \"align\": \"center\",\n\t\t\t \"resizable\": False,\n\t\t\t \"sortable\": False,\n\t\t\t \"sort\": \"none\",\n\t\t\t \"filter\": {\n\t\t\t \"enabled\": False,\n\t\t\t \"visible\": \"on-hover\",\n\t\t\t \"string\": {\n\t\t\t \"condition\": \"\",\n\t\t\t \"value\": \"\"\n\t\t\t },\n\t\t\t \"number\": {\n\t\t\t \"condition\": \"\",\n\t\t\t \"value\": \"\"\n\t\t\t },\n\t\t\t \"boolean\": {\n\t\t\t \"condition\": \"\"\n\t\t\t },\n\t\t\t \"date\": {\n\t\t\t \"condition\": \"\",\n\t\t\t \"value\": \"\"\n\t\t\t }\n\t\t\t },\n\t\t\t \"viewPath\": \"\",\n\t\t\t \"viewParams\": {},\n\t\t\t \"boolean\": \"checkbox\",\n\t\t\t \"number\": \"value\",\n\t\t\t \"toggleSwitch\": {\n\t\t\t \"color\": {\n\t\t\t \"selected\": \"\",\n\t\t\t \"unselected\": \"\"\n\t\t\t }\n\t\t\t },\n\t\t\t \"nullFormat\": {\n\t\t\t \"includeNullStrings\": False,\n\t\t\t \"strict\": False,\n\t\t\t \"nullFormatValue\": \"\"\n\t\t\t },\n\t\t\t \"numberFormat\": \"0,0.##\",\n\t\t\t \"dateFormat\": \"MM/DD/YYYY\",\n\t\t\t \"width\": \"\",\n\t\t\t \"strictWidth\": False,\n\t\t\t \"style\": {\n\t\t\t \"classes\": \"\"\n\t\t\t },\n\t\t\t \"header\": {\n\t\t\t \"title\": \"\",\n\t\t\t \"justify\": \"left\",\n\t\t\t \"align\": \"center\",\n\t\t\t \"style\": {\n\t\t\t \"classes\": \"\"\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\n\t\tfor colname in headers:\n\t\t\tt1 \u003d copy.deepcopy(template)\n\t\t\tt1[\"field\"] \u003d colname\n\t\t\tif colname \u003d\u003d \"t_stamp\":\n\t\t\t\tt1[\"render\"] \u003d \"date\"\n\t\t\t\tt1[\"dateFormat\"] \u003d \"MM/DD/YYYY HH:mm:ss\"\n\t\t\t\tt1[\"header\"][\"title\"] \u003d \"Timestamp\"\n\t\t\tallCols.append(t1)\n\texcept:\n\t\tpass\n\treturn allCols\n\t",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.data": {
|
|
"persistent": false
|
|
}
|
|
},
|
|
"props": {
|
|
"emptyMessage": {
|
|
"noData": {
|
|
"text": "No Data Found"
|
|
}
|
|
}
|
|
},
|
|
"type": "ia.display.table"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Data"
|
|
},
|
|
"position": {
|
|
"basis": "200px",
|
|
"grow": 1
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"overflow": "visible"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"gap": "5px"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |