From cd75f68557f9fe6d023366705ec65e8477ea7c75 Mon Sep 17 00:00:00 2001 From: "gigi.mamaladze" Date: Sat, 18 Oct 2025 21:27:13 +0400 Subject: [PATCH] Updated Dumper cycles tables --- .../views/Windows/Statistics/view.json | 1415 ++++++++++++++--- .../Dumper/Dumper Lane Percent/query.sql | 22 +- 2 files changed, 1218 insertions(+), 219 deletions(-) diff --git a/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json b/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json index f9c068c..c98d98c 100644 --- a/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json +++ b/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json @@ -1125,24 +1125,12 @@ "children": [ { "meta": { - "name": "Dumper cycles" + "name": "Dumper cycles Count" }, "position": { "basis": "50%" }, "propConfig": { - "custom.mode": { - "binding": { - "config": { - "expression": "{..../Statistics.props.currentTabIndex} \r\n+ {..../Period_not_Global_0/Period.props.value} \r\n+ {..../Period_not_Global_0/EndTime.custom.Selected}\r\n+ {..../Period_not_Global_0/StartTime.custom.Selected} \r\n+ {this.custom.time} \r\n+ {..../Lane Drop Down/Lane.props.value} \r\n+ {..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value}\r\n" - }, - "type": "expr" - }, - "onChange": { - "enabled": null, - "script": "\tpath \u003d \"\"\n\theaders \u003d []\n\tgraph \u003d []\n\t\n\tif self.parent.parent.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\tpath \u003d \"Dumper/Dumper Lane Count\"\n\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Total\",\"Cycles of ULC1\",\"Cycles of ULC2\",\"Cycles of ULC3\",\"Cycles of ULC4\"]\n\t\tself.getSibling(\"Dumper_cycles\").props.yAxes[0].value.range.max \u003d \"\"\n\t\n\telif self.parent.parent.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\tpath \u003d \"Dumper/Dumper Lane Percent\"\n\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULC1 (%)\",\"Cycles of ULC2 (%)\",\"Cycles of ULC3 (%)\",\"Cycles of ULC4 (%)\"]\n\t\tself.getSibling(\"Dumper_cycles\").props.yAxes[0].value.range.max \u003d 100\n\t\n\telse:\n\t\tpath \u003d \"Dumper/Dumper Lane Rate\"\n\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULC1 (cph)\",\"Cycles of ULC2 (cph)\",\"Cycles of ULC3 (cph)\",\"Cycles of ULC4 (cph)\"]\n\t\tself.getSibling(\"Dumper_cycles\").props.yAxes[0].value.range.max \u003d \"\"\n\t\n\tparams \u003d {\n\t\t\"starttime\": self.parent.parent.parent.getChild(\"Period_not_Global_0\").custom.StartDate,\n\t\t\"endtime\": self.parent.parent.parent.getChild(\"Period_not_Global_0\").custom.EndDate,\n\t\t\"dumper\": self.parent.parent.parent.getChild(\"Dumper Drop Down_0\").getChild(\"Dumper\").props.value\n\t}\t\n\t\n\tdata \u003d system.dataset.toPyDataSet(system.db.runNamedQuery(path, params))\n\t\n\t# For Count mode, create separate data points for each lane\n\tif self.parent.parent.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\tfor row in data:\n\t\t\t# Create one data point for each lane\n\t\t\tfor lane in [\u0027ULC1\u0027, \u0027ULC2\u0027, \u0027ULC3\u0027, \u0027ULC4\u0027]:\n\t\t\t\tdict \u003d {}\n\t\t\t\tdict[\u0027Hour\u0027] \u003d lane # Use lane name as X-axis value\n\t\t\t\tdict[\u0027ULC1\u0027] \u003d row[\u0027ULC1\u0027] if lane \u003d\u003d \u0027ULC1\u0027 else 0\n\t\t\t\tdict[\u0027ULC2\u0027] \u003d row[\u0027ULC2\u0027] if lane \u003d\u003d \u0027ULC2\u0027 else 0\n\t\t\t\tdict[\u0027ULC3\u0027] \u003d row[\u0027ULC3\u0027] if lane \u003d\u003d \u0027ULC3\u0027 else 0\n\t\t\t\tdict[\u0027ULC4\u0027] \u003d row[\u0027ULC4\u0027] if lane \u003d\u003d \u0027ULC4\u0027 else 0\n\t\t\t\tgraph.append(dict)\n\telse:\n\t\t# For Rate and Percentage modes, use Hour on X-axis\n\t\tfor row in data:\n\t\t\tdict \u003d {}\n\t\t\tdict[\u0027Hour\u0027] \u003d row[\u0027Hour\u0027]\n\t\t\tdict[\u0027ULC1\u0027] \u003d row[\u0027ULC1\u0027]\n\t\t\tdict[\u0027ULC2\u0027] \u003d row[\u0027ULC2\u0027]\n\t\t\tdict[\u0027ULC3\u0027] \u003d row[\u0027ULC3\u0027]\n\t\t\tdict[\u0027ULC4\u0027] \u003d row[\u0027ULC4\u0027]\n\t\t\tgraph.append(dict)\n\t\n\t# GET CHART COMPONENT\n\tdumper_chart \u003d self.getSibling(\"Dumper_cycles\")\n\t\n\t# SOLUTION 1: Replace entire dataSources object (MOST RELIABLE)\n\tdumper_chart.props.dataSources \u003d {\"example\": graph}\n\t\n\t# SOLUTION 2: Update table data\n\tself.props.data \u003d system.dataset.toDataSet(headers, data)" - } - }, "custom.time": { "binding": { "config": { @@ -1151,23 +1139,19 @@ "type": "expr" } }, - "props.columns[7].visible": { + "meta.visible": { "binding": { "config": { "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" }, "transforms": [ { - "fallback": true, + "fallback": false, "inputType": "scalar", "mappings": [ { - "input": "Percentage", - "output": false - }, - { - "input": "Rate", - "output": false + "input": "Count", + "output": true } ], "outputType": "scalar", @@ -1176,6 +1160,40 @@ ], "type": "property" } + }, + "position.display": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": false, + "inputType": "scalar", + "mappings": [ + { + "input": "Count", + "output": true + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "props.data": { + "binding": { + "config": { + "parameters": { + "endtime": "{..../Period_not_Global_0/EndTime.props.value}", + "starttime": "{..../Period_not_Global_0/StartTime.props.value}" + }, + "queryPath": "Dumper/Dumper Lane Count" + }, + "type": "query" + } } }, "props": { @@ -1185,7 +1203,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "", + "field": "StartTimestamp", "footer": { "align": "center", "justify": "left", @@ -1196,11 +1214,11 @@ }, "header": { "align": "center", - "justify": "left", + "justify": "center", "style": { "classes": "" }, - "title": "n/a" + "title": "Start Timestamp" }, "justify": "center", "number": "value", @@ -1232,7 +1250,7 @@ "render": "date", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1245,7 +1263,7 @@ }, "viewParams": {}, "viewPath": "", - "visible": false, + "visible": true, "width": "" }, { @@ -1253,7 +1271,7 @@ "boolean": "value", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "", + "field": "EndTimestamp", "footer": { "align": "center", "justify": "left", @@ -1268,7 +1286,7 @@ "style": { "classes": "" }, - "title": "Start Timestamp" + "title": "End Timestamp" }, "justify": "center", "number": "value", @@ -1300,7 +1318,7 @@ "render": "date", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1321,7 +1339,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "", + "field": "Total", "footer": { "align": "center", "justify": "left", @@ -1336,7 +1354,7 @@ "style": { "classes": "" }, - "title": "Hour" + "title": "Total" }, "justify": "center", "number": "value", @@ -1368,7 +1386,7 @@ "render": "auto", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1389,7 +1407,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, - "field": "", + "field": "ULC1", "footer": { "align": "center", "justify": "left", @@ -1404,7 +1422,606 @@ "style": { "classes": "" }, - "title": "Total (%)" + "title": "ULC1 (#)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC2", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC2 (#)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC3", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC3 (#)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC4", + "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": "ULC4 (#)" + }, + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + } + ], + "filter": { + "results": { + "enabled": true + } + }, + "pager": { + "bottom": false + }, + "rows": { + "style": { + "textAlign": "center" + } + }, + "selection": { + "enableRowSelection": false + }, + "style": { + "marginTop": 20 + }, + "virtualized": false + }, + "type": "ia.display.table" + }, + { + "meta": { + "name": "Dumper cycles Percentage" + }, + "position": { + "basis": "50%" + }, + "propConfig": { + "custom.time": { + "binding": { + "config": { + "expression": "now()" + }, + "type": "expr" + } + }, + "meta.visible": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": false, + "inputType": "scalar", + "mappings": [ + { + "input": "Percentage", + "output": true + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "position.display": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": false, + "inputType": "scalar", + "mappings": [ + { + "input": "Percentage", + "output": true + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "props.data": { + "binding": { + "config": { + "parameters": { + "endtime": "{..../Period_not_Global_0/EndTime.props.value}", + "starttime": "{..../Period_not_Global_0/StartTime.props.value}" + }, + "queryPath": "Dumper/Dumper Lane Percent" + }, + "type": "query" + } + } + }, + "props": { + "columns": [ + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY HH:mm:ss", + "editable": false, + "field": "StartTimestamp", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "Start Timestamp" + }, + "justify": "center", + "number": "value", + "numberFormat": "00:00:00", + "progressBar": { + "bar": { + "color": "", + "style": { + "classes": "" + } + }, + "max": 100, + "min": 0, + "track": { + "color": "", + "style": { + "classes": "" + } + }, + "value": { + "enabled": true, + "format": "0,0.##", + "justify": "center", + "style": { + "classes": "" + } + } + }, + "render": "date", + "resizable": true, + "sort": "none", + "sortable": false, + "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": "EndTimestamp", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "End Timestamp" + }, + "justify": "center", + "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": "date", + "resizable": true, + "sort": "none", + "sortable": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": 150 + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY HH:mm:ss", + "editable": false, + "field": "Total", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "Total" + }, + "justify": "center", + "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": false, + "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": "ULC1", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC1 (%)" }, "justify": "center", "number": "value", @@ -1436,7 +2053,7 @@ "render": "auto", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1457,7 +2074,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, - "field": "", + "field": "ULC2", "footer": { "align": "center", "justify": "left", @@ -1468,15 +2085,15 @@ }, "header": { "align": "center", - "justify": "left", + "justify": "center", "style": { "classes": "" }, - "title": "" + "title": "ULC2 (%)" }, - "justify": "auto", + "justify": "center", "number": "value", - "numberFormat": "0,0.##", + "numberFormat": "0.##%", "progressBar": { "bar": { "color": "", @@ -1504,7 +2121,7 @@ "render": "auto", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1525,7 +2142,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, - "field": "", + "field": "ULC3", "footer": { "align": "center", "justify": "left", @@ -1536,15 +2153,15 @@ }, "header": { "align": "center", - "justify": "left", + "justify": "center", "style": { "classes": "" }, - "title": "" + "title": "ULC3 (%)" }, - "justify": "auto", + "justify": "center", "number": "value", - "numberFormat": "0,0.##", + "numberFormat": "0.##%", "progressBar": { "bar": { "color": "", @@ -1572,7 +2189,7 @@ "render": "auto", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1593,7 +2210,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, - "field": "ulc4", + "field": "ULC4", "filter": { "boolean": { "condition": "" @@ -1623,20 +2240,20 @@ }, "header": { "align": "center", - "justify": "left", + "justify": "center", "style": { "classes": "" }, - "title": "ulg4" + "title": "ULC4 (%)" }, - "justify": "auto", + "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", - "numberFormat": "0,0.##", + "numberFormat": "0.##%", "progressBar": { "bar": { "color": "", @@ -1664,7 +2281,7 @@ "render": "auto", "resizable": true, "sort": "none", - "sortable": true, + "sortable": false, "strictWidth": false, "style": { "classes": "" @@ -1679,157 +2296,539 @@ "viewPath": "", "visible": true, "width": "" - }, - { - "align": "center", - "boolean": "checkbox", - "dateFormat": "MM/DD/YYYY", - "editable": false, - "field": "", - "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": "", - "width": "" } ], - "data": { - "$": [ - "ds", - 192, - 1760752928854 - ], - "$columns": [ - { - "data": [ - "2025-10-08 5:22" - ], - "name": "Start Timestamp", - "type": "String" - }, - { - "data": [ - "2025-10-15 5:22" - ], - "name": "End Timestamp", - "type": "String" - }, - { - "data": [ - 17 - ], - "name": "Total", - "type": "Double" - }, - { - "data": [ - 5 - ], - "name": "Cycles of ULC1", - "type": "Double" - }, - { - "data": [ - 4 - ], - "name": "Cycles of ULC2", - "type": "Double" - }, - { - "data": [ - 4 - ], - "name": "Cycles of ULC3", - "type": "Double" - }, - { - "data": [ - 4 - ], - "name": "Cycles of ULC4", - "type": "Double" - } - ] + "filter": { + "results": { + "enabled": true + } }, + "pager": { + "bottom": false + }, + "rows": { + "style": { + "textAlign": "center" + } + }, + "selection": { + "enableRowSelection": false + }, + "style": { + "marginTop": 20 + }, + "virtualized": false + }, + "type": "ia.display.table" + }, + { + "meta": { + "name": "Dumper cycles Rate" + }, + "position": { + "basis": "50%" + }, + "propConfig": { + "custom.time": { + "binding": { + "config": { + "expression": "now()" + }, + "type": "expr" + } + }, + "meta.visible": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": false, + "inputType": "scalar", + "mappings": [ + { + "input": "Rate", + "output": true + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "position.display": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": false, + "inputType": "scalar", + "mappings": [ + { + "input": "Rate", + "output": true + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } + }, + "props.data": { + "binding": { + "config": { + "parameters": { + "endtime": "{..../Period_not_Global_0/EndTime.props.value}", + "starttime": "{..../Period_not_Global_0/StartTime.props.value}" + }, + "queryPath": "Dumper/Dumper Lane Rate" + }, + "type": "query" + } + } + }, + "props": { + "columns": [ + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY HH:mm:ss", + "editable": false, + "field": "StartTimestamp", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "Start Timestamp" + }, + "justify": "center", + "number": "value", + "numberFormat": "00:00:00", + "progressBar": { + "bar": { + "color": "", + "style": { + "classes": "" + } + }, + "max": 100, + "min": 0, + "track": { + "color": "", + "style": { + "classes": "" + } + }, + "value": { + "enabled": true, + "format": "0,0.##", + "justify": "center", + "style": { + "classes": "" + } + } + }, + "render": "date", + "resizable": true, + "sort": "none", + "sortable": false, + "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": "Hour", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "Hour" + }, + "justify": "center", + "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": "date", + "resizable": true, + "sort": "none", + "sortable": false, + "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": "ULC1", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC1 (Cph)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC2", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC2 (Cph)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC3", + "footer": { + "align": "center", + "justify": "left", + "style": { + "classes": "" + }, + "title": "" + }, + "header": { + "align": "center", + "justify": "center", + "style": { + "classes": "" + }, + "title": "ULC3 (Cph)" + }, + "justify": "center", + "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + }, + { + "align": "center", + "boolean": "checkbox", + "dateFormat": "MM/DD/YYYY", + "editable": false, + "field": "ULC4", + "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": "ULC4 (Cph)" + }, + "justify": "center", + "nullFormat": { + "includeNullStrings": false, + "nullFormatValue": "", + "strict": false + }, + "number": "value", + "numberFormat": "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": false, + "strictWidth": false, + "style": { + "classes": "" + }, + "toggleSwitch": { + "color": { + "selected": "", + "unselected": "" + } + }, + "viewParams": {}, + "viewPath": "", + "visible": true, + "width": "" + } + ], "filter": { "enabled": true, "results": { @@ -1863,7 +2862,7 @@ "example": [ { "Hour": "ULC1", - "ULC1": 5, + "ULC1": "29.41%", "ULC2": 0, "ULC3": 0, "ULC4": 0 @@ -1871,7 +2870,7 @@ { "Hour": "ULC2", "ULC1": 0, - "ULC2": 4, + "ULC2": "23.53%", "ULC3": 0, "ULC4": 0 }, @@ -1879,7 +2878,7 @@ "Hour": "ULC3", "ULC1": 0, "ULC2": 0, - "ULC3": 4, + "ULC3": "23.53%", "ULC4": 0 }, { @@ -1887,7 +2886,7 @@ "ULC1": 0, "ULC2": 0, "ULC3": 0, - "ULC4": 4 + "ULC4": "23.53%" } ] }, @@ -3177,7 +4176,7 @@ "style": { "fontSize": "1.5vmin" }, - "value": "Count" + "value": "Rate" }, "type": "ia.input.dropdown" } @@ -3874,8 +4873,8 @@ "position": { "height": 0.0269, "width": 0.124, - "x": 0.872, - "y": 0.0439 + "x": 0.8725, + "y": 0.0428 }, "props": { "style": { diff --git a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Percent/query.sql b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Percent/query.sql index f2c1bdf..9a0cdd3 100644 --- a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Percent/query.sql +++ b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Percent/query.sql @@ -1,21 +1,21 @@ SELECT - CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp, - CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(dumper_cycles.t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS Hour, - CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0)/COUNT(*) * 100*2, 2),'%') AS ULC1, - CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc2 = 1), 0)/COUNT(*) * 100*2, 2),'%') AS ULC2, - CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc3 = 1), 0)/COUNT(*) * 100*2, 2),'%') AS ULC3, - CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc4 = 1), 0)/COUNT(*) * 100*2, 2),'%') AS ULC4 - + CONCAT(DATE(:starttime), ' ', HOUR(:starttime), ':', LPAD(MINUTE(:starttime), 2, '0')) AS StartTimestamp, + CONCAT(DATE(:endtime), ' ', HOUR(:endtime), ':', LPAD(MINUTE(:endtime), 2, '0')) AS EndTimestamp, + COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc4 = 1), 0) AS Total, + CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) / NULLIF(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc4 = 1), 0), 0) * 100, 2), '%') AS ULC1, + CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) / NULLIF(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc4 = 1), 0), 0) * 100, 2), '%') AS ULC2, + CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) / NULLIF(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc4 = 1), 0), 0) * 100, 2), '%') AS ULC3, + CONCAT(ROUND(COALESCE(SUM(dumper_cycles.ulc4 = 1), 0) / NULLIF(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) + COALESCE(SUM(dumper_cycles.ulc4 = 1), 0), 0) * 100, 2), '%') AS ULC4 FROM dumper_cycles -WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime) -GROUP BY HOUR(dumper_cycles.t_stamp) +WHERE dumper_cycles.t_stamp BETWEEN :starttime AND :endtime UNION ALL -- Default row with zeros when no dumper cycles exist SELECT - CONCAT(DATE(:starttime), ' ', HOUR(:starttime), ':00') AS StartTimestamp, - CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(:starttime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS Hour, + CONCAT(DATE(:starttime), ' ', HOUR(:starttime), ':', LPAD(MINUTE(:starttime), 2, '0')) AS StartTimestamp, + CONCAT(DATE(:endtime), ' ', HOUR(:endtime), ':', LPAD(MINUTE(:endtime), 2, '0')) AS EndTimestamp, + 0 AS Total, '0%' AS ULC1, '0%' AS ULC2, '0%' AS ULC3,