]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.history/src/org/simantics/history/HistorySamplerItem2.java
Rest API for Historian data
[simantics/platform.git] / bundles / org.simantics.history / src / org / simantics / history / HistorySamplerItem2.java
index 73d89fa56a1aed8d73bed10724f12fe4417f4d40..d5c3942a6ba35caa4c796f54526763b18ea7f20b 100644 (file)
@@ -41,6 +41,11 @@ public class HistorySamplerItem2 implements Comparable<HistorySamplerItem2> {
                this.items = items;
                this.chartDataId = identityHashCode;
        }
+       
+       public void flush() throws HistoryException {
+               if (collector != null)
+                       collector.flush();
+       }
 
        public void open() throws HistoryException {
                accessor = history.openStream(items[0].id, "r");
@@ -93,11 +98,11 @@ public class HistorySamplerItem2 implements Comparable<HistorySamplerItem2> {
                return true;
        }
 
-       private LevelItem getFormat(double pixelsPerSecond) throws HistoryException {
+       private LevelItem getFormat(double secondsPerPixel) throws HistoryException {
                LevelItem result = null;
                for (LevelItem format : items) {
                        double interval = format.samplingInterval;
-                       if (Double.isNaN( interval ) || interval <= pixelsPerSecond) {
+                       if (Double.isNaN( interval ) || interval <= secondsPerPixel) {
                                result = format;
                        } else {
                                break;