faa.tg.aircraft
Class Aircraft

java.lang.Object
  extended by faa.tg.aircraft.Aircraft
All Implemented Interfaces:
HasName, Filterable, AircraftInformation, TransmittedSimData, FreeBody, Recordable, RecordableState, ManagedObject, TrackMonitorI, java.io.Serializable
Direct Known Subclasses:
AircraftGroup

public class Aircraft
extends java.lang.Object
implements RecordableState, TransmittedSimData, HasName, TrackMonitorI, AircraftInformation, FreeBody

 Aircraft is an class used to define an aircraft in the simulation.
 faa.tg.aircraft.adm.aircraft.ADMAircraft is current subclass representing
 an implementation of Aircraft.
 
See the source: Aircraft.java

Version:
$Id: Aircraft.java,v 3.110 2009/01/21 22:47:55 lykensj Exp $
Author:
Dan Warburton, FAA/ACT-510
See Also:
Serialized Form

Nested Class Summary
private static class Aircraft.AcListenerPacket
          Aircraft Packet See the source AcListenerPacket.java
 
Field Summary
private  java.util.List<Aircraft.AcListenerPacket> acEvtListeners
          The list of AircraftEventListeners that have registered to receive AircraftEvents for this aircraft.
private  Acid acid
          The unique identifier for this Aircraft.
private  AcType acType
          The type of aircraft i.e.
private  MonitorType aircraftMonitor
          The instrument(s) this aircraft uses to monitor other aircraft.
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  DatalinkEquipment datalinkEquipment
          The Aircraft datalink equipment representation
private  Dynamics dynamics
           
private  short entityId
          The DIS entityId assigned to this Aircraft (Entity State PDU)
private  Flight flight
          A back reference to the Flight Object that manages the Aircraft in the Simulation.
private  Position position
          The current three-dimensional location of the aircraft.
protected  AircraftTypeProfile profile
           
private  Scenario scenario
           
(package private) static long serialVersionUID
           
private  Transponder transponder
          The Aircraft transponder object
private  java.util.List<UpdateCompleteListener> updateEvtListeners
          A list of UpdateCompleteListener's registered with this Aircraft
private  Frequency voiceFrequency
          The Aircraft Voice Frequency object
 
Constructor Summary
  Aircraft(Acid acid, AircraftState acState)
          Create a dead reckoned aircraft from an AircraftState object.
  Aircraft(Acid acid, Flight flight, Ufp ufp, Scenario scenario)
          Constructs an ADM Aircraft from a Ufp and associated Flight.
  Aircraft(Acid acid, Flight flight, Ufp ufp, Scenario scenario, GroundPath groundRoute, Altitude startAltitude)
          Constructs an ground based departure from a Ufp and associated Flight.
  Aircraft(Acid acid, Position position, java.lang.String aircraftType)
          Basic constructor.
  Aircraft(Acid acid, Position position, java.lang.String aircraftType, Time simTime, ExternalUpdateSource externalUpdater)
          (Tim Swantek added 07/16/08) This creates an aircraft from the passed parameters and uses the DeadReckonDynamics to move it about.
  Aircraft(Acid acid, Position position, java.lang.String aircraftType, Time simTime, TrueHeading heading, ExternalUpdateSource externalUpdater)
          (Tim Swantek added 10/01/08) This creates an aircraft from the passed parameters and uses the DeadReckonDynamics to move it about.
private Aircraft(Aircraft other, Flight flight, Scenario scenario)
           
 
Method Summary
 void addAircraftEventListener(AircraftEventListener lis)
          Registers a AircraftEventListener to receive all aircraft events for this Aircraft.
 void addAircraftEventListener(AircraftEventListener lis, java.lang.Class<?> acEvtType)
          Registers a AircraftEventListener to receive aircraft events for this Aircraft for the instance of the event subclass specified.
 void addSimEvent(SimEventPredicate predicate, CommandLine commandLine)
          Add a simulation event.
 void addUpdateCompleteListener(UpdateCompleteListener lis)
          Registers a UpdateCompleteListener to receive this epoch-by-epoch event, signifying the aircraft update was completed for this Aircraft.
 TrueHeading calculateTrueHeading(MagneticHeading magHeading)
           
 void captureLocalizer()
          The implementing class is responsible for updating the state.
private  void changeDynamics(Dynamics dynamics, FlyingStatus newStatus, SimulationTime timeRemaining)
          Switch dynamics so that the new dynamics is transfered smoothly and in a consistient state.
 void changeFlyingStatusIfValid(FlyingStatus newFlyingStatus)
          Changes flying status of aircraft to the given status used by FlightMgr, DepartureMgr, DepartureFlight, and CockpitMgr
 void clearForILSApproach()
          The aircraft will perform the given Approach.
 void clearForRNavApproach()
           
