Package GPS
Class ImportGPSData
java.lang.Object
GPS.ImportGPSData
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkDate
(GpsDataUnit gpsDataUnit) Occasionally a completely spurious date is recorded.static Collection<String>
importFileStrings
(String filename) Import from .csv or txt- creates an array of strings.void
Import data from a filevoid
performPreChecks
(File file) Having problems with deadlock when opening dialog from inside thread so this is a quick fix.void
saveGPSData
(GpsData gpsData)
-
Constructor Details
-
ImportGPSData
-
-
Method Details
-
loadFile
Import data from a file- Parameters:
file
- - path to file;
-
performPreChecks
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
Import from .csv or txt- creates an array of strings.- Parameters:
filename
-- Returns:
-
saveGPSData
-
checkDate
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.
-