FlightGear next
FGGroundController Class Reference

#include <GroundController.hxx>

Inherits FGATCController.

Public Member Functions

 FGGroundController (FGAirportDynamics *par)
 
 ~FGGroundController ()
 
void setVersion (int v)
 
int getVersion ()
 
bool exists ()
 
virtual void announcePosition (int id, FGAIFlightPlan *intendedRoute, int currentRoute, double lat, double lon, double hdg, double spd, double alt, double radius, int leg, FGAIAircraft *aircraft)
 
virtual void updateAircraftInformation (int id, SGGeod geod, double heading, double speed, double alt, double dt)
 The ground network can deal with the following states: 0 = Normal; no action required 1 = "Acknowledge "Hold position 2 = "Acknowledge "Resume taxi".
 
virtual void handover (SGSharedPtr< FGTrafficRecord > aiObject, int leg)
 We share the traffic record much like real life.
 
bool checkForCircularWaits (int id)
 Check whether situations occur where the current aircraft is waiting for itself due to higher order interactions.
 
virtual void render (bool)
 Draw visible taxi routes.
 
virtual std::string getName () const
 
virtual void update (double dt)
 
void addVersion (int v)
 
- Public Member Functions inherited from FGATCController
 FGATCController ()
 
virtual ~FGATCController ()
 
void init ()
 
void setAirportGroundRadar (SGSharedPtr< AirportGroundRadar > groundRadar)
 
bool checkTransmissionState (int minState, int MaxState, TrafficVectorIterator i, time_t now, AtcMsgId msgId, AtcMsgDir msgDir)
 
SGSharedPtr< FGTrafficRecordgetRecord (int id) const
 
bool hasInstruction (int id)
 
FGATCInstruction getInstruction (int id)
 
bool hasActiveTraffic ()
 
TrafficVectorgetActiveTraffic ()
 
double getDt ()
 
void setDt (double dt)
 
void transmit (FGTrafficRecord *rec, FGAirportDynamics *parent, AtcMsgId msgId, AtcMsgDir msgDir, bool audible)
 
std::string getGateName (FGAIAircraft *aircraft)
 

Additional Inherited Members

- Public Types inherited from FGATCController
enum  AtcMsgId {
  MSG_ANNOUNCE_ENGINE_START , MSG_REQUEST_ENGINE_START , MSG_PERMIT_ENGINE_START , MSG_DENY_ENGINE_START ,
  MSG_ACKNOWLEDGE_ENGINE_START , MSG_REQUEST_PUSHBACK_CLEARANCE , MSG_PERMIT_PUSHBACK_CLEARANCE , MSG_HOLD_PUSHBACK_CLEARANCE ,
  MSG_ACKNOWLEDGE_SWITCH_GROUND_FREQUENCY , MSG_INITIATE_CONTACT , MSG_ACKNOWLEDGE_INITIATE_CONTACT , MSG_REQUEST_TAXI_CLEARANCE ,
  MSG_ISSUE_TAXI_CLEARANCE , MSG_ACKNOWLEDGE_TAXI_CLEARANCE , MSG_HOLD_POSITION , MSG_ACKNOWLEDGE_HOLD_POSITION ,
  MSG_RESUME_TAXI , MSG_ACKNOWLEDGE_RESUME_TAXI , MSG_REPORT_RUNWAY_HOLD_SHORT , MSG_ACKNOWLEDGE_REPORT_RUNWAY_HOLD_SHORT ,
  MSG_CLEARED_FOR_TAKEOFF , MSG_ACKNOWLEDGE_CLEARED_FOR_TAKEOFF , MSG_SWITCH_TOWER_FREQUENCY , MSG_ACKNOWLEDGE_SWITCH_TOWER_FREQUENCY ,
  MSG_ARRIVAL , MSG_ACKNOWLEDGE_ARRIVAL , MSG_HOLD , MSG_ACKNOWLEDGE_HOLD ,
  MSG_CLEARED_TO_LAND , MSG_ACKNOWLEDGE_CLEARED_TO_LAND , MSG_TAXI_PARK , MSG_ACKNOWLEDGE_TAXI_PARK
}
 
enum  AtcMsgDir { ATC_AIR_TO_GROUND , ATC_GROUND_TO_AIR }
 
