Commit d7c27900 authored by enfo's avatar enfo

Merge branch 'develop' into 'master'

Added "status" flag to adis packages

See merge request enfo/sentiboard-utils!11
parents 90ebd47a 6c379ec9
Pipeline #128 passed with stages
in 1 minute and 1 second
......@@ -31,7 +31,7 @@ class AdisPackage(object):
def __init__(self, TOV, TOA, TOT, timestamp, prod_id,
deltang, deltvel, temp=None,
mag=None, barometer=None, gyro=None, accl=None):
mag=None, barometer=None, gyro=None, accl=None, status=None):
if gyro is None:
gyro = []
if accl is None:
......@@ -74,7 +74,7 @@ class AdisPackage(object):
self.temp = temp_scale(temp)
self.status = [0x00]
self.status = status
self.data = [self.tov] + self._message.data + self.deltang + self.deltvel
self.dict = {'tov': self._tov, 'toa': self._toa, 'tot': self.tot,
......@@ -87,6 +87,8 @@ class AdisPackage(object):
'barometer': self.barometer})
elif prod_id == 16490:
self.dict.update({'deltvel': self.deltvel, 'deltang': self.deltang})
if self.status is not None:
self.dict.update({'status': self.status})
......@@ -121,7 +123,7 @@ class AdisParser(object):
prod_id,
(deltang_x, deltang_y, deltang_z),
(deltvel_x, deltvel_y, deltvel_z),
temp)
temp, status=sys_e_flag)
else:
if not MAG_ON:
temp, \
......@@ -158,7 +160,7 @@ class AdisParser(object):
(gyro_x, gyro_y, gyro_z),
(accl_x, accl_y, accl_z))
if not (sys_e_flag == 1 or sys_e_flag == 0):
print('Error: %X %X' % (sys_e_flag, diag_sts))
print('\nError: %X %X\n' % (sys_e_flag, diag_sts))
return package
......
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