Class Scrolling2DPlotDataFX

java.lang.Object
dataPlotsFX.scrollingPlot2D.Scrolling2DPlotDataFX
Direct Known Subclasses:
Spectrogram2DPlotData

public class Scrolling2DPlotDataFX extends Object
Contains the spectrogram data for a single channel. Will only exist and be populated if that channel is included in the spectrogram display.
Author:
Doug Gillespie and Jamie Macaulay Was SpectrogramPlotDataFX
  • Constructor Details

    • Scrolling2DPlotDataFX

      public Scrolling2DPlotDataFX(Scrolling2DPlotInfo specPlotInfo, int iChannel)
    • Scrolling2DPlotDataFX

      public Scrolling2DPlotDataFX(TimeProjectorFX tdProjector, DataBlock2D fftDataBlock, Plot2DColours spectrogramColours, int iChannel, boolean isViewer)
      Called when making a datagram.
      Parameters:
      tdProjector -
      fftDataBlock -
      spectrogramColours -
      iChannel -
      isViewer -
  • Method Details

    • new2DData

      public void new2DData(DataUnit2D fftDataUnit)
      New fft data arrived for this channel.
      Parameters:
      fftDataUnit - fft data unit.
    • checkTimeGap

      public void checkTimeGap(DataUnit2D dataUnit2D)
      Check that the new fft is concurrent to the last fft. If not fill the spectrogram with blank sapce.
    • checkConfig

      public void checkConfig()
      Check the configuration of the channel data - array sizes are correct, etc.
    • drawSpectrogramWrap

      public double drawSpectrogramWrap(javafx.scene.canvas.GraphicsContext g2d, double timePixels, double freqPixels, PamAxisFX timeAxis, double scrollStart, double scrollEndTime, double imageFP1, double imageFP2, double[] freqBinRange, double freqWidth)
    • drawSpectrogramScroll

      public void drawSpectrogramScroll(javafx.scene.canvas.GraphicsContext g2d, double timePixels, double freqPixels, PamAxisFX timeAxis, double scrollStart, double scrollEndTime, double imageFP1, double imageFP2, double[] freqBinRange, double freqWidth)
    • drawSpectrogram

      public void drawSpectrogram(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, double scrollStart, boolean wrap)
    • drawWrapLine

      public void drawWrapLine(javafx.scene.canvas.GraphicsContext g2d, double wrapScreenPix, double freqPixels)
      Draw the wrap line.
      Parameters:
      g2d -
      wrapScreenPix -
      freqPixels -
    • reBuildImage

      public void reBuildImage()
    • reBuildImage

      protected boolean reBuildImage(javafx.concurrent.Task<Boolean> task)
      Call to re build the image, for example if colour map or amplitude scale changes. Note: Do not run a seperate thread if the image is running in real time mode. Can be used on thread if image is paused or in viewer mode. During rebuilding in real time mode some data may be lost
      Parameters:
      if - on a separate thread input which task this function is a part of. Means the rebuild can be cancelled. Can null
      Returns:
      true if image was completely rebuilt.
    • resetForLoad

      public void resetForLoad()
      Reset anything necessary before new data are loaded offline in viewer mode.
    • resetForLoad

      public void resetForLoad(boolean newWritableImage)
      Reset anything necessary before new data are loaded offline in viewer mode.
    • getFftHop

      public int getFftHop()
      Get the current FFT hop size in bins (samples) for this spectrogram plot.
      Returns:
      FFT hop size in bins (samples)
    • rebuildFinished

      public void rebuildFinished()
    • setFreqLimits

      @Deprecated public void setFreqLimits(javafx.beans.property.DoubleProperty[] frequencyLimits)
      Deprecated.
      Checks the frequency range range to be displayed.
    • setSpecColors

      public void setSpecColors(Plot2DColours specColors)
      Set the colours for the spectrogram
      Parameters:
      specColors - - spectrogram colours.
    • getSpecColors

      public Plot2DColours getSpecColors()
      Get the colours for the spectrogram
      Parameters:
      specColors - - spectrogram colours.
    • getWritableImage

      public javafx.scene.image.Image getWritableImage()
      Get the image in memory of the spectrogram
      Returns:
      the current image whihc has spectrogram drawn on it.
    • getTotalPowerSpec

      public long getTotalPowerSpec()
      Get the total number of 2D data units added to the plot
      Returns:
      the total number of 2D plot lines.
    • getLastPowerSpecTime

      public long getLastPowerSpecTime()
    • setLastPowerSpecTime

      public void setLastPowerSpecTime(long lastPowerSpecTime)