- Protected Member Functions inherited from FGATCController
std::string formatATCFrequency3_2 (int)
 
std::string genTransponderCode (const std::string &fltRules)
 
bool isUserAircraft (FGAIAircraft *)
 
void clearTrafficControllers ()
 
TrafficVectorIterator searchActiveTraffic (int id) const
 Search activeTraffic vector to find matching id.
 
void eraseDeadTraffic ()
 
- Protected Attributes inherited from FGATCController
bool _isDestroying = false
 
bool initialized
 
bool available
 
time_t lastTransmission
 
TrafficVector activeTraffic
 
std::default_random_engine generator
 
double dt_count
 
osg::Group * group
 
FGAirportDynamicsparent = nullptr
 
SGSharedPtr< AirportGroundRadarairportGroundRadar
 

Detailed Description

Definition at line 40 of file GroundController.hxx.

Constructor & Destructor Documentation

◆ FGGroundController()

FGGroundController::FGGroundController ( FGAirportDynamics * par)

Definition at line 71 of file GroundController.cxx.

◆ ~FGGroundController()

FGGroundController::~FGGroundController ( )

Definition at line 85 of file GroundController.cxx.

Member Function Documentation

◆ addVersion()

void FGGroundController::addVersion ( int v)
inline

Definition at line 83 of file GroundController.hxx.

◆ announcePosition()

void FGGroundController::announcePosition ( int id,
FGAIFlightPlan * intendedRoute,
int currentRoute,
double lat,
double lon,
double hdg,
double spd,
double alt,
double radius,
int leg,
FGAIAircraft * aircraft )
virtual

Implements FGATCController.

Definition at line 99 of file GroundController.cxx.

◆ checkForCircularWaits()

bool FGGroundController::checkForCircularWaits ( int id)

Check whether situations occur where the current aircraft is waiting for itself due to higher order interactions.

A 'circular' wait is a situation where a waits for b, b waits for c, and c waits for a. Ideally each aircraft only waits for one other aircraft, so by tracing through this list of waiting aircraft, we can check if we'd eventually end back at the current aircraft.

Note that we should consider the situation where we are actually checking aircraft d, which is waiting for aircraft a. d is not part of the loop, but is held back by the looping aircraft. If we don't check for that, this function will get stuck into endless loop.

Definition at line 439 of file GroundController.cxx.

◆ exists()

bool FGGroundController::exists ( )
inline

Definition at line 68 of file GroundController.hxx.

◆ getName()

string FGGroundController::getName ( ) const
virtual

Implements FGATCController.

Definition at line 738 of file GroundController.cxx.

◆ getVersion()

int FGGroundController::getVersion ( )
inline

Definition at line 66 of file GroundController.hxx.

◆ handover()

void FGGroundController::handover ( SGSharedPtr< FGTrafficRecord > aiObject,
int leg )
virtual

We share the traffic record much like real life.

It gets handed from one controller to the next.

Parameters
aiObject
leg

Reimplemented from FGATCController.

Definition at line 522 of file GroundController.cxx.

◆ render()

void FGGroundController::render ( bool visible)
virtual

Draw visible taxi routes.

Implements FGATCController.

Definition at line 548 of file GroundController.cxx.

◆ setVersion()

void FGGroundController::setVersion ( int v)
inline

Definition at line 65 of file GroundController.hxx.

◆ update()

void FGGroundController::update ( double dt)
virtual

Implements FGATCController.

Definition at line 742 of file GroundController.cxx.

◆ updateAircraftInformation()

void FGGroundController::updateAircraftInformation ( int id,
SGGeod geod,
double heading,
double speed,
double alt,
double dt )
virtual

The ground network can deal with the following states: 0 = Normal; no action required 1 = "Acknowledge "Hold position 2 = "Acknowledge "Resume taxi".

3 = "Issue TaxiClearance" 4 = Acknowledge Taxi Clearance" 5 = Post acknowlegde taxiclearance: Start taxiing 6 = Report runway 7 = Acknowledge report runway 8 = Switch tower frequency 9 = Acknowledge switch tower frequency

Implements FGATCController.

Definition at line 165 of file GroundController.cxx.


The documentation for this class was generated from the following files: