]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java
Fixed history data collection minmax stream updates and plot rendering
[simantics/platform.git] / bundles / org.simantics.trend / src / org / simantics / trend / impl / ItemNode.java
index dcbd1c797a28ac138a0037792fbbff2a000d2130..699b441ca226c916aa6e725aa8c10a6df6c09b53 100644 (file)
@@ -54,6 +54,7 @@ import org.simantics.trend.configuration.TrendItem;
 import org.simantics.trend.configuration.TrendItem.DrawMode;
 import org.simantics.trend.configuration.TrendItem.Renderer;
 import org.simantics.trend.util.KvikDeviationBuilder;
+import org.slf4j.LoggerFactory;
 
 /**
  * Data node for a TrendItem
@@ -63,7 +64,8 @@ import org.simantics.trend.util.KvikDeviationBuilder;
 public class ItemNode extends G2DNode implements TrendLayout {
 
        private static final long serialVersionUID = -4741446944761752871L;
-
+       private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ItemNode.class);
+       
        public static final AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .61f);
 
        public TrendItem item;
@@ -246,7 +248,9 @@ public class ItemNode extends G2DNode implements TrendLayout {
                        line.lineTo(maxX, ny);
                        line.moveTo(x, y);              
                } else {
-                       line.lineTo(x, y);              
+                       if (x != currentX || y != currentY) {
+                               line.lineTo(x, y);
+                       }
                }
                
        }
@@ -329,7 +333,7 @@ public class ItemNode extends G2DNode implements TrendLayout {
                        s.accessor.get(i, s.sampleBinding, vb.getSample());
                        
                        if(!validSample(vb)) {
-                               System.err.println("-invalid value band: " + i + "/" + count + ":" + vb);
+                               LOGGER.warn("-invalid value band: " + i + "/" + count + ":" + vb);
                                continue;
                        }
                        // Non-continuation point
@@ -425,7 +429,8 @@ public class ItemNode extends G2DNode implements TrendLayout {
                                                                }
                                                        }
 
-                                                       lineTo(x2, y2);
+                                                       if (flat)
+                                                               lineTo(x2, y2);
                                                        
 //                                                     if(showBand) {
 //                                                             lineTo(x2, y2);
@@ -466,7 +471,7 @@ public class ItemNode extends G2DNode implements TrendLayout {
                        }
                                        
                        // Binary signal
-                       if (item.renderer == Renderer.Binary) {
+                       else if (item.renderer == Renderer.Binary) {
                                byte value = 0;
                                if (vb.getValueBinding() instanceof BooleanBinding) {
                                        value = ((Boolean) vb.getValue(Bindings.BOOLEAN)) ? (byte)0 : (byte)1;