X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.trend%2Fsrc%2Forg%2Fsimantics%2Ftrend%2Fimpl%2FItemNode.java;h=402d793f8cc4c34e4fbc15c5d4958f9a3635e26c;hb=035118aa5f35c9e5acd1f34d22065055dfdee486;hp=dcbd1c797a28ac138a0037792fbbff2a000d2130;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java b/bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java index dcbd1c797..402d793f8 100644 --- a/bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java +++ b/bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java @@ -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,11 @@ public class ItemNode extends G2DNode implements TrendLayout { } } - lineTo(x2, y2); + // gitlab #35: t2 > t1 ensure that the value band is + // rendered as a horizontal line until the the time when + // the band's value went out of dead-band. + if (flat || t2 > t1) + lineTo(x2, y2); // if(showBand) { // lineTo(x2, y2); @@ -466,7 +474,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;