net.sf.marineapi.nmea.sentence
Interface VTGSentence

All Superinterfaces:
Sentence

public interface VTGSentence
extends Sentence

Course and speed over the ground. True and magnetic COG, speed provided in km/h and knots. Mode (the last "A" in example sentence) was added in NMEA 2.3 and may not always be available.

Example:
$GPVTG,46.96,T,,,16.89,N,31.28,K,A*43

Author:
Kimmo Tuukkanen

Field Summary
static char KMPH
          Units indicator for kilometers per hour
static char KNOT
          Units indicator for knots (nautical miles per hour)
static char MAGNETIC
          Char indicator for "magnetic"
static char MODE_AUTOMATIC
          Operating in automatic mode (2D/3D).
static char MODE_MANUAL
          Operating in manual mode (forced 2D or 3D).
static char TRUE
          Char indicator for "true"
 
Fields inherited from interface net.sf.marineapi.nmea.sentence.Sentence
ALTERNATIVE_BEGIN_CHAR, BEGIN_CHAR, CHECKSUM_DELIMITER, FIELD_DELIMITER, MAX_LENGTH, TERMINATOR
 
Method Summary
 double getMagneticCourse()
          Get the magnetic course over ground.
 FaaMode getMode()
          Get the FAA operating mode of GPS receiver.
 double getSpeedKmh()
          Get current speed over ground, in kilometers per hour.
 double getSpeedKnots()
          Get speed over ground in knots.
 double getTrueCourse()
          Get the true course over ground.
 void setMagneticCourse(double mcog)
          Set the magnetic course over ground.
 void setMode(FaaMode mode)
          Set the FAA operating mode of GPS receiver.
 void setSpeedKmh(double kmh)
          Set the current speed over ground.
 void setSpeedKnots(double knots)
          Set the speed over ground, in knots.
 void setTrueCourse(double tcog)
          Set the true course over ground.
 
Methods inherited from interface net.sf.marineapi.nmea.sentence.Sentence
getBeginChar, getFieldCount, getSentenceId, getTalkerId, isProprietary, isValid, reset, setBeginChar, setTalkerId, toSentence, toSentence, toString
 

Field Detail

TRUE

static final char TRUE
Char indicator for "true"

See Also:
Constant Field Values

MAGNETIC

static final char MAGNETIC
Char indicator for "magnetic"

See Also:
Constant Field Values

KMPH

static final char KMPH
Units indicator for kilometers per hour

See Also:
Constant Field Values

KNOT

static final char KNOT
Units indicator for knots (nautical miles per hour)

See Also:
Constant Field Values

MODE_MANUAL

static final char MODE_MANUAL
Operating in manual mode (forced 2D or 3D).

See Also:
Constant Field Values

MODE_AUTOMATIC

static final char MODE_AUTOMATIC
Operating in automatic mode (2D/3D).

See Also:
Constant Field Values
Method Detail

getMagneticCourse

double getMagneticCourse()
Get the magnetic course over ground.

Returns:
Magnetic course
Throws:
DataNotAvailableException - If the data is not available.
ParseException - If the field contains unexpected or illegal value.

getMode

FaaMode getMode()
Get the FAA operating mode of GPS receiver. The field may not be available, depending on the NMEA version.

Returns:
FaaMode enum
Throws:
DataNotAvailableException - If the data is not available.
ParseException - If the field contains unexpected or illegal value.
Since:
NMEA 2.3

getSpeedKmh

double getSpeedKmh()
Get current speed over ground, in kilometers per hour.

Returns:
Speed in km/h
Throws:
DataNotAvailableException - If the data is not available.
ParseException - If the field contains unexpected or illegal value.

getSpeedKnots

double getSpeedKnots()
Get speed over ground in knots.

Returns:
Speed in knots (nautical miles per hour)
Throws:
DataNotAvailableException - If the data is not available.
ParseException - If the field contains unexpected or illegal value.

getTrueCourse

double getTrueCourse()
Get the true course over ground.

Returns:
True course, in degrees
Throws:
DataNotAvailableException - If the data is not available.
ParseException - If the field contains unexpected or illegal value.

setMagneticCourse

void setMagneticCourse(double mcog)
Set the magnetic course over ground.

Parameters:
mcog - Course in degrees.

setMode

void setMode(FaaMode mode)
Set the FAA operating mode of GPS receiver.

Parameters:
mode - Mode to set
Since:
NMEA 2.3

setSpeedKmh

void setSpeedKmh(double kmh)
Set the current speed over ground.

Parameters:
kmh - Speed in kilometers per hour (km/h).

setSpeedKnots

void setSpeedKnots(double knots)
Set the speed over ground, in knots.

Parameters:
knots - Speed in knots (nautical miles per hour)

setTrueCourse

void setTrueCourse(double tcog)
Set the true course over ground.

Parameters:
tcog - True course, in degrees
Throws:
IllegalArgumentException - If specified course is out of bounds 0..360 degrees.


Copyright (C) 2010-2014 Java Marine API authors. All Rights Reserved.