Add some error handling to telemetry parsing. Fix burst tooltip display.

bearings
Mark Jessop 2018-07-28 14:47:51 +09:30
rodzic 82285d7c09
commit 016e5cb98b
2 zmienionych plików z 13 dodań i 5 usunięć

Wyświetl plik

@ -453,9 +453,13 @@ def ozi_listener_callback(data):
output['callsign'] = "Payload"
output['time_dt'] = data['time']
logging.info("OziMux Data: %.5f, %.5f %.1f" % (data['lat'], data['lon'], data['alt']))
logging.info("OziMux Data: %.5f, %.5f, %.1f" % (data['lat'], data['lon'], data['alt']))
try:
handle_new_payload_position(output)
except Exception as e:
logging.error("Error Handling Payload Position - %s" % str(e))
handle_new_payload_position(output)
def udp_listener_summary_callback(data):
@ -469,7 +473,7 @@ def udp_listener_summary_callback(data):
output['alt'] = data['altitude']
output['callsign'] = data['callsign']
logging.info("Horus UDP Data: %.5f, %.5f %.1f" % (output['lat'], output['lon'], output['alt']))
logging.info("Horus UDP Data: %.5f, %.5f, %.1f" % (output['lat'], output['lon'], output['alt']))
# Process the 'short time' value if we have been provided it.
if 'time' in data.keys():
@ -479,7 +483,10 @@ def udp_listener_summary_callback(data):
# Otherwise use the current UTC time.
output['time_dt'] = datetime.utcnow()
handle_new_payload_position(output)
try:
handle_new_payload_position(output)
except Exception as e:
logging.error("Error Handling Payload Position - %s" % str(e))
def udp_listener_car_callback(data):

Wyświetl plik

@ -617,13 +617,14 @@
}
if(data.burst.length == 3){
// There is burst data!
var _burst_txt = _callsign + " Burst (" + data.burst[2].toFixed(0) + "m)";
if (balloon_positions[_callsign].burst_marker == null){
var _burst_txt = _callsign + " Burst (" + data.burst[2].toFixed(0) + "m)";
balloon_positions[_callsign].burst_marker = L.marker(data.burst,{title:_burst_txt, icon: burstIcon})
.bindTooltip(_burst_txt,{permanent:false,direction:'right'})
.addTo(map);
}else{
balloon_positions[_callsign].burst_marker.setLatLng(data.burst);
balloon_positions[_callsign].burst_marker.setTooltipContent(_burst_txt);
}
}else{
// No burst data, or we are in descent.