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 int
getCode()
Error code, defined specifically by generator.java.lang.String
getId()
Return the ID int of the transmitter this measurement describes.javax.vecmath.Point3d
getPoint()
Reading
getReading()
Return the Reading this measurement made from.java.lang.String
getSource()
Get name of the source.javax.vecmath.Vector3d
getVector()
double
getVSound()
double
getX()
double
getY()
double
getZ()
boolean
isOkPoint()
Should this be considered a valid measurement?boolean
isValidPosition()
void
setValidPosition(boolean val)
java.lang.String
textCode()
Get the error code as a human-readable string.java.lang.String
toString()
(package private) double
truncate(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:
toString
in classjava.lang.Object
-
truncate
double truncate(double x)
-
-