|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.gps.GPSDistributor
public class GPSDistributor
This class collects GPS data from GPS data sources and accumulates current position data for use by other parts of the application. It also allows collecting GPS data from remote GPS's (such as relayed over unlicensed ISM links from an amateur rocket) for display and reporting.
Method Summary | |
---|---|
void |
addGpsDataListener(GpsDataListener l)
Register to be informed when local GPS position data is updated. |
java.lang.Object |
extractGpsdJsonInfo(java.util.Map<java.lang.String,java.lang.Object> jsonMsg,
boolean isLocal,
java.lang.String source)
Decode a JSON message from GPSD. |
GpsFix |
getCurrentFix()
get the current GPS fix information. |
static GPSDistributor |
getInstance()
Get the singleton instance of GPSDistributor. |
float |
getLocalBearingDegN(int stepBack)
Returns the current direction of motion in degrees relative to True North. |
float |
getLocalSpeedKnots()
Return the current movement speed of the local station in knots (nautical miles per hour). |
GpsFix |
getNamedGpsFix(java.lang.String name)
Get the current GPS fix information for the named source. |
SatelliteCatalog |
getNamedSatCatalog(java.lang.String name)
Get the current GPS satellite catalog for the named source. |
java.lang.String[] |
getNamedSources()
Get the names for the currently known named remote GPS receivers. |
SatelliteCatalog |
getSatCatalog()
Get the current state of the GPS satellite constellation. |
java.util.ArrayList<GpsFix> |
getShortTermHistory()
Get a copy of the recent position history of this station. |
java.lang.Object |
parseNMEA0183DataLine(java.lang.String line,
PortConnector connector,
boolean isLocal,
java.lang.String source)
Parse an NMEA-0183 standard data sentence into GPS data structure values. |
void |
removeGpsDataListener(GpsDataListener l)
Stop being informed when GPS data is updated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static GPSDistributor getInstance()
public java.lang.Object parseNMEA0183DataLine(java.lang.String line, PortConnector connector, boolean isLocal, java.lang.String source)
line
- String line to parseconnector
- PortConnector that received the sentenceisLocal
- boolean true if this is from this station's own GPS, not from some other stationsource
- callsign of source (used only for error messages)
public java.lang.Object extractGpsdJsonInfo(java.util.Map<java.lang.String,java.lang.Object> jsonMsg, boolean isLocal, java.lang.String source)
jsonMsg
- Map<String,Object> as returned by Json.decodeJSON()isLocal
- boolean true if this is for the GPS local to this station (not a remote GPS)source
- String name of source, used for identifying specific remote GPS ports
Json.decodeJSON(java.io.Reader, org.ka2ddo.yaac.io.PortConnector)
public void addGpsDataListener(GpsDataListener l)
l
- GpsDataListener to call when the GPS data is updatedpublic void removeGpsDataListener(GpsDataListener l)
l
- GpsDataListener to unregisterpublic GpsFix getCurrentFix()
public java.lang.String[] getNamedSources()
public GpsFix getNamedGpsFix(java.lang.String name)
name
- String name of source
public float getLocalSpeedKnots()
public float getLocalBearingDegN(int stepBack)
stepBack
- number of position samples to use to get direction (larger numbers average out motion more)
public SatelliteCatalog getSatCatalog()
public SatelliteCatalog getNamedSatCatalog(java.lang.String name)
name
- String name of source
public java.util.ArrayList<GpsFix> getShortTermHistory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |