kopia lustrzana https://github.com/projecthorus/chasemapper
Log bearing data to chase log.
rodzic
ea94f7634b
commit
03f8772a43
|
@ -260,7 +260,7 @@ class Bearings(object):
|
||||||
# Add in any raw DOA data we may have been given.
|
# Add in any raw DOA data we may have been given.
|
||||||
if 'raw_bearing_angles' in bearing:
|
if 'raw_bearing_angles' in bearing:
|
||||||
_new_bearing['raw_bearing_angles'] = bearing['raw_bearing_angles']
|
_new_bearing['raw_bearing_angles'] = bearing['raw_bearing_angles']
|
||||||
_new_bearing['raw_doa'] = bearing['raw_doa']
|
_new_bearing['raw_doa'] = bearing['raw_doa'][::-1]
|
||||||
|
|
||||||
|
|
||||||
# Now we need to update the web clients on what has changed.
|
# Now we need to update the web clients on what has changed.
|
||||||
|
|
|
@ -104,6 +104,19 @@ class ChaseLogger(object):
|
||||||
self.log_error("Processing not running, discarding.")
|
self.log_error("Processing not running, discarding.")
|
||||||
|
|
||||||
|
|
||||||
|
def add_bearing(self, data):
|
||||||
|
""" Log a packet of bearing data """
|
||||||
|
|
||||||
|
data['log_type'] = 'BEARING'
|
||||||
|
data['log_time'] = pytz.utc.localize(datetime.datetime.utcnow()).isoformat()
|
||||||
|
|
||||||
|
# Add it to the queue if we are running.
|
||||||
|
if self.input_processing_running:
|
||||||
|
self.input_queue.put(data)
|
||||||
|
else:
|
||||||
|
self.log_error("Processing not running, discarding.")
|
||||||
|
|
||||||
|
|
||||||
def process_queue(self):
|
def process_queue(self):
|
||||||
""" Process data from the input queue, and write telemetry to log files.
|
""" Process data from the input queue, and write telemetry to log files.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -664,10 +664,11 @@ def udp_listener_car_callback(data):
|
||||||
|
|
||||||
|
|
||||||
def udp_listener_bearing_callback(data):
|
def udp_listener_bearing_callback(data):
|
||||||
global bearing_store
|
global bearing_store, chase_logger
|
||||||
|
|
||||||
if bearing_store != None:
|
if bearing_store != None:
|
||||||
bearing_store.add_bearing(data)
|
bearing_store.add_bearing(data)
|
||||||
|
chase_logger.add_bearing(data)
|
||||||
|
|
||||||
|
|
||||||
# Data Age Monitoring Thread
|
# Data Age Monitoring Thread
|
||||||
|
|
Ładowanie…
Reference in New Issue