public class Plot1D extends Plot
Plot.PlotChangedListener, Plot.PlotFlag, Plot.PlotMarker, Plot.PlotMarkerDefault, Plot.PlotStyle
Modifier and Type | Field and Description |
---|---|
de.lme.plotview.Plot.PlotAxis |
xAxis |
Constructor and Description |
---|
Plot1D(java.lang.String plotTitle,
Paint paint,
Plot.PlotStyle style,
int maxCache) |
Plot1D(java.lang.String plotTitle,
Paint paint,
Plot.PlotStyle style,
int maxCache,
boolean maintainMinMax) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(float value,
long x) |
void |
addValue(long value,
long x)
Adds a single new value to this plot using the given x coordinate.
|
void |
addValue(long value,
long x,
Plot.PlotMarker marker)
Adds a single new sample using the timestamp and sets a new PlotMarker to
this entry.
|
void |
addValueFast(float value,
long x) |
void |
addValueFast(long value,
long x)
Fast addValue that skips the lock, marker and plotChange listener.
|
void |
clear() |
static Plot1D |
create(java.lang.String filePath,
char delimiter,
int firstColumn,
int secondColumn,
int numHeaderLines,
PlotView.PlotProgressListener progressListener)
Creates a Plot1D by loading the given text (gzipped) m_file, separating
at delimiter and using the given columns.
|
void |
getViewport(de.lme.plotview.PlotView.PlotSurface surface)
Calculates certain viewport-related values.
|
int |
loadFromFile(Context con,
java.io.InputStream streamIn)
Loads from streamIn.
|
boolean |
saveToFile(Context con,
java.lang.String filePath,
java.lang.String header)
Save to filename as text m_file.
|
void |
setAxis(java.lang.String xTitle,
java.lang.String xUnit,
float xMultiplier,
java.lang.String valueTitle,
java.lang.String valueUnit,
float valueMultiplier) |
drawGlobalMarks, generatePlotPaint, generatePlotPaint, generatePlotPaint, getMarker, getValueHead, setAxis, setFile, setMarker, setMarker, setPaint, setViewport
public Plot1D(java.lang.String plotTitle, Paint paint, Plot.PlotStyle style, int maxCache)
plotTitle
- m_paint
- style
- maxCache
- public Plot1D(java.lang.String plotTitle, Paint paint, Plot.PlotStyle style, int maxCache, boolean maintainMinMax)
public void setAxis(java.lang.String xTitle, java.lang.String xUnit, float xMultiplier, java.lang.String valueTitle, java.lang.String valueUnit, float valueMultiplier)
xTitle
- xUnit
- xMultiplier
- valueTitle
- valueUnit
- valueMultiplier
- public void addValueFast(long value, long x)
value
- x
- public void addValueFast(float value, long x)
public void addValue(long value, long x)
value
- Sample value.x
- X coordinatepublic void addValue(float value, long x)
public void addValue(long value, long x, Plot.PlotMarker marker)
value
- x
- marker
- public void getViewport(de.lme.plotview.PlotView.PlotSurface surface)
Plot
surface
- Structure has to be filled with missing values.public boolean saveToFile(Context con, java.lang.String filePath, java.lang.String header)
saveToFile
in class Plot
con
- filePath
- The absolute path of the m_file.header
- [optional] Header to write at the beginning of the m_file.
(incl. '\n' !)public static Plot1D create(java.lang.String filePath, char delimiter, int firstColumn, int secondColumn, int numHeaderLines, PlotView.PlotProgressListener progressListener)
filePath
- File to load. Must be a textfile but can be gzipped.delimiter
- Character at which to separate the columns.firstColumn
- Index of the first column to use for the x values (starting
from 1)secondColumn
- Index of the second column to use for the Plot values
(starting from 2, must be > firstColumn)numHeaderLines
- Number of header lines to skip.progressListener
- (AsyncTask) object listener the progress is updated topublic int loadFromFile(Context con, java.io.InputStream streamIn)
loadFromFile
in class Plot
con
- streamIn
-