Package dataPlotsFX.scrollingPlot2D
Class Scrolling2DPlotDataFX
java.lang.Object
dataPlotsFX.scrollingPlot2D.Scrolling2DPlotDataFX
- Direct Known Subclasses:
Spectrogram2DPlotData
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
ConstructorDescriptionScrolling2DPlotDataFX
(TimeProjectorFX tdProjector, DataBlock2D fftDataBlock, Plot2DColours spectrogramColours, int iChannel, boolean isViewer) Called when making a datagram.Scrolling2DPlotDataFX
(Scrolling2DPlotInfo specPlotInfo, int iChannel) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check the configuration of the channel data - array sizes are correct, etc.void
checkTimeGap
(DataUnit2D dataUnit2D) 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 spectrogramlong
Get the total number of 2D data units added to the plotjavafx.scene.image.Image
Get the image in memory of the spectrogramvoid
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
setSpecColors
(Plot2DColours specColors) Set the colours for the spectrogram
-
Constructor Details
-
Scrolling2DPlotDataFX
-
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
New fft data arrived for this channel.- Parameters:
fftDataUnit
- fft data unit.
-
checkTimeGap
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.Checks the frequency range range to be displayed. -
setSpecColors
Set the colours for the spectrogram- Parameters:
specColors
- - spectrogram colours.
-
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.
-