Configure Dumper Statistic

This commit is contained in:
gigi.mamaladze 2025-10-12 20:02:52 +04:00
parent 8351350843
commit bd7fb770f0
17 changed files with 130 additions and 45 deletions

View File

@ -1,7 +1,7 @@
{ {
"custom": {}, "custom": {},
"params": { "params": {
"Tab_ID": 0, "Tab_ID": 1,
"Table": "Statistics" "Table": "Statistics"
}, },
"propConfig": { "propConfig": {
@ -1140,7 +1140,7 @@
}, },
"onChange": { "onChange": {
"enabled": null, "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\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\",\"Cycles of ULGL4\"]\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 ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\",\"Cycles of ULGL4 (%)\"]\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 ULGL1 (cph)\",\"Cycles of ULGL2 (cph)\",\"Cycles of ULGL3 (cph)\",\"Cycles of ULGL4 (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\tfor row in data:\t\n\t\tdict \u003d {}\n\t\tdict[\u0027Hour\u0027] \u003d row[\u0027Hour\u0027]\n\t\tdict[\u0027ULGL1\u0027] \u003d row[\u0027ULGL1\u0027]\n\t\tdict[\u0027ULGL2\u0027] \u003d row[\u0027ULGL2\u0027]\n\t\tdict[\u0027ULGL3\u0027] \u003d row[\u0027ULGL3\u0027]\n\t\tdict[\u0027ULGL4\u0027] \u003d row[\u0027ULGL4\u0027]\n\t\t\n\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)" "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\",\"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 \"\"\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\tfor row in data:\t\n\t\tdict \u003d {}\n\t\tdict[\u0027Hour\u0027] \u003d row[\u0027Hour\u0027]\n\t\tdict[\u0027ULC1\u0027] \u003d row[\u0027ULC1\u0027]\n\t\tdict[\u0027ULC2\u0027] \u003d row[\u0027ULC2\u0027]\n\t\tdict[\u0027ULC3\u0027] \u003d row[\u0027ULC3\u0027]\n\t\tdict[\u0027ULC4\u0027] \u003d row[\u0027ULC4\u0027]\n\t\t\n\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": { "custom.time": {
@ -1159,7 +1159,7 @@
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY HH:mm:ss", "dateFormat": "MM/DD/YYYY HH:mm:ss",
"editable": false, "editable": false,
"field": "ulgl1", "field": "ulc1",
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1227,7 +1227,7 @@
"boolean": "value", "boolean": "value",
"dateFormat": "MM/DD/YYYY HH:mm:ss", "dateFormat": "MM/DD/YYYY HH:mm:ss",
"editable": false, "editable": false,
"field": "ulgl1", "field": "ulc1",
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1295,7 +1295,7 @@
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY HH:mm:ss", "dateFormat": "MM/DD/YYYY HH:mm:ss",
"editable": false, "editable": false,
"field": "ulgl2", "field": "ulc2",
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1363,7 +1363,7 @@
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "ulgl3", "field": "ulc3",
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1567,7 +1567,7 @@
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "ulg4", "field": "ulc4",
"filter": { "filter": {
"boolean": { "boolean": {
"condition": "" "condition": ""
@ -1659,37 +1659,49 @@
"$": [ "$": [
"ds", "ds",
192, 192,
1758706866228 1760284942576
], ],
"$columns": [ "$columns": [
{ {
"data": [], "data": [
"2025-10-12 19:00"
],
"name": "Start Timestamp", "name": "Start Timestamp",
"type": "String" "type": "String"
}, },
{ {
"data": [], "data": [
"H1"
],
"name": "Hour", "name": "Hour",
"type": "String" "type": "String"
}, },
{ {
"data": [], "data": [
"name": "Cycles of ULGL1 (%)", null
],
"name": "Cycles of ULC1 (%)",
"type": "String" "type": "String"
}, },
{ {
"data": [], "data": [
"name": "Cycles of ULGL2 (%)", null
],
"name": "Cycles of ULC2 (%)",
"type": "String" "type": "String"
}, },
{ {
"data": [], "data": [
"name": "Cycles of ULGL3 (%)", null
],
"name": "Cycles of ULC3 (%)",
"type": "String" "type": "String"
}, },
{ {
"data": [], "data": [
"name": "Cycles of ULGL4 (%)", null
],
"name": "Cycles of ULC4 (%)",
"type": "String" "type": "String"
} }
] ]
@ -1724,7 +1736,15 @@
}, },
"props": { "props": {
"dataSources": { "dataSources": {
"example": [] "example": [
{
"Hour": "H1",
"ULC1": null,
"ULC2": null,
"ULC3": null,
"ULC4": null
}
]
}, },
"legend": { "legend": {
"enabled": false "enabled": false
@ -1898,7 +1918,7 @@
"y": "" "y": ""
} }
}, },
"name": "ULGL1", "name": "ULC1",
"render": "column", "render": "column",
"stepLine": { "stepLine": {
"appearance": { "appearance": {
@ -1983,7 +2003,7 @@
"cornerRadius": 3, "cornerRadius": 3,
"enabled": true, "enabled": true,
"pointerLength": 4, "pointerLength": 4,
"text": "ULGL1 (#): [bold]{valueY}[/]" "text": "ULC1 (#): [bold]{valueY}[/]"
}, },
"visible": true, "visible": true,
"xAxis": "Hour", "xAxis": "Hour",
@ -2158,7 +2178,7 @@
"y": "" "y": ""
} }
}, },
"name": "ULGL2", "name": "ULC2",
"render": "column", "render": "column",
"stepLine": { "stepLine": {
"appearance": { "appearance": {
@ -2243,7 +2263,7 @@
"cornerRadius": 3, "cornerRadius": 3,
"enabled": true, "enabled": true,
"pointerLength": 4, "pointerLength": 4,
"text": "ULGL2 (#): [bold]{valueY}[/]" "text": "ULC2 (#): [bold]{valueY}[/]"
}, },
"visible": true, "visible": true,
"xAxis": "Hour", "xAxis": "Hour",
@ -2418,7 +2438,7 @@
"y": "" "y": ""
} }
}, },
"name": "ULGL3", "name": "ULC3",
"render": "column", "render": "column",
"stepLine": { "stepLine": {
"appearance": { "appearance": {
@ -2503,7 +2523,7 @@
"cornerRadius": 3, "cornerRadius": 3,
"enabled": true, "enabled": true,
"pointerLength": 4, "pointerLength": 4,
"text": "ULGL3 (#): [bold]{valueY}[/]" "text": "ULC3 (#): [bold]{valueY}[/]"
}, },
"visible": true, "visible": true,
"xAxis": "Hour", "xAxis": "Hour",
@ -2626,7 +2646,7 @@
"y": "" "y": ""
} }
}, },
"name": "ULGL4", "name": "ULC4",
"render": "column", "render": "column",
"stepLine": { "stepLine": {
"appearance": { "appearance": {
@ -2711,7 +2731,7 @@
"cornerRadius": 3, "cornerRadius": 3,
"enabled": true, "enabled": true,
"pointerLength": 4, "pointerLength": 4,
"text": "ULGL4 (#): [bold]{valueY}[/]" "text": "ULC4 (#): [bold]{valueY}[/]"
}, },
"visible": true, "visible": true,
"xAxis": "Hour", "xAxis": "Hour",
@ -2927,6 +2947,7 @@
} }
}, },
"props": { "props": {
"currentTabIndex": 1,
"menuStyle": { "menuStyle": {
"backgroundColor": "#FFFFFFBD", "backgroundColor": "#FFFFFFBD",
"fontSize": "1.0vmin", "fontSize": "1.0vmin",
@ -5472,7 +5493,7 @@
}, },
"props": { "props": {
"dismissOnSelect": false, "dismissOnSelect": false,
"formattedValue": "Sep 24, 2025 12:41 PM", "formattedValue": "Oct 12, 2025 7:02 PM",
"formattedValues": { "formattedValues": {
"date": "Mar 26, 2021", "date": "Mar 26, 2021",
"datetime": "Mar 26, 2021 12:00 AM", "datetime": "Mar 26, 2021 12:00 AM",
@ -5490,9 +5511,9 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1758706866224 1760284943009
], ],
"$ts": 1758703266000 "$ts": 1760281343000
} }
}, },
"type": "ia.input.date-time-input" "type": "ia.input.date-time-input"
@ -5643,7 +5664,7 @@
}, },
"props": { "props": {
"dismissOnSelect": false, "dismissOnSelect": false,
"formattedValue": "Sep 24, 2025 1:41 PM", "formattedValue": "Oct 12, 2025 8:02 PM",
"formattedValues": { "formattedValues": {
"date": "Mar 29, 2021", "date": "Mar 29, 2021",
"datetime": "Mar 29, 2021 1:37 PM", "datetime": "Mar 29, 2021 1:37 PM",
@ -5661,9 +5682,9 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1758706866223 1760284943106
], ],
"$ts": 1758706866000 "$ts": 1760284943000
} }
}, },
"type": "ia.input.date-time-input" "type": "ia.input.date-time-input"

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"data.bin"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-12T15:42:18Z"
},
"lastModificationSignature": "4504114d561ca43f62412a71d1219ce98b958493d5ac025dae704282be6328ed"
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"data.bin"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-12T15:42:18Z"
},
"lastModificationSignature": "2ce3ba4cdd7f5ee49eb1dc1dce3533d4ae5c21ba5fe614e036b51136bb78a7f1"
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"data.bin"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-12T15:43:43Z"
},
"lastModificationSignature": "ea17210d5fcdc9ef6529f51f389e4a8bee9b07605100c960bce054651c95cf10"
}
}

