X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fsidstar.cxx;h=af7a020c958de0b769908283f9b7e878c17ab7db;hb=e7dec994b80c409f59e6fafaeee57c5a98181c4a;hp=6566e23d851fdc491328f7c8003e27bf44e50463;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/Airports/sidstar.cxx b/src/Airports/sidstar.cxx index 6566e23d8..af7a020c9 100644 --- a/src/Airports/sidstar.cxx +++ b/src/Airports/sidstar.cxx @@ -28,15 +28,14 @@ #include #include - - -#include - +#include +#include #include "sidstar.hxx" using std::cerr; using std::endl; +using std::string; FGSidStar::FGSidStar(FGAirport *ap) { id = ap->getId(); @@ -46,7 +45,6 @@ FGSidStar::FGSidStar(FGAirport *ap) { FGSidStar::FGSidStar(const FGSidStar &other) { cerr << "TODO" << endl; - exit(1); } void FGSidStar::load(SGPath filename) { @@ -73,23 +71,25 @@ void FGSidStar::load(SGPath filename) { fp->setName(name); SGPropertyNode * wpts_node = fpl_node->getNode("wpts"); for (int j = 0; j < wpts_node->nChildren(); j++) { - FGAIFlightPlan::waypoint* wpt = new FGAIFlightPlan::waypoint; + FGAIWaypoint* wpt = new FGAIWaypoint; SGPropertyNode * wpt_node = wpts_node->getChild(j); //cerr << "Reading waypoint " << j << wpt_node->getStringValue("name", "END") << endl; - wpt->name = wpt_node->getStringValue("name", "END"); - wpt->latitude = wpt_node->getDoubleValue("lat", 0); - wpt->longitude = wpt_node->getDoubleValue("lon", 0); - wpt->altitude = wpt_node->getDoubleValue("alt", 0); - wpt->speed = wpt_node->getDoubleValue("ktas", 0); - wpt->crossat = wpt_node->getDoubleValue("crossat", -10000); - wpt->gear_down = wpt_node->getBoolValue("gear-down", false); - wpt->flaps_down= wpt_node->getBoolValue("flaps-down", false); - wpt->on_ground = wpt_node->getBoolValue("on-ground", false); - wpt->time_sec = wpt_node->getDoubleValue("time-sec", 0); - wpt->time = wpt_node->getStringValue("time", ""); - - if (wpt->name == "END") wpt->finished = true; - else wpt->finished = false; + wpt->setName (wpt_node->getStringValue("name", "END")); + wpt->setLatitude (wpt_node->getDoubleValue("lat", 0)); + wpt->setLongitude (wpt_node->getDoubleValue("lon", 0)); + wpt->setAltitude (wpt_node->getDoubleValue("alt", 0)); + wpt->setSpeed (wpt_node->getDoubleValue("ktas", 0)); + wpt->setCrossat (wpt_node->getDoubleValue("crossat", -10000)); + wpt->setGear_down (wpt_node->getBoolValue("gear-down", false)); + wpt->setFlaps_down (wpt_node->getBoolValue("flaps-down", false)); + wpt->setOn_ground (wpt_node->getBoolValue("on-ground", false)); + wpt->setTime_sec (wpt_node->getDoubleValue("time-sec", 0)); + wpt->setTime (wpt_node->getStringValue("time", "")); + + if (wpt->contains("END")) + wpt->setFinished(true); + else + wpt->setFinished(false); // fp->addWaypoint( wpt ); @@ -117,4 +117,4 @@ FGAIFlightPlan *FGSidStar::getBest(string activeRunway, double heading) } else { return 0; } -} \ No newline at end of file +}