ihedvall / mdflib

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

Channel data error issue #77

Closed t1y2y3 closed 7 months ago

t1y2y3 commented 7 months ago

I found that setting the Type and Sync of the channel to ChannelType.Master and ChannelSyncType.Time
The data of this channel will be incorrect. problem Is there any way to solve this problem?

ihedvall commented 7 months ago

It took me a while before I found the error. It's not an error. It's a badly made unit test. It's no meaning to set the time channel if it is a time master. The call to the writer.SaveSample(ns70) find the time master channel and sets the relative time. So the cn[0] = ... call is overwritten later.

The ns70 is just the current PC time. So a better written use case should increment the absolute time (ns70), say 10 ms.

t1y2y3 commented 7 months ago

Thank you.