protected  void clearListeners()
          Clear list of AircraftEvent listeners.
 void descendGlideSlope()
           
 boolean disableDatalinkEquipment()
          Shuts off the DatalinkEquipment for this aircraft if it exists.
 boolean enableDatalinkEquipment()
          Enables DatalinkEquipment for this aircraft if it was not already enabled.
protected  void eventPostProcessing(AircraftEvent evt)
          Additional action that should be taken before an aircraft event is sent out to this aircraft's listeners.
protected  void eventPreProcessing(AircraftEvent evt)
          Additional action that should be taken before an aircraft event is sent out to this aircraft's listeners.
 void fireAircraftEvent(AircraftEvent evt)
          Sends aircraft events to all the AircraftEventListeners registered for the type of event.
 void fireUpdateCompleteEvent(UpdateCompleteEvent evt)
          Sends aircraft events to all the UpdateCompleteEventListeners registered for the type of event.
 void followTrack(Aircraft trackedAc, Offset4D offset)
          Follow the track specified.
 Trace4D get4D()
          Returns the aircraft location as a NGATS-style 4D point.
 Acid getAcid()
          Returns the aircraft ID (unique identifier for this aircraft) as an Acid.
 AcType getAcType()
          Returns the type of aircraft, i.e.
 AircraftCapacity getAircraftCapacity()
          DOCUMENT
 AircraftDynamicsResult getAircraftDynamicsResult()
          Required in order to implement the AircraftInformation interface.
 MonitorType getAircraftMonitor()
          Returns the instrument(s) this aircraft uses to monitor other aircraft.
 AircraftState getAircraftState()
          Creates and returns the current state of an aircraft as an AircraftState (for recordings, etc).
 AltitudeRate getAltRate()
          Returns the altitude rate.
 Controller getController()
           
 DatalinkEquipment getDatalinkEquipment()
          Returns this aircraft's datalink equipment, or null if none exists.
 Dynamics getDynamics()
          Returns current dynamics.
 short getEntityId()
          Returns the entity ID for this aircraft.
 Position getEstimatedPosition()
          Returns the estimated position of the aircraft.
 Flight getFlight()
          Accessors for the Flight object, which defines the flight scheduled for this aircraft.
 FlyingStatus getFlyingStatus()
          Returns the flying status of the aircraft.
 Frequency getFrequency()
          Returns the current voice Frequency of this aircraft.
 GuidanceResult getGuidanceResult()
          Required in order to implement the AircraftInformation interface.
 AltitudeRate getMaxClimbRate()
          Returns the maximum climb rate of the aircraft when expedited.
 java.lang.String getName()
          Returns the name (aircraft ID) of this aircraft as a String.
 NED_VelocityVector getNEDVelocityVector()
          Returns the velocity vector of the object in the North-East-Down rectangular coordinate frame.
 Position getPosition()
          Returns the current position of this aircraft.
 Route getPreviousRoute()
          Returns the current route, or null if not on a route.
 Recordable getRecordable()
          Returns the AircraftState of an aircraft for recording.
 Route getRoute()
          Returns the current route, or null if not on a route.
 java.lang.String getRouteString()
          Return the current route of this aircraft as a dot-separated string, if no route, returns "N/A".
 java.lang.String getRouteWithBracketLogicString()
          Return the current route of this aircraft as a dot-separated string with the UFP bracket logic; if no route, returns "N/A".
 Scenario getScenario()
           
 TrackMgr getTrackMgr()
          Return, if it exists, the TrackMgr monitioring this Aircraft.
 Transponder getTransponder()
           
 TurnRate getTurnRate()
          Returns the turn rate (the rate of heading change) of the object.
 void hold(Fix holdFix, HoldingPattern holdingPattern)
          Method called to direct the aircraft to follow a holding pattern.
 boolean isMachCapable()
          Returns whether Mach speeds can be performed.
 void joinGroup(AircraftGroup acGroup)
          Tries to join the specified group.
 void leftTurn(MagneticHeading magHeading)
          Converge on the target Magnetic Heading by turning left until the target Magnetic heading is achieved.
 void leftTurn(TrueHeading targetHeading)
          Change the heading of the aircraft by turning left until the specified true heading is achieved.
 void missApproach()
          Method called to direct the aircraft to abort the landing.
 void newAirport(Airport theAirport)
          Method to assign a new airport as the aircraft's destination.
 void newAirport(Airport theAirport, Runway theRunway)
          Method to assign a new airport and runway as the aircraft's destination.
 void newHeading(MagneticHeading magHeading)
          This is a helper method to call the newHeading method with a magnetic heading.
 void newHeading(TrueHeading targetHeading)
          Change the heading of the aircraft to a new heading.
 void newRunway(Runway theRunway)
          Method to assign a new runway as the aircraft's destination.
 boolean prepApproach()
          Returns whether the aircraft successfully changed to approach status.
 void prompt(java.lang.String prompt)
          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 promptNow(java.lang.String prompt)
          Send a command prompt to the Aircraft (Sim-Pilot) IMMEDIATELY
