Package org.ka2ddo.yaac.core
Class AlohaTracker
java.lang.Object
org.ka2ddo.yaac.core.AlohaTracker
- All Implemented Interfaces:
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 and
the algorithm defined by Bob Bruninga, WB4APR.
It can therefore be queried efficiently when something else needs to know the circle radius.
- Author:
- Andrew Pavlin, KA2DDO
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Maximum number of typical APRS packets that can be transmitted at 1200 baud over a 30-minute period. -
Method Summary
Modifier and TypeMethodDescriptionGet the currently computed Aloha ranges for this station.static AlohaTracker
Get a reference to the singleton AlohaTracker.double
Get the center latitude of the computed Aloha ranges.double
Get the center longitude of the computed Aloha ranges.void
gpsDataUpdated
(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, String source) Called by the GPSDistributor when the GPS data has been updated.static boolean
Report whether APRS-IS stations will be computed into an aloha circle.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, String source) Called when the satellite constellation in use changes.static void
setDoAlohaForAprsIs
(boolean doAlohaForAprsIs) Specify whether APRS-IS stations will be computed into an aloha circle.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
Called when an existing station is updated with new information in the tracker.
-
Field Details
-
MAX_ALOHA_1200_CAPACITY
public static final int MAX_ALOHA_1200_CAPACITYMaximum number of typical APRS packets that can be transmitted at 1200 baud over a 30-minute period.- See Also:
-
-
Method Details
-
getInstance
Get a reference to the singleton AlohaTracker.- Returns:
- the AlohaTracker object
-
getAlohaRanges
Get the currently computed Aloha ranges for this station.- Returns:
- array of per-RF-interface AlohaRanger objects
- See Also:
-
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:
-
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:
-
isDoAlohaForAprsIs
public static boolean isDoAlohaForAprsIs()Report whether APRS-IS stations will be computed into an aloha circle.- Returns:
- boolean true if an aloha circle will be computed for Internet ports
-
setDoAlohaForAprsIs
public static void setDoAlohaForAprsIs(boolean doAlohaForAprsIs) Specify whether APRS-IS stations will be computed into an aloha circle.- Parameters:
doAlohaForAprsIs
- boolean true if an aloha circle should be computed for Internet ports
-
gpsDataUpdated
public void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, String source) Called by the GPSDistributor when the GPS data has been updated.- Specified by:
gpsDataUpdated
in interfaceGpsDataListener
- Parameters:
distributor
- instance of the GPSDistributorcurrentFix
- current position data reported by the local GPSisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiver
-
satDataUpdated
public void satDataUpdated(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, String source) Called when the satellite constellation in use changes. Meaningless to the AlohaTracker.- Specified by:
satDataUpdated
in interfaceGpsDataListener
- Parameters:
distributor
- instance of the GPSDistributorsatCatalog
- updated SatelliteCatalog instanceisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiver
-
stationAdded
Called when a new station is initially added to the tracker.- Specified by:
stationAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState objectindex
- zero-based integer sequence number for this station in the StationTracker
-
stationUpdated
Called when an existing station is updated with new information in the tracker.- Specified by:
stationUpdated
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the new AX25Message will not yet be stored within the StationState object
-
stationDeleted
Called when an existing station is deleted from the tracker.- Specified by:
stationDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based integer sequence number for this station in the StationTracker
-
messageAdded
Called when a AX25Message is added to the history for a station in the tracker.- Specified by:
messageAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based index of the message added to the StationState objectmsg
- 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
Called when a AX25Message is deleted from the history for a station in the tracker.- Specified by:
messageDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the AX25Message will already be removed from the StationState objectindex
- zero-based index of the message removed from the StationState objectmsg
- 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
-