diff --git a/.gitignore b/.gitignore index 41198cdd..dbf9ac2d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__ .ipynb_checkpoints *.egg-info *.DS_Store +*.pyc # Editor stuff *.swp diff --git a/cara/apps/calculator/static/form.html b/cara/apps/calculator/static/form.html index 7b1f9501..63f39d4c 100644 --- a/cara/apps/calculator/static/form.html +++ b/cara/apps/calculator/static/form.html @@ -1,7 +1,7 @@ - + @@ -14,61 +14,81 @@ -

CARA Covid Calculator

-
+Beta v1.0.0 Please send feedback to CARA-dev@cern.ch +

CARA Covid Airborne Risk Assessment tool

+ +
- Simulation name:
+ Simulation name:
Room number:
- +
+ Room data:
Room volume:   
Floor area:   
-      Ceiling height:   
+       Ceiling height:   
+
- Ventilation type: - Mechanical - Natural + Ventilation type: + Mechanical + Natural
+ + + Air changes per hour   
+
- + + +
+ + + HEPA filtration: + + + + + +
- Event data:
+ Event data:
Attendees:
- Total number of people:
- Number of infected people:
+ Total number of occupants:
+ Number of infected people:
+
Activity type:
Start:    Finish:
+ Infected person(s) presence:
+ Start:    + Finish:
+
+ When is the event?
Single event Date:
Recurrent usage @@ -86,170 +106,67 @@
- +
- -
-
- Mask wearing: Continuous - Removed when seated - -

This tool estimates the risk of COVID-19 spread. It is based on current scientific data and can be used to provide an illustration for different real world scenarios.

- - How to use this tool:
- - Room data
- - Enter the data about the area you wish to study. You can find these in GIS, or by measuring them yourself. - For mechanical ventilation, you should check with a specialist for the air flow or air change rate.

- - Event data
- - Enter the total number of people and how many you assume are infected.

- - Activity types:
- - Office = typical scenario all persons seated, talking quietly.
- Workshop = assembly workshop environment, all persons doing light exercise, talking.
- Training = one person standing, talking, all others seated, breathing normally.
- Seminar = As training, but all participants take turns in standing and talking.
- - You should specify if the event is a one off (give date) or recurrent use of the same space for the same activity, in which case tick the months when the activity takes place.
- - Specify if a lunch break should be included, and when it starts/stops.
- - If you will take coffee breaks, they are spread out evenly throughout the day, in addition to lunch.
- - Mask wearing: Specify if they are worn all the time, or only when less than 2 meters apart.


- + This tool simulates the long range airborne spread SARS-CoV-2 virus in a finite volume and estimates the risk of COVID-19 infection. It is based on current scientific data and can be used to measures the effectiveness of different mitigation measures.
+ + How to use this tool:
+ Room data
+ Enter the data about the area you wish to study. You can find these figures in GIS Portal, or by measuring them yourself.
+ Ventilation data
+ Enter the data on the available means for venting of indoor spaces. For mechanical ventilation, you should check with a specialist for the air flow or air change rate.
+ Event data
+ Enter the total number of occupants in the room and how many of them you assume are infected. We have provided common activity types:
+ Office = typical scenario all persons seated, talking.
+ Workshop = assembly workshop environment, all persons doing light exercise, talking.
+ 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.
+You should specify if the event is a one off (give date) or recurrent use of the same space for the same activity, in which case select the month when the activity takes place.
+ Specify if a lunch break should be included, and when it starts/stops.
+ If you will take coffee breaks, they are spread out evenly throughout the day, in addition to lunch.
+ Mask wearing: Specify if they are worn at occupant workstations, or are removed when a physical distance of 2m is respected.




-
- The results will go here: -
- - - \ No newline at end of file diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index ca15b3d0..dedf29e2 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -2,6 +2,9 @@ function clear_form(){ document.covid_calculator.reset(); } +function test() { +} + /* -------Show/Hide DIVs------- */ function show(show, var_id, obj) { var show = document.getElementById(show); @@ -16,30 +19,21 @@ function show(show, var_id, obj) { } function show_hide(show, hide, obj) { + var show = document.getElementById(show); var hide = document.getElementById(hide); - - if (show.style.display === "none") { - show.style.display = "block"; - hide.style.display = "none"; - }// else { - // show.style.display = "none"; - //} + var no_ventilation = document.getElementById("no_ventilation"); - require_fields(obj); - -} - -/*$(document).on("click", "input[name='ventilation_type']", function(){ - thisRadio = $(this); - if (thisRadio.hasClass("imChecked")) { - thisRadio.removeClass("imChecked"); - thisRadio.prop('checked', false); - } else { - thisRadio.prop('checked', true); - thisRadio.addClass("imChecked"); - }; - })*/ + if (show.style.display === "block") { + show.style.display = "none"; + obj.checked = false; + no_ventilation.checked = true; + unrequire_fields(obj); + } else if (show.style.display === "none") { + show.style.display = "block"; + hide.style.display = "none"; + require_fields(obj); +} } /* -------Required fields------- */ function require_fields(obj){ @@ -74,19 +68,23 @@ function require_fields(obj){ case "event_type_recurrent": require_single_event(false); break; - case "BUTTON_lunch": - var button = document.getElementById("lunch_option"); - if (button.value == 0) - require_lunch(false); - else if (button.value == 1) - require_lunch(true); + case "lunch_option_no": + require_lunch(false); break; - case "BUTTON_coffee": - var button = document.getElementById("coffee_option"); - if (button.value == 0) - require_coffee(false); - else if (button.value == 1) - require_coffee(true); + case "lunch_option_yes": + require_lunch(true); + break; + default: + break; +} } + +function unrequire_fields(obj){ + switch(obj.id) { + case "mechanical": + require_mechanical_ventilation(false); + break; + case "natural": + require_natural_ventilation(false); break; default: break; @@ -132,10 +130,6 @@ function require_lunch(option) { $("#lunch_finish").prop('required',option); } -function require_coffee(option) { - $("#coffee_breaks").prop('required',option); -} - /* -------UI------- */ $(function() { $("#datepicker").datepicker();