private  void readObject(java.io.ObjectInputStream stream)
          Restores the aircraft object from an ObjectInputStream, with a newly constructed UpdateCompleteListenerList.
 void removeAircraftEventListener(AircraftEventListener lis)
          Removes registration of the AircraftEventListener for all AircraftEvent types for this Aircraft.
 void removeUpdateCompleteListener(UpdateCompleteListener lis)
          Removes registration of the UpdateCompleteEventListener for all Events for this Aircraft.
 void resumePlannedRoute()
          Method used to instruct the aircraft to capture the PlannedRoute at its closest segment and continue to destination.
 void resumePlannedRoute(TrueHeading headingToTheRoute)
          Method used to instruct the aircraft to capture the PlannedRoute by following the given heading and then to continue to destination.
 void resumePreviousRoute()
          Method used to instruct the aircraft to capture the PlannedRoute at its closest segment and continue to destination.
 void resumePreviousRoute(TrueHeading headingToTheRoute)
          Method used to instruct the aircraft to capture the PlannedRoute by following the given heading and then to continue to destination.
 void rightTurn(MagneticHeading magHeading)
          Converge on the target Magnetic Heading by turning right until the target Magnetic heading is achieved.
 void rightTurn(TrueHeading targetHeading)
          Change the heading of the aircraft by turning right until the specified true heading is achieved.
 void sendMessage(java.lang.String message)
          Send a message out to all of those listening for CommandFeedback in this scenario.
 void setArrivalRunway(Runway theRunway)
          Method to assign a new runway as the aircraft's destination.
 void setDepartureRunway(Runway theRunway)
          Method to assign a new runway departure runway The aircraft's plannedRoute will not be modified.
 void setDynamics(Dynamics dynamic)
          Set the dynamics to use.
 void setEntityId(short entityId)
          Replaces the current entity ID with the specified entity ID.
 void setFlight(Flight flight)
          Set the flight the aircraft belongs to.
 java.lang.String setFrequency(Frequency newFrequency)
          Sets the voice Frequency that the pilot is talking on; Looks at whether aircraft is datalink equipped Sends a monitor frequency prompt if the aircraft is datalink equipped, otherwise just sends contact controller prompt
private  java.lang.String setFrequency(Frequency newFrequency, java.lang.String prompt)
          Changes frequency to given newFrequency
 Frequency setFrequency(Ufp ufp)
          Tries to set the frequency from data contained in a Ufp.
 java.lang.String setFrequencyNContactController(Frequency newFrequency)
          Sets the voice Frequency that the pilot is talking on; does NOT check whether aircraft is datalink equipped.
 java.lang.String setFrequencyNMonitor(Frequency newFrequency)
          Sets the voice Frequency that the pilot is talking on; does NOT look at whether aircraft is datalink equipped, always sends a monitor frequency prompt.
 void setPosition(Position pos)
          Sets the current position of this aircraft.
 Aircraft split(Flight flight, Scenario scenario)
           
 java.lang.String toString()
          Returns a string representation of this object.
 void transitionToADMDynamics(SimulationTime timeRemaining)
          Switch from current type of flight dynamics to ADMDynamics.
 void transitionToCrashed(SimulationTime timeRemaining)
          Switch dynamics to an unresponsive state after a non-recoverable accident.
 void transitionToGround(Position updatedPosition)
          Switch from current dynamics to GroundDynamics.
 void transitionToGroundDynamics(SimulationTime timeRemaining)
          Change from the current dynamics into ground dynamics.
 void updateState(SimulationTime timeStep, int iterations)
          Advances the state of the Aircraft to the next epoch to be displayed.
private  java.lang.String validateFrequency(Frequency frequency)
          Validates frequency.
 
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

position

private Position position
The current three-dimensional location of the aircraft.


flight

private Flight flight
A back reference to the Flight Object that manages the Aircraft in the Simulation.


acid

private Acid acid
The unique identifier for this Aircraft.


acType

private AcType acType
The type of aircraft i.e. DC-9. The aircraft's type is the equivalency type. (the one we hava data for) this is different than the type stored on flight. Unlike the aircraft, the flight stores the type of the aircraft that it thinks it is. this type also has the navigation equipment appended onto it. It is used for presentation only.


dynamics

private Dynamics dynamics

entityId

private short entityId
The DIS entityId assigned to this Aircraft (Entity State PDU)

See Also:
TgPduFactory

transponder

private final Transponder transponder
The Aircraft transponder object


datalinkEquipment

private DatalinkEquipment datalinkEquipment
The Aircraft datalink equipment representation

See Also:
DatalinkEquipment

voiceFrequency

private Frequency voiceFrequency
The Aircraft Voice Frequency object

See Also:
Sector

acEvtListeners

private transient java.util.List<Aircraft.AcListenerPacket> acEvtListeners
The list of AircraftEventListeners that have registered to receive AircraftEvents for this aircraft.


updateEvtListeners

private transient java.util.List<UpdateCompleteListener> updateEvtListeners
A list of UpdateCompleteListener's registered with this Aircraft

See Also:
addUpdateCompleteListener(UpdateCompleteListener)

profile

protected AircraftTypeProfile profile

aircraftMonitor

private MonitorType aircraftMonitor
The instrument(s) this aircraft uses to monitor other aircraft.


scenario

private final transient Scenario scenario
Constructor Detail

Aircraft

private Aircraft(Aircraft other,
                 Flight flight,
                 Scenario scenario)
          throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

Aircraft

public Aircraft(Acid acid,
                Position position,
                java.lang.String aircraftType)
Basic constructor.

Parameters:
acid - The aircraft ID to use for this aircraft (i.e., NWA776).
position - The location of the aircraft.
aircraftType - Type of aircraft (i.e., B727).

Aircraft

public Aircraft(Acid acid,
                Position position,
                java.lang.String aircraftType,
                Time simTime,
                ExternalUpdateSource externalUpdater)
(Tim Swantek added 07/16/08) This creates an aircraft from the passed parameters and uses the DeadReckonDynamics to move it about.

Parameters:
acid - is the Aircraft Flight ID.
position - is the current lat, lon, alt of the aircraft.
aircraftType - is the type of aircraft being reckoned.
simTime - is the simulation time the aircraft is valid for.

Aircraft

public Aircraft(Acid acid,
                Position position,
                java.lang.String aircraftType,
                Time simTime,
                TrueHeading heading,
                ExternalUpdateSource externalUpdater)
(Tim Swantek added 10/01/08) This creates an aircraft from the passed parameters and uses the DeadReckonDynamics to move it about.

Parameters:
acid - is the Aircraft Flight ID.
position - is the current lat, lon, alt of the aircraft.
aircraftType - is the type of aircraft being reckoned.
simTime - is the simulation time the aircraft is valid for.
heading - is the TrueHeading of the aircraft.

Aircraft

public Aircraft(Acid acid,
                AircraftState acState)
Create a dead reckoned aircraft from an AircraftState object. Since no aircraft dynamics calculations are involved, the aircraft is effectively a dead reckoned aircraft.

Parameters:
acid - The aircraft ID to use for this aircraft (i.e., NWA776).
acState - Aircraft state at a sim time of an aircraft (treat as dead reckoned because dynamics are not calculated).

Aircraft

public Aircraft(Acid acid,
                Flight flight,
                Ufp ufp,
                Scenario scenario)
         throws FlightPlanException
Constructs an ADM Aircraft from a Ufp and associated Flight. Used for construction from a Ufp.

Parameters:
acid - The aircraft ID to use for this aircraft (i.e., NWA776).
flight - The flight associated with this aircraft.
ufp - Ufp used to construct this aircraft.
Throws:
FlightPlanException - if this Flight cannot find an appropriate AircraftTypeProfile.

Aircraft

public Aircraft(Acid acid,
                Flight flight,
                Ufp ufp,
                Scenario scenario,
                GroundPath groundRoute,
                Altitude startAltitude)
         throws FlightPlanException
Constructs an ground based departure from a Ufp and associated Flight. Used for construction from a Ufp.

Parameters:
acid - The aircraft ID to use for this aircraft (i.e., NWA776).
flight - The flight associated with this aircraft.
ufp - Ufp used to construct this aircraft.
scenario - the scenario to run in
groundRoute - the starting route to follow
startAltitude - the altitude to start at
Throws:
FlightPlanException - Flight cannot find appropriate AircraftTypeProfile.
Method Detail

get4D

public Trace4D get4D()
Returns the aircraft location as a NGATS-style 4D point.


updateState

public void updateState(SimulationTime timeStep,
                        int iterations)
Advances the state of the Aircraft to the next epoch to be displayed. Fires an UpdateCompleteEvent for all UpdateCompleteListeners.

