1
0
Fork 0

Level-D procedures: parse Flytype element

With this, the fly-by / fly-over info from the procedures is exposed
correctly.
This commit is contained in:
James Turner 2014-12-07 12:34:50 +00:00
parent d806b68706
commit 938a180c3d
2 changed files with 11 additions and 2 deletions

View file

@ -69,6 +69,7 @@ void NavdataVisitor::startElement(const char* name, const XMLAttributes &atts)
_speed = 0.0;
_altRestrict = RESTRICT_NONE;
_altitude = 0.0;
_overflightWaypt = false; // default to Fly-by
} else if (tag == "Approach") {
_ident = atts.getValue("Name");
_waypoints.clear();
@ -86,7 +87,7 @@ void NavdataVisitor::startElement(const char* name, const XMLAttributes &atts)
_transition = new Transition(_transIdent, PROCEDURE_RUNWAY_TRANSITION, _procedure);
_transWaypts.clear();
} else {
// nothing here, we warn on unrecognized in endElement
}
}
@ -199,8 +200,11 @@ void NavdataVisitor::endElement(const char* name)
_dmeDistance = atof(_text.c_str());
} else if (tag == "RadialtoIntercept") {
_radial = atof(_text.c_str());
} else if (tag == "Flytype") {
// values are 'Fly-by' and 'Fly-over'
_overflightWaypt = (_text == "Fly-over");
} else {
SG_LOG(SG_IO, SG_INFO, "unrecognized Level-D XML element:" << tag);
}
}
@ -263,6 +267,10 @@ Waypt* NavdataVisitor::buildWaypoint(RouteBase* owner)
wp->setSpeed(_speed, RESTRICT_AT); // or _BELOW?
}
if (_overflightWaypt) {
wp->setFlag(WPT_OVERFLIGHT);
}
return wp;
}

View file

@ -52,6 +52,7 @@ private:
std::string _transIdent;
double _longitude, _latitude, _altitude, _speed;
RouteRestriction _altRestrict;
bool _overflightWaypt;
double _holdRadial; // inbound hold radial, or -1 if radial is 'inbound'
double _holdTD; ///< hold time (seconds) or distance (nm), based on flag below