|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opengts.util.Nmea0183
public class Nmea0183
A container for a NMEA-0183 record
| Field Summary | |
|---|---|
static java.lang.String |
DNAME_GPGGA
|
static java.lang.String |
DNAME_GPRMC
|
static java.lang.String |
DNAME_GPVTG
|
static java.lang.String |
DNAME_GPZDA
|
static long |
FIELD_ALTITUDE
|
static long |
FIELD_DDMMYY
|
static long |
FIELD_FIX_TYPE
|
static long |
FIELD_HDOP
|
static long |
FIELD_HEADING
|
static long |
FIELD_HHMMSS
|
static long |
FIELD_LATITUDE
|
static long |
FIELD_LONGITUDE
|
static long |
FIELD_NUMBER_SATS
|
static long |
FIELD_RECORD_TYPE
|
static long |
FIELD_SPEED
|
static long |
FIELD_VALID_FIX
|
static double |
KILOMETERS_PER_KNOT
|
static double |
KNOTS_PER_KILOMETER
|
static java.lang.String |
NAME_GPGGA
|
static java.lang.String |
NAME_GPRMC
|
static java.lang.String |
NAME_GPVTG
|
static java.lang.String |
NAME_GPZDA
|
static java.lang.String |
NAME_NONE
|
static long |
TYPE_GPGGA
|
static long |
TYPE_GPRMC
|
static long |
TYPE_GPVTG
|
static long |
TYPE_GPZDA
|
static long |
TYPE_NONE
|
| Constructor Summary | |
|---|---|
Nmea0183()
Constructor |
|
Nmea0183(java.lang.String rcd)
Constructor |
|
Nmea0183(java.lang.String[] rcds)
Constructor |
|
Nmea0183(java.lang.String[] rcds,
boolean ignoreChecksum)
Constructor |
|
Nmea0183(java.lang.String rcd,
boolean ignoreChecksum)
Constructor |
|
| Method Summary | |
|---|---|
static int |
calcXORChecksum(java.lang.String str,
boolean includeAll)
Calculates/Returns the checksum for a NMEA-0183 formatted String |
boolean |
didIgnoreInvalidGPS()
Returns true if ignoring invalid GPS flags, and the flag indicator was not "A" |
double |
getAltitudeMeters()
Gets the altitude in meters |
static long |
getCurrentHHMMSS(java.util.TimeZone tz)
Returns the current HHMMSS |
long |
getDDMMYY()
Gets the day/month/year of the fix |
java.lang.String[] |
getExtraData()
Gets any data that may follow the checksum |
long |
getFieldMask()
Gets the mask of available fields |
long |
getFixtime()
Gets the epoch fix time |
long |
getFixtime(boolean dftToCurrentTOD)
Gets the epoch fix time |
int |
getFixType()
Gets the "$GPGGA" fix type (0=no fix, 1=GPS, 2=DGPS, 3=PPS?, 6=dead-reckoning) |
GeoPoint |
getGeoPoint()
Gets the lat/lon as a GeoPoint |
double |
getHDOP()
Gets the horizontal-dilution-of-precision |
double |
getHeading()
Gets the heading/course in degrees |
long |
getHHMMSS()
Gets the hour/minute/seconds of the fix |
boolean |
getIgnoreInvalidGpsFlag()
gets whether the A|V (valid|invalid) GPS location flag should be ignored. |
java.lang.String |
getLastRecordType()
Gets the last record type |
double |
getLatitude()
Gets the latitude |
double |
getLongitude()
Gets the longitude |
double |
getMagneticVariation()
Gets the magnetic variation in degrees |
int |
getNumberOfSatellites()
Gets the number of satellites used in fix |
long |
getParsedRecordTypes()
Gets all parsed record types (mask) |
double |
getSpeedKnots()
Returns the speed in knots |
double |
getSpeedKPH()
Gets the speed in KPH |
static java.lang.String |
GetTypeNames(long type)
Gets the message type String from a type mask |
boolean |
hasAltitude()
Returns true if the altitude has been defined |
boolean |
hasField(long fld)
Returns true if specified field is available |
boolean |
hasFixtime()
Returns true if the fixtime has been defined |
boolean |
hasGeoPoint()
Returns true if the latitude/longitude have been defined |
boolean |
hasGPRMC()
Returns true if a $GPRMC record has been parsed |
boolean |
hasHeading()
Returns true if the heading has been defined |
boolean |
hasLatitude()
Returns true if the latitude has been defined |
boolean |
hasLongitude()
Returns true if the longitude has been defined |
boolean |
hasSpeed()
Returns true if the speed has been defined |
boolean |
isValidChecksum()
Returns true if the checksum is valid |
boolean |
isValidGPS()
Returns true if the GPS fix is valid |
static void |
main(java.lang.String[] argv)
Main entry point for testing/debugging |
boolean |
parse(java.lang.String rcd)
Parses a NMEA-0183 record |
boolean |
parse(java.lang.String[] rcds)
Parses a NMEA-0183 record |
boolean |
parse(java.lang.String[] rcds,
boolean ignoreChecksum)
Parses a NMEA-0183 record |
boolean |
parse(java.lang.String rcd,
boolean ignoreChecksum)
Parses a NMEA-0183 record |
static long |
parseFixtime(long ddmmyy,
long hhmmss,
boolean dftToCurrentTOD)
Returns the parsed epoch fix time |
static long |
parseFixtime(java.lang.String DDMMYY,
java.lang.String HHMMSS,
boolean dftToCurrentTOD)
Returns the parsed epoch fix time |
static double |
ParseLatitude(java.lang.String s,
java.lang.String d)
Parses latitude given values from GPS device. |
static double |
ParseLatitude(java.lang.String s,
java.lang.String d,
double dft)
Parses latitude given values from GPS device. |
static double |
ParseLongitude(java.lang.String s,
java.lang.String d)
Parses longitude given values from GPS device. |
static double |
ParseLongitude(java.lang.String s,
java.lang.String d,
double dft)
Parses longitude given values from GPS device. |
void |
setDDMMYY(long ddmmyy)
Sets the day/month/year (for "$GPGGA" records) |
void |
setGeoPoint(GeoPoint gp)
Sets the lat/lon as a GeoPoint |
void |
setIgnoreInvalidGpsFlag(boolean ignore)
Sets whether the A|V (valid|invalid) GPS location flag should be ignored. Setting to "true" is not recommended as invalid GPS locations may be returned. |
java.lang.String |
toGPRMC()
Return a formatted $GPRMC record from the values in this instance |
java.lang.String |
toString()
Returns a string representation of this object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String NAME_NONE
public static final java.lang.String NAME_GPRMC
public static final java.lang.String NAME_GPGGA
public static final java.lang.String NAME_GPVTG
public static final java.lang.String NAME_GPZDA
public static final java.lang.String DNAME_GPRMC
public static final java.lang.String DNAME_GPGGA
public static final java.lang.String DNAME_GPVTG
public static final java.lang.String DNAME_GPZDA
public static final long TYPE_NONE
public static final long TYPE_GPRMC
public static final long TYPE_GPGGA
public static final long TYPE_GPVTG
public static final long TYPE_GPZDA
public static final long FIELD_RECORD_TYPE
public static final long FIELD_VALID_FIX
public static final long FIELD_DDMMYY
public static final long FIELD_HHMMSS
public static final long FIELD_LATITUDE
public static final long FIELD_LONGITUDE
public static final long FIELD_SPEED
public static final long FIELD_HEADING
public static final long FIELD_HDOP
public static final long FIELD_NUMBER_SATS
public static final long FIELD_ALTITUDE
public static final long FIELD_FIX_TYPE
public static final double KILOMETERS_PER_KNOT
public static final double KNOTS_PER_KILOMETER
| Constructor Detail |
|---|
public Nmea0183()
public Nmea0183(java.lang.String rcd)
rcd - The NMEA-0183 recordpublic Nmea0183(java.lang.String[] rcds)
rcds - An array of NMEA-0183 records
public Nmea0183(java.lang.String rcd,
boolean ignoreChecksum)
rcd - The NMEA-0183 recordignoreChecksum - True if the record's checksum is to be ignored
public Nmea0183(java.lang.String[] rcds,
boolean ignoreChecksum)
rcds - An array of NMEA-0183 recordsignoreChecksum - True if the record's checksum is to be ignored| Method Detail |
|---|
public static java.lang.String GetTypeNames(long type)
type - The message type
public long getFieldMask()
public boolean hasField(long fld)
public long getParsedRecordTypes()
public java.lang.String getLastRecordType()
public boolean isValidChecksum()
public void setDDMMYY(long ddmmyy)
ddmmyy - The day/month/year [CHECK](as what?)public long getDDMMYY()
public long getHHMMSS()
public boolean hasFixtime()
public long getFixtime()
public long getFixtime(boolean dftToCurrentTOD)
public void setIgnoreInvalidGpsFlag(boolean ignore)
public boolean getIgnoreInvalidGpsFlag()
public boolean didIgnoreInvalidGPS()
public boolean isValidGPS()
public boolean hasLatitude()
public double getLatitude()
public boolean hasLongitude()
public double getLongitude()
public boolean hasGeoPoint()
public GeoPoint getGeoPoint()
public void setGeoPoint(GeoPoint gp)
gp - The GeoPointpublic boolean hasSpeed()
public double getSpeedKnots()
public double getSpeedKPH()
public boolean hasHeading()
public double getHeading()
public int getFixType()
public int getNumberOfSatellites()
public double getHDOP()
public boolean hasAltitude()
public double getAltitudeMeters()
public double getMagneticVariation()
public java.lang.String[] getExtraData()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toGPRMC()
public boolean parse(java.lang.String[] rcds)
rcds - An array of NMEA-0183 records to parse
public boolean parse(java.lang.String rcd)
rcd - the NMEA-0183 record to parse
public boolean parse(java.lang.String[] rcds,
boolean ignoreChecksum)
rcds - An array of NMEA-0183 records to parseignoreChecksum - True to ignore the terminating checksum
public boolean parse(java.lang.String rcd,
boolean ignoreChecksum)
rcd - the NMEA-0183 record to parseignoreChecksum - True to ignore the terminating checksum
public boolean hasGPRMC()
public static long getCurrentHHMMSS(java.util.TimeZone tz)
public static long parseFixtime(java.lang.String DDMMYY,
java.lang.String HHMMSS,
boolean dftToCurrentTOD)
DDMMYY - The String representation of the "DDMMYY"HHMMSS - The String representation of the "HHMMSS"dftToCurrentTOD - True to default to current time-of-day
public static long parseFixtime(long ddmmyy,
long hhmmss,
boolean dftToCurrentTOD)
ddmmyy - The Integer representation of the "DDMMYY"hhmmss - The Integer representation of the "HHMMSS"
public static double ParseLatitude(java.lang.String s,
java.lang.String d)
s - Latitude String from GPS device in ddmm.mm format.d - Latitude hemisphere, "N" for northern, "S" for southern.
public static double ParseLatitude(java.lang.String s,
java.lang.String d,
double dft)
s - Latitude String from GPS device in ddmm.mm format.d - Latitude hemisphere, "N" for northern, "S" for southern.dft - The default latitude, if the specified latitude cannot be parsed
public static double ParseLongitude(java.lang.String s,
java.lang.String d)
s - Longitude String from GPS device in ddmm.mm format.d - Longitude hemisphere, "E" for eastern, "W" for western.
public static double ParseLongitude(java.lang.String s,
java.lang.String d,
double dft)
s - Longitude String from GPS device in ddmm.mm format.d - Longitude hemisphere, "E" for eastern, "W" for western.dft - The default latitude, if the specified latitude cannot be parsed
public static int calcXORChecksum(java.lang.String str,
boolean includeAll)
str - NMEA-0183 formatted String to be checksummed.
public static void main(java.lang.String[] argv)
argv - Comand-line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||