ihedvall / mdflib

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

Add automatic master channel handling #20

Closed ihedvall closed 11 months ago

ihedvall commented 11 months ago

Summary

When adding samples to a channel group, the absolute time is supplied. If a master channel is configured, this channel should use that time but the time needs to be converted to relative time.

The idea is to check if a time master exist and if so set the proper relative time. The relative time should be relative to the start time. This time is store when theStartMeasurement() is called.

The StartMeasurement() function shall update samples in the cache while theSaveSample() function only needs to update the master channel value before creating.

ihedvall commented 11 months ago

Added so the master time channel uses the sample time to calculate the relative time. The user only needs to create the time master channel and the writer object will fix calculating the correct values from sample time and start time.