Skip to content

Commit

Permalink
ILS/MLS DME distance not displayed if RMP tuned
Browse files Browse the repository at this point in the history
  • Loading branch information
juliansebline committed Jun 10, 2022
1 parent c421bd1 commit 06c3c2c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@
- Number
- The current mode of the right radio management panel.

- A32NX_RMP_L_NAV_BUTTON_SELECTED
- Bool
- Whether the NAV push button on the left RMP is pushed or not.

- A32NX_RMP_R_NAV_BUTTON_SELECTED
- Bool
- Whether the NAV push button on the right RMP is pushed or not.

- A32NX_RMP_L_VHF2_STANDBY
- Hz
- The VHF 2 standby frequency for the left RMP.
Expand All @@ -407,6 +415,10 @@
- Hz
- The VHF 3 standby frequency for the right RMP.

- A32NX_RMP_ILS_MLS_TUNED
- Bool
- If the ILS/MLS is tuned via the RMP

- A32NX_TO_CONFIG_FLAPS_ENTERED
- Bool
- True if the pilot has entered a FLAPS value in the PERF TAKE OFF takeoff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,8 @@ class FMCMainDisplay extends BaseAirliners {
} else if (this.ilsFrequency > 0 && SimVar.GetSimVarValue('L:A32NX_RADIO_RECEIVER_LOC_IS_VALID', 'number') === 1) {
course = SimVar.GetSimVarValue('NAV LOCALIZER:3', 'degrees');
}
SimVar.SetSimVarValue('L:A32NX_RMP_ILS_MLS_TUNED', 'boolean', false);

return SimVar.SetSimVarValue('L:A32NX_FM_LS_COURSE', 'number', course);
}

Expand Down
9 changes: 8 additions & 1 deletion src/instruments/src/PFD/LandingSystemIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class LandingSystemInfo extends DisplayComponent<{ bus: EventBus }> {

private dme = 0;

private rmpTuned = false;

private dmeVisibilitySub = Subject.create('hidden');

private destRef = FSComponent.createRef<SVGTextElement>();
Expand Down Expand Up @@ -111,6 +113,11 @@ class LandingSystemInfo extends DisplayComponent<{ bus: EventBus }> {
this.dme = dme;
this.updateContents();
});

sub.on('ilsRMPTuned').whenChanged().handle((rmpTuned) => {
this.rmpTuned = rmpTuned;
this.updateContents();
});
}

private updateContents() {
Expand All @@ -124,7 +131,7 @@ class LandingSystemInfo extends DisplayComponent<{ bus: EventBus }> {

let distLeading = '';
let distTrailing = '';
if (this.hasDme) {
if (this.hasDme && !this.rmpTuned) {
this.dmeVisibilitySub.set('display: inline');
const dist = Math.round(this.dme * 10) / 10;

Expand Down
1 change: 1 addition & 0 deletions src/instruments/src/PFD/instrument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class A32NX_PFD extends BaseInstrument {
this.simVarPublisher.subscribe('targetSpeedManaged');
this.simVarPublisher.subscribe('vfeNext');
this.simVarPublisher.subscribe('ilsCourse');
this.simVarPublisher.subscribe('ilsRMPTuned');
this.simVarPublisher.subscribe('tla1');
this.simVarPublisher.subscribe('tla2');
this.simVarPublisher.subscribe('metricAltToggle');
Expand Down
3 changes: 3 additions & 0 deletions src/instruments/src/PFD/shared/PFDSimvarPublisher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface PFDSimvars {
selectedFpa: number;
vfeNext: number;
ilsCourse: number;
ilsRMPTuned: boolean;
metricAltToggle: boolean;
tla1: number;
tla2: number;
Expand Down Expand Up @@ -190,6 +191,7 @@ export enum PFDVars {
selectedFpa = 'L:A32NX_AUTOPILOT_FPA_SELECTED',
vfeNext = 'L:A32NX_SPEEDS_VFEN',
ilsCourse = 'L:A32NX_FM_LS_COURSE',
ilsRMPTuned = 'L:A32NX_RMP_ILS_MLS_TUNED',
metricAltToggle = 'L:A32NX_METRIC_ALT_TOGGLE',
tla1='L:A32NX_AUTOTHRUST_TLA:1',
tla2='L:A32NX_AUTOTHRUST_TLA:2',
Expand Down Expand Up @@ -306,6 +308,7 @@ export class PFDSimvarPublisher extends SimVarPublisher<PFDSimvars> {
['selectedFpa', { name: PFDVars.selectedFpa, type: SimVarValueType.Degree }],
['vfeNext', { name: PFDVars.vfeNext, type: SimVarValueType.Number }],
['ilsCourse', { name: PFDVars.ilsCourse, type: SimVarValueType.Number }],
['ilsRMPTuned', { name: PFDVars.ilsRMPTuned, type: SimVarValueType.Bool }],
['metricAltToggle', { name: PFDVars.metricAltToggle, type: SimVarValueType.Bool }],
['tla1', { name: PFDVars.tla1, type: SimVarValueType.Number }],
['tla2', { name: PFDVars.tla2, type: SimVarValueType.Number }],
Expand Down
3 changes: 3 additions & 0 deletions src/instruments/src/RMP/Components/NavRadioPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export const NavRadioPanel = (props: Props) => {
} else {
setActive(Avionics.Utils.make_adf_bcd32(standbyHz));
}
if (props.transceiver === TransceiverType.ILS || props.transceiver === TransceiverType.MLS) {
SimVar.SetSimVarValue('L:A32NX_RMP_ILS_MLS_TUNED', 'boolean', true);
}
} else {
setCourse(course);
setMode(Mode.FREQUENCY);
Expand Down

0 comments on commit 06c3c2c

Please sign in to comment.