"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Navaids/FlightPlan.cxx" between
flightgear-2020.1.1.tar.bz2 and flightgear-2020.1.2.tar.bz2

About: FlightGear is a multi-platform, cooperative flight simulator development project.

FlightPlan.cxx  (flightgear-2020.1.1.tar.bz2):FlightPlan.cxx  (flightgear-2020.1.2.tar.bz2)
skipping to change at line 768 skipping to change at line 768
auto leg = _legs.at(i); auto leg = _legs.at(i);
Waypt* wpt = leg->waypoint(); Waypt* wpt = leg->waypoint();
auto legNode = routeNode->getChild("wp", i, true); auto legNode = routeNode->getChild("wp", i, true);
wpt->saveAsNode(legNode); wpt->saveAsNode(legNode);
leg->writeToProperties(legNode); leg->writeToProperties(legNode);
} // of waypoint iteration } // of waypoint iteration
} }
bool FlightPlan::load(const SGPath& path) bool FlightPlan::load(const SGPath& path)
{ {
if (!path.exists()) if (!path.exists()) {
{ SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << path
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << path << "'. The file does not exist.");
<< "'. The file does not exist."); return false;
return false; }
}
SG_LOG(SG_NAVAID, SG_INFO, "going to read flight-plan from:" << path);
SG_LOG(SG_NAVAID, SG_INFO, "going to read flight-plan from:" << path);
bool Status = false;
bool Status = false; lockDelegates();
lockDelegates();
// try different file formats
// try different file formats if (loadGpxFormat(path)) { // GPX format
if (loadGpxFormat(path)) // GPX format _arrivalChanged = true;
Status = true; _departureChanged = true;
else Status = true;
if (loadXmlFormat(path)) // XML property data } else if (loadXmlFormat(path)) { // XML property data
Status = true; // we don't want to re-compute the arrival / departure after
else // a load, since we assume the flight-plan had it specified already
if (loadPlainTextFormat(path)) // simple textual list of waypoints // especially, the XML might have a SID/STAR embedded, which we don't
Status = true; // want to lose
_arrivalChanged = false;
if (Status == true) { _departureChanged = false;
setIdent(path.file_base()); Status = true;
} } else if (loadPlainTextFormat(path)) { // simple textual list of waypoints
_arrivalChanged = true;
// mark data as unchanged since this is a clean plan _departureChanged = true;
_arrivalChanged = false; Status = true;
_departureChanged = false; }
_cruiseDataChanged = true;
_waypointsChanged = true; if (Status == true) {
unlockDelegates(); setIdent(path.file_base());
}
_cruiseDataChanged = true;
_waypointsChanged = true;
unlockDelegates();
return Status; return Status;
} }
bool FlightPlan::load(std::istream &stream) bool FlightPlan::load(std::istream &stream)
{ {
SGPropertyNode_ptr routeData(new SGPropertyNode); SGPropertyNode_ptr routeData(new SGPropertyNode);
try { try {
readProperties(stream, routeData); readProperties(stream, routeData);
} catch (sg_exception& e) { } catch (sg_exception& e) {
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << e.getOrigi n() SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << e.getOrigi n()
<< "'. " << e.getMessage()); << "'. " << e.getMessage());
 End of changes. 2 change blocks. 
33 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)