|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jaron.flightgear.FlightGearNMEAReceiver
public class FlightGearNMEAReceiver
The FlightGearNMEAReceiver
class provides a TCP/IP connection to the
FlightGear flight simulator (FG) via the FG NMEA output interface.
FlightGearNMEAReceiver
runs as a thread and by instantiating it
waits for the incoming connection from FG (at port 5557 by default).
The instantiating has to be done before FG starts up, else FG reports a
connection error and terminates.
Be aware that running FG and a Java application that uses the
FlightGearNMEAReceiver
needs a computer with sufficient performance.
The consequence of a lack of performance is, that some of the data sent by FG
could be lost because of timing issues. In this case you could run FG and the
Java application on two different machines via a network connection.
Have a look at the UAVsim
. example on how to use the
FlightGearNMEAReceiver
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default port that is used for the incoming connection. |
static float |
DEFAULT_UPDATE_FREQUENCY
The default update frequency of the FlightGearNMEAReceiver
is 1.0fHz. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FlightGearNMEAReceiver()
Creates a new FlightGearNMEAReceiver and starts a Thread
that listens for incoming connections. |
|
FlightGearNMEAReceiver(int port)
Creates a new FlightGearNMEAReceiver and starts a Thread
that listens for incoming connections. |
Method Summary | |
---|---|
void |
addNMEAListener(NMEAListener listener)
Adds a listener to the EventListener mechanism. |
void |
addTrackpointListener(TrackpointListener listener)
Adds a listener to the EventListener mechanism. |
void |
run()
|
void |
setDebug(java.lang.Boolean debug)
Sets the debugging flag which determines if the debugging informations should be printed to the console. |
void |
setUpdateFrequency(float updateFrequency)
Sets the update frequency for the FlightGearNMEAReceiver . |
void |
shutDown()
Shuts this receiver down and disconnects the client. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final float DEFAULT_UPDATE_FREQUENCY
FlightGearNMEAReceiver
is 1.0fHz.
public static final int DEFAULT_PORT
Constructor Detail |
---|
public FlightGearNMEAReceiver(int port)
FlightGearNMEAReceiver
and starts a Thread
that listens for incoming connections.
port
- the port the receiver listens topublic FlightGearNMEAReceiver()
FlightGearNMEAReceiver
and starts a Thread
that listens for incoming connections. It listens on the default port
DEFAULT_PORT
.
DEFAULT_PORT
Method Detail |
---|
public void addNMEAListener(NMEAListener listener)
EventListener
mechanism. So whenever
a set of NMEA data is received, the listener will be informed about
that.
listener
- the listener to be addedpublic void addTrackpointListener(TrackpointListener listener)
EventListener
mechanism. So whenever
a trackpoint is added to the trackpath, the listener will be informed about
that event.
listener
- the listener to be addedpublic void setUpdateFrequency(float updateFrequency)
FlightGearNMEAReceiver
.
The default update frequency is set to 1.0fHz.
updateFrequency
- the new frequency in Hzpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setDebug(java.lang.Boolean debug)
debug
- set to true
if additional debugging information
should be printedpublic void shutDown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |