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, isViewer, scaleInfoIndex -
Constructor Summary
ConstructorsConstructorDescriptionScrolling2DPlotInfo(TDDataProviderFX tdDataProvider, TDGraphFX tdGraph, DataBlock2D pamDataBlock) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidSet up binding between display and control panels.booleanConfigure all the parameters for the spectrogramprotected voidCreate the colour arrays to use in the plots.abstract PlotParams2DCreate plot params.abstract TDScaleInfocreateTDScaleInfo(Scrolling2DPlotInfo scrolingPlotinfo, double minVal, double maxVal) Create a bespoke scale info object reflecting the right type of axis informationvoiddrawData(int plotNumber, javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector) Paint data into the graphics window.voidfinal configuration tasks called from Platform->runLater()javafx.scene.paint.ColorgetColours(double dBLevel) Get the colour triplet for a particular db value.doubleConvenience function to get at the axis max valuedoubleConvenience 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.intSpecial case here with spectrogram.intGet the number of panels whihc are active i.e.intSet display related parameters for the spectrogram.longgetRequiredDataHistory(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 informationprotected longGet the extra millis for loading data.Get an object that will be packed up with the serialised settings when information about a plot get's stored.protected longGet the end time of the visible portion of the display.protected longGet the start time of the visible portion of the display.javafx.scene.paint.ColorGet the colour of the wrap line.booleanHas 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.voidnew2DData(DataUnit2D dataUnit2D) Called when new data arrive.voidnotifyChange(int changeType) Notify of changes from PamController.voidreColourPlots(boolean thread) Re-colour the whole saved spectrogram image.voidCalled whenever a data line is removed from a graph, or when a graph is removed from a plot.voidsetDisplayedDataRange(double lowVal, double highVal) Set the y range of the displayed bins.voidsetnRebuiltPanels(int nRebuilt) voidsetPlot2DParameters(SpectrogramParamsFX spectrogramParameters) Get display related parameters for the spectrogram.voidsetSampleRate(float sampleRate, boolean notify) voidsetSpectrogramColours(StandardPlot2DColours spectrogramColours) booleansetStoredSettings(Serializable storedSettings) Set settings which have been read back from storage (the psf file).voidtimeRangeSpinnerChange(double oldValue, double newValue) Called when the time range spinner on the main display panel changes.voidtimeScrollRangeChanged(double minimumMillis, double maximumMillis) (non-Javadoc)voidtimeScrollValueChanged(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, getTdDataProvider, getTDGraph, getToolTipText, hasAxisName, isPaused, isScrollChanging, isShowing, isViewer, lastUnitDrawn, 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:TDDataInfoFXCalled 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:
removeDatain classTDDataInfoFX
-
getDataValue
Description copied from class:TDDataInfoFXGets 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:
getDataValuein classTDDataInfoFX- Parameters:
pamDataUnit-- Returns:
- data value or null if this data point should not be plotted.
-
getSymbolChooser
- Specified by:
getSymbolChooserin classTDDataInfoFX- Returns:
- a class containing functions to chose a symbol to plot.
-
getScaleInfo
Description copied from class:TDDataInfoFXGet scale information based on the min max values of units in the data block or fixed scale information- Overrides:
getScaleInfoin 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:
getScaleInfoin classTDDataInfoFX- Returns:
- the fixedScaleInformation
-
hasOptions
public boolean hasOptions()Description copied from class:TDDataInfoFXHas options that will result in a dialog.- Overrides:
hasOptionsin classTDDataInfoFX- Returns:
- true if there are options.
-
getStoredSettings
Description copied from class:TDDataInfoFXGet 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:
getStoredSettingsin 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:
setStoredSettingsin 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:TDDataInfoFXPaint data into the graphics window.- Overrides:
drawDatain 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() -
createColours
protected void createColours()Create the colour arrays to use in the plots. -
getColours
public javafx.scene.paint.Color getColours(double dBLevel) Get the colour triplet for a particular db value.- Specified by:
getColoursin 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-
-
getVisibleStart
protected long getVisibleStart()Get the start time of the visible portion of the display.- Returns:
- the start time of the display in millis.
-
getVisibleEnd
protected long getVisibleEnd()Get the end time of the visible portion of the display.- Returns:
- the end time of the display in millis.
-
getSmooshMillis
protected long getSmooshMillis()Get the extra millis for loading data.- Returns:
- the end time of the display in millis.
-
timeScrollValueChanged
public void timeScrollValueChanged(double valueMillis) (non-Javadoc)- Overrides:
timeScrollValueChangedin classTDDataInfoFX- Parameters:
valueMillis- new scroll value in millis- See Also:
-
timeScrollRangeChanged
public void timeScrollRangeChanged(double minimumMillis, double maximumMillis) (non-Javadoc)- Overrides:
timeScrollRangeChangedin 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:TDDataInfoFXCalled when the time range spinner on the main display panel changes.- Overrides:
timeRangeSpinnerChangein 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:
getDisplayColTypein 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:
getWrapColorin 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:TDDataInfoFXGet 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:
getRequiredDataHistoryin classTDDataInfoFX- Parameters:
o- PamObservable - what's observing the dataarg- optional argumentnonminalTime- nominal storage time in milliseconds.- Returns:
- storage time in milliseconds.
-
notifyChange
public void notifyChange(int changeType) Notify of changes from PamController.- Overrides:
notifyChangein classTDDataInfoFX- Parameters:
changeType- - the chnage type.
-