net.sf.marineapi.provider
Class TPVProvider

java.lang.Object
  extended by net.sf.marineapi.provider.TPVProvider
All Implemented Interfaces:
EventListener, SentenceListener

public class TPVProvider
extends Object
implements SentenceListener

Provides a time/position/velocity report from GPS. Data is captured from RMC and GGA or GLL sentences. RMC is used for date/time, speed and course. GGA is used as primary source for position as it contains also the altitude. When GGA is not available, position may be taken from GLL or RMC. If this is the case, there is no altitude included in the Position. GPS data statuses are also captured and events are dispatched only when sentences report DataStatus.ACTIVE.

When constructing the TPVEvent, captured sentences must be from within the last 1000 milliseconds (i.e. standard NMEA update rate, 1/s).

Version:
$Revision: 103 $
Author:
Kimmo Tuukkanen
See Also:
TPVListener, TPVEvent, SentenceReader

Constructor Summary
TPVProvider(SentenceReader reader)
          Creates a new instance of GPSProvider.
 
Method Summary
 void addListener(TPVListener listener)
          Inserts a listener to provider.
 void readingPaused()
          Called when NMEA data flow has paused for some reason, e.g. when reached the end of file or device has stopped providing data, but the reader is still running and waiting for more data.
 void readingStarted()
          Called when NMEA data is found in stream and reader starts dispatching SentenceEvents.
 void readingStopped()
          Invoked after SentenceReader has stopped reading the input stream, either due to error or explicit request by calling SentenceReader.stop().
 void removeListener(TPVListener listener)
          Removes the specified listener from provider.
 void sentenceRead(SentenceEvent event)
          Invoked when valid NMEA 0183 data has been read by SentenceReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TPVProvider

public TPVProvider(SentenceReader reader)
Creates a new instance of GPSProvider.

Parameters:
reader - SentenceReader to be used as the data source.
Method Detail

addListener

public void addListener(TPVListener listener)
Inserts a listener to provider.

Parameters:
listener - Listener to add

readingPaused

public void readingPaused()
Description copied from interface: SentenceListener
Called when NMEA data flow has paused for some reason, e.g. when reached the end of file or device has stopped providing data, but the reader is still running and waiting for more data. Timeout for pause event to occur is 5 seconds.

Specified by:
readingPaused in interface SentenceListener

readingStarted

public void readingStarted()
Description copied from interface: SentenceListener
Called when NMEA data is found in stream and reader starts dispatching SentenceEvents. Also, this notification occurs when events dispatching continues after readingPaused() has occurred.

Specified by:
readingStarted in interface SentenceListener

readingStopped

public void readingStopped()
Description copied from interface: SentenceListener
Invoked after SentenceReader has stopped reading the input stream, either due to error or explicit request by calling SentenceReader.stop().

Specified by:
readingStopped in interface SentenceListener

removeListener

public void removeListener(TPVListener listener)
Removes the specified listener from provider.

Parameters:
listener - Listener to remove

sentenceRead

public void sentenceRead(SentenceEvent event)
Description copied from interface: SentenceListener
Invoked when valid NMEA 0183 data has been read by SentenceReader.

Specified by:
sentenceRead in interface SentenceListener
Parameters:
event - SentenceEvent containing the data.


Copyright (C) 2010-2011 Java Marine API author(s). All Rights Reserved.