#include <iostream>
#include <simgear/route/waypoint.hxx>
-#include <Navaids/awynet.hxx>
+#include <Airports/simple.hxx>
#include <Airports/runways.hxx>
#include <Airports/dynamics.hxx>
using std::iostream;
+/*
void FGAIFlightPlan::evaluateRoutePart(double deplat,
double deplon,
double arrlat,
}
}
-
+*/
/*
void FGAIFlightPlan::createCruise(bool firstFlight, FGAirport *dep,
FGAirport *arr, double latitude,
* Note that this is the original version that does not
* do any dynamic route computation.
******************************************************************/
-void FGAIFlightPlan::createCruise(FGAIAircraft *ac, bool firstFlight, FGAirport *dep,
+bool FGAIFlightPlan::createCruise(FGAIAircraft *ac, bool firstFlight, FGAirport *dep,
FGAirport *arr, double latitude,
double longitude, double speed,
double alt, const string& fltType)
{
double vCruise = ac->getPerformance()->vCruise();
- waypoint *wpt;
+ FGAIWaypoint *wpt;
wpt = createInAir(ac, "Cruise", SGGeod::fromDeg(longitude, latitude), alt, vCruise);
waypoints.push_back(wpt);
string rwyClass = getRunwayClassFromTrafficType(fltType);
double heading = ac->getTrafficRef()->getCourse();
arr->getDynamics()->getActiveRunway(rwyClass, 2, activeRunway, heading);
- rwy = arr->getRunwayByIdent(activeRunway);
+ FGRunway* rwy = arr->getRunwayByIdent(activeRunway);
+ assert( rwy != NULL );
// begin descent 110km out
- SGGeod beginDescentPoint = rwy->pointOnCenterline(-110000);
+ SGGeod beginDescentPoint = rwy->pointOnCenterline(0);
+ SGGeod secondaryDescentPoint = rwy->pointOnCenterline(-10000);
- wpt = createInAir(ac, "BOD", beginDescentPoint, alt, vCruise);
+ wpt = createInAir(ac, "BOD", beginDescentPoint, alt, vCruise);
+ waypoints.push_back(wpt);
+ wpt = createInAir(ac, "BOD2", secondaryDescentPoint, alt, vCruise);
waypoints.push_back(wpt);
+ return true;
}