org.ka2ddo.yaac.core
Class AlohaTracker

java.lang.Object
  extended by org.ka2ddo.yaac.core.AlohaTracker
All Implemented Interfaces:
TrackerListener, GpsDataListener

public class AlohaTracker
extends java.lang.Object
implements TrackerListener, GpsDataListener

This class tracks the real-time addition and removal of stations from the data cache, and computes the Aloha circle for each open RF interface, based on current data. It can therefore be queried efficiently when something else needs to know the circle radius.


Field Summary
static int MAX_ALOHA_1200_CAPACITY
           
 
Method Summary
 AlohaRanger[] getAlohaRanges()
          Get the currently computed Aloha ranges for this station.
static AlohaTracker getInstance()
          Get a reference to the singleton AlohaTracker.
 double getLastLatitude()
          Get the center latitude of the computed Aloha ranges.
 double getLastLongitude()
          Get the center longitude of the computed Aloha ranges.
 void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, java.lang.String source)
          Called by the GPSDistributor when the GPS data has been updated.
 void messageAdded(StationState ss, int index, AX25Message msg)
          Called when a AX25Message is added to the history for a station in the tracker.
 void messageDeleted(StationState ss, int index, AX25Message msg)
          Called when a AX25Message is deleted from the history for a station in the tracker.
 void satDataUpdated(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, java.lang.String source)
          Called when the satellite constellation in use changes.
 void stationAdded(StationState ss, int index)
          Called when a new station is initially added to the tracker.
 void stationDeleted(StationState ss, int index)
          Called when an existing station is deleted from the tracker.
 void stationUpdated(StationState ss)
          Called when an existing station is updated with new information in the tracker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ALOHA_1200_CAPACITY

public static final int MAX_ALOHA_1200_CAPACITY
See Also:
Constant Field Values
Method Detail

getInstance

public static AlohaTracker getInstance()
Get a reference to the singleton AlohaTracker.

Returns:
the AlohaTracker object

getAlohaRanges

public AlohaRanger[] getAlohaRanges()
Get the currently computed Aloha ranges for this station.

Returns:
array of per-RF-interface AlohaRanger objects
See Also:
getLastLatitude(), getLastLongitude()

getLastLatitude

public double getLastLatitude()
Get the center latitude of the computed Aloha ranges.

Returns:
double specifying the latitude (in decimal degrees) used for the last-fetched AlohaRanges
See Also:
getAlohaRanges()

getLastLongitude

public double getLastLongitude()
Get the center longitude of the computed Aloha ranges.

Returns:
double specifying the longitude (in decimal degrees) used for the last-fetched AlohaRanges
See Also:
getAlohaRanges()

gpsDataUpdated

public void gpsDataUpdated(GPSDistributor distributor,
                           GpsFix currentFix,
                           boolean isLocal,
                           java.lang.String source)
Called by the GPSDistributor when the GPS data has been updated.

Specified by:
gpsDataUpdated in interface GpsDataListener
Parameters:
distributor - instance of the GPSDistributor
currentFix - current position data reported by the local GPS
isLocal - boolean true if this is GPS data for the local station, false if for a remote GPS receiver
source - String name assigned to remote GPS receiver, or null if for the local receiver

satDataUpdated

public void satDataUpdated(GPSDistributor distributor,
                           SatelliteCatalog satCatalog,
                           boolean isLocal,
                           java.lang.String source)
Called when the satellite constellation in use changes. Meaningless to the AlohaTracker.

Specified by:
satDataUpdated in interface GpsDataListener
Parameters:
distributor - instance of the GPSDistributor
satCatalog - updated SatelliteCatalog instance
isLocal - boolean true if this is GPS data for the local station, false if for a remote GPS receiver
source - String name assigned to remote GPS receiver, or null if for the local receiver

stationAdded

public void stationAdded(StationState ss,
                         int index)
Called when a new station is initially added to the tracker.

Specified by:
stationAdded in interface TrackerListener
Parameters:
ss - StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState object
index - zero-based integer sequence number for this station in the StationTracker

stationUpdated

public void stationUpdated(StationState ss)
Called when an existing station is updated with new information in the tracker.

Specified by:
stationUpdated in interface TrackerListener
Parameters:
ss - StationState containing the station's information; the new AX25Message will not yet be stored within the StationState object

stationDeleted

public void stationDeleted(StationState ss,
                           int index)
Called when an existing station is deleted from the tracker.

Specified by:
stationDeleted in interface TrackerListener
Parameters:
ss - StationState containing the station's information
index - zero-based integer sequence number for this station in the StationTracker

messageAdded

public void messageAdded(StationState ss,
                         int index,
                         AX25Message msg)
Called when a AX25Message is added to the history for a station in the tracker.

Specified by:
messageAdded in interface TrackerListener
Parameters:
ss - StationState containing the station's information
index - zero-based index of the message added to the StationState object
msg - APRS Message object being added to the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here

messageDeleted

public void messageDeleted(StationState ss,
                           int index,
                           AX25Message msg)
Called when a AX25Message is deleted from the history for a station in the tracker.

Specified by:
messageDeleted in interface TrackerListener
Parameters:
ss - StationState containing the station's information; the AX25Message will already be removed from the StationState object
index - zero-based index of the message removed from the StationState object
msg - APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here