Class Scrolling2DPlotInfo

java.lang.Object
dataPlotsFX.data.TDDataInfoFX
dataPlotsFX.scrollingPlot2D.Scrolling2DPlotInfo
All Implemented Interfaces:
Plot2DColours
Direct Known Subclasses:
BeamOGramPlotInfo, FFTPlotInfo

public abstract class Scrolling2DPlotInfo extends TDDataInfoFX implements Plot2DColours
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
  • Constructor Details

  • Method Details

    • createPlotParams

      public abstract PlotParams2D 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 class TDDataInfoFX
    • getDataValue

      public Double getDataValue(PamDataUnit pamDataUnit)
      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 class TDDataInfoFX
      Returns:
      data value or null if this data point should not be plotted.
    • getSymbolChooser

      public TDSymbolChooserFX getSymbolChooser()
      Specified by:
      getSymbolChooser in class TDDataInfoFX
      Returns:
      a class containing functions to chose a symbol to plot.
    • getScaleInfo

      public TDScaleInfo getScaleInfo(boolean autoScale)
      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 class TDDataInfoFX
      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

      public TDScaleInfo getScaleInfo()
      Overrides:
      getScaleInfo in class TDDataInfoFX
      Returns:
      the fixedScaleInformation
    • hasOptions

      public boolean hasOptions()
      Description copied from class: TDDataInfoFX
      Has options that will result in a dialog.
      Overrides:
      hasOptions in class TDDataInfoFX
      Returns:
      true if there are options.
    • getStoredSettings

      public Serializable 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 class TDDataInfoFX
      Returns:
      serializable object to save.
    • setStoredSettings

      public boolean setStoredSettings(Serializable storedSettings)
      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 class TDDataInfoFX
      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 class TDDataInfoFX
      Parameters:
      plotNumber - plot number
      g - 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 interface Plot2DColours
      Parameters:
      dBLevel -
      Returns:
      colour triplet.
    • getPlot2DParameters

      public PlotParams2D getPlot2DParameters()
      Set display related parameters for the spectrogram.
      Returns:
      spectrogram parameters (different from FFT parameters).
    • setPlot2DParameters

      public void setPlot2DParameters(SpectrogramParamsFX spectrogramParameters)
      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 display
      highVal - highest value to display
    • new2DData

      public void new2DData(DataUnit2D dataUnit2D)
      Called when new data arrive.
      Parameters:
      dataUnit2D -
    • timeScrollValueChanged

      public void timeScrollValueChanged(double valueMillis)
      (non-Javadoc)
      Overrides:
      timeScrollValueChanged in class TDDataInfoFX
      Parameters:
      valueMillis - new scroll value in millis
      See Also:
    • timeScrollRangeChanged

      public void timeScrollRangeChanged(double minimumMillis, double maximumMillis)
      (non-Javadoc)
      Overrides:
      timeScrollRangeChanged in class TDDataInfoFX
      Parameters:
      minimumMillis - new minimum in millis
      maximumMillis - 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 class TDDataInfoFX
      Parameters:
      oldValue - old value (seconds)
      newValue - new value (seconds)
    • getDataBlock2D

      public DataBlock2D 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 class TDDataInfoFX
      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

      public Scrolling2DPlotDataFX 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.
      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 interface Plot2DColours
      Returns:
      the colour of the wrap line.
    • getSpectrogramColours

      public StandardPlot2DColours getSpectrogramColours()
    • setSpectrogramColours

      public void setSpectrogramColours(StandardPlot2DColours spectrogramColours)
      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

      public long getRequiredDataHistory(PamObservable o, Object arg, long nonminalTime)
      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 class TDDataInfoFX
      Parameters:
      o - PamObservable - what's observing the data
      arg - optional argument
      nonminalTime - nominal storage time in milliseconds.
      Returns:
      storage time in milliseconds.