]> git.mxchange.org Git - flightgear.git/commitdiff
Report Final to tower control class in addition to displaying it
authorcvsguest <cvsguest>
Thu, 16 Oct 2003 16:06:54 +0000 (16:06 +0000)
committercvsguest <cvsguest>
Thu, 16 Oct 2003 16:06:54 +0000 (16:06 +0000)
src/ATC/AILocalTraffic.cxx

index f9a5669d544bc2369c556bde3b3152367e54e30e..7f3ea81b8580f7e585693ff7a4a99d6a1f1fe591 100644 (file)
@@ -281,6 +281,7 @@ bool FGAILocalTraffic::Init(string ICAO, OperatingState initialState, PatternLeg
 
 // Return what type of landing we're doing on this circuit
 LandingType FGAILocalTraffic::GetLandingOption() {
+       //cout << "circuitsToFly = " << circuitsToFly << '\n';
        if(circuitsToFly) {
                return(touchAndGo ? TOUCH_AND_GO : STOP_AND_GO);
        } else {
@@ -535,6 +536,11 @@ void FGAILocalTraffic::RegisterTransmission(int code) {
                clearedToTakeOff = true;
                SG_LOG(SG_ATC, SG_INFO, "AI local traffic " << plane.callsign << " cleared to take-off...");
                break;
+//     case 13: // Go around!
+//             responseCounter = 0;
+//             goAround = true;
+//             SG_LOG(SG_ATC, SG_INFO, "AI local traffic " << plane.callsign << " told to go-around!!");
+//             break;
        default:
                break;
        }
@@ -607,7 +613,7 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                                        cout << "Turning to crosswind, distance from threshold = " << orthopos.y() << '\n'; 
                                        leg = TURN1;
                                }
-                       } else {
+                       } else if(orthopos.y() > 1500.0) {   // Added this constraint as a hack to prevent turning too early when going around.
                                cout << "Turning to crosswind, distance from threshold = " << orthopos.y() << '\n'; 
                                leg = TURN1;
                        }
@@ -946,6 +952,7 @@ void FGAILocalTraffic::TransmitPatternPositionReport(void) {
                // Fall through to FINAL
        case FINAL:             // maybe this should include long/short final if appropriate?
                trns += "final ";
+               code = 13;
                break;
        default:                // Hopefully this won't be used
                trns += "pattern ";
@@ -962,6 +969,7 @@ void FGAILocalTraffic::TransmitPatternPositionReport(void) {
 }
 
 // Callback handler
+// TODO - Really should enumerate these coded values.
 void FGAILocalTraffic::ProcessCallback(int code) {
        // 1 - Request Departure from ground
        // 10 - report crosswind
@@ -972,6 +980,8 @@ void FGAILocalTraffic::ProcessCallback(int code) {
                ground->RequestDeparture(plane, this);
        } else if(code == 11) {
                tower->ReportDownwind(plane.callsign);
+       } else if(code == 13) {
+               tower->ReportFinal(plane.callsign);
        }
 }