Class GPS

  • All Implemented Interfaces:
    java.lang.Runnable

    public class GPS
    extends SimpleGPS
    This class manages data received from a GPS Device. GPS Class manages the following NMEA Sentences: GPRMC GPGSV GPGSA GPGGA (superclass) GPVTG (superclass)
    Author:
    BB, Juan Antonio Brenha Moral
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      GPS​(java.io.InputStream in)
      The constructor.
    • Constructor Detail

      • GPS

        public GPS​(java.io.InputStream in)
        The constructor. It needs an InputStream
        Parameters:
        in - An input stream from the GPS receiver
    • Method Detail

      • getCompassDegrees

        public float getCompassDegrees()
        Return Compass Degrees in a range: 0.0-359.9
        Returns:
        the compass degrees
      • getDate

        public java.util.Date getDate()
        Return a Date Object with data from GGA and RMC NMEA Sentence
        Returns:
        the date
      • getSatellite

        public Satellite getSatellite​(int index)
        Get NMEA Satellite. The satellite list is retrieved from the almanac data. Satellites are ordered by their elevation: highest elevation (index 0) -> lowest elevation.
        Parameters:
        index - the satellite index
        Returns:
        the NMEASaltellite object for the selected satellite
      • getSatellitesTracked

        public int getSatellitesTracked()
        Returns the number of satellites being tracked to determine the coordinates. This method overwrites the superclass method and returns the number from the GSV sentence.
        Overrides:
        getSatellitesTracked in class SimpleGPS
        Returns:
        Number of satellites e.g. 8
      • getSatellitesInView

        public int getSatellitesInView()
        The satellites in view is a list of satellites the GPS could theoretically connect to (i.e. satellites that are not over the earth's horizon). The getSatellitesInView() method will always return an equal or greater number than getSatellitesTracked().
        Returns:
        Number of satellites e.g. 8
      • sentenceChooser

        protected void sentenceChooser​(java.lang.String header,
                                       java.lang.String s)
        Internal helper method to aid in the subclass architecture. Overwrites the superclass method and calls it internally.
        Overrides:
        sentenceChooser in class SimpleGPS
        Parameters:
        header -
        s -