Package jmri.jmrix.rps
Class Measurement
- java.lang.Object
-
- jmri.jmrix.rps.Measurement
-
public class Measurement extends java.lang.Object
Encodes a single measurement point for RPS.Immutable
-
-
Constructor Summary
Constructors Constructor Description Measurement(Reading r)Measurement(Reading r, double x, double y, double z, double vsound, int code, java.lang.String source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCode()Error code, defined specifically by generator.java.lang.StringgetId()Return the ID int of the transmitter this measurement describes.javax.vecmath.Point3dgetPoint()ReadinggetReading()Return the Reading this measurement made from.java.lang.StringgetSource()Get name of the source.javax.vecmath.Vector3dgetVector()doublegetVSound()doublegetX()doublegetY()doublegetZ()booleanisOkPoint()Should this be considered a valid measurement?booleanisValidPosition()voidsetValidPosition(boolean val)java.lang.StringtextCode()Get the error code as a human-readable string.java.lang.StringtoString()(package private) doubletruncate(double x)
-
-
-
Constructor Detail
-
Measurement
public Measurement(Reading r)
-
Measurement
public Measurement(Reading r, double x, double y, double z, double vsound, int code, java.lang.String source)
-
-
Method Detail
-
getReading
public Reading getReading()
Return the Reading this measurement made from.By definition, Reading objects are immutable
- Returns:
- the reading.
-
getId
public java.lang.String getId()
Return the ID int of the transmitter this measurement describes.- Returns:
- transmitter ID.
-
getX
public double getX()
-
getY
public double getY()
-
getZ
public double getZ()
-
getVSound
public double getVSound()
-
isValidPosition
public boolean isValidPosition()
-
setValidPosition
public void setValidPosition(boolean val)
-
getCode
public int getCode()
Error code, defined specifically by generator.- Returns:
- error code.
-
isOkPoint
public boolean isOkPoint()
Should this be considered a valid measurement?- Returns:
- if getCode greater 0.
-
textCode
public java.lang.String textCode()
Get the error code as a human-readable string.- Returns:
- readable error code.
-
getPoint
public javax.vecmath.Point3d getPoint()
-
getVector
public javax.vecmath.Vector3d getVector()
-
getSource
public java.lang.String getSource()
Get name of the source.- Returns:
- source name.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
truncate
double truncate(double x)
-
-