public abstract class NumericProbeBase extends Probe implements Displayable
Probe.ExportProps, Probe.ImportExportFileInfo
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static double |
EXPLICIT_TIME |
static PropertyList |
myProps |
NumericProbePanel |
mySmallDisplay |
useOldSaveMethod, writeStartStopTimeInSeconds
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
NumericProbeBase() |
Modifier and Type | Method and Description |
---|---|
void |
addData(ReaderTokenizer rtok,
double timeStep) |
abstract void |
apply(double t)
Called at time
t to apply this probe |
void |
applyDefaultDisplayRanges() |
void |
clearData() |
java.lang.Object |
clone() |
void |
createNumericList(int vsize) |
void |
decreaseDisplayRanges()
Decrease the display range of each numeric probe panel.
|
void |
dispose()
Remove resources used by this agent.
|
void |
export(java.io.File file,
Probe.ExportProps props) |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
Property[] |
getAttachedProperties() |
VectorNd |
getData(double sec) |
double |
getDefaultDisplayMax() |
double |
getDefaultDisplayMin() |
double[] |
getDefaultDisplayRange() |
javax.swing.JPanel |
getDisplay(int w,
int h,
boolean isLargeDisplay) |
NumericProbeDriver[] |
getDrivers() |
Probe.ImportExportFileInfo[] |
getExportFileInfo() |
Probe.ExportProps |
getExportProps(java.lang.String ext) |
java.lang.String |
getFormat() |
Interpolation |
getInterpolation()
Returns the interpolation method for this numeric input probe.
|
Interpolation.Order |
getInterpolationOrder()
Returns the interpolation order for this numeric probe.
|
LegendDisplay |
getLegend() |
java.lang.String |
getMatlabName() |
double[] |
getMinMaxValues() |
NumericList |
getNumericList() |
int |
getOrderedTraceIndex(int order) |
PlotTraceInfo |
getPlotTraceInfo(int idx) |
double[] |
getRange() |
static double[] |
getRange(NumericList list) |
java.awt.Color |
getTraceColor(int idx) |
java.lang.String |
getTraceLabel(int idx) |
PlotTraceManager |
getTraceManager() |
double[][] |
getValues()
Returns the values of this probe as a two dimensional array of
doubles.
|
java.util.LinkedHashMap<java.lang.String,NumericProbeVariable> |
getVariables() |
int |
getVsize() |
void |
importData(java.io.File file,
boolean explicitTime,
boolean overlay)
Still being implemented
|
void |
importText(java.io.File file,
boolean explicitTime,
boolean overlay,
char separator)
Still being implemented
|
void |
increaseDisplayRanges()
Increase the display range of each numeric probe panel.
|
boolean |
isCloneable() |
boolean |
isDisplayable()
Queries whether this component is currently displayable.
|
boolean |
isEmpty() |
boolean |
isPrintable() |
boolean |
isSmallDisplayVisible() |
boolean |
isTraceVisible(int idx) |
static boolean |
isValidVariableName(java.lang.String name) |
boolean |
isWritable()
Returns
true if this component should in fact be written to
secondary storage. |
boolean |
loadFromMatlab(MatlabInterface mi,
java.lang.String matlabName) |
void |
print(double sec) |
void |
read(java.io.File file,
boolean setTimes)
Reads the start and stop times, scale value, and data for this probe from
an ascii file.
|
boolean |
removeDisplay(javax.swing.JPanel display) |
void |
removeLegend() |
void |
resetTraceColors() |
void |
resetTraceOrder() |
void |
saveToMatlab(MatlabInterface mi,
java.lang.String matlabName) |
void |
scaleNumericList(double s)
Scales the values of a numberic probe.
|
void |
setDefaultDisplayRange(double[] minmax) |
void |
setDefaultDisplayRange(double min,
double max) |
void |
setFormat(java.lang.String fmtStr) |
void |
setInterpolation(Interpolation method)
Sets the interpolation method for this numeric input probe.
|
void |
setInterpolationOrder(Interpolation.Order order)
Sets the interpolation order for this numeric probe.
|
void |
setLegend(LegendDisplay legend) |
void |
setLegendLabels(java.util.List<java.lang.String> labels) |
void |
setScale(double s) |
void |
setSmallDisplayVisible(boolean visible) |
void |
setTraceColor(int idx,
java.awt.Color color) |
void |
setTraceLabel(int idx,
java.lang.String label) |
void |
setTraceOrder(int[] indices)
Sets a new ordering for the plot traces.
|
void |
setTraceVisible(int idx,
boolean visible) |
void |
setValues(double[][] vals)
Sets the values of this numeric probe from a two dimensional array of
doubles.
|
void |
smoothWithMovingAverage(int winSize)
Smooths the values in this probe by applying a mean average filter over a
moving window of specified size.
|
void |
smoothWithSavitzkyGolay(int winSize,
int deg)
Smooths the values in this probe by applying Savitzky-Golay smoothing
over a moving window of specified size.
|
void |
swapPlotTraceOrder(PlotTraceInfo pti0,
PlotTraceInfo pti1) |
void |
updateDisplays() |
void |
updateDisplays(NumericProbePanel notToUpdate) |
void |
updateDisplaysForPropertyChanges()
Update displays if associated properties (like interpolation) have
changed.
|
void |
updateDisplaysWithoutAutoRanging()
Update displays with auto-ranging suppressed.
|
void |
writeText(java.io.File file,
java.lang.String fmtStr,
java.lang.String separator,
boolean includeTime) |
createState, getAttachedFile, getAttachedFileName, getChildren, getClippedVirtualTime, getDefaultScale, getDefaultStartTime, getDefaultStopTime, getDefaultUpdateInterval, getDuration, getExportFile, getExportFileName, getFileFromPath, getImportFile, getImportFileInfo, getImportFileName, getInitialState, getPathFromFile, getProperty, getScale, getStartTime, getState, getStopTime, getTimelineTime, getTrack, getUpdateInterval, getVirtualTime, hasAttachedFile, hasChildren, hasState, isAttachedFileRelative, isEventTime, isInput, isScalable, isSettable, load, nextEventTime, save, scan, setAttachedFileName, setData, setExportFileName, setImportFileName, setInterval, setName, setScalable, setStartStopTimes, setStartTime, setState, setStopTime, setTrack, setUpdateInterval
finalize, getModel, initialize, isActive, setActive, setModel, setModelFromComponent, write
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isScanning, isSelected, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setNumber, setParent, setSelected, setWritable, updateReferences
postscan
public static final double EXPLICIT_TIME
public NumericProbePanel mySmallDisplay
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class Probe
public double[][] getValues()
public void setValues(double[][] vals)
getValues()
.vals
- Values used to set this numeric probepublic abstract void apply(double t)
Probe
t
to apply this probepublic boolean isDisplayable()
Displayable
isDisplayable
in interface Displayable
public javax.swing.JPanel getDisplay(int w, int h, boolean isLargeDisplay)
getDisplay
in interface Displayable
public boolean removeDisplay(javax.swing.JPanel display)
removeDisplay
in interface Displayable
public int getVsize()
public void createNumericList(int vsize)
public void clearData()
public void updateDisplays()
updateDisplays
in interface Displayable
public void setSmallDisplayVisible(boolean visible)
public boolean isSmallDisplayVisible()
public void updateDisplays(NumericProbePanel notToUpdate)
public void updateDisplaysForPropertyChanges()
public void updateDisplaysWithoutAutoRanging()
public void setInterpolation(Interpolation method)
method
- interpolation method.public Interpolation getInterpolation()
setInterpolation(maspack.interpolation.Interpolation)
public void setInterpolationOrder(Interpolation.Order order)
order
- new interpolation orderpublic Interpolation.Order getInterpolationOrder()
public void setFormat(java.lang.String fmtStr)
public java.lang.String getFormat()
public boolean isCloneable()
isCloneable
in class Probe
public double getDefaultDisplayMax()
public double getDefaultDisplayMin()
public void setDefaultDisplayRange(double min, double max)
public void setDefaultDisplayRange(double[] minmax)
public void increaseDisplayRanges()
public void decreaseDisplayRanges()
public void applyDefaultDisplayRanges()
public double[] getDefaultDisplayRange()
public double[] getMinMaxValues()
public boolean isEmpty()
public static double[] getRange(NumericList list)
public double[] getRange()
public void scaleNumericList(double s)
s
- scale factor
the parameter by which to scale the values.public NumericList getNumericList()
public java.util.LinkedHashMap<java.lang.String,NumericProbeVariable> getVariables()
public NumericProbeDriver[] getDrivers()
public Property[] getAttachedProperties()
public void smoothWithMovingAverage(int winSize)
winSize
- size of the averaging window. The value should be odd; if
it is even, it will be incremented internally to be odd. The method does
nothing if the value is is less than 1. Finally, winSize
will be
reduced if necessary to fit the number of data points.public void smoothWithSavitzkyGolay(int winSize, int deg)
deg
, and then using this to recompute the value in the middle of the
window. The polynomial is also used to interpolate the first and last
winSize/2
values, since it is not possible to center the window
on these.deg
- degree of the smoothing polynomial. Must be at least 1.winSize
- size of the averaging window. The value must be >=
deg+1
and should also be odd; if it is even, it will be incremented
internally to be odd. Finally, winSize
will be reduced if
necessary to fit the number of data points.public static boolean isValidVariableName(java.lang.String name)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class ModelComponentBase
java.lang.CloneNotSupportedException
public boolean isPrintable()
isPrintable
in class Probe
public VectorNd getData(double sec)
public void setLegendLabels(java.util.List<java.lang.String> labels)
public PlotTraceInfo getPlotTraceInfo(int idx)
public int getOrderedTraceIndex(int order)
public void setTraceOrder(int[] indices)
public void swapPlotTraceOrder(PlotTraceInfo pti0, PlotTraceInfo pti1)
public void resetTraceOrder()
public void setTraceVisible(int idx, boolean visible)
public boolean isTraceVisible(int idx)
public void setTraceColor(int idx, java.awt.Color color)
public java.awt.Color getTraceColor(int idx)
public void resetTraceColors()
public PlotTraceManager getTraceManager()
public void setTraceLabel(int idx, java.lang.String label)
public java.lang.String getTraceLabel(int idx)
public LegendDisplay getLegend()
public void setLegend(LegendDisplay legend)
public void removeLegend()
public void dispose()
dispose
in interface ModelAgent
dispose
in class ModelAgentBase
public java.lang.String getMatlabName()
public void saveToMatlab(MatlabInterface mi, java.lang.String matlabName) throws MatlabInterfaceException
MatlabInterfaceException
public boolean loadFromMatlab(MatlabInterface mi, java.lang.String matlabName) throws MatlabInterfaceException
MatlabInterfaceException
public boolean isWritable()
ModelComponentBase
true
if this component should in fact be written to
secondary storage. This gives subclasses control over whether or
not they are actually written out.isWritable
in interface Scannable
isWritable
in class ModelComponentBase
true
if this component should be written to
secondary storage.public void addData(ReaderTokenizer rtok, double timeStep) throws java.io.IOException
java.io.IOException
public void read(java.io.File file, boolean setTimes) throws java.io.IOException
setTimes
is false.
setTimes
is false.
setTimes
is false.
2.0 10.0 1.2 linear 2 explicit 0.0 2.0 2.0 1.1 4.0 3.0 3.0 0.0 1.0specifies a probe with a start and stop time of 2 and 10 seconds, respectively, a scale value of 1.2, linear interpolation, 2 values at each knot point, and three knot points at times 0.0, 1.1, and 3.0. If knot time is given implicitly by a time setp, then time is assumed to start at 0. The following input
2000000000 3000000000 2.5 step 2 2.0 2.0 2.0 4.0 3.0 0.0 1.0specifies a probe with a start and stop time of 2 and 3 seconds, respectively, a scale value of 2.5, step interpolation, 2 values at each knot point, and three knot points with times of 0, 2.0, and 4.0 (given implicity by a step size of 2.0).
The character '#' is a comment character, causing all subsequent input up to the next new line to be ignored.
file
- File from which to read the probe informationsetTimes
- if true
, sets the start time, stop time,
and scale values to those indicated at the head of the file. If
false
, these values are ignored.java.io.IOException
- if an I/O or format error occurred.public void writeText(java.io.File file, java.lang.String fmtStr, java.lang.String separator, boolean includeTime) throws java.io.IOException
java.io.IOException
public void importText(java.io.File file, boolean explicitTime, boolean overlay, char separator) throws java.io.IOException
java.io.IOException
public Probe.ImportExportFileInfo[] getExportFileInfo()
getExportFileInfo
in class Probe
public Probe.ExportProps getExportProps(java.lang.String ext)
getExportProps
in class Probe
public void export(java.io.File file, Probe.ExportProps props) throws java.io.IOException
public void importData(java.io.File file, boolean explicitTime, boolean overlay) throws java.io.IOException
importData
in class Probe
java.io.IOException