public class PredictionPlotData extends Object implements data.DiscretePlotData, data.MutablePlotData
Each data point has four dimensions: time, acceleration, velocity and position. The times are relative to the start of motion.
This class isn't thread safe and methods should be called only from the event dispatch
thread, for example via invokeLater.
PlotDataListener| Modifier and Type | Field and Description |
|---|---|
static int |
ACCELERATION |
static int |
POSITION |
static int |
TIME |
static int |
VELOCITY |
| Constructor and Description |
|---|
PredictionPlotData() |
| Modifier and Type | Method and Description |
|---|---|
void |
addData(List<PredictedPosition> pos,
org.lsst.ccs.utilities.taitime.CCSTimeStamp t0)
Adds new data and causes the plot pane to be repainted.
|
void |
addPlotDataListener(data.PlotDataListener listener) |
data.MetaData |
getMetaData()
Gets the metadata for this plot data object.
|
int |
getNDimensions()
Gets the number of dimensions, that is, the number of values per data point.
|
int |
getNPoints()
Gets the count of data points currently stored.
|
data.SuggestedRange |
getSuggestedRange() |
String |
getTitle() |
void |
getValue(org.freehep.util.Value value,
int dim,
int index)
Gets the value of a given data point at a given dimension.
|
Object |
lock()
Locking isn't implemented.
|
String |
names(int index)
Gets the name of one of the dimensions of a data point.
|
void |
removePlotDataListener(data.PlotDataListener listener) |
void |
reset()
Clears away any old data and cause the plot pane to be repainted.
|
Class |
types(int index)
Returns the data type (class object) for the values of a given dimension.
|
public static final int TIME
public static final int ACCELERATION
public static final int VELOCITY
public static final int POSITION
public void reset()
public void addData(List<PredictedPosition> pos, org.lsst.ccs.utilities.taitime.CCSTimeStamp t0)
Acceleration values will be scaled by dividing by the max absolute value. Likewise for the velocity values. Position values are assumed to be already scaled so that a full stroke has size 1.0.
pos - a stream of PredictedPosition from simulated motionpublic int getNPoints()
getNPoints in interface data.DiscretePlotDatapublic int getNDimensions()
getNDimensions in interface data.DiscretePlotDatagetNDimensions in interface data.PlotDatapublic String names(int index)
names in interface data.DiscretePlotDataindex - The dimension index d, where 0 <= d < getNDimensions().IndexOutOfBoundsException - if index is out of bounds.public Class types(int index)
types in interface data.DiscretePlotDataindex - The dimension index, ignored by this method.Double.TYPE, always.public void getValue(org.freehep.util.Value value,
int dim,
int index)
getValue in interface data.DiscretePlotDatavalue - A generic container for values of primitive type. In this case
it will always be given a double value, so use value.getDouble().dim - The dimension index d, where 0 <= d < getNDimensions().index - The data point index i, where 0 <= i < getNPoints(.IndexOutOfBoundsException - if either dim or index
is out of bounds.public data.MetaData getMetaData()
getMetaData in interface data.PlotDatapublic String getTitle()
getTitle in interface data.PlotDatapublic data.SuggestedRange getSuggestedRange()
getSuggestedRange in interface data.PlotDatapublic void addPlotDataListener(data.PlotDataListener listener)
addPlotDataListener in interface data.MutablePlotDatapublic void removePlotDataListener(data.PlotDataListener listener)
removePlotDataListener in interface data.MutablePlotDatapublic Object lock()
lock in interface data.MutablePlotDataUnsupportedOperationExceptionCopyright © 2021 LSST. All rights reserved.