|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.core.Measurement
org.placelab.core.GPSMeasurement
A Measurement based on a reading from a GPS unit. GPSMeasurements are different from most Measurements in that they have a Coordinate included with them that is read from the GPS.
| Field Summary | |
static int |
DONT_HAVE_A_LOCK
|
static java.lang.String[] |
gpsTypes
|
static int |
HAVE_A_LOCK
|
static int |
NO_INFO_RE_A_LOCK
|
| Constructor Summary | |
GPSMeasurement(long timestampInMillis,
Coordinate loc)
|
|
GPSMeasurement(long timestampInMillis,
Coordinate loc,
java.util.Hashtable fields)
|
|
GPSMeasurement(long time,
java.io.DataInputStream dis)
|
|
| Method Summary | |
java.lang.String |
getField(java.lang.String fieldName)
|
Coordinate |
getPosition()
|
java.lang.String |
getType()
|
int |
haveALock()
Roughly the same as isValid, but also returns whether there was no info about a lock (which can be assumed to be no lock) |
boolean |
isLikelyAccurate()
Uses a heuristic based on number of satellites and satellite angles to predict if reading is likely to be accurate. |
boolean |
isValid()
Gets whether or not the fix data is valid for this GPSMeasurement. |
byte[] |
toCompressedBytes()
For storage on impoverished devices |
java.lang.String |
toLogString()
Converts the Measurement to a form which is convenient for writing to a log file. |
java.lang.String |
toShortString()
A short string based representation for debugging purposes |
| Methods inherited from class org.placelab.core.Measurement |
fromCompressedBytes, getTimestamp, setTimestamp |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.placelab.core.PositionMeasurement |
getTimestamp |
| Field Detail |
public static final java.lang.String[] gpsTypes
public static final int HAVE_A_LOCK
public static final int DONT_HAVE_A_LOCK
public static final int NO_INFO_RE_A_LOCK
| Constructor Detail |
public GPSMeasurement(long timestampInMillis,
Coordinate loc,
java.util.Hashtable fields)
public GPSMeasurement(long timestampInMillis,
Coordinate loc)
public GPSMeasurement(long time,
java.io.DataInputStream dis)
throws java.io.IOException
| Method Detail |
public Coordinate getPosition()
getPosition in interface PositionMeasurementpublic boolean isValid()
public boolean isLikelyAccurate()
public java.lang.String getField(java.lang.String fieldName)
fieldName - GPS field names from NMEASentence
public java.lang.String getType()
getType in interface PositionMeasurementpublic java.lang.String toLogString()
MeasurementTYPE=type|TIME=timestamp|OTHERFIELD=value ...All necessary fields should be stored in that pipe separated format, and all values should be percentEscaped with
StringUtil.percentEscape(String)
Such a format is easily converted into a HashMap form, and a Measurement should (but is not required to) provide a constructor to build itself from a HashMap created from its log string form.
toLogString in class Measurementpublic java.lang.String toShortString()
Measurement
toShortString in class Measurementpublic byte[] toCompressedBytes()
Measurement
toCompressedBytes in class Measurementpublic int haveALock()
HAVE_A_LOCK,
DONT_HAVE_A_LOCK,
NO_INFO_RE_A_LOCK
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||