com.partnersoft.maps.app
Class MapGpsLogic

java.lang.Object
  extended by com.partnersoft.maps.app.MapGpsLogic

public class MapGpsLogic
extends java.lang.Object

Controls the behavior of GPS in a map app.

Copyright 2005-2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
MapGpsLogic(MapApp app)
           
 
Method Summary
 void autodraw()
          Performs an autodraw action.
 void editGpsSettings()
           
 GPSState getGpsState()
          Returns a projected GPSState.
 GPSReading getLastReading()
          Returns a projected GPSReading.
 Projection getProjection()
          Figuring out the projection is a little complicated because we have to be backwards compatible with previous versions of 4.0.
 java.lang.String getProjectionName()
          Works exactly like getProjection(), except it returns a human-readable name.
protected  void initialize()
           
 boolean isAddingWithGps()
          If true, GPS auto-drawing is enabled.
 boolean isFollowingGps()
           
 boolean isGpsEnabled()
           
 boolean isGpsOpen()
          Returns true if there is a configured, active GPS device.
 boolean isRotatingWithGps()
           
 void setAddingWithGps(boolean addingWithGps)
          Setting this to true turns on GPS auto-drawing functionality, subject the the auto-draw granularity.
 void setFollowingGps(boolean followingGps)
           
 void setRotatingWithGps(boolean rotatingWithGps)
           
 void whereAmI()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapGpsLogic

public MapGpsLogic(MapApp app)
Method Detail

initialize

protected void initialize()

autodraw

public void autodraw()
Performs an autodraw action.


editGpsSettings

public void editGpsSettings()

whereAmI

public void whereAmI()

getLastReading

public GPSReading getLastReading()
Returns a projected GPSReading. The projection comes from getProjection(), which either uses the projection configured in the mapset or the GPS projection.

Returns:
the projected version of daemon.getLastReading().

getGpsState

public GPSState getGpsState()
Returns a projected GPSState. The projection comes from getProjection(), which either uses the projection configured in the mapset or the GPS projection.

Returns:
the projected version of daemon.getState().

getProjection

public Projection getProjection()
Figuring out the projection is a little complicated because we have to be backwards compatible with previous versions of 4.0.

The translator writes out projection settings as part of the background mapset. These settings are configured in the translator and were originally used by the Palm map viewer.

However, the projection settings for the background mapset were never used by 4.0. Instead, each seat was configured with its own projection setting.

In 4.4 prior to 4.4.7, we used those parameters from the background mapset. This proved dangerous since it complicated precision and datum shift issues and required coordination of configuration between 3.7 and 4.4.7 even if the translator itself wasn't doing any projection.

Now, projections are configured in the mapspace file CoordinateSystem.xml.

If all else fails, returns a do-nothing projection. Never returns null.

Returns:
the most appropriate Projection for this installation.

getProjectionName

public java.lang.String getProjectionName()
Works exactly like getProjection(), except it returns a human-readable name. Written specifically for the GpsControlPanel. Note that the projection configured in the background mapset does not have a name. It's just a bunch of projection settings.

Returns:

isGpsEnabled

public boolean isGpsEnabled()

isFollowingGps

public boolean isFollowingGps()

setFollowingGps

public void setFollowingGps(boolean followingGps)

isAddingWithGps

public boolean isAddingWithGps()
If true, GPS auto-drawing is enabled.

Returns:

setAddingWithGps

public void setAddingWithGps(boolean addingWithGps)
Setting this to true turns on GPS auto-drawing functionality, subject the the auto-draw granularity.

Parameters:
addingWithGps -

isRotatingWithGps

public boolean isRotatingWithGps()

setRotatingWithGps

public void setRotatingWithGps(boolean rotatingWithGps)

isGpsOpen

public boolean isGpsOpen()
Returns true if there is a configured, active GPS device.

Returns:
true if there is a configured, active GPS device