X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2Fatc_mgr.cxx;h=88f527f32347d9b261578bb3efdb46b2d31856e2;hb=e16f772e54216b0088ca9cb3f3b0fb062be8bfdb;hp=d8203552a550e17ab3eceb953252f1f1aaac8928;hpb=493661a2dcd89403559af50d7e1b5004da1b49e4;p=flightgear.git diff --git a/src/ATC/atc_mgr.cxx b/src/ATC/atc_mgr.cxx index d8203552a..88f527f32 100644 --- a/src/ATC/atc_mgr.cxx +++ b/src/ATC/atc_mgr.cxx @@ -29,7 +29,6 @@ #include #include #include - #include "atc_mgr.hxx" @@ -69,7 +68,6 @@ void FGATCManager::init() { double speed = fgGetDouble("/velocities/groundspeed-kt"); double aircraftRadius = 40; // note that this is currently hardcoded to a one-size-fits all JumboJet value. Should change later; - // Next, ai_ac.setCallSign ( callsign ); ai_ac.setLongitude( longitude ); @@ -78,8 +76,19 @@ void FGATCManager::init() { ai_ac.setPerformance("jet_transport"); // NEXT UP: Create a traffic Schedule and fill that with appropriate information. This we can use to flight plannign. - + FGAISchedule *trafficRef = new FGAISchedule; + trafficRef->setFlightType("gate"); + + FGScheduledFlight *flight = new FGScheduledFlight; + flight->setDepartureAirport(airport); + flight->setArrivalAirport(airport); + flight->initializeAirports(); + flight->setFlightRules("IFR"); + flight->setCallSign(callsign); + + trafficRef->assign(flight); FGAIFlightPlan *fp = new FGAIFlightPlan; + ai_ac.setTrafficRef(trafficRef); string flightPlanName = airport + "-" + airport + ".xml"; double cruiseAlt = 100; // Doesn't really matter right now.