Package dataPlotsFX.scrollingPlot2D
Class Scrolling2DPlotInfo
java.lang.Object
dataPlotsFX.data.TDDataInfoFX
dataPlotsFX.scrollingPlot2D.Scrolling2DPlotInfo
- All Implemented Interfaces:
Plot2DColours
- Direct Known Subclasses:
BeamOGramPlotInfo
,FFTPlotInfo
Wrapper for the FFT data block allowing it to be plot as a spectrogram on a TDGraphFX.
- Author:
- Doug Gillespie and Jamie Macaulay Was FFTPlotInfo
-
Nested Class Summary
Nested classes/interfaces inherited from class dataPlotsFX.data.TDDataInfoFX
TDDataInfoFX.DataLoadObserver
-
Field Summary
Fields inherited from class dataPlotsFX.data.TDDataInfoFX
dataPlugIns, scaleInfoIndex
-
Constructor Summary
ConstructorDescriptionScrolling2DPlotInfo
(TDDataProviderFX tdDataProvider, TDGraphFX tdGraph, DataBlock2D pamDataBlock) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Set up binding between display and control panels.boolean
Configure all the parameters for the spectrogramabstract PlotParams2D
Create plot params.abstract TDScaleInfo
createTDScaleInfo
(Scrolling2DPlotInfo scrolingPlotinfo, double minVal, double maxVal) Create a bespoke scale info object reflecting the right type of axis informationvoid
drawData
(int plotNumber, javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector) Paint data into the graphics window.void
final configuration tasks called from Platform->runLater()javafx.scene.paint.Color
getColours
(double dBLevel) Get the colour triplet for a particular db value.double
Convenience function to get at the axis max valuedouble
Convenience function to get at the axis min valueGet the FFT data block for this FFTPlotInfogetDataValue
(PamDataUnit pamDataUnit) Gets a value for a specific data unit which should be in the same units as the scale information.int
Special case here with spectrogram.int
Get the number of panels whihc are active i.e.int
Set display related parameters for the spectrogram.long
getRequiredDataHistory
(PamObservable o, Object arg, long nonminalTime) Get how long data of this type needs to be held in memory during real time operation.getScaleInfo
(boolean autoScale) Get scale information based on the min max values of units in the data block or fixed scale informationGet an object that will be packed up with the serialised settings when information about a plot get's stored.javafx.scene.paint.Color
Get the colour of the wrap line.boolean
Has options that will result in a dialog.makeScrolling2DPlotData
(int iChannel) Put this into a function so that if a display needs to extend the Spectrogram2DPlotdata class in any way, it can easily do so.void
new2DData
(DataUnit2D dataUnit2D) Called when new data arrive.void
reColourPlots
(boolean thread) Re-colour the whole saved spectrogram image.void
Called whenever a data line is removed from a graph, or when a graph is removed from a plot.void
setDisplayedDataRange
(double lowVal, double highVal) Set the y range of the displayed bins.void
setnRebuiltPanels
(int nRebuilt) void
setPlot2DParameters
(SpectrogramParamsFX spectrogramParameters) Get display related parameters for the spectrogram.void
setSampleRate
(float sampleRate, boolean notify) void
setSpectrogramColours
(StandardPlot2DColours spectrogramColours) boolean
setStoredSettings
(Serializable storedSettings) Set settings which have been read back from storage (the psf file).void
timeRangeSpinnerChange
(double oldValue, double newValue) Called when the time range spinner on the main display panel changes.void
timeScrollRangeChanged
(double minimumMillis, double maximumMillis) (non-Javadoc)void
timeScrollValueChanged
(double valueMillis) (non-Javadoc)Methods inherited from class dataPlotsFX.data.TDDataInfoFX
addScaleInfo, clearDraw, drawAllDataUnits, drawDataUnit, drawHighLightData, editOptions, getCurrentScaleInfo, getDataBlock, getDataDimensions, getDataName, getDataObserver, getDataProvider, getDDataProvider, getGraphSettingsPane, getLastDrawPoints, getMasterClockOverride, getMenuNodes, getPreviousDataUnit, getScaleInfoIndex, getScaleInfos, getShortName, getSourceDataBlock, getTDGraph, getToolTipText, hasAxisName, isPaused, isScrollChanging, isShowing, isViewer, lastUnitDrawn, notifyChange, removeScaleInfo, selectScaleInfo, setCurrentAxisName, setNPlotPanes, setShowing, shouldDraw, shouldDraw
-
Constructor Details
-
Scrolling2DPlotInfo
public Scrolling2DPlotInfo(TDDataProviderFX tdDataProvider, TDGraphFX tdGraph, DataBlock2D pamDataBlock)
-
-
Method Details
-
createPlotParams
Create plot params. These will generally be extensions o f PlotParams2D to include additional information required by specific plot types.- Returns:
- params controlling the plot.
-
createTDScaleInfo
public abstract TDScaleInfo createTDScaleInfo(Scrolling2DPlotInfo scrolingPlotinfo, double minVal, double maxVal) Create a bespoke scale info object reflecting the right type of axis information- Parameters:
minVal
-maxVal
-- Returns:
- Scale informatoin.
-
bindPlotParams
public abstract void bindPlotParams()Set up binding between display and control panels. Amplitude params / scales are handled in the base class, but here will need to do the frequency scale for spectrograms and whatever required for other display types. -
removeData
public void removeData()Description copied from class:TDDataInfoFX
Called whenever a data line is removed from a graph, or when a graph is removed from a plot.
Is a good opportunity for the DataInfo to unsubscribe itself from any data blocks it might be observing.- Overrides:
removeData
in classTDDataInfoFX
-
getDataValue
Description copied from class:TDDataInfoFX
Gets a value for a specific data unit which should be in the same units as the scale information. This will then be converted into a plot position by the TDGraph.- Specified by:
getDataValue
in classTDDataInfoFX
- Returns:
- data value or null if this data point should not be plotted.
-
getSymbolChooser
- Specified by:
getSymbolChooser
in classTDDataInfoFX
- Returns:
- a class containing functions to chose a symbol to plot.
-
getScaleInfo
Description copied from class:TDDataInfoFX
Get scale information based on the min max values of units in the data block or fixed scale information- Overrides:
getScaleInfo
in classTDDataInfoFX
- Parameters:
autoScale
- . Create a scale information which is based on min/max value of data units in data block. False to use fixed scale information.- Returns:
- Information about the scales of the data.
-
getScaleInfo
- Overrides:
getScaleInfo
in classTDDataInfoFX
- Returns:
- the fixedScaleInformation
-
hasOptions
public boolean hasOptions()Description copied from class:TDDataInfoFX
Has options that will result in a dialog.- Overrides:
hasOptions
in classTDDataInfoFX
- Returns:
- true if there are options.
-
getStoredSettings
Description copied from class:TDDataInfoFX
Get an object that will be packed up with the serialised settings when information about a plot get's stored.
The Object MUST implement serializable and ideally also cloneable or it will go belly up !
This only gets called when settings are to be saved so there is no need to keep parameters this returns up to date except right at settings save time (when this is called)- Overrides:
getStoredSettings
in classTDDataInfoFX
- Returns:
- serializable object to save.
-
setStoredSettings
Set settings which have been read back from storage (the psf file). Assume these are of the right type and cast into whatever is needed !- Overrides:
setStoredSettings
in classTDDataInfoFX
- Parameters:
storedSettings
-- Returns:
- true if all OK.
-
drawData
public void drawData(int plotNumber, javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector) Description copied from class:TDDataInfoFX
Paint data into the graphics window.- Overrides:
drawData
in classTDDataInfoFX
- Parameters:
plotNumber
- plot numberg
- graphics
-
getnRebuiltPanels
public int getnRebuiltPanels()- Returns:
- the nRebuilt
-
setnRebuiltPanels
public void setnRebuiltPanels(int nRebuilt) - Parameters:
nRebuilt
- the nRebuilt to set
-
reColourPlots
public void reColourPlots(boolean thread) Re-colour the whole saved spectrogram image.- Parameters:
thread
- . True to perform re-colour calculation on different thread.
-
configureDisplay
public boolean configureDisplay()Configure all the parameters for the spectrogram- Returns:
- true if configuration has succeeded.
-
finalConfigurationTasks
public void finalConfigurationTasks()final configuration tasks called from Platform->runLater() -
getColours
public javafx.scene.paint.Color getColours(double dBLevel) Get the colour triplet for a particular db value.- Specified by:
getColours
in interfacePlot2DColours
- Parameters:
dBLevel
-- Returns:
- colour triplet.
-
getPlot2DParameters
Set display related parameters for the spectrogram.- Returns:
- spectrogram parameters (different from FFT parameters).
-
setPlot2DParameters
Get display related parameters for the spectrogram.- Parameters:
spectrogram
- parameters (different from FFT parameters).
-
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) -
setDisplayedDataRange
public void setDisplayedDataRange(double lowVal, double highVal) Set the y range of the displayed bins. Mostly used by the spectrogram to zoom in in frequency- Parameters:
lowVal
- lowest value to displayhighVal
- highest value to display
-
new2DData
Called when new data arrive.- Parameters:
dataUnit2D
-
-
timeScrollValueChanged
public void timeScrollValueChanged(double valueMillis) (non-Javadoc)- Overrides:
timeScrollValueChanged
in classTDDataInfoFX
- Parameters:
valueMillis
- new scroll value in millis- See Also:
-
timeScrollRangeChanged
public void timeScrollRangeChanged(double minimumMillis, double maximumMillis) (non-Javadoc)- Overrides:
timeScrollRangeChanged
in classTDDataInfoFX
- Parameters:
minimumMillis
- new minimum in millismaximumMillis
- new maximum in millis.- See Also:
-
timeRangeSpinnerChange
public void timeRangeSpinnerChange(double oldValue, double newValue) Description copied from class:TDDataInfoFX
Called when the time range spinner on the main display panel changes.- Overrides:
timeRangeSpinnerChange
in classTDDataInfoFX
- Parameters:
oldValue
- old value (seconds)newValue
- new value (seconds)
-
getDataBlock2D
Get the FFT data block for this FFTPlotInfo- Returns:
- an FFT Data Block
-
getDisplayColType
public int getDisplayColType()Special case here with spectrogram. Want light icons for overlaid buttons for most spectrograms.- Overrides:
getDisplayColType
in classTDDataInfoFX
- Returns:
- flag indicating the background colour of the display. Option are LIGHT_TD_DISPLAY or DARK_TD_DISPLAY
-
getNActivePanels
public int getNActivePanels()Get the number of panels whihc are active i.e. are showing data.- Returns:
- the number of active channels
-
makeScrolling2DPlotData
Put this into a function so that if a display needs to extend the Spectrogram2DPlotdata class in any way, it can easily do so.- Parameters:
iChannel
- channel number- Returns:
- plot information.
-
getWrapColor
public javafx.scene.paint.Color getWrapColor()Get the colour of the wrap line. It should contrast with the spectrogram.- Specified by:
getWrapColor
in interfacePlot2DColours
- Returns:
- the colour of the wrap line.
-
getSpectrogramColours
-
setSpectrogramColours
- Parameters:
spectrogramColours
- the spectrogramColours to set
-
getDataAxisMinVal
public double getDataAxisMinVal()Convenience function to get at the axis min value- Returns:
- Data axis minimum value
-
getDataAxisMaxVal
public double getDataAxisMaxVal()Convenience function to get at the axis max value- Returns:
- Data axis maximum value
-
getRequiredDataHistory
Description copied from class:TDDataInfoFX
Get how long data of this type needs to be held in memory during real time operation. the third argument is the standard history length of the display scroller so most often it can simply return this value. Occasionally, such as in the case of spectrogram data which we don't want to save because they go into a separate store as an image, we can return 0.- Overrides:
getRequiredDataHistory
in classTDDataInfoFX
- Parameters:
o
- PamObservable - what's observing the dataarg
- optional argumentnonminalTime
- nominal storage time in milliseconds.- Returns:
- storage time in milliseconds.
-