Class AlohaTracker

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

public class AlohaTracker extends 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 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 Details

    • MAX_ALOHA_1200_CAPACITY

      public static final int MAX_ALOHA_1200_CAPACITY
      Maximum number of typical APRS packets that can be transmitted at 1200 baud over a 30-minute period.
      See Also:
  • Method Details

    • 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

      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 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, 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