Utility for history data stream truncation to given timestamp
|Assignee:||Tuukka Lehtonen||% Done:|
|Release notes:||Added @org.simantics.simulation.history.HistoryUtil@ utility method for truncating history data streams to a specified timestamp.|
|Tags:||subscription, history, 1.31.0, truncate|
|Velocity based estimate||-|
|Release||Simantics 1.31.0||Release relationship||Auto|
Some dynamic simulation systems can do backtracking, i.e. returning the simulator to a state that existed earlier in time. If simulation is continued from this earlier time then subscribed history data needs to be truncated so that there are no samples in the history data streams with timestamps greater than the time where simulation was resumed from.
Added utility for truncating collected history data
The utility also supports an approximate truncation of the dynamic
CollectorState structure related to an active Collector instance.
Tested and fixed utility for truncating history data.
HistoryUtil.truncateHistory now actually works as intended. Care must be
taken not to interfere with the history data while it is being
truncated. This must be ensured externally.
A reference counter (AtomicInteger) was also added to ChartData to be
able to see how many users the ChartData has and to wait until it no
longer has any users. This is required to wait until all chart editors
have detached themselves from the history data.