View File

@ -0,0 +1,16 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"data.bin"
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-12T15:43:21Z"
},
"lastModificationSignature": "5ecf14b27628aceb2e660ed1f6861004d372c7ca64f69591bd804201adeae692"
}
}

View File

@ -2,10 +2,10 @@ SELECT
CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp, 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('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,
SUM(dumper_cycles.ulgl1 = 1) AS ULGL1, SUM(dumper_cycles.ulc1 = 1) AS ULC1,
SUM(dumper_cycles.ulgl2 = 1) AS ULGL2, SUM(dumper_cycles.ulc2 = 1) AS ULC2,
SUM(dumper_cycles.ulgl3 = 1) AS ULGL3, SUM(dumper_cycles.ulc3 = 1) AS ULC3,
SUM(dumper_cycles.ulgl4 = 1) AS ULGL4 -- <-- ADD THIS LINE SUM(dumper_cycles.ulc4 = 1) AS ULC4 -- <-- ADD THIS LINE
FROM dumper_cycles FROM dumper_cycles
WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime) WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)

View File

@ -2,10 +2,10 @@ SELECT
CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp, 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('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(SUM(dumper_cycles.ulgl1 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL1, CONCAT(ROUND(SUM(dumper_cycles.ulc1 = 1)/COUNT(*) * 100*2, 2),'%') AS ULC1,
CONCAT(ROUND(SUM(dumper_cycles.ulgl2 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL2, CONCAT(ROUND(SUM(dumper_cycles.ulc2 = 1)/COUNT(*) * 100*2, 2),'%') AS ULC2,
CONCAT(ROUND(SUM(dumper_cycles.ulgl3 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL3, CONCAT(ROUND(SUM(dumper_cycles.ulc3 = 1)/COUNT(*) * 100*2, 2),'%') AS ULC3,
CONCAT(ROUND(SUM(dumper_cycles.ulgl4 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL4 -- <-- ADD THIS LINE CONCAT(ROUND(SUM(dumper_cycles.ulc4 = 1)/COUNT(*) * 100*2, 2),'%') AS ULC4 -- <-- ADD THIS LINE
FROM dumper_cycles FROM dumper_cycles
WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime) WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)

View File

@ -2,10 +2,10 @@ SELECT
CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp, 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('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(CAST(SUM(dumper_cycles.ulgl1 = 1) AS CHAR),' cph') AS ULGL1, CONCAT(CAST(SUM(dumper_cycles.ulc1 = 1) AS CHAR),' cph') AS ULC1,
CONCAT(CAST(SUM(dumper_cycles.ulgl2 = 1) AS CHAR),' cph') AS ULGL2, CONCAT(CAST(SUM(dumper_cycles.ulc2 = 1) AS CHAR),' cph') AS ULC2,
CONCAT(CAST(SUM(dumper_cycles.ulgl3 = 1) AS CHAR),' cph') AS ULGL3, CONCAT(CAST(SUM(dumper_cycles.ulc3 = 1) AS CHAR),' cph') AS ULC3,
CONCAT(CAST(SUM(dumper_cycles.ulgl4 = 1) AS CHAR),' cph') AS ULGL4 -- <-- ADD THIS LINE CONCAT(CAST(SUM(dumper_cycles.ulc4 = 1) AS CHAR),' cph') AS ULC4 -- <-- ADD THIS LINE
FROM dumper_cycles FROM dumper_cycles
WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime) WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)