Commit 1b30e2c3 by Corey Koval

Basically rewriting the whole front end in JS, but not because I want to

parent ce7dae65
......@@ -15,6 +15,7 @@ from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler, minmax_scale
from geojson import Point, MultiPoint, Feature, FeatureCollection
from czml3 import Packet, Document, Preamble
import json
from bottle import route, run, request, get, post, redirect, template, static_file
......@@ -69,6 +70,13 @@ class receiver:
except:
raise IOError
def receiver_dict(self):
return ({'station_id': self.station_id, 'station_url': self.station_url,
'latitude':self.latitude, 'longitude':self.longitude, 'heading':self.heading,
'doa':self.doa, 'frequency':self.frequency, 'power':self.power,
'confidence':self.confidence, 'doa_time':self.doa_time, 'mobile': self.isMobile,
'active':self.isActive, 'auto':self.isAuto})
latitude = 0.0
longitude = 0.0
heading = 0.0
......@@ -422,7 +430,15 @@ def update_cesium():
@get('/rx_params')
def rx_params():
return template('rx_params.tpl', {'receivers':receivers})
all_rx = {'receivers':{}}
rx_properties = []
for index, x in enumerate(receivers):
rx = x.receiver_dict()
rx['uid'] = index
rx_properties.append(rx)
all_rx['receivers'] = rx_properties
return json.dumps(all_rx)
def start_server(ipaddr = "127.0.0.1", port=8080):
run(host=ipaddr, port=port, quiet=True, server="paste", debug=True)
......
bottle==0.12.17
geojson==2.5.0
numpy==1.13.3
lxml==4.2.1
czml3==0.5.3
scikit_learn==0.23.2
......@@ -2,6 +2,11 @@ body {
overflow-x: hidden;
}
#menuToggle p {
display: inline-block;
margin: 1px;
}
#menuToggle {
display: block;
position: absolute;
......
% for x in {{receivers}}:
<RECEIVER>
<STATION_ID>{{x.station_id}}</STATION_ID>
<URL>{{x.station_url}}</URL>
<AUTO>{{x.isAuto}}</AUTO>
<FREQUENCY>{{x.frequency}}</FREQUENCY>
<LATITUDE>{{x.latitude}}</LATITUDE>
<LONGITUDE>{{x.longitude}}</LONGITUDE>
<HEADING>{{x.heading}}</HEADING>
<MOBILE>{{x.isMobile}}</MOBILE>
</RECEIVER>
% end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment