faa.tg.datalink
Class DatalinkEquipment

java.lang.Object
  extended by faa.tg.datalink.DatalinkEquipment
All Implemented Interfaces:
FlightTerminatedListener, java.util.EventListener

public class DatalinkEquipment
extends java.lang.Object
implements FlightTerminatedListener

  This class encapsulates the functionality of the datalink
    Equipment on an Aircraft
 

Version:
$Id: DatalinkEquipment.java,v 3.11 2008/12/18 17:08:45 samf Exp $
Author:
Michael Capito

Field Summary
private  Aircraft aircraft
           
private static boolean autoWilco
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  java.util.List<Dmsg> dmsgList
           
private static DatalinkRep drep
           
private  DatalinkMsgMgr mgr
           
private static java.lang.String WILCO
           
 
Constructor Summary
DatalinkEquipment(Aircraft ac)
          Constructor
 
Method Summary
 void addDcUpMsgListener(DcUpMsgListener lis)
          Registers a DcUpMsgListener to receive a data com up link message
 SimulationTime getCurrentSimTime()
          Returns current sim time
 void handleFlightTerminatedEvent(FlightTerminatedEvent evt)
          Respond to incoming flight terminated Event
 void newDmsgToAircraft(Dmsg dmsg)
          Sends a new datalink message to an aircraft
protected  void processCmds(int refMsgNum, java.lang.String cmds)
          processes given commands
 boolean processDatalinkMessage(int messageNum, TgfResponseType response)
          Process data link message
private  boolean removeMessageFromAc(int msgNum)
          Remove message from internal list
 void sendDownlinkMsgFromAircraft(DownlinkRequestInterface request)
          send down link message from aircraft
protected  void sendEvent(java.lang.String orgMsg, SimulationTime orgMsgRecievedTime, RpDmsg responseMsg)
          Send message to listeners
 RpDmsg sendResponseFromAircraft(int msgNum, java.lang.String msg)
          Send response message from Aircraft
static void setAutoWilco(boolean boo)
          Set whether auto wilco is enabled
static void setDatalinkRep(DatalinkRep dr)
          Set the Datalink Rep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_VERSION_ID

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

See Also:
Constant Field Values

dmsgList

private java.util.List<Dmsg> dmsgList

aircraft

private Aircraft aircraft

mgr

private DatalinkMsgMgr mgr

drep

private static DatalinkRep drep

autoWilco

private static boolean autoWilco

WILCO

private static final java.lang.String WILCO
See Also:
Constant Field Values
Constructor Detail

DatalinkEquipment

public DatalinkEquipment(Aircraft ac)
Constructor

Parameters:
ac - - the aircraft this equipment is for
Method Detail

setDatalinkRep

public static void setDatalinkRep(DatalinkRep dr)
Set the Datalink Rep

Parameters:
dr - - the DatalinkRep

setAutoWilco

public static void setAutoWilco(boolean boo)
Set whether auto wilco is enabled

Parameters:
boo - - whether auto wilco is enabled

newDmsgToAircraft

public void newDmsgToAircraft(Dmsg dmsg)
Sends a new datalink message to an aircraft

Parameters:
dmsg - - the message to send

removeMessageFromAc

private boolean removeMessageFromAc(int msgNum)
Remove message from internal list

Parameters:
msgNum - - the number of the message to remove
Returns:
Returns whether removal was successful

sendResponseFromAircraft

public RpDmsg sendResponseFromAircraft(int msgNum,
                                       java.lang.String msg)
Send response message from Aircraft

Parameters:
msgNum - - the number of the message to respond to
msg - - the message response text
Returns:
Returns the message sent

sendDownlinkMsgFromAircraft

public void sendDownlinkMsgFromAircraft(DownlinkRequestInterface request)
send down link message from aircraft

Parameters:
request - - the request

addDcUpMsgListener

public void addDcUpMsgListener(DcUpMsgListener lis)
Registers a DcUpMsgListener to receive a data com up link message

Parameters:
lis - - the listener to add

handleFlightTerminatedEvent

public void handleFlightTerminatedEvent(FlightTerminatedEvent evt)
Respond to incoming flight terminated Event

Specified by:
handleFlightTerminatedEvent in interface FlightTerminatedListener

processCmds

protected void processCmds(int refMsgNum,
                           java.lang.String cmds)
processes given commands

Parameters:
refMsgNum - - the number of the message that contained the commands
cmds - - the commands to process

processDatalinkMessage

public boolean processDatalinkMessage(int messageNum,
                                      TgfResponseType response)
Process data link message

Parameters:
messageNum - - the message number
response - - how to respond to message
Returns:
Returns an indication as to whether message was processed successfully

sendEvent

protected void sendEvent(java.lang.String orgMsg,
                         SimulationTime orgMsgRecievedTime,
                         RpDmsg responseMsg)
Send message to listeners

Parameters:
orgMsg - - text of orginal message
orgMsgRecievedTime - - time orginal message recieved
responseMsg - - the response

getCurrentSimTime

public SimulationTime getCurrentSimTime()
Returns current sim time