oswald2 / AURIS

A new, open source mission control system in Haskell
BSD 3-Clause "New" or "Revised" License
55 stars 9 forks source link

Refactor MIB parser #41

Closed jorpic closed 4 years ago

jorpic commented 4 years ago

I added unit tests for each of the FromRecord instances but for VDF and LGF there is not enough data in ASCII_RTE folder vfd.dat contains single entry which appears to be invalid and lgf.dat is just empty.

Also added unit tests for calibration conversions. Not sure if they are adequate, please check.

Some parsers check input record length with (>=). E.g. can input for PCFentry really be longer than 23? https://github.com/oswald2/AURIS/blob/0712070ebb4ffd4c13b609629f23ad28820f670b/esa-mib/src/Data/MIB/PCF.hs#L95-L97 PCF also provides some defaults in case input is a bit shorter. https://github.com/oswald2/AURIS/blob/0712070ebb4ffd4c13b609629f23ad28820f670b/esa-mib/src/Data/MIB/PCF.hs#L145 Can the length be 21? In this case should parser overwrite fields 19 and 20 with defaults?

oswald2 commented 4 years ago

The VDF entry is indeed not right, I corrected it on the master branch.

I added a single entry to LGF.dat, which is comletely analog to mcf.dat, just it doesn't do a polynomial calculation, but a logarithmic one.

For the PCF, I just checked with the documentation and:

Do you need further updates on this with these answers? Otherwise I would merge it.

jorpic commented 4 years ago

Thank you for the answers. No further information is needed. Please do not merge it yet, I'll rebase my changes on top of the updated master and will change tests accordingly.

oswald2 commented 4 years ago

I pushed changes to master: