Tested and fixed utility for truncating history data. 80/1280/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 3 Dec 2017 20:07:15 +0000 (22:07 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 3 Dec 2017 20:08:36 +0000 (22:08 +0200)
commit908f3683f6cd21dcff70a8f3b1a9d1e3368ca5af
tree5e558086ab9e0535605dc7923de3e035cf6372e5
parent74045ae2a729ae2ec57db0816709a948eea7d392
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.

refs #7622

Change-Id: I35863f5258da2cae193b3086500b5514c4699518
bundles/org.simantics.charts/src/org/simantics/charts/editor/ChartData.java
bundles/org.simantics.charts/src/org/simantics/charts/editor/TimeSeriesEditor.java
bundles/org.simantics.history/src/org/simantics/history/impl/CollectorState.java
bundles/org.simantics.simulation/src/org/simantics/simulation/history/HistoryUtil.java