Skip to content

Commit

Permalink
fix(fm): ils auto-selection robustness (#8080)
Browse files Browse the repository at this point in the history
* fix(fm): improve ils selection robustness

* fix(fm): fix criteria for rendering selected navaid
  • Loading branch information
tracernz committed Jun 22, 2023
1 parent 815d33a commit 0b052f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
1. [LIGHTS] Fixed trim decal emissive and floods - @FinalLightNL (FinalLight#2113)
1. [EFB] Fixed Simbridge failing to connect if remote setting is enabled then disabled - @DevonDF (Devon#9451)
1. [SIM] fix(sim): only shown nav radio tip once @tracernz (Mike)
1. [FMS] Improved robustness of ILS selection - @tracernz (Mike)

## 0.10.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CDUSelectedNavaids {
const selectedNavaids = mcdu.getSelectedNavaids();

for (const [i, navaid] of selectedNavaids.entries()) {
if (navaid.frequency === null) {
if (navaid.frequency < 1) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ export class LandingSystemSelectionManager {
await this.selectDepartureIls();
} else if (phase >= FmgcFlightPhase.Descent) {
await this.selectApproachIls();
} else if (this.pposValid) {
} else if (this.pposValid && phase >= FmgcFlightPhase.Cruise) {
const destination = this.fpm.getDestination(FlightPlans.Active);
if (destination && distanceTo(this.ppos, destination.infos.coordinates) <= LandingSystemSelectionManager.DESTINATION_TUNING_DISTANCE) {
await this.selectApproachIls();
} else if (this._selectedIls !== null) {
this.resetSelectedIls();
}
} else if (this._selectedIls !== null) {
this.resetSelectedIls();
}
} catch (e) {
console.error('Failed to select ILS', e);
Expand Down Expand Up @@ -117,8 +121,8 @@ export class LandingSystemSelectionManager {
const airport = this.fpm.getDestination(FlightPlans.Active);
const approach = this.fpm.getApproach(FlightPlans.Active);

if (this.isTunableApproach(approach?.approachType) && this.setIlsFromApproach(airport, approach, true)) {
return true;
if (this.isTunableApproach(approach?.approachType)) {
return this.setIlsFromApproach(airport, approach, true);
}

// if we got here there wasn't a suitable ILS
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/fmgc/src/navigation/NavaidTuner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export class NavaidTuner {
for (const [i, mmr] of this.mmrTuningStatus.entries()) {
const autoFacility = this.landingSystemSelectionManager.selectedIls ?? undefined;
const autoCourse = this.landingSystemSelectionManager.selectedLocCourse;
if (!mmr.manual && mmr.facility?.icao !== autoFacility?.icao && autoCourse !== null) {
if (!mmr.manual && mmr.facility?.icao !== autoFacility?.icao && (autoCourse !== null || autoFacility === undefined)) {
mmr.databaseCourse = autoCourse;
mmr.databaseBackcourse = this.landingSystemSelectionManager.selectedApprBackcourse;
mmr.course = mmr.databaseCourse;
Expand Down

0 comments on commit 0b052f2

Please sign in to comment.