Reimplement the RUSA ACP controle time calculator with flask and ajax
The current RUSA controle time calculator is a Perl script that takes an HTML form and emits a text page. The reimplementation will fill in times as the input fields are filled. Each time a distance is filled in, the corresponding open and close times should be filled in. If no begin time has been provided, use 0:00 as the begin time.
Megan McMillan
http://ix.cs.uoregon.edu/~mcmillan/htbin/cis399/proj3-ajax/
- Modify Makefile and CONFIG.py to point to the appropriate local environment variables.
- Run
make install
- Activate the virtual environment by running
. env/bin/activate
- Run
python3 app.py
- Access in browser by navigating to 'hostname:port#', which will most likely be 'localhost:5000'
Control Location (km) | Minimum Speed (km/hr) | Maximum Speed (km/hr)
0-200 | 15 | 34
200-400 | 15 | 32
400-600 | 15 | 30
600-1000 | 11.428 | 28
distance (km) / speed (km/hr) = time (hr)
Control Location / Maximum Speed = Opening Time
For controls above 200km, the max speed begins to reduce: Ex: 350km = 200/34 + 150/32 = 5H53 + 4H41 = 10H34
Control Location / Minimum Speed = Closing Time
For controls above 600km, the max speed begins to reduce: Ex: 650km = 600/15 + 50/11.428 = 4H00 + 4H23 = 8H23
- Brevets can be: 200, 300, 400, 600, 1000
- Ending time for brevets:
200km brevet is 13H30
300km brevet is 20H00
400km brevet is 27H00
600km brevet is 40H00
1000km brevet is 51H00
- Closing time for the starting point control (at 0km) is one hour after the official start.
- The total distance of the route cannot be more than 10% longer than the theoretical distance.
- Times are shown in 24-hour format.
- Minutes should be rounded to the nearest minute.
- It is assumed that all checkpoints are located within the same time zone.
- Control point distance field only takes numbers
- If a setting is changed above, all modified form elements should update accordingly
Run the unit test scripts by running:
python3 unit_test.py