diff --git a/cara/apps/calculator/model_generator.py b/cara/apps/calculator/model_generator.py index 1974e6df..88d0dcb6 100644 --- a/cara/apps/calculator/model_generator.py +++ b/cara/apps/calculator/model_generator.py @@ -43,6 +43,8 @@ class FormData: total_people: int ventilation_type: str volume_type: str + windows_duration: float + windows_frequency: float window_height: float window_type: str window_width: float @@ -121,6 +123,8 @@ class FormData: total_people=int(form_data['total_people']), ventilation_type=form_data['ventilation_type'], volume_type=form_data['volume_type'], + windows_duration=float(form_data['windows_duration']), + windows_frequency=float(form_data['windows_frequency']), window_height=float(form_data['window_height']), window_type=form_data['window_type'], window_width=float(form_data['window_width']), @@ -138,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(120, 10) + window_interval = models.PeriodicInterval(self.windows_frequency*60, self.windows_duration) else: window_interval = always_on @@ -424,7 +428,7 @@ def baseline_raw_form_data(): 'mask_type': 'Type I', 'mask_wearing': 'removed', 'mechanical_ventilation_type': '', - 'model_version': 'v1.1.0', + 'model_version': 'v1.2.0', 'opening_distance': '0.2', 'recurrent_event_month': 'January', 'room_number': '123', @@ -438,7 +442,7 @@ def baseline_raw_form_data(): 'window_type': 'sliding', 'window_width': '2', 'windows_number': '1', - 'windows_open': 'interval' + 'windows_open': 'always' } @@ -449,7 +453,7 @@ MASK_TYPES = {'Type I', 'FFP2'} MASK_WEARING = {'continuous', 'removed'} VENTILATION_TYPES = {'natural', 'mechanical', 'no-ventilation'} VOLUME_TYPES = {'room_volume', 'room_dimensions'} -WINDOWS_OPEN = {'always', 'interval', 'breaks', 'not-applicable'} +WINDOWS_OPEN = {'always', 'interval', 'not-applicable'} WINDOWS_TYPES = {'sliding', 'hinged', 'not-applicable'} diff --git a/cara/apps/calculator/templates/report.html.j2 b/cara/apps/calculator/templates/report.html.j2 index ded74dbb..c640d0f9 100644 --- a/cara/apps/calculator/templates/report.html.j2 +++ b/cara/apps/calculator/templates/report.html.j2 @@ -33,7 +33,7 @@
Ventilation data:
Mechanical ventilation: - {% if form.ventilation_type == "mechanical"%} + {% if form.ventilation_type == "mechanical" %} Yes
@@ -61,7 +61,13 @@ Sliding / Side-Hung
Opening distance: {{ form.opening_distance }} m
Windows open: {{ form.windows_open }}
Windows open: + {% if form.windows_open == "interval" %} + {{ form.windows_open }}s of {{ form.windows_duration }} mins every {{ form.windows_frequency }} hours + {% else %} + {{ form.windows_open }} + {% endif %} +
When using the natural ventilation option, air flows are calculated using averaged hourly temperatures for the Geneva region, based on historical data for the month selected.
{% else %} @@ -90,7 +96,7 @@ Call Centre = typical office-like scenario with all persons seated, all talking continuously. {% elif form.activity_type == "library" %} Library = Library scenario with all persons seated, breathing and not talking. - {% elif form.activity_type == "workshop" %} + {% elif form.activity_type == "workshop" %} Workshop = assembly workshop environment, all persons doing moderate physical activity, talking 50% of the time. {% elif form.activity_type == "training" %} Training – one person (the trainer) standing, talking, all others seated, talking quietly (whispering). It is assumed the trainer is the infected person, for the worst case scenario.