faa.tg.aircraft
Class AircraftEventBus

java.lang.Object
  extended by faa.tg.aircraft.AircraftEventBus
All Implemented Interfaces:
Route.DescentCapturePredictor, java.io.Serializable

public class AircraftEventBus
extends java.lang.Object
implements java.io.Serializable, Route.DescentCapturePredictor

 AircraftEventBus is a wrapper that allows certain actions to be called
 on an aircraft without granting access to most aircraft information.
 
See the source: AircraftEventBus.java

Version:
$Id: AircraftEventBus.java,v 3.28 2009/01/28 13:11:49 samf Exp $
See Also:
Serialized Form

Field Summary
private  Aircraft aircraft
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
(package private) static long serialVersionUID
           
 
Constructor Summary
AircraftEventBus(Aircraft ac)
          Construct wrapper enabling protected access to aircraft for events.
 
Method Summary
 LocalAtm calculateLocalAtm(Position pos)
          Calculates the atmospheric conditions at this position.
 LocalWind calculateLocalWind(Position pos)
          Calculates the wind at this position.
 void changeFlyingStatusIfValid(FlyingStatus fs)
          Changes flying status of aircraft to given status if change is valid.
 SimulationTime currentTime()
          Returns the current simulation time.
 void fireEndOfRouteEvent(Route route)
           
 void fireFlyingStatusChangeEvent(FlyingStatus oldFlyingStatus, FlyingStatus newFlyingStatus)
          Sends a flying status change event to all the AircraftEventListeners registered for the type of event.
 void fireHeadingCaptureEvent(TrueHeading capturedHdg)
           
 void fireHeadingChangeEvent(TrueHeading desiredHdg)
           
 void fireIntialTaxiStartEvent()
           
 void fireOverRouteNodeEvent(GroundNode routeNode)
           
 void fireOverRouteNodeEvent(RouteNode routeNode)
           
 void firePassedOuterMarkerEvent()
           
 void fireRouteCapturedEvent(Route route)
           
 void fireSimulationEvent(SimEvent event)
          Adds the given event to the SimEventMgr for the Scenario this aircraft is in.
 void fireTakeoffStartEvent()
           
 void fireTouchDownEvent()
          Sends a touchdown event to AircraftEventListeners.
 MonitorType getAircraftMonitor()
          Returns the instrument(s) this aircraft uses to monitor other aircraft.
 Position getEstimatedPosition()
          Returns the position of the aircraft, as estimated by the navigator.
 Altitude getExpeditedDescentCapture(Position pos)
          Method called to determine the altitude at which the crossing point's latitude/longitude can be captured with an expedited descent.
 Route getFiledRoute()
          Returns filed route
 AltitudeRate getMaxClimbRate()
          Returns the maximum climb rate of the aircraft when expedited.
 java.lang.String getName()
          Returns aircraft ID as a String, or null if no associated aircraft.
 Altitude groundTransitionOffset()
          Returns an altitude offset if this aircraft has a ground arrival route, or null if it doesn't.
 TrackMgr initializeTrackMgr()
          Creates a TrackManager that watches the current aircraft and stores its previous state in the form of positions, velocities, and times.
 boolean isGroundAutoTakeoff()
           
 boolean isGroundMovementAuto()
           
 boolean isInGroup()
           
 void landAircraft(Position position)
          Switch from current dynamics to GroundDynamics.
 void prompt(java.lang.String promptString)
          Send a command prompt to the Aircraft (Sim-Pilot) after a short delay -- either 1 second for a piloted aircraft or several seconds for a non-piloted aircraft.
 void terminateFlight()
          Terminates the flight associated with this aircraft.
 java.lang.String toString()
          Returns information for this aircraft event bus as a String, in the format:
 TrackMgr updateTrack()
          Updates the track monitoring the aircraft this bus represents if one exists and returns its TrackMgr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

aircraft

private final Aircraft aircraft
Constructor Detail

AircraftEventBus

public AircraftEventBus(Aircraft ac)
Construct wrapper enabling protected access to aircraft for events.
 NOTE: This constructor allows a null aircraft value, so that the
       AircraftEventBus may be distributed before creating the aircraft.
       However, if an attempt to access the events occurs before the
       aircraft is set using setAircraft(), that method will throw a
       NullPointerException.)

Parameters:
ac - The aircraft to be wrapped.
Method Detail

getFiledRoute

public Route getFiledRoute()
Returns filed route


changeFlyingStatusIfValid

public void changeFlyingStatusIfValid(FlyingStatus fs)
Changes flying status of aircraft to given status if change is valid.


