mirror of
https://github.com/30hours/3lips.git
synced 2024-11-18 12:33:58 +00:00
Rename main.py to api.py and minor changes
This commit is contained in:
parent
d379e4073c
commit
32401c9031
4 changed files with 23 additions and 6 deletions
|
@ -10,7 +10,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# define environment variable
|
# define environment variable
|
||||||
ENV FLASK_APP=main.py
|
ENV FLASK_APP=api.py
|
||||||
|
|
||||||
# run Gunicorn instead of the default Flask development server
|
# run Gunicorn instead of the default Flask development server
|
||||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "main:app"]
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "main:app"]
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
# main.py
|
"""
|
||||||
|
@file api.py
|
||||||
|
@brief API for 3lips.
|
||||||
|
@author 30hours
|
||||||
|
"""
|
||||||
|
|
||||||
from flask import Flask, Response, render_template, request, redirect, jsonify, send_from_directory
|
from flask import Flask, Response, render_template, request, redirect, jsonify, send_from_directory
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -7,8 +7,9 @@ class AdsbAssociator:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@class AdsbAssociator
|
@class AdsbAssociator
|
||||||
@brief A class for associating a detection with ADS-B truth.
|
@brief A class for associating detections of the same target.
|
||||||
@details Uses radar detection data from a blah2 server.
|
@details Girst associate ADS-B truth with each radar detection.
|
||||||
|
Then associate over multiple radars.
|
||||||
@see blah2 at https://github.com/30hours/blah2.
|
@see blah2 at https://github.com/30hours/blah2.
|
||||||
Uses truth data in delay-Doppler space from an adsb2dd server.
|
Uses truth data in delay-Doppler space from an adsb2dd server.
|
||||||
@see adsb2dd at https://github.com/30hours/adsb2dd.
|
@see adsb2dd at https://github.com/30hours/adsb2dd.
|
||||||
|
|
|
@ -81,7 +81,19 @@ async def event():
|
||||||
# main processing
|
# main processing
|
||||||
for item in api_event:
|
for item in api_event:
|
||||||
|
|
||||||
for radar in item["server"]:
|
# associator selection
|
||||||
|
if item["associator"] == "adsb-associator":
|
||||||
|
associator = adsbAssociator
|
||||||
|
else:
|
||||||
|
print("Error: Associator invalid.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# coord reg selection
|
||||||
|
if item["coordreg"] == "ellipse-parametric":
|
||||||
|
coordreg = ellipseParametric
|
||||||
|
else:
|
||||||
|
print("Error: Coord reg invalid.")
|
||||||
|
return
|
||||||
|
|
||||||
print(radar, flush=True)
|
print(radar, flush=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue