|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jaron.flightgear.FlightGearSender
public class FlightGearSender
The FlightGearSender
class provides a TCP/IP connection to the
FlightGear flight simulator (FG) via the FG generic input interface.
FlightGearSender
runs as a thread an by instantiating it tries to
connect to FG (with port 5556 and ip address "127.0.0.1"
by default).
Be aware that running FG and a Java application that uses the
FlightGearSender
needs a computer with sufficient performance.
The consequence of a lack of performance is, that some of the data sent to 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_IP
The default IP address that is used for the outgoing connection. |
static int |
DEFAULT_PORT
The default port that is used for the outgoing connection. |
static float |
DEFAULT_UPDATE_FREQUENCY
The default update frequency of the FlightGearSender
is 3.0f Hz. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FlightGearSender()
Creates a new FlightGearSender and starts a Thread
that tries to connect to FlightGear. |
|
FlightGearSender(java.lang.String ip)
Creates a new FlightGearSender and starts a Thread
that tries to connect to FlightGear. |
|
FlightGearSender(java.lang.String ip,
int port)
Creates a new FlightGearSender and starts a Thread
that tries to connect to FlightGear. |
Method Summary | |
---|---|
Signal |
getAileron()
Returns a Signal object that provides access to the aileron
data. |
Signal |
getElevator()
Returns a Signal object that provides access to the elevator
data. |
Signal |
getRudder()
Returns a Signal object that provides access to the rudder
data. |
Signal |
getThrottle()
Returns a Signal object that provides access to the throttle
data. |
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 FlightGearSender . |
void |
shutDown()
Shuts this sender down. |
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
FlightGearSender
is 3.0f Hz.
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_IP
Constructor Detail |
---|
public FlightGearSender(java.lang.String ip, int port)
FlightGearSender
and starts a Thread
that tries to connect to FlightGear.
ip
- the IP address of the FlightGear applicationport
- the port of the FlightGear applicationpublic FlightGearSender(java.lang.String ip)
FlightGearSender
and starts a Thread
that tries to connect to FlightGear. It tries to connect to the default
port DEFAULT_PORT
.
ip
- the IP address of the FlightGear applicationDEFAULT_PORT
public FlightGearSender()
FlightGearSender
and starts a Thread
that tries to connect to FlightGear. It tries to connect to the default
IP adres DEFAULT_IP
and the default port DEFAULT_PORT
.
DEFAULT_PORT
,
DEFAULT_IP
Method Detail |
---|
public Signal getAileron()
Signal
object that provides access to the aileron
data. Usually the signal is linked to another signal via the EventListener
mechanism. Like that the aileron data is for example sent from a joystick
to FlightGear.
public Signal getElevator()
Signal
object that provides access to the elevator
data. Usually the signal is linked to another signal via the EventListener
mechanism. Like that the elevator data is for example sent from a joystick
to FlightGear.
public Signal getRudder()
Signal
object that provides access to the rudder
data. Usually the signal is linked to another signal via the EventListener
mechanism. Like that the rudder data is for example sent from a joystick
to FlightGear.
public Signal getThrottle()
Signal
object that provides access to the throttle
data. Usually the signal is linked to another signal via the EventListener
mechanism. Like that the throttle data is for example sent from a joystick
to FlightGear.
public void setDebug(java.lang.Boolean debug)
debug
- set to true
if additional debugging information
should be printedpublic void setUpdateFrequency(float updateFrequency)
FlightGearSender
.
The default update frequency is set to 3.0fHz.
updateFrequency
- the new frequency in Hzpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void shutDown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |