From cef977db55372a9c16bc2eb9afc1311beb9683a1 Mon Sep 17 00:00:00 2001 From: studerCoder Date: Fri, 23 Jun 2017 22:00:12 -0700 Subject: [PATCH] I did shit and stuff Stuff and shit. Oh and shit and stuff --- Control/GCS/app.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Control/GCS/app.py b/Control/GCS/app.py index 8cf33a1..9a690fe 100644 --- a/Control/GCS/app.py +++ b/Control/GCS/app.py @@ -11,7 +11,19 @@ app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app) -# tower = Tower() +tower = Tower() + +def get_battery(): + return tower.vehicle.batter.voltage + +def get_vehicle_status(): + """Laundry list function. + + """ + get_battery() + status = {} + status['battery'] = get_battery() + return status @app.route('/') def index(): @@ -20,7 +32,11 @@ def index(): @socketio.on('connect') def on_connect(): send('Initialization in progress...') - emit('status', {'data': 42}) + emit('status', {'status': get_vehicle_status()}) + # emit('status', {'status': 'wazzup world'}) + + + if __name__ == '__main__': socketio.run(app, debug=True)