diff --git a/README.md b/README.md index b46ee67b..6e4ac6aa 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ CARA – COVID Airborne Risk Assessment tool © Copyright 2020-2021 CERN. All rights not expressly granted are reserved. **For use of the CARA model** + Henriques A, Mounet N, Aleixo L, Elson P, Devine J, Azzopardi G, Andreini M, Rognlien M, Tarocco N, Tang J. (2022). Modelling airborne transmission of SARS-CoV-2 using CARA: risk assessment for enclosed spaces. _Interface Focus 20210076_. https://doi.org/10.1098/rsfs.2021.0076 Reference on the Short-range expiratory jet model from: diff --git a/cara/apps/calculator/model_generator.py b/cara/apps/calculator/model_generator.py index 8e92f361..cb6738f7 100644 --- a/cara/apps/calculator/model_generator.py +++ b/cara/apps/calculator/model_generator.py @@ -128,8 +128,8 @@ class FormData: 'window_type': 'window_sliding', 'window_height': 0., 'window_width': 0., - 'windows_duration': 0., - 'windows_frequency': 0., + 'windows_duration': 10., + 'windows_frequency': 60., 'windows_number': 0, 'window_opening_regime': 'windows_open_permanently', 'short_range_option': 'short_range_no', @@ -716,8 +716,8 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'ventilation_type': 'natural_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': 'room_volume_explicit', - 'windows_duration': '', - 'windows_frequency': '', + 'windows_duration': '10', + 'windows_frequency': '60', 'window_height': '2', 'window_type': 'window_sliding', 'window_width': '2', diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index e4597acc..26e72eea 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -183,7 +183,6 @@ function require_mask(option) { function require_hepa(option) { require_input_field("#hepa_amount", option); - set_disabled_status("#hepa_amount", !option); } function require_input_field(id, option) { @@ -236,6 +235,20 @@ function on_ventilation_type_change() { }); } +function on_hepa_option_change() { + hepa_option = $('input[type=radio][name=hepa_option]') + hepa_option.each(function (index) { + if (this.checked) { + getChildElement($(this)).show(); + require_fields(this); + } + else { + getChildElement($(this)).hide(); + require_fields(this); + } + }) +} + function on_wearing_mask_change() { wearing_mask = $('input[type=radio][name=mask_wearing_option]') wearing_mask.each(function (index) { @@ -711,6 +724,12 @@ $(document).ready(function () { // Call the function now to handle forward/back button presses in the browser. on_ventilation_type_change(); + // When the hepa filtration option changes we want to make its respective + // children show/hide. + $("input[type=radio][name=hepa_option]").change(on_hepa_option_change); + // Call the function now to handle forward/back button presses in the browser. + on_hepa_option_change(); + // When the mask_wearing_option changes we want to make its respective // children show/hide. $("input[type=radio][name=mask_wearing_option]").change(on_wearing_mask_change); @@ -850,7 +869,7 @@ $(document).ready(function () { - +
@@ -861,8 +880,8 @@ $(document).ready(function () {
-
-

+
+

diff --git a/cara/apps/templates/base/calculator.form.html.j2 b/cara/apps/templates/base/calculator.form.html.j2 index dd43228d..3b494d0f 100644 --- a/cara/apps/templates/base/calculator.form.html.j2 +++ b/cara/apps/templates/base/calculator.form.html.j2 @@ -88,31 +88,31 @@
-
+
- +
-
- +
+
-
+
- +
-
- +
+
-
- +
+
-
- +
+
@@ -189,73 +189,79 @@