]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.history/src/org/simantics/history/impl/CollectorImpl.java
Still fixes history collection value band endTime setting and rendering
[simantics/platform.git] / bundles / org.simantics.history / src / org / simantics / history / impl / CollectorImpl.java
index 87062a9dabecae759aa0f5dffd442a496af156e5..e956b37117fcc365cbb85cf0e2b339752d814bcc 100644 (file)
@@ -815,11 +815,20 @@ public class CollectorImpl implements Collector {
 
                        /// Extend existing band
                        // Extend endTime value
-                       if (!i.hasEndTime) {
-                               i.current.setTime( time.getBinding(), time.getValue() );
-                       } else {
-                               i.current.setEndTime( time.getBinding(), time.getValue() );
+
+                       // This ensures that a value band's end time isn't the same
+                       // as the next band's start time which makes it possible to
+                       // know what are the timestamps between which the item value
+                       // changed from a to b. This allows us to more correctly render
+                       // steps and sloped lines accoring to the actual data.
+                       if (!i.itemState.ooDeadband || isMinMaxFormat) {
+                               if (!i.hasEndTime) {
+                                       i.current.setTime( time.getBinding(), time.getValue() );
+                               } else {
+                                       i.current.setEndTime( time.getBinding(), time.getValue() );
+                               }
                        }
+
                        if (i.itemState.ooDeadband || isMinMaxFormat) {
                                if (isValidValue) {
                                        // Set last value