public class TRCWriter
extends java.lang.Object
At present, the source data for writing the file must be a numeric probe that contains position data for a set of points.
Constructor and Description |
---|
TRCWriter(java.io.File file)
Creates a TRCWriter for the indicated file.
|
TRCWriter(java.lang.String filePath)
Creates a TRCWriter for the indicated file path.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNumberFormat()
Queries the explict format for floating point data written by this
writer.
|
java.lang.String |
getUnitsString()
Queries the string representing units in this writer.
|
void |
setNumberFormat(java.lang.String str)
Sets an explicit format for floating point data written by this writer.
|
void |
setUnitsString(java.lang.String str)
Sets the string representing units in this writer.
|
static void |
write(java.io.File file,
NumericProbeBase probe,
java.util.List<java.lang.String> labels)
Writes a TRC file based on the contents of a given numeric probe, which
is assumed to contain point position data.
|
static void |
write(java.lang.String filepath,
NumericProbeBase probe,
java.util.List<java.lang.String> labels)
Writes a TRC file based on the contents of a given numeric probe, which
is assumed to contain point position data.
|
void |
writeData(NumericProbeBase probe,
java.util.List<java.lang.String> labels)
Writes the file based on the contents of a position input probe.
|
public TRCWriter(java.io.File file)
file
- TRC file to be writtenpublic TRCWriter(java.lang.String filePath)
filePath
- path name of the TRC file to be writtenpublic java.lang.String getUnitsString()
public void setUnitsString(java.lang.String str)
"mm"
.str
- string representing unitspublic java.lang.String getNumberFormat()
setNumberFormat(java.lang.String)
)
null
is returned.public void setNumberFormat(java.lang.String str)
str
should be a number string used for specifying NumberFormat
. If str
is null
, the explicit format is
removed and the format is inferred from the data.str
- string describing the number formatpublic void writeData(NumericProbeBase probe, java.util.List<java.lang.String> labels) throws java.io.IOException
"position"
or "targetPosition"
.
Also, each point may be associated with only one such property.
The marker count and data rate is inferred from the probe. If labels
is non-null
, it provides labels for the marker data
within the file and should have a length equal to the number of
points. Otherwise, if labels
is null
, labels are
determined from the names of the points, or when these are null
,
by appending "mkr"
to $k+1$, where $k$ is the zero-based index of
the marker.
probe
- probe containing the marker datalabels
- if non-null
, provides labels for the TRC
markersjava.io.IOException
public static void write(java.io.File file, NumericProbeBase probe, java.util.List<java.lang.String> labels) throws java.io.IOException
labels
argument, as
described for writeData(artisynth.core.probes.NumericProbeBase, java.util.List<java.lang.String>)
.file
- TRC file to be createdprobe
- numeric probe containing the datalabels
- if non-null
, provides labels for the TRC
markersjava.io.IOException
public static void write(java.lang.String filepath, NumericProbeBase probe, java.util.List<java.lang.String> labels) throws java.io.IOException
labels
argument, as
described for writeData(artisynth.core.probes.NumericProbeBase, java.util.List<java.lang.String>)
.filepath
- path name of the TRC file to be createdprobe
- numeric probe containing the datalabels
- if non-null
, provides labels for the TRC
markersjava.io.IOException