From c0137d93af2ef988704e46f49325957e30d17cb9 Mon Sep 17 00:00:00 2001 From: daveluff Date: Mon, 22 Sep 2003 23:54:41 +0000 Subject: [PATCH] Return landing type --- src/ATC/AILocalTraffic.cxx | 14 +++++++++++++- src/ATC/AILocalTraffic.hxx | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ATC/AILocalTraffic.cxx b/src/ATC/AILocalTraffic.cxx index bfd67bc07..d052bc5c7 100644 --- a/src/ATC/AILocalTraffic.cxx +++ b/src/ATC/AILocalTraffic.cxx @@ -139,6 +139,7 @@ void FGAILocalTraffic::GetRwyDetails() { } } + /* There are two possible scenarios during initialisation: The first is that the user is flying towards the airport, and hence the traffic @@ -273,6 +274,17 @@ bool FGAILocalTraffic::Init(string ICAO, OperatingState initialState, PatternLeg return(true); } + +// Return what type of landing we're doing on this circuit +LandingType FGAILocalTraffic::GetLandingOption() { + if(circuitsToFly) { + return(touchAndGo ? TOUCH_AND_GO : STOP_AND_GO); + } else { + return(FULL_STOP); + } +} + + // Commands to do something from higher level logic void FGAILocalTraffic::FlyCircuits(int numCircuits, bool tag) { //cout << "FlyCircuits called" << endl; @@ -350,7 +362,7 @@ void FGAILocalTraffic::FlyCircuits(int numCircuits, bool tag) { // Run the internal calculations void FGAILocalTraffic::Update(double dt) { //cout << "A" << flush; - double responseTime = 10.0; // seconds - this should get more sophisticated at some point + //double responseTime = 10.0; // seconds - this should get more sophisticated at some point responseCounter += dt; if((contactTower) && (responseCounter >= 8.0)) { // Acknowledge request before changing frequency so it gets rendered if the user is on the same freq diff --git a/src/ATC/AILocalTraffic.hxx b/src/ATC/AILocalTraffic.hxx index eb8343456..fa8390929 100644 --- a/src/ATC/AILocalTraffic.hxx +++ b/src/ATC/AILocalTraffic.hxx @@ -70,6 +70,9 @@ public: // Go out and practice circuits void FlyCircuits(int numCircuits, bool tag); + // Return what type of landing we're doing on this circuit + LandingType GetLandingOption(); + // TODO - this will get more complex and moved into the main class // body eventually since the position approved to taxi to will have // to be passed. -- 2.39.5