jwo.landserf.process.gps.garmin
Class TrackDataPacket

java.lang.Object
  extended byjwo.landserf.process.gps.garmin.GarminPacket
      extended byjwo.landserf.process.gps.garmin.TrackDataPacket
All Implemented Interfaces:
GPSTrack, Position

public class TrackDataPacket
extends GarminPacket
implements GPSTrack

Represents a Garmin track packet used for storing sets of locations. Uses the Garmin D301 protocol or the D300 if not available.

Version:
2.1, 4th August, 2004
Author:
Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).

Field Summary
 
Fields inherited from class jwo.landserf.process.gps.garmin.GarminPacket
Cmnd_Abort_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Posn, Cmnd_Transfer_Prx, Cmnd_Transfer_Rte, Cmnd_Transfer_Time, Cmnd_Transfer_Trk, Cmnd_Transfer_Wpt, Cmnd_Turn_Off_Pwr, DLE, ETX, packet, Pid_Ack_Byte, Pid_Almanac_Data, Pid_Command_Data, Pid_Date_Time_Data, Pid_Nak_Byte, Pid_Position_Data, Pid_Product_Data, Pid_Product_Rqst, Pid_Protocol_Array, Pid_Prx_Wpt_Data, Pid_Pvt_Data, Pid_Records, Pid_Rte_Hdr, Pid_Rte_Link_Data, Pid_Rte_Wpt_Data, Pid_Trk_Data, Pid_Trk_Hdr, Pid_Wpt_Data, Pid_Xfer_Cmplt
 
Constructor Summary
TrackDataPacket(GarminPacket packet)
          Creates a track packet from the given packet data.
TrackDataPacket(int[] packet)
          Creates a track packet from the given data.
 
Method Summary
 float getAltitude()
          Reports the altitude of this track coordinate.
 AngleRadians getLatitude()
          Reports the latitude of the track coordinate.
 AngleRadians getLongitude()
          Reports the longitude of the track coordinate.
 Date getTime()
          Should report the time stamp associated with this track coordinate.
 boolean isFirst()
          Reports whether this is the first point in a track segment.
 
Methods inherited from class jwo.landserf.process.gps.garmin.GarminPacket
calcChecksum, commandToString, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getRawPacket, idToString, isLegal, readByte, readDouble, readFloat, readLong, readNullTerminatedString, readWord, setPacket, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrackDataPacket

public TrackDataPacket(int[] packet)
Creates a track packet from the given data. If the D301 protocol supported elevations along the track will also be stored.

Parameters:
packet - Data representing the track data packet.
Throws:
PacketNotRecognizedException - if the track data format is not defined.

TrackDataPacket

public TrackDataPacket(GarminPacket packet)
Creates a track packet from the given packet data.

Parameters:
packet - Packet to copy.
Throws:
PacketNotRecognizedException - if the given packet is not a track packet.
Method Detail

getLatitude

public AngleRadians getLatitude()
Reports the latitude of the track coordinate.

Specified by:
getLatitude in interface Position
Returns:
Latitude in radians.

getLongitude

public AngleRadians getLongitude()
Reports the longitude of the track coordinate.

Specified by:
getLongitude in interface Position
Returns:
Latitude in radians.

getAltitude

public float getAltitude()
Reports the altitude of this track coordinate.

Specified by:
getAltitude in interface Position
Returns:
Altitude of this position in units determined by the GPS. May be 0 if GPS unit does not record waypoint altitude.

isFirst

public boolean isFirst()
Reports whether this is the first point in a track segment.

Specified by:
isFirst in interface GPSTrack
Returns:
true if first point.

getTime

public Date getTime()
Should report the time stamp associated with this track coordinate.

Specified by:
getTime in interface GPSTrack
Returns:
Time associated with this track coordinate.


Copyright Jo Wood, 1996-2004, last modified, 3rd September, 2004