Package GPS

Class GPSDataBlock

All Implemented Interfaces:
NMEAEmulator

public class GPSDataBlock extends PamDataBlock<GpsDataUnit> implements NMEAEmulator
Add a bit of extra functionality to GPSDataBlock so that it can check new GPS data are 'reasonable' and flag bad ones.
Author:
Doug
  • Constructor Details

    • GPSDataBlock

      public GPSDataBlock(PamProcess process)
  • Method Details

    • addPamData

      public void addPamData(GpsDataUnit gpsDataUnit)
      Description copied from class: PamDataBlock
      Adds a new PamDataUnit to the PamDataBlock. When the data unit is added, PamObservers that have subscribed to the block will be notified.
      If the data unit already has a UID, it will be left as is.
      Overrides:
      addPamData in class PamDataBlock<GpsDataUnit>
      Parameters:
      gpsDataUnit - Reference to a PamDataUnit
    • isReasonable

      public boolean isReasonable(GpsDataUnit gpsDataUnit)
      Check a GPS entry is reasonable - i.e. doesn't jump a huge distance from the preceeding entry.
      Parameters:
      gpsDataUnit -
      Returns:
      true if reasonable.
    • getNextData

      public EmulatedData getNextData()
      Specified by:
      getNextData in interface NMEAEmulator
      Returns:
      the next emulated data, or null if there are no more.
    • prepareDataSource

      public boolean prepareDataSource(long[] timeLimits, long timeOffset)
      Description copied from interface: NMEAEmulator
      Prepare the data to be read into the emulator.

      The task may be as simple as setting up an interator to go through the data already read into the datablock or it may involve setting up a new database query to get back to raw data.

      Specified by:
      prepareDataSource in interface NMEAEmulator
      Parameters:
      timeLimits - time limits for the emulation
      timeOffset - time offset - between when the data were collected and the time they should be emulated at.
      Returns:
      true if OK
    • loadViewerData

      public boolean loadViewerData(long dataStart, long dataEnd, ViewLoadObserver loadObserver)
      Description copied from class: PamDataBlock
      Instruction from the viewer scroll manager to load new data.

      This just calls through to loadViewerData(OfflineDataLoadInfo ...) so this should not be overridden. Override the other function instead.

      Overrides:
      loadViewerData in class PamDataBlock<GpsDataUnit>
      Parameters:
      dataStart - data start time in millis
      dataEnd - data end time in millis.
      loadObserver - - the load obsever. Can be used as a callback for load progress.
    • loadViewerData

      public boolean loadViewerData(OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver)
      Description copied from class: PamDataBlock
      Instruction from the viewer scroll manager to load new data.
      Overrides:
      loadViewerData in class PamDataBlock<GpsDataUnit>
      Parameters:
      offlineDataLoadInfo - - the load object which contains all info on the data to be loaded.
      loadObserver - - the load observer. Can be used as a callback for load progress.