diff --git a/Changelog.txt b/Changelog.txt index 8f8906f..eb4068e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,7 @@ [Changelog v0.15.0] +[!WARNING] +SID evaluation slightly changed due to the bug fixing of restrictions overruling pilot filed SIDs. If you encounter odd or unexpected evaluation results please feel free to report back. + :new: **New Features** * GEN - add crash handling * a .txt file is generated with a small stacktrace showing the line or offset, depending if the pdb file was present at the time of the crash @@ -18,6 +21,7 @@ * CONF - fix crash during coordinate conversion while parsing the .ese file for atc stations and vis points * due to a wrong coordinate in the .ese file the split was wrong and parameters missing - now guarded against * GEN - version check could report newer remote version if minor or patch was newer but major was older +* FPLN - fulfilled restrictions could overwrite "pilot filed only" SIDs, even if it was not filed by the pilot [Changelog v0.14.4] :gear: **Changed Features / Behaviour** @@ -37,7 +41,7 @@ > This Hotfix is only needed if SIDs without any route (no waypoint after the last ':') is present :lady_beetle: **Fixes** -* CONF - added check to not try to retrieve a route from the .ese-file if no route is presend +* CONF - added check to not try to retrieve a route from the .ese-file if no route is present [Changelog v0.14.3] diff --git a/vSIDPlugin.cpp b/vSIDPlugin.cpp index 4bfd189..dc093f6 100644 --- a/vSIDPlugin.cpp +++ b/vSIDPlugin.cpp @@ -327,7 +327,7 @@ vsid::Sid vsid::VSIDPlugin::processSid(EuroScopePlugIn::CFlightPlan& FlightPlan, else if (!currSid.transition.empty() && !currSid.transition.contains(sidWpt)) continue; bool rwyMatch = false; - bool restriction = false; + bool restriction = false; // #evaluate - can probably be removed, tmp unused validEquip = true; @@ -1083,6 +1083,17 @@ vsid::Sid vsid::VSIDPlugin::processSid(EuroScopePlugIn::CFlightPlan& FlightPlan, continue; } + // skip the SID if only accepted as pilot filed but it differs + + if (currSid.pilotfiled && currSid.name() != fplnData.GetSidName()) + { + messageHandler->writeMessage("DEBUG", "[" + callsign + "] Skipping SID \"" + currSid.idName() + + "\" as pilot filed only. Filed SID: " + fplnData.GetSidName(), vsid::MessageHandler::DebugArea::Sid + ); + + continue; + } + // if a SID has the special prio "0" return an empty SID for forced manual selection if (currSid.prio == 0) { @@ -1093,31 +1104,30 @@ vsid::Sid vsid::VSIDPlugin::processSid(EuroScopePlugIn::CFlightPlan& FlightPlan, return vsid::Sid(); } - // if a SID is accepted when filed by a pilot set the SID - if (currSid.pilotfiled && currSid.name() == fplnData.GetSidName() && currSid.prio < prio) - { - setSid = currSid; - prio = currSid.prio; - } - else if (currSid.pilotfiled) messageHandler->writeMessage("DEBUG", "[" + callsign + "] Ignoring SID \"" + currSid.idName() + - "\" because it is only accepted as pilot filed and the prio is higher or the filed SID was another", - vsid::MessageHandler::DebugArea::Sid - ); - if (currSid.prio < prio && (setSid.pilotfiled == currSid.pilotfiled || restriction)) + if (currSid.prio == 99) { - setSid = currSid; - prio = currSid.prio; + messageHandler->writeMessage("DEBUG", "[" + callsign + "] Skipping SID \"" + currSid.idName() + + "\" because prio is 99 (manual only SID)", + vsid::MessageHandler::DebugArea::Sid); + + continue; } - else if (currSid.prio == 99) + + if (currSid.prio > prio) { messageHandler->writeMessage("DEBUG", "[" + callsign + "] Skipping SID \"" + currSid.idName() + - "\" because prio is 99 (manual only SID)", + "\" because prio is higher", vsid::MessageHandler::DebugArea::Sid); + + continue; } - else messageHandler->writeMessage("DEBUG", "[" + callsign + "] Skipping SID \"" + currSid.idName() + - "\" because prio is higher", - vsid::MessageHandler::DebugArea::Sid); + + // update SID if a better prio is found for non-pilot filed SIDs + + setSid = currSid; + prio = currSid.prio; } + messageHandler->writeMessage("DEBUG", "[" + callsign + "] Setting SID \"" + setSid.idName() + "\"", vsid::MessageHandler::DebugArea::Sid); // if the last valid SID fails due to equipment return a special "EQUIP" sid to also handle yet unprocessed fplns