This is the overall method to calculate the new Aircraft state. This calls dynamics.updateState() as many times as there are timesteps per epoch multiplied by the ECO's speed slider value to get to the next displayed epoch.


readObject

private void readObject(java.io.ObjectInputStream stream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Restores the aircraft object from an ObjectInputStream, with a newly constructed UpdateCompleteListenerList.

Parameters:
stream - Stream to read the Aircraft object from.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getAltRate

public AltitudeRate getAltRate()
Returns the altitude rate.

Specified by:
getAltRate in interface FreeBody

getPosition

public Position getPosition()
Returns the current position of this aircraft.

Specified by:
getPosition in interface FreeBody
Returns:
the current position of this aircraft.

setPosition

public void setPosition(Position pos)
Sets the current position of this aircraft.

Parameters:
pos - the current position of this aircraft.

getPreviousRoute

public Route getPreviousRoute()
Returns the current route, or null if not on a route.


getRoute

public Route getRoute()
Returns the current route, or null if not on a route.


getRouteString

public java.lang.String getRouteString()
Return the current route of this aircraft as a dot-separated string, if no route, returns "N/A".


getRouteWithBracketLogicString

public java.lang.String getRouteWithBracketLogicString()
Return the current route of this aircraft as a dot-separated string with the UFP bracket logic; if no route, returns "N/A".


getTransponder

public Transponder getTransponder()

addAircraftEventListener

public void addAircraftEventListener(AircraftEventListener lis)
Registers a AircraftEventListener to receive all aircraft events for this Aircraft.

Parameters:
lis - is an Object that implements the AircraftEventListener interface.

addAircraftEventListener

public void addAircraftEventListener(AircraftEventListener lis,
                                     java.lang.Class<?> acEvtType)
Registers a AircraftEventListener to receive aircraft events for this Aircraft for the instance of the event subclass specified. The acEvtType can be any Class, superclass, or interface: an instanceof test will be used to determine whether the event being sent is one the listener wants.

For example: to receive all AircraftEvents, use the AircraftEvent Class; to receive all aircraft events, use the AircraftEvent Class.

Parameters:
lis - Object that implements the AircraftEventListener interface.
acEvtType - is the Class of AircraftEvent to send events for.

removeAircraftEventListener

public void removeAircraftEventListener(AircraftEventListener lis)
Removes registration of the AircraftEventListener for all AircraftEvent types for this Aircraft.

Parameters:
lis - Object that implements the AircraftEventListener interface.

fireAircraftEvent

public void fireAircraftEvent(AircraftEvent evt)
Sends aircraft events to all the AircraftEventListeners registered for the type of event.

Parameters:
evt - Aircraft event to send to the listeners.
See Also:
eventPreProcessing(AircraftEvent), eventPostProcessing(AircraftEvent)

clearListeners

protected void clearListeners()
Clear list of AircraftEvent listeners.


eventPostProcessing

protected void eventPostProcessing(AircraftEvent evt)
Additional action that should be taken before an aircraft event is sent out to this aircraft's listeners.

Parameters:
evt - The AircraftEvent to process.
See Also:
fireAircraftEvent(AircraftEvent)

eventPreProcessing

protected void eventPreProcessing(AircraftEvent evt)
Additional action that should be taken before an aircraft event is sent out to this aircraft's listeners.

Parameters:
evt - The AircraftEvent to process.
See Also:
fireAircraftEvent(AircraftEvent)

addUpdateCompleteListener

public void addUpdateCompleteListener(UpdateCompleteListener lis)
Registers a UpdateCompleteListener to receive this epoch-by-epoch event, signifying the aircraft update was completed for this Aircraft.

Parameters:
lis - Object that implements the UpdateCompleteListener interface

removeUpdateCompleteListener

public void removeUpdateCompleteListener(UpdateCompleteListener lis)
Removes registration of the UpdateCompleteEventListener for all Events for this Aircraft.

Parameters:
lis - object implementing the UpdateCompleteEventListener interface.

fireUpdateCompleteEvent

public void fireUpdateCompleteEvent(UpdateCompleteEvent evt)
Sends aircraft events to all the UpdateCompleteEventListeners registered for the type of event.

Parameters:
evt - Aircraft event to send to the listeners.

setFrequencyNMonitor

public java.lang.String setFrequencyNMonitor(Frequency newFrequency)
Sets the voice Frequency that the pilot is talking on; does NOT look at whether aircraft is datalink equipped, always sends a monitor frequency prompt.

Parameters:
newFrequency - The new frequency
Returns:
Null if successful, otherwise the reason the new frequency was rejected as a String.

setFrequencyNContactController

public java.lang.String setFrequencyNContactController(Frequency newFrequency)
Sets the voice Frequency that the pilot is talking on; does NOT check whether aircraft is datalink equipped. Always sends a contact controller prompt.

Parameters:
newFrequency - The new frequency.
Returns:
Null if successful, otherwise the reason the new frequency was rejected as a String.

setFrequency

public java.lang.String setFrequency(Frequency newFrequency)
Sets the voice Frequency that the pilot is talking on; Looks at whether aircraft is datalink equipped Sends a monitor frequency prompt if the aircraft is datalink equipped, otherwise just sends contact controller prompt

Parameters:
newFrequency - The new frequency.
Returns:
Null if successful, otherwise the reason the new frequency was rejected as a String.

validateFrequency

private java.lang.String validateFrequency(Frequency frequency)
Validates frequency.

Parameters:
frequency - - the frequency to validate
Returns:
Null if valid, otherwise the reason the new frequency is invalid as a String.

setFrequency

private java.lang.String setFrequency(Frequency newFrequency,
                                      java.lang.String prompt)
Changes frequency to given newFrequency

Parameters:
newFrequency - - the new frequency
prompt - - the prompt to sent the pilot
Returns:
Null if successful, otherwise the reason the new frequency was rejected as a String.

getFrequency

public Frequency getFrequency()
Returns the current voice Frequency of this aircraft.


clearForILSApproach

public final void clearForILSApproach()
                               throws UnableToComplyException
The aircraft will perform the given Approach. The implementing class is responsible for updating the state. Please, please, please tell me why all these methods are synch.

Throws:
UnableToComplyException

prepApproach

public boolean prepApproach()
Returns whether the aircraft successfully changed to approach status.


clearForRNavApproach

public final void clearForRNavApproach()
                                throws UnableToComplyException
Throws:
UnableToComplyException

captureLocalizer

public final void captureLocalizer()
                            throws UnableToComplyException
The implementing class is responsible for updating the state.

Throws:
UnableToComplyException

descendGlideSlope

public final void descendGlideSlope()
                             throws UnableToComplyException
Throws:
UnableToComplyException

transitionToGround

public void transitionToGround(Position updatedPosition)
Switch from current dynamics to GroundDynamics.


transitionToCrashed

public void transitionToCrashed(SimulationTime timeRemaining)
Switch dynamics to an unresponsive state after a non-recoverable accident.

Parameters:
timeRemaining - how much time that was left unused by the previous dynamics in this time step.

changeDynamics

private void changeDynamics(Dynamics dynamics,
                            FlyingStatus newStatus,
                            SimulationTime timeRemaining)
Switch dynamics so that the new dynamics is transfered smoothly and in a consistient state.

Parameters:
dynamics - the dynamics to switch to.
newStatus - what flying status to change to initially after construction.
timeRemaining - how much time that was left unused by the previous dynamics in this time step.

transitionToGroundDynamics

public void transitionToGroundDynamics(SimulationTime timeRemaining)
Change from the current dynamics into ground dynamics. Note that this dynamics does not factor in drag or lift, so high speeds or altitudes will result in consistient, but not expected behaviour. High speed planes will not stop as quickly as expected * and high altitude planes will drop out of the sky.

Parameters:
timeRemaining - the time remaining within the time step that was unused by the previous dynamics.

transitionToADMDynamics

public void transitionToADMDynamics(SimulationTime timeRemaining)
Switch from current type of flight dynamics to ADMDynamics.

Parameters:
timeRemaining - the time remaining within the time step that was unused by the previous dynamics.

newHeading

public final void newHeading(TrueHeading targetHeading)
Change the heading of the aircraft to a new heading. It will also maintain its current altitude and indicated airspeed.

Parameters:
targetHeading - The desired true heading for the aircraft.

newHeading

public void newHeading(MagneticHeading magHeading)
This is a helper method to call the newHeading method with a magnetic heading.

Parameters:
magHeading - Magnetic Heading the aircraft will follow.

leftTurn

public final void leftTurn(TrueHeading targetHeading)
Change the heading of the aircraft by turning left until the specified true heading is achieved.

Parameters:
targetHeading - The desired true heading for the aircraft.

leftTurn

public void leftTurn(MagneticHeading magHeading)
Converge on the target Magnetic Heading by turning left until the target Magnetic heading is achieved. This is a convenience method for using magnetic heading to command the Aircraft

Parameters:
magHeading - The target magnetic heading to converge on.

rightTurn

public final void rightTurn(TrueHeading targetHeading)
Change the heading of the aircraft by turning right until the specified true heading is achieved.

Parameters:
targetHeading - The desired true heading for the aircraft.

rightTurn

public void rightTurn(MagneticHeading magHeading)
Converge on the target Magnetic Heading by turning right until the target Magnetic heading is achieved. This is a convenience method for using magnetic heading to command the Aircraft

Parameters:
magHeading - The target magnetic heading to converge on.

followTrack

public final void followTrack(Aircraft trackedAc,
                              Offset4D offset)
                       throws UnableToComplyException
Follow the track specified.

Throws:
UnableToComplyException - Aircraft is not visible to follower.

resumePlannedRoute

public final void resumePlannedRoute()
                              throws UnableToComplyException
Method used to instruct the aircraft to capture the PlannedRoute at its closest segment and continue to destination. This is the current behavior of newRoute(route) so just use the saved route and call it.

Throws:
UnableToComplyException

resumePlannedRoute

public void resumePlannedRoute(TrueHeading headingToTheRoute)
                        throws UnableToComplyException
Method used to instruct the aircraft to capture the PlannedRoute by following the given heading and then to continue to destination.

Parameters:
headingToTheRoute - Heading to take to capture route.
Throws:
UnableToComplyException - if heading does not intercept the route

resumePreviousRoute

public final void resumePreviousRoute()
                               throws UnableToComplyException
Method used to instruct the aircraft to capture the PlannedRoute at its closest segment and continue to destination. This is the current behavior of newRoute(route) so just use the saved route and call it.

Throws:
UnableToComplyException

resumePreviousRoute

public void resumePreviousRoute(TrueHeading headingToTheRoute)
                         throws UnableToComplyException
Method used to instruct the aircraft to capture the PlannedRoute by following the given heading and then to continue to destination.

Parameters:
headingToTheRoute - Heading to take to capture route.
Throws:
UnableToComplyException - if heading does not intercept the route

newAirport

public void newAirport(Airport theAirport)
Method to assign a new airport as the aircraft's destination. The aircraft's plannedRoute will not be modified.

Parameters:
theAirport - New destination airport.

newAirport

public void newAirport(Airport theAirport,
                       Runway theRunway)
Method to assign a new airport and runway as the aircraft's destination. The aircraft's plannedRoute will not be modified.

Parameters:
theAirport - New destination airport.
theRunway - New destination runway.

newRunway

public void newRunway(Runway theRunway)
Method to assign a new runway as the aircraft's destination. The aircraft's plannedRoute will not be modified.

Parameters:
theRunway - New destination runway.

setDepartureRunway

public void setDepartureRunway(Runway theRunway)
Method to assign a new runway departure runway The aircraft's plannedRoute will not be modified.

Parameters:
theRunway - New departure runway.

setArrivalRunway

public void setArrivalRunway(Runway theRunway)
Method to assign a new runway as the aircraft's destination. The aircraft's plannedRoute will not be modified.

Parameters:
theRunway - New destination runway.

missApproach

public final void missApproach()
                        throws UnableToComplyException
Method called to direct the aircraft to abort the landing.

Throws:
UnableToComplyException

hold

public final void hold(Fix holdFix,
                       HoldingPattern holdingPattern)
                throws FixNotOnRouteException,
                       UnableToComplyException
Method called to direct the aircraft to follow a holding pattern. The implementing class is responsible for updating the state.

Parameters:
holdFix - The Fix to hold at.
holdingPattern - Instructions for flying a hold pattern.
Throws:
FixNotOnRouteException - Thrown if the fix is not on the route.
UnableToComplyException

getMaxClimbRate

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


getName

public final java.lang.String getName()
Returns the name (aircraft ID) of this aircraft as a String.

Specified by:
getName in interface ManagedObject
Specified by:
getName in interface TrackMonitorI
Returns:
Returns the name of the object.

getAcid

public Acid getAcid()
Returns the aircraft ID (unique identifier for this aircraft) as an Acid.


getFlyingStatus

public FlyingStatus getFlyingStatus()
Returns the flying status of the aircraft.


getEntityId

public short getEntityId()
Returns the entity ID for this aircraft.


setEntityId

public void setEntityId(short entityId)
Replaces the current entity ID with the specified entity ID. entitiId should be an Object!! dw...

Parameters:
entityId - The new entityId.

getAcType

public AcType getAcType()
Returns the type of aircraft, i.e. DC-9. The aircraft's type is the equivalency type. (the one we hava data for) this is different than the type stored on flight. Unlike the aircraft, the flight stores the type of the aircraft that it thinks it is. this type also has the navigation equipment appended onto it. It is used for presentation only.

Returns:
Type of aircraft, i.e. DC-9.

getAircraftCapacity

public AircraftCapacity getAircraftCapacity()
DOCUMENT


getFlight

public Flight getFlight()
Accessors for the Flight object, which defines the flight scheduled for this aircraft.

Returns:
Flight the flight scheduled for this aircraft

setFlight

public void setFlight(Flight flight)
Set the flight the aircraft belongs to.

Parameters:
flight - The flight to set.

getDatalinkEquipment

public DatalinkEquipment getDatalinkEquipment()
Returns this aircraft's datalink equipment, or null if none exists.


enableDatalinkEquipment

public boolean enableDatalinkEquipment()
Enables DatalinkEquipment for this aircraft if it was not already enabled.

Returns:
if dataLink was already enabled
See Also:
DatalinkEquipment

disableDatalinkEquipment

public boolean disableDatalinkEquipment()
Shuts off the DatalinkEquipment for this aircraft if it exists.

Returns:
if dataLink was already disabled
See Also:
DatalinkEquipment

getRecordable

public Recordable getRecordable()
Returns the AircraftState of an aircraft for recording.

Specified by:
getRecordable in interface AircraftInformation
Specified by:
getRecordable in interface RecordableState
Returns:
the AircraftState.

getAircraftState

public AircraftState getAircraftState()
Creates and returns the current state of an aircraft as an AircraftState (for recordings, etc).

Specified by:
getAircraftState in interface AircraftInformation

toString

public java.lang.String toString()
Returns a string representation of this object. In general, the toString method returns a String that "textually represents" this object.

Overrides:
toString in class java.lang.Object

promptNow

public void promptNow(java.lang.String prompt)
Send a command prompt to the Aircraft (Sim-Pilot) IMMEDIATELY

Parameters:
prompt - the message to send to the pilot

prompt

public void prompt(java.lang.String prompt)
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:
prompt - the message to send to the pilot

changeFlyingStatusIfValid

public void changeFlyingStatusIfValid(FlyingStatus newFlyingStatus)
Changes flying status of aircraft to the given status used by FlightMgr, DepartureMgr, DepartureFlight, and CockpitMgr


setDynamics

public void setDynamics(Dynamics dynamic)
Set the dynamics to use.


getGuidanceResult

public GuidanceResult getGuidanceResult()
Required in order to implement the AircraftInformation interface.

Specified by:
getGuidanceResult in interface AircraftInformation

getAircraftDynamicsResult

public AircraftDynamicsResult getAircraftDynamicsResult()
Required in order to implement the AircraftInformation interface.

Specified by:
getAircraftDynamicsResult in interface AircraftInformation

getDynamics

public Dynamics getDynamics()
Returns current dynamics.


getEstimatedPosition

public Position getEstimatedPosition()
Returns the estimated position of the aircraft. (Required for the AircraftInformation interface.)

Specified by:
getEstimatedPosition in interface AircraftInformation

getTurnRate

public TurnRate getTurnRate()
Returns the turn rate (the rate of heading change) of the object.

Specified by:
getTurnRate in interface FreeBody

getNEDVelocityVector

public NED_VelocityVector getNEDVelocityVector()
Returns the velocity vector of the object in the North-East-Down rectangular coordinate frame.

Specified by:
getNEDVelocityVector in interface FreeBody

getController

public Controller getController()

getAircraftMonitor

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

Specified by:
getAircraftMonitor in interface TrackMonitorI

joinGroup

public final void joinGroup(AircraftGroup acGroup)
                     throws UnableToComplyException
Tries to join the specified group.

Throws:
UnableToComplyException

isMachCapable

public boolean isMachCapable()
Returns whether Mach speeds can be performed.


setFrequency

public Frequency setFrequency(Ufp ufp)
Tries to set the frequency from data contained in a Ufp.

Parameters:
ufp -
Returns:
Returns the current frequency.

getScenario

public Scenario getScenario()

getTrackMgr

public TrackMgr getTrackMgr()
Return, if it exists, the TrackMgr monitioring this Aircraft.

Returns:
the monitoring TrackMgr or null if none exists.

split

public Aircraft split(Flight flight,
                      Scenario scenario)
               throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

calculateTrueHeading

public TrueHeading calculateTrueHeading(MagneticHeading magHeading)

addSimEvent

public void addSimEvent(SimEventPredicate predicate,
                        CommandLine commandLine)
                 throws UnableToComplyException
Add a simulation event.

Parameters:
predicate - - determines when the event is triggered
commandLine - - the command line to execute
Throws:
UnableToComplyException - Cannot add simevent.

sendMessage

public void sendMessage(java.lang.String message)
Send a message out to all of those listening for CommandFeedback in this scenario.

Parameters:
message -