public class NumericMonitorProbe extends NumericDataFunctionProbe
DataFunction to generate the data;
generateData(maspack.matrix.VectorNd, double, double) method;
apply(double) method.
Probe.ExportProps, Probe.ImportExportFileInfoModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
EXPLICIT_TIME, mySmallDisplayuseOldSaveMethod, writeStartStopTimeInSecondsenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesCOPY_REFERENCES, REST_POSITION| Constructor and Description |
|---|
NumericMonitorProbe() |
NumericMonitorProbe(int vsize,
double interval) |
NumericMonitorProbe(int vsize,
java.lang.String fileName,
double startTime,
double stopTime,
double interval) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(double t)
Called at time
t to apply this probe |
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
void |
generateData(VectorNd vec,
double t,
double trel)
Generates data for this probe by evaluating a vectored-valued function of
time and storing the result in
vec. |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
NumericList |
getOutput() |
boolean |
getShowHeader() |
boolean |
getShowTime() |
void |
save()
When called (perhaps by the Artsynth timeline), causes information about
this probe to be written to its attached file.
|
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
boolean |
scanItem(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
void |
setAttachedFileName(java.lang.String fileName,
java.lang.String fmtStr) |
void |
setAttachedFileName(java.lang.String fileName,
java.lang.String fmtStr,
boolean showTime,
boolean showHeader) |
void |
setShowHeader(boolean enable) |
void |
setShowTime(boolean enable) |
void |
setVsize(int vsize) |
void |
setVsize(int vsize,
PlotTraceInfo[] traceInfos) |
void |
write(java.io.PrintWriter pw,
java.lang.String fmtStr,
boolean showTime)
Writes the start and stop times, scale value, and data for this probe to a
PrintWriter, using the format described for
NumericInputProbe.read(File). |
void |
writeData(java.io.PrintWriter pw,
java.lang.String fmtStr,
boolean showTime) |
void |
writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor)
Write probe attributes to a PrintWriter
|
clone, createState, getDataFunction, getInitialState, getState, hasState, isCloneable, isDuplicatable, setDataFunction, setStateaddData, applyDefaultDisplayRanges, clearData, decreaseDisplayRanges, dispose, exportCsvData, exportCsvData, exportData, exportTextData, exportTextData, getAttachedProperties, getData, getData, getDefaultDisplayMax, getDefaultDisplayMin, getDefaultDisplayRange, getDisplay, getDrivers, getExportFileInfo, getExportProps, getFormat, getImportFileInfo, getInterpolation, getInterpolationOrder, getLegend, getMatlabName, getMinMaxValues, getNumericList, getOrderedTraceIndex, getPlotTraceInfo, getRotationRep, getRotationSubvecOffsets, getTraceColor, getTraceLabel, getTraceManager, getValues, getVariables, getVisibleMinMaxValues, getVisibleRange, getVisibleRange, getVsize, importCsvData, importData, importText, importTextData, increaseDisplayRanges, isDisplayable, isEmpty, isPrintable, isSmallDisplayVisible, isTraceVisible, isValidVariableName, isWritable, loadFromMatlab, print, read, removeDisplay, removeLegend, resetTraceColors, resetTraceOrder, saveToMatlab, scaleNumericList, setData, setData, setDefaultDisplayRange, setDefaultDisplayRange, setFormat, setInterpolation, setInterpolationOrder, setLegend, setLegendLabels, setScale, setSmallDisplayVisible, setTraceColor, setTraceLabel, setTraceOrder, setTraceVisible, setValues, setValues, smoothWithMovingAverage, smoothWithSavitzkyGolay, swapPlotTraceOrder, updateDisplays, updateDisplays, updateDisplaysForPropertyChanges, updateDisplaysWithoutAutoRanging, writeTextgetAttachedFile, getAttachedFileName, getChildren, getClippedVirtualTime, getDefaultScale, getDefaultStartTime, getDefaultStopTime, getDefaultUpdateInterval, getDuration, getExportFile, getExportFileName, getFileFromPath, getImportFile, getImportFileName, getPathFromFile, getProperty, getScale, getStartTime, getStopTime, getTimelineTime, getTrack, getUpdateInterval, getVirtualTime, hasAttachedFile, hasChildren, isAttachedFileRelative, isEditable, isEventTime, isInput, isScalable, isSettable, load, nextEventTime, setAttachedFileName, setData, setExportFileName, setImportFileName, setInterval, setName, setScalable, setStartStopTimes, setStartTime, setStopTime, setTrack, setUpdateIntervalfinalize, getModel, initialize, isActive, setActive, setModel, setModelFromComponent, writecheckFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, 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, updateReferencesequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writepublic static PropertyList myProps
public NumericMonitorProbe()
public NumericMonitorProbe(int vsize,
double interval)
public NumericMonitorProbe(int vsize,
java.lang.String fileName,
double startTime,
double stopTime,
double interval)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class NumericProbeBasepublic boolean getShowTime()
public void setShowTime(boolean enable)
public boolean getShowHeader()
public void setShowHeader(boolean enable)
public void write(java.io.PrintWriter pw,
java.lang.String fmtStr,
boolean showTime)
throws java.io.IOException
NumericInputProbe.read(File). The format used for producing floating
point numbers can be controlled using a printf-style format string,
details of which are described in NumberFormat.pw - writer which accepts the outputfmtStr - printf-style format string (if set to null then "%g" will be assumed,
which will produce full precision output).showTime - if true, then time values are written explicitly. Otherwise, an implicit
step size corresponding to the value returned by getUpdateInterval will be specified.java.io.IOException - if an I/O error occurs.public void setAttachedFileName(java.lang.String fileName,
java.lang.String fmtStr)
public void setAttachedFileName(java.lang.String fileName,
java.lang.String fmtStr,
boolean showTime,
boolean showHeader)
public void save()
throws java.io.IOException
save in class Probejava.io.IOExceptionwrite(java.io.PrintWriter, java.lang.String, boolean)public void writeData(java.io.PrintWriter pw,
java.lang.String fmtStr,
boolean showTime)
public void generateData(VectorNd vec, double t, double trel)
vec. The size of
vec will equal the vector size of the probe (as returned by
NumericProbeBase.getVsize(). The function may generate the data using either
absolute time t or relative time trel, where
relative time is determined from the probe's start time and scale factor
using trel = (t - startTime)/scale
vec - returns the generated data.t - absolute time (seconds)trel - probe relative timepublic void apply(double t)
Probet to apply this probeapply in class NumericProbeBaset - time at which probe is being appliedpublic NumericList getOutput()
public boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
java.io.IOExceptionpublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBasewrite.scan in interface ModelComponentscan in interface Scannablescan in class Probertok - Tokenizer from which to scan the elementref - optional reference object which can be used for resolving references to
other objectsjava.io.IOException - if an I/O or formatting error occuredpublic void writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor)
throws java.io.IOException
Probepw - writer to which components are writtenfmt - format for floating point numbersancestor - ancestor component which respect to which references are
expressedjava.io.IOException - if an I/O error occurredpublic void setVsize(int vsize)
public void setVsize(int vsize,
PlotTraceInfo[] traceInfos)
public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true if and only if CopyableComponent.isDuplicatable() returns
true.refs - list to which references are appendedancestor - root node of the hierarchy from which references are to be excludedpublic ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponentCOPY_REFERENCES
is set in flags, then any component referenced
by this component should itself be set to a copy. This
should be done first checking copyMap for an
existing copy of the referenced component. If there is no existing
copy, then a copy should be created by calling copy
recursively and adding the new copy to copyMap.copy in interface CopyableComponentcopy in class ModelComponentBaseflags - flags to control the copyingcopyMap - map to possible existing instances of referenced
components