Package GPS

Class ImportGPSData

java.lang.Object
GPS.ImportGPSData

public class ImportGPSData extends Object
Class to take external GPS data and record in a database table. Developers should be able to easily add functions to load data the simply add to the switch statement in the doInBackground() function of the ImportGPSThread. Inside the function, the ImportGPSThread should be updated with load progress. Everything else should then just work.
Author:
Jamie Macaulay
  • Constructor Details

    • ImportGPSData

      public ImportGPSData(GPSControl gpsControl)
  • Method Details

    • loadFile

      public void loadFile(String fileString)
      Import data from a file
      Parameters:
      file - - path to file;
    • performPreChecks

      public void performPreChecks(File file)
      Having problems with deadlock when opening dialog from inside thread so this is a quick fix. Not as pretty- sure a better fix is available
    • importFileStrings

      public static Collection<String> importFileStrings(String filename)
      Import from .csv or txt- creates an array of strings.
      Parameters:
      filename -
      Returns:
    • saveGPSData

      public void saveGPSData(GpsData gpsData)
    • checkDate

      public boolean checkDate(GpsDataUnit gpsDataUnit)
      Occasionally a completely spurious date is recorded. The field lastUnits keep a record of the past five timeMillis. If the average of these five is more than maxDaysOut out from the GPS data unit then the GPS data unit is not saved. This prevents dates decades in the future or past been recorded.
      Parameters:
      gpsDataUnit - - gps data unit.
      Returns:
      - true if the date seems OK.