Skip to content

Commit

Permalink
DFReader: fixed handling of multlipiers from FMTU and MULT
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 11, 2024
1 parent fda71ea commit 81da9fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DFReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def set_mult_ids(self, mult_ids, mult_lookup):
for i in range(len(self.units)):
# If the format has its own multiplier, do not adjust the unit,
# and if no unit is specified there is nothing to adjust
if self.msg_mults[i] is not None or self.units[i] == "":
if self.msg_mults[i] is not None or self.units[i] != "":
continue
# Get the unit multiplier from the lookup table
if mult_ids[i] in mult_lookup:
Expand All @@ -176,6 +176,9 @@ def set_mult_ids(self, mult_ids, mult_lookup):
self.units[i] = MULT_TO_PREFIX[unitmult]+self.units[i]
else:
self.units[i] = "%.4g %s" % (unitmult, self.units[i])
if self.units[i] in FORMAT_TO_STRUCT:
(label, mul, t) = FORMAT_TO_STRUCT[self.units[i]]
self.msg_mults[i] = mul

def get_unit(self, col):
'''Return the unit for the specified field'''
Expand Down

0 comments on commit 81da9fd

Please sign in to comment.