From be33f4070fae4606e0dcca91538d99231952da0c Mon Sep 17 00:00:00 2001 From: gaazzopa Date: Wed, 9 Dec 2020 18:36:33 +0100 Subject: [PATCH] Resolved conflicts in calculator.form.html.j2 --- cara/apps/calculator/README.md | 2 +- cara/apps/calculator/model_generator.py | 2 +- cara/apps/calculator/static/js/form.js | 2 +- .../templates/calculator.form.html.j2 | 4 ++-- cara/apps/calculator/templates/report.html.j2 | 22 ++++++++++++++++++- .../apps/calculator/test_model_generator.py | 4 ++++ 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/cara/apps/calculator/README.md b/cara/apps/calculator/README.md index 8d9685af..b4e9b5cb 100644 --- a/cara/apps/calculator/README.md +++ b/cara/apps/calculator/README.md @@ -72,7 +72,7 @@ If you open the window at different distances throughout the day, choose an aver When using natural ventilation, the circulation of air is simulated as a function of the difference between the temperature inside the room and the outside air temperature. The average outdoor temperature for each hour of the day has been computed for every month of the year based on historical data for Geneva, Switzerland. It is therefore very important to enter the correct time and date in the event data section. -Finally, you must specify when the windows are open - all the time (always), or for 10 minutes every 2 hours. +Finally, you must specify when the windows are open - all the time (always), or (interval) in duration and frequency (both in minutes). #### No ventilation This option assumes there is neither Mechanical nor Natural ventilation in the simulation. diff --git a/cara/apps/calculator/model_generator.py b/cara/apps/calculator/model_generator.py index b58a2cb8..23ff3b7e 100644 --- a/cara/apps/calculator/model_generator.py +++ b/cara/apps/calculator/model_generator.py @@ -142,7 +142,7 @@ class FormData: # Initializes a ventilation instance as a window if 'natural' is selected, or as a HEPA-filter otherwise if self.ventilation_type == 'natural': if self.windows_open == 'interval': - window_interval = models.PeriodicInterval(self.windows_frequency*60, self.windows_duration) + window_interval = models.PeriodicInterval(self.windows_frequency*60, self.windows_duration*60) else: window_interval = always_on diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index 1b6a48c8..0f5ac5f3 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -350,7 +350,7 @@ function validate_form(form) { var windowsFrequencyObj = document.getElementById("windows_frequency"); removeErrorFor(windowsFrequencyObj); - if (parseInt(windowsDurationObj.value) >= parseInt(windowsFrequencyObj.value) * 60) { + if (parseInt(windowsDurationObj.value) >= parseInt(windowsFrequencyObj.value)) { insertErrorFor(windowsFrequencyObj, "Duration >= Frequency"); submit = false; } diff --git a/cara/apps/calculator/templates/calculator.form.html.j2 b/cara/apps/calculator/templates/calculator.form.html.j2 index 5731d9d0..7a319511 100644 --- a/cara/apps/calculator/templates/calculator.form.html.j2 +++ b/cara/apps/calculator/templates/calculator.form.html.j2 @@ -91,7 +91,7 @@    / - +
@@ -218,7 +218,7 @@ Ventilation data: