com.partnersoft.gps.nmea
Class NmeaGps

java.lang.Object
  extended by com.partnersoft.gps.AbstractGPSDevice
      extended by com.partnersoft.gps.nmea.NmeaGps
All Implemented Interfaces:
GPSDevice

public class NmeaGps
extends AbstractGPSDevice

Turns NMEA messages from a NmeaParser into GPS stuff: latitude, longitude, pdop, etc.


Field Summary
 
Fields inherited from class com.partnersoft.gps.AbstractGPSDevice
caster
 
Constructor Summary
NmeaGps()
           
 
Method Summary
protected  void applyAllSettings()
          This is called by the configutron to apply all the settings that can be applied without diconnecting and reconnecting the serial port.
protected  void clearReading()
           
 void close()
          Close the GPS.
 javax.swing.JPanel getConfigutron()
          Returns a property page for configuring the GPS.
 Constellation getConstellation()
           
 java.lang.String getDeviceLabel()
           
 java.lang.String getDeviceType()
           
 GPSState getGpsState()
          Returns null if the GPS is not open.
 double getHDOP()
           
 GPSReading getLastReading()
           
 double getLatitude()
           
 double getLongitude()
           
 int getMinimumSatellites()
           
 double getPDOP()
           
 Postprocessing getPostprocessing()
           
 int getSatelliteCount()
           
 int getStatusCode()
           
 java.lang.String getStatusMessage()
           
protected  void handleGga(GGAData gga)
           
protected  void handleGll(GLLData gll)
           
protected  void handleGsa(GSAData gsa)
           
protected  void handleGsv(GSVData gsv)
           
protected  void handleRmc(RMCData rmc)
           
 boolean isOpen()
           
 void open()
          Open the GPS using the current settings.
 void setMinimumSatellites(int min)
           
protected  void setReading(double longitude, double latitude)
          This uses the last official bearing.
protected  void setReading(double longitude, double latitude, double bearing)
          This sets the "official" bearing.
 SurveyedLocation surveyLocation()
          The NMEA GPS does not take advantage of surveyLocation() to do any special processing, like point averaging.
protected  void updateStatusMessage()
           
 
Methods inherited from class com.partnersoft.gps.AbstractGPSDevice
addGPSListener, removeAllListeners, removeGPSListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NmeaGps

public NmeaGps()
Method Detail

applyAllSettings

protected void applyAllSettings()
                         throws java.io.IOException
This is called by the configutron to apply all the settings that can be applied without diconnecting and reconnecting the serial port.

Throws:
java.io.IOException

clearReading

protected void clearReading()

handleGga

protected void handleGga(GGAData gga)

handleGll

protected void handleGll(GLLData gll)

handleGsa

protected void handleGsa(GSAData gsa)

handleGsv

protected void handleGsv(GSVData gsv)

handleRmc

protected void handleRmc(RMCData rmc)

setReading

protected void setReading(double longitude,
                          double latitude)
This uses the last official bearing.

Parameters:
longitude -
latitude -

setReading

protected void setReading(double longitude,
                          double latitude,
                          double bearing)
This sets the "official" bearing.

Parameters:
longitude -
latitude -
bearing - in degrees north.

updateStatusMessage

protected void updateStatusMessage()

getMinimumSatellites

public int getMinimumSatellites()

setMinimumSatellites

public void setMinimumSatellites(int min)

getDeviceType

public java.lang.String getDeviceType()

getDeviceLabel

public java.lang.String getDeviceLabel()

open

public void open()
          throws java.io.IOException
Description copied from interface: GPSDevice
Open the GPS using the current settings. If this throws IOException, the GPS should be in the 'closed' state.

Throws:
java.io.IOException

isOpen

public boolean isOpen()
Returns:
true if the GPS is open.

close

public void close()
Description copied from interface: GPSDevice
Close the GPS.


getConstellation

public Constellation getConstellation()

getHDOP

public double getHDOP()

getLatitude

public double getLatitude()

getLastReading

public GPSReading getLastReading()

surveyLocation

public SurveyedLocation surveyLocation()
The NMEA GPS does not take advantage of surveyLocation() to do any special processing, like point averaging. It just returns the last reading. Also, it ignores the GPS ID, setting it to null in the returned SurveyedLocation.

Returns:

getLongitude

public double getLongitude()

getPDOP

public double getPDOP()

getSatelliteCount

public int getSatelliteCount()

getStatusCode

public int getStatusCode()

getStatusMessage

public java.lang.String getStatusMessage()

getConfigutron

public javax.swing.JPanel getConfigutron()
Description copied from interface: GPSDevice
Returns a property page for configuring the GPS.

Returns:

getGpsState

public GPSState getGpsState()
Description copied from interface: GPSDevice
Returns null if the GPS is not open.

Returns:

getPostprocessing

public Postprocessing getPostprocessing()