es.uv.robotica.gvsig.mobile.gps.tracklog
Class TracklogManager

java.lang.Object
  extended byes.uv.robotica.gvsig.mobile.gps.tracklog.TracklogManager

public class TracklogManager
extends java.lang.Object

A static class which manages the access to a tracklog for storing trackpoints

Author:
juangui
See Also:
Tracklogger

Field Summary
static int TRACKLOG_TYPE_CSV
          Identifies a CSV tracklog type
static int TRACKLOG_TYPE_GPX
          Identifies a GPX tracklog type
 
Constructor Summary
TracklogManager()
           
 
Method Summary
static void clearTracklog()
          Clears tracklog and keeps tracking if it was already doing it
static void closeTracklog()
          Closes the tracklog, which includes flushing the buffer and giving format to the tracklog file before closing.
static java.lang.String getFileName()
          Gets the name of the file where the tracklog is stored
static java.lang.String getFolderName()
          Gets the name of the folder where the tracklog is stored
static boolean getStopTrackingWhenMinimized()
          Check whether the program shall stop tracking when minimized
static int getType()
          Gets the tracklog type
static boolean isTracking()
          Gets the current tracklog state
static void openTracklog()
          Opens the tracklog
static void setFileName(java.lang.String _fileName)
          Sets the name of the file where the tracklog is stored
static void setFolderName(java.lang.String _folderName)
          Sets the name of the folder where the tracklog is stored
static void setStopTrackingWhenMinimized(boolean _stopTrackingWhenMinimized)
          Specifies whether the program shall stop tracking when minimized
static void setType(int _type)
          Sets the tracklog type Should not be used before closing the tracklog
static void setTypeAndOpen(int _type)
          Sets the tracklog type and keeps tracking if it was already doing it, closing the old tracklog and opening a new one.
static void startTracking()
          Begins tracking.
static void stopTracking()
          Stops tracking.
static void storeTrackpoint(Trackpoint _trkpt)
          Stores a trackpoint in the tracklog
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACKLOG_TYPE_GPX

public static final int TRACKLOG_TYPE_GPX
Identifies a GPX tracklog type

See Also:
Constant Field Values

TRACKLOG_TYPE_CSV

public static final int TRACKLOG_TYPE_CSV
Identifies a CSV tracklog type

See Also:
Constant Field Values
Constructor Detail

TracklogManager

public TracklogManager()
Method Detail

setFileName

public static void setFileName(java.lang.String _fileName)
Sets the name of the file where the tracklog is stored


getFileName

public static java.lang.String getFileName()
Gets the name of the file where the tracklog is stored

Returns:
a String with the file name

setFolderName

public static void setFolderName(java.lang.String _folderName)
Sets the name of the folder where the tracklog is stored

Parameters:
_folderName -

getFolderName

public static java.lang.String getFolderName()
Gets the name of the folder where the tracklog is stored

Returns:
a String with the folder name

setTypeAndOpen

public static void setTypeAndOpen(int _type)
Sets the tracklog type and keeps tracking if it was already doing it, closing the old tracklog and opening a new one.

Parameters:
_type - one of the following values: - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in GPX format - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in CSV format

setType

public static void setType(int _type)
Sets the tracklog type Should not be used before closing the tracklog

Parameters:
_type - one of the following values: - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in GPX format - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in CSV format
See Also:
TracklogManager.setTypeAndOpen(int _type)

getType

public static int getType()
Gets the tracklog type

Returns:
one of the following values: - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in GPX format - TracklogManager.TRACKLOG_TYPE_GPX for a tracklog in CSV format

isTracking

public static boolean isTracking()
Gets the current tracklog state

Returns:
true if it is currently storing values in the tracklog file

setStopTrackingWhenMinimized

public static void setStopTrackingWhenMinimized(boolean _stopTrackingWhenMinimized)
Specifies whether the program shall stop tracking when minimized

Parameters:
_stopTrackingWhenMinimized - Set to true if the program shall stop tracking in that case

getStopTrackingWhenMinimized

public static boolean getStopTrackingWhenMinimized()
Check whether the program shall stop tracking when minimized

Returns:
if the program shall stop tracking in that case

openTracklog

public static void openTracklog()
Opens the tracklog


closeTracklog

public static void closeTracklog()
Closes the tracklog, which includes flushing the buffer and giving format to the tracklog file before closing. Call this member function before closing the application


clearTracklog

public static void clearTracklog()
Clears tracklog and keeps tracking if it was already doing it


startTracking

public static void startTracking()
Begins tracking. Depending on the tracklogger, it may include writing some tags in the tracklog file


stopTracking

public static void stopTracking()
Stops tracking. Depending on the tracklogger, it may include writing some tags in the tracklog file


storeTrackpoint

public static void storeTrackpoint(Trackpoint _trkpt)
Stores a trackpoint in the tracklog

Parameters:
_trkpt - the trackpoint to be stored