Package org.ka2ddo.yaac.gps
Class GpsCsvLogger
java.lang.Object
org.ka2ddo.yaac.gps.GpsCsvLogger
- All Implemented Interfaces:
ShutdownHandler
,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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Stop using this format of logger.void
Log this GPS JSON event that was received from GPSD.void
logNMEA
(String nmeaSentence, GpsFix fix, SatelliteCatalog satelliteCatalog, String source) Log this GPS event that was reported as an ASCII NMEA sentence.void
open()
Set up for logging using a new format.void
shutdown()
Do whatever cleanup this object needs for program shutdown.
-
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. -
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 interfaceGpsLogger
- Parameters:
nmeaSentence
- String of the NMEA sentence to logfix
- the GpsFix object that has been updated (if necessary) by the NMEA sentence, or null if not changedsatelliteCatalog
- the SatelliteCatalog that has been updated (if necessary) by the sentence, or null if not changedsource
- 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 interfaceGpsLogger
- Parameters:
jsonMsg
- Map<String, Object> of the JSON structure, as returned byJson
fix
- the GpsFix object that has been updated (if necessary) by the JSON structure, or null if not changedsatelliteCatalog
- the SatelliteCatalog that has been updated (if necessary) by the JSON structuresource
- 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. -
shutdown
public void shutdown()Do whatever cleanup this object needs for program shutdown.- Specified by:
shutdown
in interfaceShutdownHandler
-