1
0
Fork 0

Arrival procedure routing fixes

Deal with some cases in STAR -> approach routing better:

- when the IAF is the initial wpt of the approach primary sequence, 
  just accept this instead of warning. This is common in some XML
  files from Navigraph, for example EDDF

- don’t duplicate the IAF into the wpts returned by Approach::route
This commit is contained in:
James Turner 2019-06-24 16:37:56 +01:00
parent 0d8d2addcf
commit 4905aa255c

View file

@ -104,10 +104,9 @@ void Approach::addTransition(Transition* aTrans)
bool Approach::route(WayptRef aIAF, WayptVec& aWps)
{
if (aIAF.valid()) {
WptTransitionMap::iterator it;
bool haveTrans = false;
for (it = _transitions.begin(); it != _transitions.end(); ++it) {
Transition* t= it->second;
for (auto te : _transitions) {
auto t = te.second;
if (t->enroute()->matches(aIAF)) {
t->route(aWps);
haveTrans = true;
@ -116,13 +115,28 @@ bool Approach::route(WayptRef aIAF, WayptVec& aWps)
} // of transitions iteration
if (!haveTrans) {
SG_LOG(SG_NAVAID, SG_INFO, "approach " << ident() << " has no transition " <<
"for IAF: " << aIAF->ident());
return false;
if (_primary.front()->matches(aIAF)) {
// direct IAF on the approach, no transition is needed
} else {
// we couldn't find the IAF at the front of any obvious thing - either
// the primary waypoints or any transition we have defined.
// warn and just use the primary waypoints down below
SG_LOG(SG_NAVAID, SG_INFO, "approach " << ident() << " has no transition " <<
"for IAF: " << aIAF->ident());
return false;
}
}
}
return routeFromVectors(aWps);
bool ok = routeFromVectors(aWps);
if (ok && !aWps.empty() && aIAF.valid() && aWps.front()->matches(aIAF)) {
// don't duplicate the IAF into the route we return. This avoids a
// duplicated waypt between the end of a STAR and the approach
aWps.erase(aWps.begin());
}
return ok;
}
bool Approach::routeFromVectors(WayptVec& aWps)