junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
527 stars 151 forks source link

Bds62 baro rounding fix #132

Closed JWyman482 closed 1 year ago

JWyman482 commented 1 year ago

Reference Issue

Problem(s)

  1. The round(baro, 1) call on line 277 in bds62.py was being called when baro was 'None'.
  2. (minor) Padding in _print() wasn't sufficient for the baro readout
  3. (minor) Output would display units when value was 'None.'

Fix Actions Taken

  1. Wrapped the else clause with the round call so it was only called if baro held a numeric value.
  2. Updated the output padding from 20 chars to 28 chars
  3. Added a conditional to remove the "millibars" if baro is 'None.'