ihedvall / mdflib

Implementation of the ASAM MDF data file.
https://ihedvall.github.io/mdflib/
MIT License
57 stars 25 forks source link

Setting precision in conversion block does not set precision flag #73

Closed afestini closed 4 months ago

afestini commented 4 months ago

https://github.com/ihedvall/mdflib/blob/03586d71769803c6c732af152aa00feb4be7db1b/mdflib/src/cc4block.cpp#L103

Should this be setting CcFlag::PrecisionValid ?

ihedvall commented 4 months ago

Fair enough. The precision flag should be set as well. 0xFF is unlimited precision. I can fix this.

ihedvall commented 4 months ago

Setting the precision flag and improved unit test to detect the error.

ihedvall commented 4 months ago

@afestini The MDF library have a Reader and a Writer interface. Maybe it should be a Converter interface as well. Please let me know, if you require any improvement on the interface.

afestini commented 4 months ago

Not quite sure in which way you mean it as interface. I just noticed the channel block was setting the flag when configuring the decimals, so I wondered if the conversion block shouldn't be consistent. Having them set automatically seems very convenient (and you can still override the flags otherwise).

ihedvall commented 4 months ago

@afestini Sorry about the misunderstanding. You can skip my previous message. It has nothing to do with the CC block interface. It was more of a general question about the MdfWriter interface.