From 680faf0d8b02891770ee88a10303089dce132409 Mon Sep 17 00:00:00 2001 From: lrdossan Date: Tue, 11 Jun 2024 15:18:27 +0200 Subject: [PATCH 1/6] read raw values from xlsx files --- caimira/apps/calculator/static/js/co2_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caimira/apps/calculator/static/js/co2_form.js b/caimira/apps/calculator/static/js/co2_form.js index e846bbcf..6b69c7f2 100644 --- a/caimira/apps/calculator/static/js/co2_form.js +++ b/caimira/apps/calculator/static/js/co2_form.js @@ -74,7 +74,7 @@ function uploadFile(endpoint) { } } - const data = XLSX.utils.sheet_to_json(worksheet, { header: 1, raw: false }); + const data = XLSX.utils.sheet_to_json(worksheet, { header: 1, raw: true }); // Check if there is any data below the header row if (data.length <= 1) { $("#upload-error") From c9b296bd0daadf0a04378b84a0ba8c76af05aef3 Mon Sep 17 00:00:00 2001 From: lrdossan Date: Tue, 11 Jun 2024 15:21:45 +0200 Subject: [PATCH 2/6] added fix to predictive CO2 concentration plot --- caimira/apps/calculator/static/js/report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caimira/apps/calculator/static/js/report.js b/caimira/apps/calculator/static/js/report.js index 7c804dd9..d33d7eee 100644 --- a/caimira/apps/calculator/static/js/report.js +++ b/caimira/apps/calculator/static/js/report.js @@ -541,7 +541,7 @@ function draw_generic_concentration_plot( h_lines, ) { - list_of_scenarios = (plot_svg_id === 'CO2_concentration_graph') ? CO2_concentrations : alternative_scenarios + list_of_scenarios = (plot_svg_id === 'CO2_concentration_graph') ? {'CO₂ concentration': {'concentrations': CO2_concentrations}} : alternative_scenarios // H:M format var time_format = d3.timeFormat('%H:%M'); // D3 array of ten categorical colors represented as RGB hexadecimal strings. @@ -698,7 +698,7 @@ function draw_generic_concentration_plot( } function update_concentration_plot(concentration_data) { - list_of_scenarios = (plot_svg_id === 'CO2_concentration_graph') ? CO2_concentrations : alternative_scenarios + list_of_scenarios = (plot_svg_id === 'CO2_concentration_graph') ? {'CO₂ concentration': {'concentrations': CO2_concentrations}} : alternative_scenarios var highest_concentration = 0. for (scenario in list_of_scenarios) { From 1215f1d7b7797224b5aba362792cee8bc789a102 Mon Sep 17 00:00:00 2001 From: lrdossan Date: Tue, 11 Jun 2024 17:35:19 +0200 Subject: [PATCH 3/6] temporarily disabled ARVE sensors data --- caimira/apps/calculator/static/js/form.js | 11 ++--- .../templates/cern/calculator.form.html.j2 | 42 ++++++++++--------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 71023c2a..406a454d 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -1014,13 +1014,14 @@ $(document).ready(function () { //Check all radio buttons previously selected $("input[type=radio]:checked").each(function() {require_fields(this)}); + // TEMPORARILY DISABLED // On CERN theme, when the arve_sensors_option changes we want to make its respective // children show/hide. - if ($("input[type=radio][name=arve_sensors_option]").length > 0) { - $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); - // Call the function now to handle forward/back button presses in the browser. - on_use_sensors_data_change(url); - } + // if ($("input[type=radio][name=arve_sensors_option]").length > 0) { + // $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); + // // Call the function now to handle forward/back button presses in the browser. + // on_use_sensors_data_change(url); + // } // When the ventilation_type changes we want to make its respective // children show/hide. diff --git a/caimira/apps/templates/cern/calculator.form.html.j2 b/caimira/apps/templates/cern/calculator.form.html.j2 index 4e5ae90a..2bab2783 100644 --- a/caimira/apps/templates/cern/calculator.form.html.j2 +++ b/caimira/apps/templates/cern/calculator.form.html.j2 @@ -5,28 +5,30 @@ ? -
-
Use data from ARVE sensors:
-
- - - - -
-
- - -