From 30547a4c8c3ed13ca3e322b64014d4e90163aea1 Mon Sep 17 00:00:00 2001 From: "gigi.mamaladze" Date: Sat, 18 Oct 2025 06:03:30 +0400 Subject: [PATCH] Updated Dumper cycles statistics rev1 --- .../views/Windows/Statistics/view.json | 225 ++++++++++++++---- .../Dumper/Dumper Lane Count/query.sql | 14 +- .../Dumper/Dumper Lane Rate/query.sql | 44 ++-- 3 files changed, 210 insertions(+), 73 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 df16d04..f9c068c 100644 --- a/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json +++ b/CNO8_SCADA/com.inductiveautomation.perspective/views/Windows/Statistics/view.json @@ -1140,7 +1140,7 @@ }, "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\",\"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)" + "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": { @@ -1150,6 +1150,32 @@ }, "type": "expr" } + }, + "props.columns[7].visible": { + "binding": { + "config": { + "path": "..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value" + }, + "transforms": [ + { + "fallback": true, + "inputType": "scalar", + "mappings": [ + { + "input": "Percentage", + "output": false + }, + { + "input": "Rate", + "output": false + } + ], + "outputType": "scalar", + "type": "map" + } + ], + "type": "property" + } } }, "props": { @@ -1159,7 +1185,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "ulc1", + "field": "", "footer": { "align": "center", "justify": "left", @@ -1227,7 +1253,7 @@ "boolean": "value", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "ulc1", + "field": "", "footer": { "align": "center", "justify": "left", @@ -1295,7 +1321,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY HH:mm:ss", "editable": false, - "field": "ulc2", + "field": "", "footer": { "align": "center", "justify": "left", @@ -1363,7 +1389,7 @@ "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, - "field": "ulc3", + "field": "", "footer": { "align": "center", "justify": "left", @@ -1653,56 +1679,154 @@ "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, - 1760630767507 + 1760752928854 ], "$columns": [ { "data": [ - "2025-10-16 19:00" + "2025-10-08 5:22" ], "name": "Start Timestamp", "type": "String" }, { "data": [ - "H1" + "2025-10-15 5:22" ], - "name": "Hour", + "name": "End Timestamp", "type": "String" }, { "data": [ - "0.00%" + 17 ], - "name": "Cycles of ULC1 (%)", - "type": "String" + "name": "Total", + "type": "Double" }, { "data": [ - "0.00%" + 5 ], - "name": "Cycles of ULC2 (%)", - "type": "String" + "name": "Cycles of ULC1", + "type": "Double" }, { "data": [ - "0.00%" + 4 ], - "name": "Cycles of ULC3 (%)", - "type": "String" + "name": "Cycles of ULC2", + "type": "Double" }, { "data": [ - "0.00%" + 4 ], - "name": "Cycles of ULC4 (%)", - "type": "String" + "name": "Cycles of ULC3", + "type": "Double" + }, + { + "data": [ + 4 + ], + "name": "Cycles of ULC4", + "type": "Double" } ] }, @@ -1738,11 +1862,32 @@ "dataSources": { "example": [ { - "Hour": "H1", - "ULC1": "0.00%", - "ULC2": "0.00%", - "ULC3": "0.00%", - "ULC4": "0.00%" + "Hour": "ULC1", + "ULC1": 5, + "ULC2": 0, + "ULC3": 0, + "ULC4": 0 + }, + { + "Hour": "ULC2", + "ULC1": 0, + "ULC2": 4, + "ULC3": 0, + "ULC4": 0 + }, + { + "Hour": "ULC3", + "ULC1": 0, + "ULC2": 0, + "ULC3": 4, + "ULC4": 0 + }, + { + "Hour": "ULC4", + "ULC1": 0, + "ULC2": 0, + "ULC3": 0, + "ULC4": 4 } ] }, @@ -2796,7 +2941,7 @@ "label": { "color": "", "enabled": true, - "text": "Hour" + "text": "" }, "name": "Hour", "render": "category", @@ -2909,7 +3054,7 @@ "format": "#,###.##", "logarithmic": false, "range": { - "max": 100, + "max": "", "min": "", "useStrict": false } @@ -3032,7 +3177,7 @@ "style": { "fontSize": "1.5vmin" }, - "value": "Percentage" + "value": "Count" }, "type": "ia.input.dropdown" } @@ -5194,7 +5339,7 @@ "component": { "onActionPerformed": { "config": { - "script": "\tdata \u003d []\n\ttable \u003d []\n\timport datetime\n\tcurrent_datetime\u003ddatetime.datetime.now()\n\tstr_date \u003d current_datetime.strftime(\"%m-%d-%Y %I-%M\")\n\n\n\tif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 0:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Induct Details\").getChild(\"Induct Details\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_count\u0027],result[\u0027singlecarrier_count\u0027],result[\u0027doublecarrier_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_perc\u0027],result[\u0027SingleCarrier_perc\u0027],result[\u0027DoubleCarrier_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_rate\u0027],result[\u0027SingleCarrier_rate\u0027],result[\u0027DoubleCarrier_rate\u0027]])\n\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Induct Details\").getChild(\"Induct Details\").props.data)\n\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_count\u0027],result[\u0027singlecarrier_count\u0027],result[\u0027doublecarrier_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_perc\u0027],result[\u0027SingleCarrier_perc\u0027],result[\u0027DoubleCarrier_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_rate\u0027],result[\u0027SingleCarrier_rate\u0027],result[\u0027DoubleCarrier_rate\u0027]])\n\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Induct Details.csv\u0027, data \u003d csv)\t\n\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 1:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Scanner_Details\").getChild(\"Scanner Details\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No Code (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_count\u0027],result[\u0027GoodRead_count\u0027],result[\u0027NoRead_count\u0027],result[\u0027MultiLabelRead_count\u0027],result[\u0027NoCode_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_perc\u0027],result[\u0027GoodRead_perc\u0027],result[\u0027NoRead_perc\u0027],result[\u0027MultiLabelRead_perc\u0027],result[\u0027NoCode_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_rate\u0027],result[\u0027GoodRead_rate\u0027],result[\u0027NoRead_rate\u0027],result[\u0027MultiLabelRead_rate\u0027],result[\u0027NoCode_rate\u0027]])\n\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Scanner_Details\").getChild(\"Scanner Details\").props.data)\n\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No Code (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_count\u0027],result[\u0027GoodRead_count\u0027],result[\u0027NoRead_count\u0027],result[\u0027MultiLabelRead_count\u0027],result[\u0027NoCode_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_perc\u0027],result[\u0027GoodRead_perc\u0027],result[\u0027NoRead_perc\u0027],result[\u0027MultiLabelRead_perc\u0027],result[\u0027NoCode_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_rate\u0027],result[\u0027GoodRead_rate\u0027],result[\u0027NoRead_rate\u0027],result[\u0027MultiLabelRead_rate\u0027],result[\u0027NoCode_rate\u0027]])\n\t\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Scanner Details.csv\u0027, data \u003d csv)\n\t\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 2:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Sorter Summary\").getChild(\"Sorter Summary\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_count\u0027],result[\u0027Sorted_count\u0027],result[\u0027AWCSRecirc_count\u0027],result[\u0027OperRecirc_count\u0027],result[\u0027MachineRecirc_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_perc\u0027],result[\u0027Sorted_perc\u0027],result[\u0027AWCSRecirc_perc\u0027],result[\u0027OperRecirc_perc\u0027],result[\u0027MachineRecirc_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_rate\u0027],result[\u0027Sorted_rate\u0027],result[\u0027AWCSRecirc_rate\u0027],result[\u0027OperRecirc_rate\u0027],result[\u0027MachineRecirc_rate\u0027]])\n\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Sorter Summary\").getChild(\"Sorter Summary\").props.data)\n\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_count\u0027],result[\u0027Sorted_count\u0027],result[\u0027AWCSRecirc_count\u0027],result[\u0027OperRecirc_count\u0027],result[\u0027MachineRecirc_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_perc\u0027],result[\u0027Sorted_perc\u0027],result[\u0027AWCSRecirc_perc\u0027],result[\u0027OperRecirc_perc\u0027],result[\u0027MachineRecirc_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_rate\u0027],result[\u0027Sorted_rate\u0027],result[\u0027AWCSRecirc_rate\u0027],result[\u0027OperRecirc_rate\u0027],result[\u0027MachineRecirc_rate\u0027]])\n\t\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Sorter Summary.csv\u0027, data \u003d csv)\n\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 3:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Sorter Details\").getChild(\"Sorter Details\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Assigned (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027assigned_count\u0027],result[\u0027destinv_count\u0027],result[\u0027destnone_count\u0027],result[\u0027destdis_count\u0027],result[\u0027destfull_count\u0027],result[\u0027unexpected_count\u0027],result[\u0027destfault_count\u0027],result[\u0027divfail_count\u0027],result[\u0027gaperr_count\u0027],result[\u0027lost_count\u0027],result[\u0027trackerr_count\u0027],result[\u0027unknownn_count\u0027],result[\u0027unsafe_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Assigned (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_perc\u0027],result[\u0027sorted_perc\u0027],result[\u0027assigned_perc\u0027],result[\u0027destinv_perc\u0027],result[\u0027destnone_perc\u0027],result[\u0027destdis_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027unexpected_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027divfail_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027trackerr_perc\u0027],result[\u0027unknown_perc\u0027],result[\u0027unsafe_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Assigned (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_rate\u0027],result[\u0027sorted_rate\u0027],result[\u0027assigned_rate\u0027],result[\u0027destinv_rate\u0027],result[\u0027destnone_rate\u0027],result[\u0027destdis_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027unexpected_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027divfail_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027trackerr_rate\u0027],result[\u0027unknown_rate\u0027],result[\u0027unsafe_rate\u0027]])\n\t\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Sorter Details\").getChild(\"Sorter Details\").props.data)\n\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Assigned (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027destinv_count\u0027],result[\u0027destnone_count\u0027],result[\u0027destdis_count\u0027],result[\u0027destfull_count\u0027],result[\u0027unexpected_count\u0027],result[\u0027destfault_count\u0027],result[\u0027divfail_count\u0027],result[\u0027gaperr_count\u0027],result[\u0027lost_count\u0027],result[\u0027trackerr_count\u0027],result[\u0027unknownn_count\u0027],result[\u0027unsafe_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Assigned (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_perc\u0027],result[\u0027sorted_perc\u0027],result[\u0027assigned_perc\u0027],result[\u0027destinv_perc\u0027],result[\u0027destnone_perc\u0027],result[\u0027destdis_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027unexpected_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027divfail_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027trackerr_perc\u0027],result[\u0027unknown_perc\u0027],result[\u0027unsafe_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Assigned (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_rate\u0027],result[\u0027sorted_rate\u0027],result[\u0027assigned_rate\u0027],result[\u0027destinv_rate\u0027],result[\u0027destnone_rate\u0027],result[\u0027destdis_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027unexpected_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027divfail_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027trackerr_rate\u0027],result[\u0027unknown_rate\u0027],result[\u0027unsafe_rate\u0027]])\n\t\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Sorter Details.csv\u0027, data \u003d csv)\n\t\t\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 4:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Lane Details\").getChild(\"Lane Details\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Lane Details\").getChild(\"Lane Details\").props.data)\n\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n\t\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Lane Details.csv\u0027, data \u003d csv)\n\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 5:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Induct\").getChild(\"Hourly_Induct\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Single Carrier (#)\u0027],result[\u0027Double Carrier (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%\u0027],result[\u0027Single Carrier (%)\u0027],result[\u0027Double Carrier (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Single Carrier (pph)\u0027],result[\u0027Double Carrier (pph)\u0027]])\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Induct\").getChild(\"Hourly_Induct\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Single Carrier (#)\u0027],result[\u0027Double Carrier (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Single Carrier (%)\u0027],result[\u0027Double Carrier (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Single Carrier (pph)\u0027],result[\u0027Double Carrier (pph)\u0027]])\n\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Induct.csv\u0027, data \u003d csv)\n\t\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 6:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Scanner\").getChild(\"Hourly_Scanner\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No code (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Good Read (#)\u0027],result[\u0027No Read (#)\u0027],result[\u0027Multi Read (#)\u0027],result[\u0027No code (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Good Read (%)\u0027],result[\u0027No Read (%)\u0027],result[\u0027Multi Read (%)\u0027],result[\u0027No Code (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Good Read (pph)\u0027],result[\u0027No Read (pph)\u0027],result[\u0027Multi Read (pph)\u0027],result[\u0027No Code (pph)\u0027]])\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Scanner\").getChild(\"Hourly_Scanner\").props.data)\n\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No code (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Good Read (#)\u0027],result[\u0027No Read (#)\u0027],result[\u0027Multi Read (#)\u0027],result[\u0027No code (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Good Read (%)\u0027],result[\u0027No Read (%)\u0027],result[\u0027Multi Read (%)\u0027],result[\u0027No Code (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Good Read (pph)\u0027],result[\u0027No Read (pph)\u0027],result[\u0027Multi Read (pph)\u0027],result[\u0027No Code (pph)\u0027]])\n\t\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Scanner.csv\u0027, data \u003d csv)\n\t\t\t\n\t\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 7:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Summary\").getChild(\"Hourly_Sorter_Summary\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Awcs Recirc (#)\u0027],result[\u0027Operational Recirc (#)\u0027],result[\u0027Machine Recirc (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Awcs Recirc (%)\u0027],result[\u0027Operational Recirc (%)\u0027],result[\u0027Machine Recirc (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Awcs Recirc (pph)\u0027],result[\u0027Operational Recirc (pph)\u0027],result[\u0027Machine Recirc (pph)\u0027]])\n\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Summary\").getChild(\"Hourly_Sorter_Summary\").props.data)\n\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Awcs Recirc (#)\u0027],result[\u0027Operational Recirc (#)\u0027],result[\u0027Machine Recirc (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Awcs Recirc (%)\u0027],result[\u0027Operational Recirc (%)\u0027],result[\u0027Machine Recirc (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Awcs Recirc (pph)\u0027],result[\u0027Operational Recirc (pph)\u0027],result[\u0027Machine Recirc (pph)\u0027]])\n\t\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Sorter Summary.csv\u0027, data \u003d csv)\n\t\n\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 8:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Details\").getChild(\"Hourly_Sorter_Details\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Dest Inv (#)\u0027],result[\u0027Dest None (#)\u0027],result[\u0027Dest Dis (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Unexpected (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Div Fail (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Track Err (#)\u0027],result[\u0027Unknown (#)\u0027],result[\u0027Unsafe (#)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Dest Inv (%)\u0027],result[\u0027Dest None (%)\u0027],result[\u0027Dest Dis (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Unexpected (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Div Fail (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Track Err (%)\u0027],result[\u0027Unknown (%)\u0027],result[\u0027Unsafe (%)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Dest Inv (pph)\u0027],result[\u0027Dest None (pph)\u0027],result[\u0027Dest Dis (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Unexpected (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Div Fail (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Track Err (pph)\u0027],result[\u0027Unknown (pph)\u0027],result[\u0027Unsafe (pph)\u0027]])\n\t\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Details\").getChild(\"Hourly_Sorter_Details\").props.data)\n\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Dest Inv (#)\u0027],result[\u0027Dest None (#)\u0027],result[\u0027Dest Dis (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Unexpected (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Div Fail (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Track Err (#)\u0027],result[\u0027Unknown (#)\u0027],result[\u0027Unsafe (#)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Dest Inv (%)\u0027],result[\u0027Dest None (%)\u0027],result[\u0027Dest Dis (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Unexpected (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Div Fail (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Track Err (%)\u0027],result[\u0027Unknown (%)\u0027],result[\u0027Unsafe (%)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Dest Inv (pph)\u0027],result[\u0027Dest None (pph)\u0027],result[\u0027Dest Dis (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Unexpected (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Div Fail (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Track Err (pph)\u0027],result[\u0027Unknown (pph)\u0027],result[\u0027Unsafe (pph)\u0027]])\n\t\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Sorter Details.csv\u0027, data \u003d csv)\n\t\t\n\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 9:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Lane\").getChild(\"Hourly_Lane\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n\t\t\t\n\t\telse:\n\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Lane\").getChild(\"Hourly_Lane\").props.data)\n\t\t\t\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Err (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Diverted (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Dest Jam (#)\u0027],result[\u0027Dest Disabled (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Divert Fail (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Unsafe (#)\u0027],result[\u0027Dim Err (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Unknown (#)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Err (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Diverted (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Dest Jam (%)\u0027],result[\u0027Dest Disabled (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Divert Fail (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Unsafe (%)\u0027],result[\u0027Dim Err (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Unknown (%)\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Err (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n\t\t\t\tfor result in test_table:\n\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Diverted (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Dest Jam (pph)\u0027],result[\u0027Dest Disabled (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Divert Fail (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Unsafe (pph)\u0027],result[\u0027Dim Err (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Unknown (pph)\u0027]])\n\t\t\t\t\n\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Lane.csv\u0027, data \u003d csv)\n\t\t\t\n\t\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 12:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Dumper cycles\").getChild(\"Dumper cycles\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1\u0027],result[\u0027Cycles of ULGL2\u0027],result[\u0027Cycles of ULGL3\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (cph)\",\"Cycles of ULGL2 (cph)\",\"Cycles of ULGL3 (cph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (cph)\u0027],result[\u0027Cycles of ULGL2 (cph)\u0027],result[\u0027Cycles of ULGL3 (cph)\u0027]])\n\t\t\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Dumper cycles\").getChild(\"Dumper cycles\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1\u0027],result[\u0027Cycles of ULGL2\u0027],result[\u0027Cycles of ULGL3\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (cph)\",\"Cycles of ULGL2 (cph)\",\"Cycles of ULGL3 (cph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (cph)\u0027],result[\u0027Cycles of ULGL2 (cph)\u0027],result[\u0027Cycles of ULGL3 (cph)\u0027]])\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Dumper cycles.csv\u0027, data \u003d csv)\n\t\t\t\t\t\n\t\t\t\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 10:\n\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Total Full1\").getChild(\"Total Full1\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1\u0027],result[\u0027Cycles of ULGL2\u0027],result[\u0027Cycles of ULGL3\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (cph)\",\"Cycles of ULGL2 (cph)\",\"Cycles of ULGL3 (cph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (cph)\u0027],result[\u0027Cycles of ULGL2 (cph)\u0027],result[\u0027Cycles of ULGL3 (cph)\u0027]])\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Total Full1\").getChild(\"Total Full1\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Lane\",\"Total (#)\",\"DestFull (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (#)\u0027],result[\u0027DestFull (#)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Lane\",\"Total (%)\",\"DestFull (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (%)\u0027],result[\u0027DestFull (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Lane\",\"Total (pph)\",\"DestFull (pph)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (pph)\u0027],result[\u0027DestFull (pph)\u0027]])\t\t\t\t\t\t\t\n\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Lane Total Full.csv\u0027, data \u003d csv)\n\t\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 11:\n\t\t\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Jam Area\").getChild(\"Jam Area\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (#)\",\"Dumpers Jam (#)\", \"Inbound Jam (#)\",\"Runout Jam (#)\",\"Sorter Recirc Jam (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_Jam\u0027],result[\u0027Dumpers_jam\u0027],result[\u0027Inbound_jam\u0027],result[\u0027Runout_jam\u0027],result[\u0027Sorter_Recirc_jam\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (%)\",\"Dumpers Jam (%)\", \"Inbound Jam (%)\",\"Runout Jam (%)\",\"Sorter Recirc Jam (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_perc\u0027],result[\u0027Dumpers_perc\u0027],result[\u0027Inbound_perc\u0027],result[\u0027Runout_perc\u0027],result[\u0027Sorter_Recirc_perc\u0027]])\n\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Jam Area\").getChild(\"Jam Area\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (#)\",\"Dumpers Jam (#)\", \"Inbound Jam (#)\",\"Runout Jam (#)\",\"Sorter Recirc Jam (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_Jam\u0027],result[\u0027Dumpers_jam\u0027],result[\u0027Inbound_jam\u0027],result[\u0027Runout_jam\u0027],result[\u0027Sorter_Recirc_jam\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (%)\",\"Dumpers Jam (%)\", \"Inbound Jam (%)\",\"Runout Jam (%)\",\"Sorter Recirc Jam (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_perc\u0027],result[\u0027Dumpers_perc\u0027],result[\u0027Inbound_perc\u0027],result[\u0027Runout_perc\u0027],result[\u0027Sorter_Recirc_perc\u0027]])\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Jam Areas.csv\u0027, data \u003d csv)\t\t\t\t\t\t\n\t\t\t\t\t" + "script": "\tdata \u003d []\n\ttable \u003d []\n\timport datetime\n\tcurrent_datetime\u003ddatetime.datetime.now()\n\tstr_date \u003d current_datetime.strftime(\"%m-%d-%Y %I-%M\")\n\n\n\tif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 12:\n\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Induct Details\").getChild(\"Induct Details\").props.filter.results.data\n\t\tif(len(results) \u003e 0):\n\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_count\u0027],result[\u0027singlecarrier_count\u0027],result[\u0027doublecarrier_count\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_perc\u0027],result[\u0027SingleCarrier_perc\u0027],result[\u0027DoubleCarrier_perc\u0027]])\n\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n\t\t\t\tfor result in results:\n\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_rate\u0027],result[\u0027SingleCarrier_rate\u0027],result[\u0027DoubleCarrier_rate\u0027]])\n\t\t\t\t\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 1:\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Dumper cycles\").getChild(\"Dumper cycles\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULC1\u0027],result[\u0027Cycles of ULC2\u0027],result[\u0027Cycles of ULC3\u0027], result[\u0027Cycles of ULC4\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULC1 (cph)\",\"Cycles of ULC2 (cph)\",\"Cycles of ULC3 (cph)\", \"Cycles of ULC4 (cph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULC1 (cph)\u0027],result[\u0027Cycles of ULC2 (cph)\u0027],result[\u0027Cycles of ULC3 (cph)\u0027], result[\u0027Cycles of ULC4 (cph)\u0027]])\n\t\t\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Dumper cycles\").getChild(\"Dumper cycles\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1\u0027],result[\u0027Cycles of ULGL2\u0027],result[\u0027Cycles of ULGL3\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULC1 (cph)\",\"Cycles of ULC2 (cph)\",\"Cycles of ULC3 (cph)\", \"Cycles of ULC4 (cph)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULC1 (cph)\u0027],result[\u0027Cycles of ULC2 (cph)\u0027],result[\u0027Cycles of ULC3 (cph)\u0027], result[\u0027Cycles of ULC4 (cph)\u0027]])\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Dumper cycles.csv\u0027, data \u003d csv)\n\t\t\t\t\t\n\t\t\t\t\t\n\n\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 0:\n\t\t\n\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Jam Area\").getChild(\"Jam Area\").props.filter.results.data\n\t\t\tif(len(results) \u003e 0):\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (#)\",\"Dumpers Jam (#)\", \"Inbound Jam (#)\",\"Runout Jam (#)\",\"Sorter Recirc Jam (#)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_Jam\u0027],result[\u0027Dumpers_jam\u0027],result[\u0027Inbound_jam\u0027],result[\u0027Runout_jam\u0027],result[\u0027Sorter_Recirc_jam\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (%)\",\"Dumpers Jam (%)\", \"Inbound Jam (%)\",\"Runout Jam (%)\",\"Sorter Recirc Jam (%)\"]\n\t\t\t\t\tfor result in results:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_perc\u0027],result[\u0027Dumpers_perc\u0027],result[\u0027Inbound_perc\u0027],result[\u0027Runout_perc\u0027],result[\u0027Sorter_Recirc_perc\u0027]])\n\n\t\t\t\n\t\t\telse:\n\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Jam Area\").getChild(\"Jam Area\").props.data)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (#)\",\"Dumpers Jam (#)\", \"Inbound Jam (#)\",\"Runout Jam (#)\",\"Sorter Recirc Jam (#)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_Jam\u0027],result[\u0027Dumpers_jam\u0027],result[\u0027Inbound_jam\u0027],result[\u0027Runout_jam\u0027],result[\u0027Sorter_Recirc_jam\u0027]])\n\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n\t\t\t\t\theaders \u003d [\"Start Stamp\",\"End Stamp\",\"Total Jam (%)\",\"Dumpers Jam (%)\", \"Inbound Jam (%)\",\"Runout Jam (%)\",\"Sorter Recirc Jam (%)\"]\n\t\t\t\t\tfor result in test_table:\n\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027Total_perc\u0027],result[\u0027Dumpers_perc\u0027],result[\u0027Inbound_perc\u0027],result[\u0027Runout_perc\u0027],result[\u0027Sorter_Recirc_perc\u0027]])\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Jam Areas.csv\u0027, data \u003d csv)\n\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Induct Details\").getChild(\"Induct Details\").props.data)\n#\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_count\u0027],result[\u0027singlecarrier_count\u0027],result[\u0027doublecarrier_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_perc\u0027],result[\u0027SingleCarrier_perc\u0027],result[\u0027DoubleCarrier_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Induct\",\"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027InductName\u0027],result[\u0027Total_rate\u0027],result[\u0027SingleCarrier_rate\u0027],result[\u0027DoubleCarrier_rate\u0027]])\n#\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Induct Details.csv\u0027, data \u003d csv)\t\n#\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 11:\n#\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Scanner_Details\").getChild(\"Scanner Details\").props.filter.results.data\n#\t\tif(len(results) \u003e 0):\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No Code (#)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_count\u0027],result[\u0027GoodRead_count\u0027],result[\u0027NoRead_count\u0027],result[\u0027MultiLabelRead_count\u0027],result[\u0027NoCode_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_perc\u0027],result[\u0027GoodRead_perc\u0027],result[\u0027NoRead_perc\u0027],result[\u0027MultiLabelRead_perc\u0027],result[\u0027NoCode_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_rate\u0027],result[\u0027GoodRead_rate\u0027],result[\u0027NoRead_rate\u0027],result[\u0027MultiLabelRead_rate\u0027],result[\u0027NoCode_rate\u0027]])\n#\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Scanner_Details\").getChild(\"Scanner Details\").props.data)\n#\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No Code (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_count\u0027],result[\u0027GoodRead_count\u0027],result[\u0027NoRead_count\u0027],result[\u0027MultiLabelRead_count\u0027],result[\u0027NoCode_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_perc\u0027],result[\u0027GoodRead_perc\u0027],result[\u0027NoRead_perc\u0027],result[\u0027MultiLabelRead_perc\u0027],result[\u0027NoCode_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Scanner\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027ScannerName\u0027],result[\u0027Total_rate\u0027],result[\u0027GoodRead_rate\u0027],result[\u0027NoRead_rate\u0027],result[\u0027MultiLabelRead_rate\u0027],result[\u0027NoCode_rate\u0027]])\n#\t\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Scanner Details.csv\u0027, data \u003d csv)\n#\t\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 2:\n#\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Sorter Summary\").getChild(\"Sorter Summary\").props.filter.results.data\n#\t\tif(len(results) \u003e 0):\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_count\u0027],result[\u0027Sorted_count\u0027],result[\u0027AWCSRecirc_count\u0027],result[\u0027OperRecirc_count\u0027],result[\u0027MachineRecirc_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_perc\u0027],result[\u0027Sorted_perc\u0027],result[\u0027AWCSRecirc_perc\u0027],result[\u0027OperRecirc_perc\u0027],result[\u0027MachineRecirc_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_rate\u0027],result[\u0027Sorted_rate\u0027],result[\u0027AWCSRecirc_rate\u0027],result[\u0027OperRecirc_rate\u0027],result[\u0027MachineRecirc_rate\u0027]])\n#\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Sorter Summary\").getChild(\"Sorter Summary\").props.data)\n#\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_count\u0027],result[\u0027Sorted_count\u0027],result[\u0027AWCSRecirc_count\u0027],result[\u0027OperRecirc_count\u0027],result[\u0027MachineRecirc_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_perc\u0027],result[\u0027Sorted_perc\u0027],result[\u0027AWCSRecirc_perc\u0027],result[\u0027OperRecirc_perc\u0027],result[\u0027MachineRecirc_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Induct_rate\u0027],result[\u0027Sorted_rate\u0027],result[\u0027AWCSRecirc_rate\u0027],result[\u0027OperRecirc_rate\u0027],result[\u0027MachineRecirc_rate\u0027]])\n#\t\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Sorter Summary.csv\u0027, data \u003d csv)\n#\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 3:\n#\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Sorter Details\").getChild(\"Sorter Details\").props.filter.results.data\n#\t\tif(len(results) \u003e 0):\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Assigned (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027assigned_count\u0027],result[\u0027destinv_count\u0027],result[\u0027destnone_count\u0027],result[\u0027destdis_count\u0027],result[\u0027destfull_count\u0027],result[\u0027unexpected_count\u0027],result[\u0027destfault_count\u0027],result[\u0027divfail_count\u0027],result[\u0027gaperr_count\u0027],result[\u0027lost_count\u0027],result[\u0027trackerr_count\u0027],result[\u0027unknownn_count\u0027],result[\u0027unsafe_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Assigned (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_perc\u0027],result[\u0027sorted_perc\u0027],result[\u0027assigned_perc\u0027],result[\u0027destinv_perc\u0027],result[\u0027destnone_perc\u0027],result[\u0027destdis_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027unexpected_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027divfail_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027trackerr_perc\u0027],result[\u0027unknown_perc\u0027],result[\u0027unsafe_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Assigned (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_rate\u0027],result[\u0027sorted_rate\u0027],result[\u0027assigned_rate\u0027],result[\u0027destinv_rate\u0027],result[\u0027destnone_rate\u0027],result[\u0027destdis_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027unexpected_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027divfail_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027trackerr_rate\u0027],result[\u0027unknown_rate\u0027],result[\u0027unsafe_rate\u0027]])\n#\t\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Sorter Details\").getChild(\"Sorter Details\").props.data)\n#\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (#)\",\"Sorted (#)\",\"Assigned (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027sorted_count\u0027],result[\u0027destinv_count\u0027],result[\u0027destnone_count\u0027],result[\u0027destdis_count\u0027],result[\u0027destfull_count\u0027],result[\u0027unexpected_count\u0027],result[\u0027destfault_count\u0027],result[\u0027divfail_count\u0027],result[\u0027gaperr_count\u0027],result[\u0027lost_count\u0027],result[\u0027trackerr_count\u0027],result[\u0027unknownn_count\u0027],result[\u0027unsafe_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (%)\",\"Sorted (%)\",\"Assigned (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_perc\u0027],result[\u0027sorted_perc\u0027],result[\u0027assigned_perc\u0027],result[\u0027destinv_perc\u0027],result[\u0027destnone_perc\u0027],result[\u0027destdis_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027unexpected_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027divfail_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027trackerr_perc\u0027],result[\u0027unknown_perc\u0027],result[\u0027unsafe_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Inducted (pph)\",\"Sorted (pph)\",\"Assigned (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027inducted_rate\u0027],result[\u0027sorted_rate\u0027],result[\u0027assigned_rate\u0027],result[\u0027destinv_rate\u0027],result[\u0027destnone_rate\u0027],result[\u0027destdis_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027unexpected_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027divfail_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027trackerr_rate\u0027],result[\u0027unknown_rate\u0027],result[\u0027unsafe_rate\u0027]])\n#\t\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Sorter Details.csv\u0027, data \u003d csv)\n#\t\t\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 4:\n#\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Lane Details\").getChild(\"Lane Details\").props.filter.results.data\n#\t\t\tif(len(results) \u003e 0):\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n#\t\t\t\n#\t\t\telse:\n#\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Lane Details\").getChild(\"Lane Details\").props.data)\n#\t\t\t\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"End Timestamp\", \"Sorter\",\"Lane\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Startstamp\u0027],result[\u0027Endtstamp\u0027],result[\u0027SorterName\u0027],result[\u0027Lane\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n#\t\t\t\t\n#\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Lane Details.csv\u0027, data \u003d csv)\n#\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 5:\n#\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Induct\").getChild(\"Hourly_Induct\").props.filter.results.data\n#\t\t\tif(len(results) \u003e 0):\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Single Carrier (#)\u0027],result[\u0027Double Carrier (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%\u0027],result[\u0027Single Carrier (%)\u0027],result[\u0027Double Carrier (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Single Carrier (pph)\u0027],result[\u0027Double Carrier (pph)\u0027]])\n#\t\t\t\n#\t\t\telse:\n#\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Induct\").getChild(\"Hourly_Induct\").props.data)\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Single Carrier (#)\",\"Double Carrier (#)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Single Carrier (#)\u0027],result[\u0027Double Carrier (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (%)\",\"Single Carrier (%)\",\"Double Carrier (%)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Single Carrier (%)\u0027],result[\u0027Double Carrier (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (pph)\",\"Single Carrier (pph)\",\"Double Carrier (pph)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Single Carrier (pph)\u0027],result[\u0027Double Carrier (pph)\u0027]])\n#\t\t\t\n#\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Induct.csv\u0027, data \u003d csv)\n#\t\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 6:\n#\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Scanner\").getChild(\"Hourly_Scanner\").props.filter.results.data\n#\t\t\tif(len(results) \u003e 0):\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No code (#)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Good Read (#)\u0027],result[\u0027No Read (#)\u0027],result[\u0027Multi Read (#)\u0027],result[\u0027No code (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Good Read (%)\u0027],result[\u0027No Read (%)\u0027],result[\u0027Multi Read (%)\u0027],result[\u0027No Code (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Good Read (pph)\u0027],result[\u0027No Read (pph)\u0027],result[\u0027Multi Read (pph)\u0027],result[\u0027No Code (pph)\u0027]])\n#\t\t\t\n#\t\t\telse:\n#\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Scanner\").getChild(\"Hourly_Scanner\").props.data)\n#\t\t\t\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (#)\",\"Good Read (#)\",\"No Read (#)\",\"Multi Read (#)\",\"No code (#)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Good Read (#)\u0027],result[\u0027No Read (#)\u0027],result[\u0027Multi Read (#)\u0027],result[\u0027No code (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\", \"Total (%)\",\"Good Read (%)\",\"No Read (%)\",\"Multi Read (%)\",\"No Code (%)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Good Read (%)\u0027],result[\u0027No Read (%)\u0027],result[\u0027Multi Read (%)\u0027],result[\u0027No Code (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (pph)\",\"Good Read (pph)\",\"No Read (pph)\",\"Multi Read (pph)\",\"No Code (pph)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Good Read (pph)\u0027],result[\u0027No Read (pph)\u0027],result[\u0027Multi Read (pph)\u0027],result[\u0027No Code (pph)\u0027]])\n#\t\t\t\t\n#\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Scanner.csv\u0027, data \u003d csv)\n#\t\t\t\n#\t\t\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 7:\n#\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Summary\").getChild(\"Hourly_Sorter_Summary\").props.filter.results.data\n#\t\t\tif(len(results) \u003e 0):\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Awcs Recirc (#)\u0027],result[\u0027Operational Recirc (#)\u0027],result[\u0027Machine Recirc (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Awcs Recirc (%)\u0027],result[\u0027Operational Recirc (%)\u0027],result[\u0027Machine Recirc (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Awcs Recirc (pph)\u0027],result[\u0027Operational Recirc (pph)\u0027],result[\u0027Machine Recirc (pph)\u0027]])\n#\t\t\n#\t\t\telse:\n#\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Summary\").getChild(\"Hourly_Sorter_Summary\").props.data)\n#\t\t\t\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Awcs Recirc (#)\",\"Operational Recirc (#)\",\"Machine Recirc (#)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Awcs Recirc (#)\u0027],result[\u0027Operational Recirc (#)\u0027],result[\u0027Machine Recirc (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Awcs Recirc (%)\",\"Operational Recirc (%)\",\"Machine Recirc (%)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Awcs Recirc (%)\u0027],result[\u0027Operational Recirc (%)\u0027],result[\u0027Machine Recirc (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Awcs Recirc (pph)\",\"Operational Recirc (pph)\",\"Machine Recirc (pph)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Awcs Recirc (pph)\u0027],result[\u0027Operational Recirc (pph)\u0027],result[\u0027Machine Recirc (pph)\u0027]])\n#\t\t\t\t\n#\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Sorter Summary.csv\u0027, data \u003d csv)\n#\t\n#\t\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 8:\n#\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Details\").getChild(\"Hourly_Sorter_Details\").props.filter.results.data\n#\t\tif(len(results) \u003e 0):\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Dest Inv (#)\u0027],result[\u0027Dest None (#)\u0027],result[\u0027Dest Dis (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Unexpected (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Div Fail (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Track Err (#)\u0027],result[\u0027Unknown (#)\u0027],result[\u0027Unsafe (#)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Dest Inv (%)\u0027],result[\u0027Dest None (%)\u0027],result[\u0027Dest Dis (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Unexpected (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Div Fail (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Track Err (%)\u0027],result[\u0027Unknown (%)\u0027],result[\u0027Unsafe (%)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Dest Inv (pph)\u0027],result[\u0027Dest None (pph)\u0027],result[\u0027Dest Dis (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Unexpected (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Div Fail (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Track Err (pph)\u0027],result[\u0027Unknown (pph)\u0027],result[\u0027Unsafe (pph)\u0027]])\n#\t\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Sorter_Details\").getChild(\"Hourly_Sorter_Details\").props.data)\n#\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (#)\",\"Sorted (#)\",\"Dest Inv (#)\",\"Dest None (#)\",\"Dest Dis (#)\",\"Dest Full (#)\",\"Unexpected (#)\",\"Dest Fault (#)\",\"Div Fail (#)\",\"Gap Err (#)\",\"Lost (#)\",\"Track Err (#)\",\"Unknown (#)\",\"Unsafe (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (#)\u0027],result[\u0027Sorted (#)\u0027],result[\u0027Dest Inv (#)\u0027],result[\u0027Dest None (#)\u0027],result[\u0027Dest Dis (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Unexpected (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Div Fail (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Track Err (#)\u0027],result[\u0027Unknown (#)\u0027],result[\u0027Unsafe (#)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (%)\",\"Sorted (%)\",\"Dest Inv (%)\",\"Dest None (%)\",\"Dest Dis (%)\",\"Dest Full (%)\",\"Unexpected (%)\",\"Dest Fault (%)\",\"Div Fail (%)\",\"Gap Err (%)\",\"Lost (%)\",\"Track Err (%)\",\"Unknown (%)\",\"Unsafe (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (%)\u0027],result[\u0027Sorted (%)\u0027],result[\u0027Dest Inv (%)\u0027],result[\u0027Dest None (%)\u0027],result[\u0027Dest Dis (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Unexpected (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Div Fail (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Track Err (%)\u0027],result[\u0027Unknown (%)\u0027],result[\u0027Unsafe (%)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Inducted (pph)\",\"Sorted (pph)\",\"Dest Inv (pph)\",\"Dest None (pph)\",\"Dest Dis (pph)\",\"Dest Full (pph)\",\"Unexpected (pph)\",\"Dest Fault (pph)\",\"Div Fail (pph)\",\"Gap Err (pph)\",\"Lost (pph)\",\"Track Err (pph)\",\"Unknown (pph)\",\"Unsafe (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Inducted (pph)\u0027],result[\u0027Sorted (pph)\u0027],result[\u0027Dest Inv (pph)\u0027],result[\u0027Dest None (pph)\u0027],result[\u0027Dest Dis (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Unexpected (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Div Fail (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Track Err (pph)\u0027],result[\u0027Unknown (pph)\u0027],result[\u0027Unsafe (pph)\u0027]])\n#\t\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Sorter Details.csv\u0027, data \u003d csv)\n#\t\t\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 9:\n#\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Hourly_Lane\").getChild(\"Hourly_Lane\").props.filter.results.data\n#\t\tif(len(results) \u003e 0):\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Error (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027Total_count\u0027],result[\u0027Diverted_count\u0027],result[\u0027Destfull_count\u0027],result[\u0027DestJam_count\u0027],result[\u0027DestDis_count\u0027],result[\u0027DestFault_count\u0027],result[\u0027DivertFail_count\u0027],result[\u0027Lost_count\u0027],result[\u0027Unsafe_count\u0027],result[\u0027Dim_count\u0027],result[\u0027GapErr_count\u0027],result[\u0027Unknown_count\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Error (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027total_perc\u0027],result[\u0027Diverted_perc\u0027],result[\u0027destfull_perc\u0027],result[\u0027destjam_perc\u0027],result[\u0027destdisabled_perc\u0027],result[\u0027destfault_perc\u0027],result[\u0027DivertFail_perc\u0027],result[\u0027lost_perc\u0027],result[\u0027unsafe_perc\u0027],result[\u0027dim_perc\u0027],result[\u0027gaperr_perc\u0027],result[\u0027unknown_perc\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Error (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n#\t\t\t\tfor result in results:\n#\t\t\t\t\tdata.append([result[\u0027endt\u0027],result[\u0027rownumber\u0027],result[\u0027total_rate\u0027],result[\u0027Diverted_rate\u0027],result[\u0027destfull_rate\u0027],result[\u0027destjam_rate\u0027],result[\u0027destdisabled_rate\u0027],result[\u0027destfault_rate\u0027],result[\u0027DivertFail_rate\u0027],result[\u0027lost_rate\u0027],result[\u0027unsafe_rate\u0027],result[\u0027dim_rate\u0027],result[\u0027gaperr_rate\u0027],result[\u0027unknown_rate\u0027]])\n#\t\t\t\n#\t\telse:\n#\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Hourly_Lane\").getChild(\"Hourly_Lane\").props.data)\n#\t\t\t\n#\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Total (#)\",\"Diverted (#)\",\"Dest Full (#)\",\"Dest Jam (#)\",\"Dest Disabled (#)\",\"Dest Fault (#)\",\"Divert Fail (#)\",\"Lost (#)\",\"Unsafe (#)\",\"Dim Err (#)\",\"Gap Error (#)\",\"Unknown (#)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (#)\u0027],result[\u0027Diverted (#)\u0027],result[\u0027Dest Full (#)\u0027],result[\u0027Dest Jam (#)\u0027],result[\u0027Dest Disabled (#)\u0027],result[\u0027Dest Fault (#)\u0027],result[\u0027Divert Fail (#)\u0027],result[\u0027Lost (#)\u0027],result[\u0027Unsafe (#)\u0027],result[\u0027Dim Err (#)\u0027],result[\u0027Gap Err (#)\u0027],result[\u0027Unknown (#)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (%)\",\"Diverted (%)\",\"Dest Full (%)\",\"Dest Jam (%)\",\"Dest Disabled (%)\",\"Dest Fault (%)\",\"Divert Fail (%)\",\"Lost (%)\",\"Unsafe (%)\",\"Dim Err (%)\",\"Gap Error (%)\",\"Unknown (%)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (%)\u0027],result[\u0027Diverted (%)\u0027],result[\u0027Dest Full (%)\u0027],result[\u0027Dest Jam (%)\u0027],result[\u0027Dest Disabled (%)\u0027],result[\u0027Dest Fault (%)\u0027],result[\u0027Divert Fail (%)\u0027],result[\u0027Lost (%)\u0027],result[\u0027Unsafe (%)\u0027],result[\u0027Dim Err (%)\u0027],result[\u0027Gap Err (%)\u0027],result[\u0027Unknown (%)\u0027]])\n#\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\theaders \u003d [\"Start Timestamp\", \"Hour\",\"Total (pph)\",\"Diverted (pph)\",\"Dest Full (pph)\",\"Dest Jam (pph)\",\"Dest Disabled (pph)\",\"Dest Fault (pph)\",\"Divert Fail (pph)\",\"Lost (pph)\",\"Unsafe (pph)\",\"Dim Err (pph)\",\"Gap Error (pph)\",\"Unknown (pph)\"]\n#\t\t\t\tfor result in test_table:\n#\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Total (pph)\u0027],result[\u0027Diverted (pph)\u0027],result[\u0027Dest Full (pph)\u0027],result[\u0027Dest Jam (pph)\u0027],result[\u0027Dest Disabled (pph)\u0027],result[\u0027Dest Fault (pph)\u0027],result[\u0027Divert Fail (pph)\u0027],result[\u0027Lost (pph)\u0027],result[\u0027Unsafe (pph)\u0027],result[\u0027Dim Err (pph)\u0027],result[\u0027Gap Err (pph)\u0027],result[\u0027Unknown (pph)\u0027]])\n#\t\t\t\t\n#\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Hourly Lane.csv\u0027, data \u003d csv)\n#\t\n#\telif self.getSibling(\"Statistics\").props.currentTabIndex \u003d\u003d 10:\n#\n#\t\t\tresults \u003d self.parent.getChild(\"Statistics\").getChild(\"Total Full1\").getChild(\"Total Full1\").props.filter.results.data\n#\t\t\tif(len(results) \u003e 0):\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1\",\"Cycles of ULGL2\",\"Cycles of ULGL3\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1\u0027],result[\u0027Cycles of ULGL2\u0027],result[\u0027Cycles of ULGL3\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (%)\",\"Cycles of ULGL2 (%)\",\"Cycles of ULGL3 (%)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (%)\u0027],result[\u0027Cycles of ULGL2 (%)\u0027],result[\u0027Cycles of ULGL3 (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Start Timestamp\",\"Hour\",\"Cycles of ULGL1 (cph)\",\"Cycles of ULGL2 (cph)\",\"Cycles of ULGL3 (cph)\"]\n#\t\t\t\t\tfor result in results:\n#\t\t\t\t\t\tdata.append([result[\u0027Start Timestamp\u0027],result[\u0027Hour\u0027],result[\u0027Cycles of ULGL1 (cph)\u0027],result[\u0027Cycles of ULGL2 (cph)\u0027],result[\u0027Cycles of ULGL3 (cph)\u0027]])\n#\t\t\t\n#\t\t\telse:\n#\t\t\t\ttest_table \u003d system.dataset.toPyDataSet(self.parent.getChild(\"Statistics\").getChild(\"Total Full1\").getChild(\"Total Full1\").props.data)\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n#\t\t\t\tif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Count\":\n#\t\t\t\t\theaders \u003d [\"Lane\",\"Total (#)\",\"DestFull (#)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (#)\u0027],result[\u0027DestFull (#)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Percentage\":\n#\t\t\t\t\theaders \u003d [\"Lane\",\"Total (%)\",\"DestFull (%)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (%)\u0027],result[\u0027DestFull (%)\u0027]])\n#\t\t\t\telif self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\").props.value \u003d\u003d \"Rate\":\n#\t\t\t\t\theaders \u003d [\"Lane\",\"Total (pph)\",\"DestFull (pph)\"]\n#\t\t\t\t\tfor result in test_table:\n#\t\t\t\t\t\tdata.append([result[\u0027Lane\u0027],result[\u0027Total (pph)\u0027],result[\u0027DestFull (pph)\u0027]])\t\t\t\t\t\t\t\n#\t\t\t\n#\t\t\ttable \u003d system.dataset.toDataSet(headers, data)\t\n#\t\t\tcsv \u003d system.dataset.toCSV(table,1,0,1)\n#\t\t\tsystem.perspective.download(filename \u003d str_date+\u0027 Lane Total Full.csv\u0027, data \u003d csv)\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t" }, "scope": "G", "type": "script" @@ -5334,7 +5479,7 @@ "style": { "fontSize": "1.5vmin" }, - "value": "Past Hour" + "value": "Custom" }, "type": "ia.input.dropdown" }, @@ -5370,9 +5515,9 @@ "$": [ "ts", 192, - 1689168205405 + 1760752329550 ], - "$ts": 1688473380000 + "$ts": 1759886520000 } }, "events": { @@ -5493,7 +5638,7 @@ }, "props": { "dismissOnSelect": false, - "formattedValue": "Oct 16, 2025 7:06 PM", + "formattedValue": "Oct 8, 2025 5:22 AM", "formattedValues": { "date": "Mar 26, 2021", "datetime": "Mar 26, 2021 12:00 AM", @@ -5510,10 +5655,10 @@ "value": { "$": [ "ts", - 192, - 1760630767504 + 0, + 1760752329544 ], - "$ts": 1760627167000 + "$ts": 1759886520000 } }, "type": "ia.input.date-time-input" @@ -5664,7 +5809,7 @@ }, "props": { "dismissOnSelect": false, - "formattedValue": "Oct 16, 2025 8:06 PM", + "formattedValue": "Oct 15, 2025 5:22 AM", "formattedValues": { "date": "Mar 29, 2021", "datetime": "Mar 29, 2021 1:37 PM", @@ -5682,9 +5827,9 @@ "$": [ "ts", 192, - 1760630767503 + 1760752329549 ], - "$ts": 1760630767000 + "$ts": 1760491320000 } }, "type": "ia.input.date-time-input" diff --git a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Count/query.sql b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Count/query.sql index 1446ab3..7ae4cf5 100644 --- a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Count/query.sql +++ b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Count/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(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, COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) AS ULC1, COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) AS ULC2, COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) AS ULC3, COALESCE(SUM(dumper_cycles.ulc4 = 1), 0) 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, diff --git a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Rate/query.sql b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Rate/query.sql index 5134405..baee502 100644 --- a/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Rate/query.sql +++ b/CNO8_SCADA/ignition/named-query/Dumper/Dumper Lane Rate/query.sql @@ -1,27 +1,19 @@ 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(CAST(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) AS CHAR),' cph') AS ULC1, - CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) AS CHAR),' cph') AS ULC2, - CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) AS CHAR),' cph') AS ULC3, - CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc4 = 1), 0) AS CHAR),' cph') AS ULC4 - -FROM dumper_cycles -WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime) -GROUP BY HOUR(dumper_cycles.t_stamp) - -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, - '0 cph' AS ULC1, - '0 cph' AS ULC2, - '0 cph' AS ULC3, - '0 cph' AS ULC4 - -WHERE NOT EXISTS ( - SELECT 1 FROM dumper_cycles - WHERE dumper_cycles.t_stamp BETWEEN :starttime AND :endtime -); \ No newline at end of file + CONCAT(DATE(hour_series.hour_timestamp), ' ', HOUR(hour_series.hour_timestamp), ':00') AS StartTimestamp, + CONCAT('H', hour_series.hour_offset) AS Hour, + CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc1 = 1), 0) AS CHAR), ' cph') AS ULC1, + CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc2 = 1), 0) AS CHAR), ' cph') AS ULC2, + CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc3 = 1), 0) AS CHAR), ' cph') AS ULC3, + CONCAT(CAST(COALESCE(SUM(dumper_cycles.ulc4 = 1), 0) AS CHAR), ' cph') AS ULC4 +FROM ( + SELECT + DATE_ADD(DATE_FORMAT(:starttime, "%Y-%m-%d %H:00:00"), INTERVAL n HOUR) AS hour_timestamp, + n AS hour_offset + FROM ( + SELECT 0 as n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15 UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23 UNION ALL SELECT 24 UNION ALL SELECT 25 UNION ALL SELECT 26 UNION ALL SELECT 27 UNION ALL SELECT 28 UNION ALL SELECT 29 UNION ALL SELECT 30 UNION ALL SELECT 31 UNION ALL SELECT 32 UNION ALL SELECT 33 UNION ALL SELECT 34 UNION ALL SELECT 35 UNION ALL SELECT 36 UNION ALL SELECT 37 UNION ALL SELECT 38 UNION ALL SELECT 39 UNION ALL SELECT 40 UNION ALL SELECT 41 UNION ALL SELECT 42 UNION ALL SELECT 43 UNION ALL SELECT 44 UNION ALL SELECT 45 UNION ALL SELECT 46 UNION ALL SELECT 47 UNION ALL SELECT 48 UNION ALL SELECT 49 UNION ALL SELECT 50 UNION ALL SELECT 51 UNION ALL SELECT 52 UNION ALL SELECT 53 UNION ALL SELECT 54 UNION ALL SELECT 55 UNION ALL SELECT 56 UNION ALL SELECT 57 UNION ALL SELECT 58 UNION ALL SELECT 59 UNION ALL SELECT 60 UNION ALL SELECT 61 UNION ALL SELECT 62 UNION ALL SELECT 63 UNION ALL SELECT 64 UNION ALL SELECT 65 UNION ALL SELECT 66 UNION ALL SELECT 67 UNION ALL SELECT 68 UNION ALL SELECT 69 UNION ALL SELECT 70 UNION ALL SELECT 71 UNION ALL SELECT 72 UNION ALL SELECT 73 UNION ALL SELECT 74 UNION ALL SELECT 75 UNION ALL SELECT 76 UNION ALL SELECT 77 UNION ALL SELECT 78 UNION ALL SELECT 79 UNION ALL SELECT 80 UNION ALL SELECT 81 UNION ALL SELECT 82 UNION ALL SELECT 83 UNION ALL SELECT 84 UNION ALL SELECT 85 UNION ALL SELECT 86 UNION ALL SELECT 87 UNION ALL SELECT 88 UNION ALL SELECT 89 UNION ALL SELECT 90 UNION ALL SELECT 91 UNION ALL SELECT 92 UNION ALL SELECT 93 UNION ALL SELECT 94 UNION ALL SELECT 95 UNION ALL SELECT 96 UNION ALL SELECT 97 UNION ALL SELECT 98 UNION ALL SELECT 99 UNION ALL SELECT 100 UNION ALL SELECT 101 UNION ALL SELECT 102 UNION ALL SELECT 103 UNION ALL SELECT 104 UNION ALL SELECT 105 UNION ALL SELECT 106 UNION ALL SELECT 107 UNION ALL SELECT 108 UNION ALL SELECT 109 UNION ALL SELECT 110 UNION ALL SELECT 111 UNION ALL SELECT 112 UNION ALL SELECT 113 UNION ALL SELECT 114 UNION ALL SELECT 115 UNION ALL SELECT 116 UNION ALL SELECT 117 UNION ALL SELECT 118 UNION ALL SELECT 119 UNION ALL SELECT 120 UNION ALL SELECT 121 UNION ALL SELECT 122 UNION ALL SELECT 123 UNION ALL SELECT 124 UNION ALL SELECT 125 UNION ALL SELECT 126 UNION ALL SELECT 127 UNION ALL SELECT 128 UNION ALL SELECT 129 UNION ALL SELECT 130 UNION ALL SELECT 131 UNION ALL SELECT 132 UNION ALL SELECT 133 UNION ALL SELECT 134 UNION ALL SELECT 135 UNION ALL SELECT 136 UNION ALL SELECT 137 UNION ALL SELECT 138 UNION ALL SELECT 139 UNION ALL SELECT 140 UNION ALL SELECT 141 UNION ALL SELECT 142 UNION ALL SELECT 143 UNION ALL SELECT 144 UNION ALL SELECT 145 UNION ALL SELECT 146 UNION ALL SELECT 147 UNION ALL SELECT 148 UNION ALL SELECT 149 UNION ALL SELECT 150 UNION ALL SELECT 151 UNION ALL SELECT 152 UNION ALL SELECT 153 UNION ALL SELECT 154 UNION ALL SELECT 155 UNION ALL SELECT 156 UNION ALL SELECT 157 UNION ALL SELECT 158 UNION ALL SELECT 159 UNION ALL SELECT 160 UNION ALL SELECT 161 UNION ALL SELECT 162 UNION ALL SELECT 163 UNION ALL SELECT 164 UNION ALL SELECT 165 UNION ALL SELECT 166 UNION ALL SELECT 167 + ) numbers + WHERE DATE_ADD(DATE_FORMAT(:starttime, "%Y-%m-%d %H:00:00"), INTERVAL n HOUR) <= :endtime +) AS hour_series +LEFT JOIN dumper_cycles ON DATE_FORMAT(dumper_cycles.t_stamp, "%Y-%m-%d %H:00:00") = hour_series.hour_timestamp +GROUP BY hour_series.hour_timestamp, hour_series.hour_offset +ORDER BY hour_series.hour_timestamp; \ No newline at end of file