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 Summary

    Constructors
    Constructor
    Description
    Scrolling2DPlotDataFX(TimeProjectorFX tdProjector, DataBlock2D fftDataBlock, Plot2DColours spectrogramColours, int iChannel, boolean isViewer)
    Called when making a datagram.
    Scrolling2DPlotDataFX(Scrolling2DPlotInfo specPlotInfo, int iChannel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Check the configuration of the channel data - array sizes are correct, etc.
    void
    Check that the new fft is concurrent to the last fft.
    void
    drawSpectrogram(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, double scrollStart, boolean wrap)
     
    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)
     
    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)
     
    void
    drawWrapLine(javafx.scene.canvas.GraphicsContext g2d, double wrapScreenPix, double freqPixels)
    Draw the wrap line.
    int
    Get the current FFT hop size in bins (samples) for this spectrogram plot.
    Get the colours for the spectrogram
    long
    Get the total number of 2D data units added to the plot
    javafx.scene.image.Image
    Get the image in memory of the spectrogram
    void
    new2DData(DataUnit2D fftDataUnit)
    New fft data arrived for this channel.
    void
     
    void
     
    void
    Reset anything necessary before new data are loaded offline in viewer mode.
    void
    resetForLoad(boolean newWritableImage)
    Reset anything necessary before new data are loaded offline in viewer mode.
    void
    setFreqLimits(javafx.beans.property.DoubleProperty[] frequencyLimits)
    Deprecated.
    void
    Set the colours for the spectrogram

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()
    • 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.