Improve start stop
Created by: michele-brambilla
This PR closes #54 (closed), closes #55 (closed).
- If the user provides a start time the
Streamer
usesoffsetsForTimes
to make sure that there are no earlier messages in the log. Indeed this is not enough, as #54 (closed) points out. Usually there are unwanted messages among the offset the method returns and the actual target. The solution is inStreamer::write
: the message timestamp is extracted usingDemuxTopic::time_difference_from_message
and compared against the start time. Earlier messages are discarded. - After listening for new commands
Master
checks the status off all theStreamMaster
. If any of them is in theStreamMasterErrorCode::is_removable
status is removed from the list (erased). - If the user issues a stop command specifying the stop time
StreamMaster::forceStop
makes sure that at most 5 seconds after the stop time (comparing with the system time) all the streams are closed and theStreamMaster
is removable.