Browse Source

LogAnalyser: Add double support to DataflashLog.py

Doubles were added to dataflash in commit 3991e0c476.
mission-4.1.18
Jason Martens 10 years ago committed by Andrew Tridgell
parent
commit
a08d57149e
  1. 5
      Tools/LogAnalyzer/DataflashLog.py

5
Tools/LogAnalyzer/DataflashLog.py

@ -110,6 +110,7 @@ class BinaryFormat(ctypes.LittleEndianStructure): @@ -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): @@ -168,7 +169,11 @@ class BinaryFormat(ctypes.LittleEndianStructure):
if scale is not None:
p = property(lambda x:getattr(x, attributename) / scale)
members[propertyname] = p
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…
Cancel
Save