Class GpsCsvLogger

java.lang.Object
org.ka2ddo.yaac.gps.GpsCsvLogger
All Implemented Interfaces:
ShutdownHandler, GpsLogger

public class GpsCsvLogger extends Object implements GpsLogger
This class logs GPS position events only (not satellite constellation updates) to a CSV file, with each record in the order latitude, longitude, elevation, and timestamp.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Details

    • GpsCsvLogger

      public GpsCsvLogger()
  • Method Details

    • open

      public void open()
      Set up for logging using a new format. Note this will not be called for day rollover or similar log segmenting events. That is up to the logger class itself to implement.
      Specified by:
      open in interface GpsLogger
    • logNMEA

      public void logNMEA(String nmeaSentence, GpsFix fix, SatelliteCatalog satelliteCatalog, String source)
      Log this GPS event that was reported as an ASCII NMEA sentence. Note that there is a YAAC-proprietary NMEA message used to mark an event point in the file, sentence $PYAACMRK, that must also be handled.
      Specified by:
      logNMEA in interface GpsLogger
      Parameters:
      nmeaSentence - String of the NMEA sentence to log
      fix - the GpsFix object that has been updated (if necessary) by the NMEA sentence, or null if not changed
      satelliteCatalog - the SatelliteCatalog that has been updated (if necessary) by the sentence, or null if not changed
      source - String name of remote GPS, or null if it is GPS data for the local station
    • logJSON

      public void logJSON(Map<String,Object> jsonMsg, GpsFix fix, SatelliteCatalog satelliteCatalog, String source)
      Log this GPS JSON event that was received from GPSD.
      Specified by:
      logJSON in interface GpsLogger
      Parameters:
      jsonMsg - Map<String, Object> of the JSON structure, as returned by Json
      fix - the GpsFix object that has been updated (if necessary) by the JSON structure, or null if not changed
      satelliteCatalog - the SatelliteCatalog that has been updated (if necessary) by the JSON structure
      source - String name of remote GPS, or null if it is GPS data for the local station
    • close

      public void close()
      Stop using this format of logger. Any buffered output will be flushed and the current log file will be closed.
      Specified by:
      close in interface GpsLogger
    • shutdown

      public void shutdown()
      Do whatever cleanup this object needs for program shutdown.
      Specified by:
      shutdown in interface ShutdownHandler