fireFlyingStatusChangeEvent

public void fireFlyingStatusChangeEvent(FlyingStatus oldFlyingStatus,
                                        FlyingStatus newFlyingStatus)
Sends a flying status change event to all the AircraftEventListeners registered for the type of event.


fireEndOfRouteEvent

public void fireEndOfRouteEvent(Route route)

fireRouteCapturedEvent

public void fireRouteCapturedEvent(Route route)

fireHeadingChangeEvent

public void fireHeadingChangeEvent(TrueHeading desiredHdg)
Parameters:
desiredHdg - The heading that the aircraft will change to.

fireHeadingCaptureEvent

public void fireHeadingCaptureEvent(TrueHeading capturedHdg)
Parameters:
capturedHdg - The heading that the aircraft captured.

firePassedOuterMarkerEvent

public void firePassedOuterMarkerEvent()

fireOverRouteNodeEvent

public void fireOverRouteNodeEvent(GroundNode routeNode)

fireOverRouteNodeEvent

public void fireOverRouteNodeEvent(RouteNode routeNode)

fireIntialTaxiStartEvent

public void fireIntialTaxiStartEvent()

fireTouchDownEvent

public void fireTouchDownEvent()
Sends a touchdown event to AircraftEventListeners.


fireTakeoffStartEvent

public void fireTakeoffStartEvent()

landAircraft

public void landAircraft(Position position)
Switch from current dynamics to GroundDynamics.


getAircraftMonitor

public MonitorType getAircraftMonitor()
                               throws UnableToComplyException
Returns the instrument(s) this aircraft uses to monitor other aircraft.

Throws:
UnableToComplyException

getEstimatedPosition

public Position getEstimatedPosition()
Returns the position of the aircraft, as estimated by the navigator.

Specified by:
getEstimatedPosition in interface Route.DescentCapturePredictor

getExpeditedDescentCapture

public Altitude getExpeditedDescentCapture(Position pos)
Method called to determine the altitude at which the crossing point's latitude/longitude can be captured with an expedited descent.

Specified by:
getExpeditedDescentCapture in interface Route.DescentCapturePredictor
Throws:
UnableToComplyException

getMaxClimbRate

public AltitudeRate getMaxClimbRate()
Returns the maximum climb rate of the aircraft when expedited.


prompt

public void prompt(java.lang.String promptString)
Send a command prompt to the Aircraft (Sim-Pilot) after a short delay -- either 1 second for a piloted aircraft or several seconds for a non-piloted aircraft.

Parameters:
promptString - the message to send to the pilot.

groundTransitionOffset

public Altitude groundTransitionOffset()
Returns an altitude offset if this aircraft has a ground arrival route, or null if it doesn't.


getName

public java.lang.String getName()
Returns aircraft ID as a String, or null if no associated aircraft.


toString

public java.lang.String toString()
Returns information for this aircraft event bus as a String, in the format:
"AircraftEventBus[AAL123]"
.

Overrides:
toString in class java.lang.Object

calculateLocalWind

public LocalWind calculateLocalWind(Position pos)
Calculates the wind at this position.

Parameters:
pos - the Position to check.
Returns:
LocalWind at pos.

calculateLocalAtm

public LocalAtm calculateLocalAtm(Position pos)
Calculates the atmospheric conditions at this position.

Parameters:
pos - the Position to check.
Returns:
LocalAtm at pos.

currentTime

public SimulationTime currentTime()
Returns the current simulation time.

Returns:
a SimulationTime

fireSimulationEvent

public void fireSimulationEvent(SimEvent event)
Adds the given event to the SimEventMgr for the Scenario this aircraft is in.

Parameters:
event - The SimEvent to add.

terminateFlight

public void terminateFlight()
Terminates the flight associated with this aircraft.


isGroundMovementAuto

public boolean isGroundMovementAuto()
Returns:
if ground aircraft should immediately begin taxiing

initializeTrackMgr

public TrackMgr initializeTrackMgr()
Creates a TrackManager that watches the current aircraft and stores its previous state in the form of positions, velocities, and times.

Returns:
the newly created TrackMgr. If one already exists, returns it instead.

updateTrack

public TrackMgr updateTrack()
Updates the track monitoring the aircraft this bus represents if one exists and returns its TrackMgr.

Returns:
the TrackMgr corresponding to the track if it exists or null otherwise.

isGroundAutoTakeoff

public boolean isGroundAutoTakeoff()
Returns:
if ground aircraft should immediately begin to takeoff.

isInGroup

public boolean isInGroup()