org.jscience.devices.gps.garmin
Class TrackpointDataPacket

java.lang.Object
  extended by org.jscience.devices.gps.garmin.GarminPacket
      extended by org.jscience.devices.gps.garmin.TrackpointDataPacket
All Implemented Interfaces:
ITrackpoint

public class TrackpointDataPacket
extends GarminPacket
implements ITrackpoint

This class encapsulates a trackpoint-packet. The Garmin-protocol contains a huge amount of different trackpoint-Packet specifications.


Field Summary
protected  float alt
          Altitude.
protected  int datatypeversion
          Holds information about which trackpoint-format this Garmin-unit uses.
protected  float depth
          Depth.
protected  int index
          DOCUMENT ME!
protected  PositionDegrees lat
          Latitude of trackpoint.
protected  PositionDegrees lon
          Longitude of trackpoint.
protected  boolean new_trk
          new track segment
protected  float temp
          Temperature.
protected  long time
          Time of track point sample
 
Fields inherited from class org.jscience.devices.gps.garmin.GarminPacket
Cmnd_Abort_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Laps, 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_Command_Data, Pid_Date_Time_Data, Pid_Lap, 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_Trk_data, Pid_Trk_Hdr, Pid_Wpt_Data, Pid_Xfer_Cmplt, pointer
 
Constructor Summary
TrackpointDataPacket(GarminPacket p)
          Creates a new TrackpointDataPacket object.
TrackpointDataPacket(int[] p)
          Throws a PacketNotRecognizedException if the Trackpoint-dataformat is not implemented.
 
Method Summary
 float getAltitude()
          DOCUMENT ME!
 int getIndex()
          DOCUMENT ME!
 PositionRadians getLatitude()
          This method returns the latitude of the trackpoint.
 PositionRadians getLongitude()
          This method returns the longitude of the trackpoint.
 Position getPosition()
          DOCUMENT ME!
 long getTime()
          DOCUMENT ME!
 boolean isHeader()
          Sets which version of the packet that this class should treat.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.devices.gps.garmin.GarminPacket
calcChecksum, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getPointer, getRawPacket, idToString, isLegal, readBoolean, readBoolean, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readLong, readLong, readNullTerminatedString, readNullTerminatedString, readPosition, readPosition, readWord, readWord, setPointer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

datatypeversion

protected int datatypeversion
Holds information about which trackpoint-format this Garmin-unit uses. The default is 301.


index

protected int index
DOCUMENT ME!


lat

protected PositionDegrees lat
Latitude of trackpoint.


lon

protected PositionDegrees lon
Longitude of trackpoint.


time

protected long time
Time of track point sample


alt

protected float alt
Altitude.


depth

protected float depth
Depth.


temp

protected float temp
Temperature.


new_trk

protected boolean new_trk
new track segment

Constructor Detail

TrackpointDataPacket

public TrackpointDataPacket(int[] p)
Throws a PacketNotRecognizedException if the Trackpoint-dataformat is not implemented.

Parameters:
p - DOCUMENT ME!

TrackpointDataPacket

public TrackpointDataPacket(GarminPacket p)
Creates a new TrackpointDataPacket object.

Parameters:
p - DOCUMENT ME!
Method Detail

isHeader

public boolean isHeader()
Sets which version of the packet that this class should treat.
Note: Setting this value will affect all instances of the class.

Specified by:
isHeader in interface ITrackpoint
Returns:
DOCUMENT ME!

getIndex

public int getIndex()
DOCUMENT ME!

Specified by:
getIndex in interface ITrackpoint
Returns:
DOCUMENT ME!

getPosition

public Position getPosition()
DOCUMENT ME!

Specified by:
getPosition in interface ITrackpoint
Returns:
DOCUMENT ME!

getTime

public long getTime()
Description copied from interface: ITrackpoint
DOCUMENT ME!

Specified by:
getTime in interface ITrackpoint
Returns:
DOCUMENT ME!

getAltitude

public float getAltitude()
DOCUMENT ME!

Specified by:
getAltitude in interface ITrackpoint
Returns:
DOCUMENT ME!

getLatitude

public PositionRadians getLatitude()
This method returns the latitude of the trackpoint.

Returns:
DOCUMENT ME!

getLongitude

public PositionRadians getLongitude()
This method returns the longitude of the trackpoint.

Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class GarminPacket
Returns:
DOCUMENT ME!