Class CircularBufferDataProvider

java.lang.Object
org.eclipse.nebula.visualization.xygraph.dataprovider.AbstractDataProvider
org.eclipse.nebula.visualization.xygraph.dataprovider.CircularBufferDataProvider
All Implemented Interfaces:
IDataProvider
Direct Known Subclasses:
ClippedCircularBufferDataProvider

public class CircularBufferDataProvider
extends AbstractDataProvider
Provides data to a trace.
  • Constructor Details

  • Method Details

    • setCurrentXData

      public void setCurrentXData​(double newValue)
      Parameters:
      currentXData - the currentXData to set
    • setCurrentYData

      public void setCurrentYData​(double newValue)
      Set current YData. It will automatically make timestamp disabled.
      Parameters:
      currentYData - the currentYData to set
    • addSample

      public void addSample​(ISample sample)
    • setCurrentYDataTimestamp

      public void setCurrentYDataTimestamp​(long timestamp)
      Set the time stamp of currrent YData
      Parameters:
      timestamp - timestamp of Y data in milliseconds.
    • setCurrentYData

      public void setCurrentYData​(double newValue, long timestamp)
      Set current YData and its timestamp when the new value generated.
      Parameters:
      currentYData - the currentYData to set
      timestamp - timestamp of Y data in milliseconds.
    • setCurrentXDataArray

      public void setCurrentXDataArray​(double[] newValue)
      Parameters:
      currentXData - the currentXData to set
    • setCurrentYDataArray

      public void setCurrentYDataArray​(double[] newValue)
      Parameters:
      currentXData - the currentXData to set
    • clearTrace

      public void clearTrace()
      Clear all data on in the data provider.
    • iterator

      public java.util.Iterator<ISample> iterator()
    • setBufferSize

      public void setBufferSize​(int bufferSize)
      Parameters:
      bufferSize - the bufferSize to set
    • setUpdateMode

      public void setUpdateMode​(CircularBufferDataProvider.UpdateMode updateMode)
      Parameters:
      updateMode - the updateMode to set
    • getUpdateMode

      public CircularBufferDataProvider.UpdateMode getUpdateMode()
      Returns:
      the update mode.
    • triggerUpdate

      public void triggerUpdate()
      In TRIGGER update mode, the trace data could be updated by this method
      Parameters:
      triggerValue - the triggerValue to set
    • setPlotMode

      public void setPlotMode​(CircularBufferDataProvider.PlotMode plotMode)
      Parameters:
      plotMode - the plotMode to set
    • getSample

      public ISample getSample​(int index)
      Description copied from interface: IDataProvider
      Get sample by index

      Synchronization: Since the data might change dynamically, synchronize on the IDataProvider around calls to getSize() and getSample().

      Specified by:
      getSample in interface IDataProvider
      Specified by:
      getSample in class AbstractDataProvider
      Parameters:
      index - Sample index, 0...getSize()-1
      Returns:
      the ISample element at the given index
    • getSize

      public int getSize()
      Description copied from interface: IDataProvider
      Total number of samples.
      Specified by:
      getSize in interface IDataProvider
      Specified by:
      getSize in class AbstractDataProvider
      Returns:
      size
      See Also:
      IDataProvider.getSample(int)
    • setXAxisDateEnabled

      public void setXAxisDateEnabled​(boolean xAxisDateEnabled)
      If xAxisDateEnable is true, you will need to use setCurrentYData(double, long) or setCurrentYDataTimestamp(long) to set the time stamp of ydata. This flag will be automatically enabled when either of these two methods were called. The default value is false.
      Parameters:
      xAxisDateEnabled - the xAxisDateEnabled to set
    • setUpdateDelay

      public void setUpdateDelay​(int updateDelay)
      Parameters:
      updateDelay - Delay in milliseconds between plot updates. This may help to reduce CPU usage. The default value is 0ms.
    • fireDataChange

      protected void fireDataChange()
      Description copied from class: AbstractDataProvider
      a data change has occured
      Overrides:
      fireDataChange in class AbstractDataProvider
    • setConcatenate_data

      public void setConcatenate_data​(boolean concatenate_data)
    • isConcatenate_data

      public boolean isConcatenate_data()