Class RawWavePlotManager
- Direct Known Subclasses:
ClickRawPlotManager
,RawClipWavePlotManager
The raw segmenter holds a 2D array of data for a segment of a plot for each channel. Each plot segment keeps a record of which data units have been added. This allows the segments to be reused for plotting without having to iterate through data units again.
An example use case is plotting raw waveform data. At high sample rates, each raw bin can only be plotted as the minimum and maximum bin withing a time segment representing a single pixel. iterating through all raw data bins and calculating this each time a plot needs repainting is processor intensive. So the bin data can be processed and added to PlotSegments, then the PlotSegments can be reused until either the plot scale time scale changes sufficiently that new segments are required (e.g. zooming in) or the plot moves to a completely new time section of data.
- Author:
- Jamie Macaulay
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRawData
(PamDataUnit pamDataUnit, ScrollingPlotSegmenter.PlotSegment plotSegment, TDProjectorFX tdProjector, double scrollStart, int chanClick, javafx.scene.paint.Color color) Draw the data unit.static javafx.scene.paint.Color
blend
(javafx.scene.paint.Color c0, javafx.scene.paint.Color c1) void
clear()
Reset the image buffer.drawRawData
(int plotNumber, PamDataUnit pamDataUnit, javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int type) Draw the raw data.abstract javafx.scene.paint.Color
getColor
(PamDataUnit pamDataUnit, int type) Get the colorabstract TDScaleInfo
Get the wave scale info.void
lastUnitDrawn
(javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int plotnumber)
-
Constructor Details
-
RawWavePlotManager
Raw wave plot manager.- Parameters:
rawClipInfo
- -0 the raw clip.
-
-
Method Details
-
lastUnitDrawn
public void lastUnitDrawn(javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int plotnumber) -
clear
public void clear()Reset the image buffer. -
getWaveScaleInfo
Get the wave scale info.- Returns:
- the wave scale info.
-
getColor
Get the color- Parameters:
pamDataUnit
-- Returns:
-
drawRawData
public Path2D drawRawData(int plotNumber, PamDataUnit pamDataUnit, javafx.scene.canvas.GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int type) Draw the raw data. If type == TDSymbolChooserFX.HIGHLIGHT_SYMBOL_MARKED then the highlighted symbol is drawn using the fgraphics context. If a normal draw then the raw data is simply passed to the plot segmenter which handles drawing later during a paintPlotData call.- Parameters:
plotNumber
- - the plot number i..e the plot on the TDGraphFX.pamDataUnit
- - the PAM data unit.g
- - the graphics context.scrollStart
- - the scroll start.tdProjector
- - the tdProjector for converting data values to pixel positions.type
- - the type of drawing. E.g. HIGHLIGHT- Returns:
- the Path2D which describes the data unit.
-
addRawData
public void addRawData(PamDataUnit pamDataUnit, ScrollingPlotSegmenter.PlotSegment plotSegment, TDProjectorFX tdProjector, double scrollStart, int chanClick, javafx.scene.paint.Color color) Draw the data unit.- Parameters:
pamDataUnit
- - the raw data unitplotSegment
- - the plot segment containing data to plot.tdProjector
- - the td projector.chanClick
- - the channle clicks.g
- = the graphics context.scrolLStart
- - the scroll data.
-
blend
public static javafx.scene.paint.Color blend(javafx.scene.paint.Color c0, javafx.scene.paint.Color c1)
-