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

Version:
$Revision: 72 $
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
ADDRESS_FIELD, BEGIN_CHAR, CHECKSUM_DELIMITER, FIELD_DELIMITER, MAX_LENGTH, TERMINATOR
 
Method Summary
 double getMagneticCourse()
          Get the magnetic course over ground.
 GpsMode getMode()
          Get the GPS receiver operating mode.
 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(GpsMode mode)
          Set the GPS receiver operating mode.
 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
getFieldCount, getSentenceId, getTalkerId, isProprietary, isValid, setTalkerId, 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

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

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

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(GpsMode mode)
Set the GPS receiver operating mode.

Parameters:
mode - Mode to set

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-2011 Java Marine API author(s). All Rights Reserved.