Receiver rankings (#158)

* Added receiver_rankings, fixed receiver_status

* Added receiver_rankings updates

* Modified receiver_ranking.html

* Removed obsolete code

* Bugfix: order countries for select box

* Frequency scan fixes from RPi

Co-authored-by: Konstantin <pi@barnave>
pull/78/head
Meisterschueler 2020-12-04 07:31:43 +01:00 zatwierdzone przez GitHub
rodzic b5893e9e61
commit d990352f5b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 14 dodań i 14 usunięć

Wyświetl plik

@ -11,16 +11,16 @@ import numpy as np
COMMON_FREQUENCIES = [
[84.015, 87.2250, 'BOS 4m'],
[87.500, 108.0000, 'UKW Rundfunk'],
[87.500, 108.0000, 'VHF FM Radio'],
[108.000, 111.9750, 'ILS'],
[112.000, 117.9750, 'VOR'],
[117.975, 137.0000, 'Flugfunk'],
[143.000, 146.0000, 'Amateurfunk 2m'],
[117.975, 137.0000, 'Aeronautical Radio'],
[143.000, 146.0000, 'Amateur Radio 2m'],
[165.210, 173.9800, 'BOS 2m'],
[177.500, 226.5000, 'DVB-T VHF'],
[273.000, 312.0000, 'Militär'],
[273.000, 312.0000, 'Military'],
[390.000, 399.9000, 'BOS Digital'],
[430.000, 440.0000, 'Amateurfunk 70cm'],
[430.000, 440.0000, 'Amateur Radio 70cm'],
[448.600, 449.9625, 'BOS 70cm'],
[474.000, 786.0000, 'DVB-T UHF'],
[791.000, 821.0000, 'LTE downlink'],
@ -28,9 +28,9 @@ COMMON_FREQUENCIES = [
[868.000, 868.6000, 'Flarm 868.3MHz'],
[880.000, 915.0000, 'GSM 900 uplink'],
[925.000, 960.0000, 'GSM 900 downlink'],
[1025.000, 1095.0000, 'Funknavigation'],
[1164.000, 1215.0000, 'Funknavigation (DME,TACAN)'],
[1429.000, 1452.0000, 'Militär'],
[1025.000, 1095.0000, 'Aeronautical Navigation'],
[1164.000, 1215.0000, 'Aeronautical Navigation (DME,TACAN)'],
[1429.000, 1452.0000, 'Military'],
]
@ -58,16 +58,16 @@ def get_bokeh_frequency_scan(frequency_scan_file):
frequency_source = ColumnDataSource(data=dict(low=low, high=high, x=x, y=y, width=width, height=height, desc=desc))
# Create the figure with tool tips
fig = figure(plot_width=900, plot_height=500, title=f"Signalauswertung {frequency_scan_file.receiver.name}", tools=[PanTool(), WheelZoomTool(), ResetTool()])
r1 = fig.rect(x='x', y='y', width='width', height='height', color="lightgrey", source=frequency_source, legend="Gängige Frequenzen")
r2 = fig.line(xval, yval, legend=f"Messung (gain={frequency_scan_file.gain})")
fig = figure(title=f"Frequency spectrum @ {frequency_scan_file.receiver.name}", sizing_mode='stretch_both', tools=[PanTool(), WheelZoomTool(), ResetTool()])
r1 = fig.rect(x='x', y='y', width='width', height='height', color="lightgrey", source=frequency_source, legend="Common Frequencies")
r2 = fig.line(xval, yval, legend=f"Measurement (gain={frequency_scan_file.gain})")
r3 = fig.line(x=[868.3, 868.3], y=[-25, 25], color="red", legend="Flarm")
fig.add_tools(HoverTool(renderers=[r1], tooltips={"info": "@desc @low-@high MHz"}))
fig.add_tools(HoverTool(renderers=[r2], tooltips={"f [MHz]": "$x", "P [dB]": "$y"}))
fig.xaxis.axis_label = "Frequenz [MHz]"
fig.yaxis.axis_label = "Signalstärke [dB]"
fig.xaxis.axis_label = "Frequency [MHz]"
fig.yaxis.axis_label = "Signal Power [dB]"
fig.legend.click_policy = 'hide'
return file_html(fig, CDN)

Wyświetl plik

@ -276,7 +276,7 @@ def upload_file():
file.save(os.path.join(current_app.config['UPLOAD_PATH'], filename))
uploaded_file = FrequencyScanFile(name=filename, gain=match.group('gain'), upload_ip_address=request.remote_addr, upload_timestamp=datetime.utcnow(), receiver=receiver)
uploaded_file = FrequencyScanFile(name=filename, gain=match.group('gain'), upload_ip_address=request.headers['X-Real-IP'], upload_timestamp=datetime.utcnow(), receiver=receiver)
db.session.add(uploaded_file)
db.session.commit()