LogAnalyser: Add double support to DataflashLog.py
Doubles were added to dataflash in commit 3991e0c476
.
This commit is contained in:
parent
0028910428
commit
a08d57149e
@ -110,6 +110,7 @@ class BinaryFormat(ctypes.LittleEndianStructure):
|
||||
'i': ctypes.c_int32,
|
||||
'I': ctypes.c_uint32,
|
||||
'f': ctypes.c_float,
|
||||
'd': ctypes.c_double,
|
||||
'n': ctypes.c_char * 4,
|
||||
'N': ctypes.c_char * 16,
|
||||
'Z': ctypes.c_char * 64,
|
||||
@ -168,7 +169,11 @@ class BinaryFormat(ctypes.LittleEndianStructure):
|
||||
if scale is not None:
|
||||
p = property(lambda x:getattr(x, attributename) / scale)
|
||||
members[propertyname] = p
|
||||
fields.append((attributename, BinaryFormat.FIELD_FORMAT[format]))
|
||||
try:
|
||||
fields.append((attributename, BinaryFormat.FIELD_FORMAT[format]))
|
||||
except KeyError:
|
||||
print('ERROR: Failed to add FMT type: {}, with format: {}'.format(attributename, format))
|
||||
raise
|
||||
createproperty(label, _type)
|
||||
members['_fields_'] = fields
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user