Class CircularBufferDataProvider

    • Field Detail

      • currentXData

        private double currentXData
      • currentYData

        private double currentYData
      • currentYDataTimestamp

        private long currentYDataTimestamp
      • currentXDataChanged

        private boolean currentXDataChanged
      • currentYDataChanged

        private boolean currentYDataChanged
      • currentXDataArray

        private double[] currentXDataArray
      • currentYDataArray

        private double[] currentYDataArray
      • currentXDataArrayChanged

        private boolean currentXDataArrayChanged
      • currentYDataArrayChanged

        private boolean currentYDataArrayChanged
      • xAxisDateEnabled

        private boolean xAxisDateEnabled
      • updateDelay

        private int updateDelay
      • duringDelay

        private boolean duringDelay
      • concatenate_data

        private boolean concatenate_data
      • fireUpdate

        private java.lang.Runnable fireUpdate
    • Constructor Detail

      • CircularBufferDataProvider

        public CircularBufferDataProvider​(boolean chronological)
    • Method Detail

      • 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.
      • tryToAddDataPoint

        private void tryToAddDataPoint()
        Try to add a new data point to trace data. Whether it will be added or not is up to the update mode.
      • addDataPoint

        private void addDataPoint()
        add a new data point to trace data.
      • setCurrentXDataArray

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

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

        private void tryToAddDataArray()
        Try to add a new data array to trace data. Whether it will be added or not is up to the update mode.
      • addDataArray

        private void addDataArray()
        add a new data point to trace data.
      • 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
      • triggerUpdate

        public void triggerUpdate()
        In TRIGGER update mode, the trace data could be updated by this method
        Parameters:
        triggerValue - the triggerValue 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
      • 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.
      • setConcatenate_data

        public void setConcatenate_data​(boolean concatenate_data)
      • isConcatenate_data

        public boolean isConcatenate_data()