From 81da9fd361ae1502f54b50a1e37f7e3b33eb5311 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 11 Aug 2024 18:11:28 +1000 Subject: [PATCH] DFReader: fixed handling of multlipiers from FMTU and MULT --- DFReader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DFReader.py b/DFReader.py index 4f8f50711..a1c92b58d 100644 --- a/DFReader.py +++ b/DFReader.py @@ -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: @@ -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'''