Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rmp): RMP navigation tuning #7241

Merged
merged 101 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from 100 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
6a57e41
fix: RMP behavior and lights [issue 344]
juliansebline Apr 24, 2022
f019154
Update src/instruments/src/EWD/elements/PseudoFWC.tsx
juliansebline Apr 27, 2022
a0e4100
Update src/instruments/src/Common/EWDMessages.tsx
juliansebline Apr 28, 2022
6afb3ad
Update src/instruments/src/EWD/elements/PseudoFWC.tsx
juliansebline Apr 28, 2022
17de4ef
Update src/instruments/src/EWD/elements/PseudoFWC.tsx
juliansebline Apr 28, 2022
9789fdf
Update RadioPanelDisplay.tsx
juliansebline Apr 28, 2022
f3402d3
Fix bug with ANN LT involved
juliansebline Apr 28, 2022
ee6a67d
Added comments about commented out code
juliansebline Apr 28, 2022
8f8791a
Fix RMPs elec buses
juliansebline Apr 29, 2022
8af8c8a
add of SEL word backlight
juliansebline Apr 29, 2022
ba3aba3
Default init of transmit and volume buttons
juliansebline Apr 29, 2022
ed0e999
fix SEL light behavior
juliansebline May 19, 2022
e6d657b
fix SEL light behavior #2
juliansebline May 19, 2022
6e58fd6
Removal of commented out code
juliansebline May 19, 2022
a76d2d7
SEL backlight code
juliansebline May 23, 2022
24bb47c
VOR, ILS, ADF tunable. MLS missing. Logic with NAV button
juliansebline May 26, 2022
e448cc6
Add of files
juliansebline May 26, 2022
75dcc4a
ILS standby frequency to active
juliansebline May 26, 2022
14eea81
Instruments knobs are now pushable
juliansebline May 26, 2022
d2b5bf2
VORs ident
juliansebline May 30, 2022
50e18af
Fix due to double comment in the xml
juliansebline May 31, 2022
af631b6
MKR ident
juliansebline May 31, 2022
6e44efd
ADF ident
juliansebline Jun 1, 2022
b348e4c
RADNAV page blank once NAV button pushed
juliansebline Jun 2, 2022
d59dfdf
AUTO/MAN/RMP status in Navaids page
juliansebline Jun 2, 2022
d906877
Fix switch between NAV backup and radio tuning
juliansebline Jun 3, 2022
3394219
VOICE button
juliansebline Jun 3, 2022
e5b07f6
fix: inhibit auto-tuning
tracernz Jun 4, 2022
a0939a5
Changelog
juliansebline Jun 7, 2022
a3a20c6
Changelog
juliansebline Jun 7, 2022
0a0d67a
NAV 1/2 ADF 1 default volume set to 0
juliansebline Jun 7, 2022
bf0c169
Merge branch 'RMP_Navigation_tuning' of https://github.com/juliansebl…
juliansebline Jun 7, 2022
b34e17c
NAV 3/4 ADF 2 (not existing yet) default volume set to 0
juliansebline Jun 7, 2022
e142e91
Merge branch 'flybywiresim:master' into master
juliansebline Jun 9, 2022
c421bd1
Fix ILS and default values
juliansebline Jun 10, 2022
06c3c2c
ILS/MLS DME distance not displayed if RMP tuned
juliansebline Jun 10, 2022
f801b65
Display of M/R if manual/rmp tuned
juliansebline Jun 11, 2022
ec363f6
Display of M/R if manual/rmp tuned
juliansebline Jun 11, 2022
888d1d1
Revert "Display of M/R if manual/rmp tuned"
juliansebline Jun 11, 2022
0dc47e9
Reset of all nav frequencies when RMP tuning is cancelled
juliansebline Jun 12, 2022
80dd31e
Removal of MLS + somes fixes for ADF and tuning based on real life
juliansebline Jun 13, 2022
55b6004
Change of default course value
juliansebline Jun 13, 2022
dd8f896
Removal of useless code
juliansebline Jun 13, 2022
0297842
Fix of display flickering when switching between ADF and VOR/ILS
juliansebline Jun 13, 2022
ad831b5
ILS/MLS volume knobs + fix
juliansebline Jun 14, 2022
11454a5
Management greatest volume within pair of knobs
juliansebline Jun 15, 2022
7dd44c1
Fix previous commit
juliansebline Jun 18, 2022
556f5ac
Fix previous commit
juliansebline Jun 18, 2022
5305900
Revert "Revert commit by mistake"
juliansebline Jun 18, 2022
0623f6a
Removal of useless newlines
juliansebline Jun 19, 2022
ce2c9fa
Table separator
juliansebline Jun 19, 2022
198dcbe
Merge similar simvars as requested
juliansebline Jun 19, 2022
5519238
French tooltips for knobs and voice button
juliansebline Jun 19, 2022
ec4d53e
Use of default tooltips + update homemade ones + english tooltips
juliansebline Jun 20, 2022
d61e0d5
Use of default tooltips + update homemade ones + english tooltips
juliansebline Jun 20, 2022
f790259
Revert "Revert commit pushed my mistake"
juliansebline Jun 20, 2022
1773caa
Dim light
juliansebline Jun 20, 2022
65035f2
ILS tunable only if both RMPs in nav backup mode. FCOM compliant
juliansebline Jun 20, 2022
f3114c0
Back to frequency mode when switching between receivers
juliansebline Jun 20, 2022
adcb7bf
Fix for vPilot
juliansebline Jun 20, 2022
788b2c7
Merge branch 'master' into RMP_fix_behavior_lights
juliansebline Jun 21, 2022
6ca2452
Merge pull request #1 from juliansebline/RMP_fix_behavior_lights
juliansebline Jun 21, 2022
3ca5d90
Merge remote-tracking branch 'upstream/master'
juliansebline Jun 21, 2022
fceb12c
Merge branch 'RMP_Navigation_tuning'
juliansebline Jun 21, 2022
72b2573
Changelog update
juliansebline Jun 21, 2022
f44dca6
Changelog from 0.4.0 to 0.9.0 as requested
juliansebline Jun 22, 2022
776a28f
Merge branch 'flybywiresim:master' into master
juliansebline Jun 23, 2022
6d1d970
Merge branch 'flybywiresim:master' into master
juliansebline Jul 23, 2022
c4b2726
Merge branch 'flybywiresim:master' into master
juliansebline Jul 24, 2022
b71ebfb
Merge branch 'flybywiresim:master' into master
juliansebline Aug 2, 2022
5775465
Merge branch 'master' into RMP_fix_behavior_lights
Saschl Aug 3, 2022
20560ad
Fix COM3 Transmit + it is now possible to transmit on no COM
juliansebline Aug 3, 2022
77833af
Merge branch 'RMP_fix_behavior_lights' of https://github.com/julianse…
juliansebline Aug 3, 2022
08f7009
Fix knob animation
juliansebline Aug 7, 2022
b21b690
Merge branch 'RMP_fix_behavior_lights'
juliansebline Aug 7, 2022
6c911a8
Revert "Merge branch 'RMP_fix_behavior_lights'"
juliansebline Aug 7, 2022
64e45b4
Reorder Changelog
juliansebline Aug 7, 2022
f24083d
Fix simvars when switching between CALLS p/b
juliansebline Aug 8, 2022
c400705
Comment
juliansebline Aug 8, 2022
0f9886f
MLS disabled
juliansebline Aug 9, 2022
67f67c3
Merge branch 'RMP_fix_behavior_lights'
juliansebline Aug 9, 2022
d9c48b0
Merge branch 'master' into RMP_Navigation_tuning
juliansebline Aug 9, 2022
b70b02d
Merge branch 'master' of https://github.com/juliansebline/a32nx
juliansebline Aug 9, 2022
d373efe
Fix bad merge
juliansebline Aug 9, 2022
806037a
Fix bad merge
juliansebline Aug 9, 2022
ddd4eef
A32NX_RMP_ILS_MLS_TUNED to A32NX_RMP_ILS_TUNED
juliansebline Aug 12, 2022
efa5a9d
Update a320-simvars.md
Benjozork Aug 14, 2022
6d43900
Fix for vPilot
juliansebline Sep 3, 2022
fa714cd
Comment
juliansebline Sep 3, 2022
313c993
Inhibit at low altitude
juliansebline Sep 3, 2022
492c168
Knobs lights
juliansebline Sep 3, 2022
334af11
Merge branch 'master' into RMP_Navigation_tuning
juliansebline Sep 4, 2022
984662b
Revert on Rust files due to bad merge
juliansebline Sep 4, 2022
cda7a8d
Copy changelog from master and add of my line
juliansebline Sep 4, 2022
a9e5bf5
Fix ILS tuning
juliansebline Sep 14, 2022
18c9465
Comment
juliansebline Sep 15, 2022
b4be06b
Comment
juliansebline Sep 15, 2022
fd42302
Fix knobs lit when cold & dark
juliansebline Sep 16, 2022
494aa9f
Merge branch 'master' into RMP_Navigation_tuning
Saschl Nov 8, 2022
4ae7617
Merge branch 'master' into RMP_Navigation_tuning
Saschl Dec 15, 2022
08526cf
Merge branch 'master' into RMP_Navigation_tuning
Saschl Dec 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
1. [FMGC] Show proper transition names and final approach slope from AAU1 - @tracernz (Mike)
1. [FMGC] Don't accept blank input or / for hold distance - @tracernz (Mike)
1. [ATSU] Fix LSK6L not returning to ATSU DATALINK page in ATC MENU - @BravoMike99 (Bruno_pt99#5802)
1. [RMP] RMPs navigation backup - Julian Sebline (Julian Sebline#8476 on Discord)

## 0.9.0

Expand Down
49 changes: 49 additions & 0 deletions docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@
- Number
- The current mode of the right radio management panel.

- A32NX_RMP_{L,R}_NAV_BUTTON_SELECTED
- Bool
- Whether the NAV push button on the corresponding RMP is pushed or not.

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

- A32NX_RMP_{L,R}_SAVED_ACTIVE_FREQUENCY_VOR
- Hz
- The VOR active frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_ACTIVE_FREQUENCY_ILS
- Hz
- The ILS active frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_ACTIVE_FREQUENCY_ADF
- Hz
- The ADF active frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_STANDBY_FREQUENCY_VOR
- Hz
- The VOR standby frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_STANDBY_FREQUENCY_ILS
- Hz
- The ILS standby frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_STANDBY_FREQUENCY_ADF
- Hz
- The ADF standby frequency that is saved for display for the left/right RMP.

- A32NX_RMP_{L,R}_SAVED_COURSE_VOR
- Number
- The VOR course tuned via the left/right RMP

- A32NX_RMP_{L,R}_SAVED_COURSE_ILS
- Number
- The ILS course tuned via the left/right RMP

- A32NX_RMP_ILS_TUNED
- Bool
- If the ILS 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 Expand Up @@ -1031,6 +1071,15 @@
GOAROUND | 6
DONE | 7

- A32NX_FMGC_RADIONAV_TUNING_MODE
- Enum
- Hold the FMGCs current tuning mode
Value | Meaning
juliansebline marked this conversation as resolved.
Show resolved Hide resolved
--- | ---
0 | AUTO
1 | MANUAL
2 | REMOTE VIA RMPs

- A32NX_FLAPS_HANDLE_INDEX
- Number
- Indicates the physical flaps handle position
Expand Down
339 changes: 337 additions & 2 deletions flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/AirlinerCommon.xml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions flybywire-aircraft-a320-neo/en-US.locPak
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_PFD_INCREASE": "Increase left PFD brightness",
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_R_PFD_DECREASE": "Decrease right PFD brightness",
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_R_PFD_INCREASE": "Increase right PFD brightness",
"COCKPIT.TOOLTIPS.NAV_PUSHBUTTON_VOICE_OFF": "Allow morse ident",
"COCKPIT.TOOLTIPS.NAV_PUSHBUTTON_VOICE_ON": "Inhibit morse ident",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_VOLUME_INCREASE": "Increase the volume of the ident of the Markers beacons",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_VOLUME_DECREASE": "Decrease the volume of the ident of the Markers beacons",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_IDENT_ENABLE": "Turn on the ident of the Markers beacons",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_IDENT_DISABLE": "Turn off the ident of the Markers beacons",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_VOLUME_INCREASE": "Increase the volume of the ident of the ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_VOLUME_DECREASE": "Decrease the volume of the ident of the ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_IDENT_ENABLE": "Turn on the ident of the ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_IDENT_DISABLE": "Turn off the ident of the ILS",
"COCKPIT.TOOLTIPS.LIGHTS_NOSMOKE_AUTO": "Set \"no smoke\" prompt light to AUTO",
"COCKPIT.TOOLTIPS.APU_AVAILABLE": "APU available",
"A32NX.LOADING.TIPS.A320NEO_001": "The FlyByWire A32NX is a collaboration between hundreds of individual contributors.",
Expand Down
10 changes: 10 additions & 0 deletions flybywire-aircraft-a320-neo/fr-FR.locPak
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_PFD_INCREASE": "Augmenter la luminosité du PFD gauche",
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_R_PFD_DECREASE": "Réduire la luminosité du PDF droit",
"COCKPIT.TOOLTIPS.LIGHTING_KNOB_R_PFD_INCREASE": "Augmenter la luminosité du PDF droit",
"COCKPIT.TOOLTIPS.NAV_PUSHBUTTON_VOICE_OFF": "Autoriser l'identification morse",
"COCKPIT.TOOLTIPS.NAV_PUSHBUTTON_VOICE_ON": "Inhiber l'identification morse",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_VOLUME_INCREASE": "Augmenter le volume de l'identification des balises Markers",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_VOLUME_DECREASE": "Diminuer le volume de l'identification des balises Marker",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_IDENT_ENABLE": "Activer l'identification des balises Markers",
"COCKPIT.TOOLTIPS.NAV_KNOB_MARKERS_IDENT_DISABLE": "Désactiver l'identification des balises Markers",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_VOLUME_INCREASE": "Augmenter le volume de l'identification de l'ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_VOLUME_DECREASE": "Diminuer le volume de l'identification de l'ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_IDENT_ENABLE": "Activer l'identification de l'ILS",
"COCKPIT.TOOLTIPS.NAV_KNOB_ILS_IDENT_DISABLE": "Désactiver l'identification de l'ILS",
"COCKPIT.TOOLTIPS.LIGHTS_NOSMOKE_AUTO": "Mettre le témoin d'interdiction de fumer en mode AUTO",
"A32NX.LOADING.TIPS.A320NEO_001": "Le FlyByWire A32NX est le fruit d'une collaboration entre des centaines de contributeurs individuels.",
"A32NX.LOADING.TIPS.A320NEO_002": "Le saviez-vous ? L'A320 peut atterrir par vent de travers jusqu'à 38 nœuds et avec un vent arrière jusqu'à 15 nœuds !",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ class CDUNavRadioPage {
mcdu.returnPageCallback = () => {
CDUNavRadioPage.ShowPage(mcdu);
};

const radioOn = mcdu.isRadioNavActive();
let vor1FrequencyCell = "";
let vor1CourseCell = "";
let ilsFrequencyCell = "";
let ilsCourseCell = "[ ]";
let ilsCourseCell = "";
let adf1FrequencyCell = "";
let adf1BfoOption = "";
let vor2FrequencyCell = "";
Expand All @@ -29,15 +30,24 @@ class CDUNavRadioPage {
}, mcdu.PageTimeout.Default);

if (!radioOn) {
vor1FrequencyCell = "[\xa0]/[\xa0\xa0.\xa0]";
const vor1Beacon = mcdu.radioNav.getVORBeacon(1);
const vor1Ident = vor1Beacon && vor1Beacon.ident.length >= 2 && vor1Beacon.ident.length <= 3 ? vor1Beacon.ident : "";
if (mcdu.vor1Frequency && !mcdu.vor1IdIsPilotEntered && mcdu.vor1FreqIsPilotEntered) {
vor1FrequencyCell = "{small}" + vor1Ident.padStart(3, "\xa0") + "{end}" + "/" + mcdu.vor1Frequency.toFixed(2);
} else if (mcdu.vor1Frequency && mcdu.vor1IdIsPilotEntered && !mcdu.vor1FreqIsPilotEntered) {
vor1FrequencyCell = mcdu.vor1IdPilotValue.padStart(3, "\xa0") + "/" + "{small}" + mcdu.vor1Frequency.toFixed(2) + "{end}";
if (!mcdu.backupNavTuning) {
vor1FrequencyCell = "[\xa0]/[\xa0\xa0.\xa0]";
const vor1Beacon = mcdu.radioNav.getVORBeacon(1);
const vor1Ident = vor1Beacon && vor1Beacon.ident.length >= 2 && vor1Beacon.ident.length <= 3 ? vor1Beacon.ident : "";
if (mcdu.vor1Frequency && !mcdu.vor1IdIsPilotEntered && mcdu.vor1FreqIsPilotEntered) {
vor1FrequencyCell = "{small}" + vor1Ident.padStart(3, "\xa0") + "{end}" + "/" + mcdu.vor1Frequency.toFixed(2);
} else if (mcdu.vor1Frequency && mcdu.vor1IdIsPilotEntered && !mcdu.vor1FreqIsPilotEntered) {
vor1FrequencyCell = mcdu.vor1IdPilotValue.padStart(3, "\xa0") + "/" + "{small}" + mcdu.vor1Frequency.toFixed(2) + "{end}";
}
}

mcdu.onLeftInput[0] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (value === FMCMainDisplay.clrValue) {
mcdu.vor1FreqIsPilotEntered = false;
Expand Down Expand Up @@ -97,11 +107,19 @@ class CDUNavRadioPage {
scratchpadCallback();
}
};
vor1CourseCell = "[\xa0]";
if (mcdu.vor1Course > 0) {
vor1CourseCell = mcdu.vor1Course.toFixed(0).padStart(3, "0");
if (!mcdu.backupNavTuning) {
vor1CourseCell = "[\xa0]";
if (mcdu.vor1Course > 0) {
vor1CourseCell = mcdu.vor1Course.toFixed(0).padStart(3, "0");
}
}
mcdu.onLeftInput[1] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (isFinite(numValue) && numValue > 0 && numValue <= 360) {
SimVar.SetSimVarValue("K:VOR1_SET", "number", numValue).then(() => {
Expand All @@ -118,26 +136,31 @@ class CDUNavRadioPage {
scratchpadCallback();
}
};
ilsFrequencyCell = "[\xa0\xa0]/[\xa0\xa0.\xa0]";
if (mcdu.ilsFrequency != 0) {
if (mcdu._ilsFrequencyPilotEntered) {
const ilsIdent = mcdu.radioNav.getILSBeacon(1);
ilsFrequencyCell = `{small}${ilsIdent.ident.trim().padStart(4, "\xa0")}{end}/${mcdu.ilsFrequency.toFixed(2)}`;
} else if (mcdu._ilsIdentPilotEntered) {
ilsFrequencyCell = `${mcdu._ilsIdent.trim().padStart(4, "\xa0")}/{small}${mcdu.ilsFrequency.toFixed(2)}{end}`;
} else if (mcdu.ilsAutoTuned) {
ilsFrequencyCell = `{small}${mcdu.ilsAutoIdent.padStart(4, "\xa0")}/${mcdu.ilsFrequency.toFixed(2)}{end}`;
}

const lsCourse = SimVar.GetSimVarValue('L:A32NX_FM_LS_COURSE', 'number');
if (lsCourse >= 0) {
ilsCourseCell = `{${mcdu.ilsCourse !== undefined ? 'big' : 'small'}}F${lsCourse.toFixed(0).padStart(3, "0")}{end}`;
} else if (mcdu._ilsFrequencyPilotEntered) {
ilsCourseCell = "{amber}____{end}";
if (!mcdu.backupNavTuning) {
ilsFrequencyCell = "[\xa0\xa0]/[\xa0\xa0.\xa0]";
if (mcdu.ilsFrequency != 0) {
if (mcdu._ilsFrequencyPilotEntered) {
const ilsIdent = mcdu.radioNav.getILSBeacon(1);
ilsFrequencyCell = `{small}${ilsIdent.ident.trim().padStart(4, "\xa0")}{end}/${mcdu.ilsFrequency.toFixed(2)}`;
} else if (mcdu._ilsIdentPilotEntered) {
ilsFrequencyCell = `${mcdu._ilsIdent.trim().padStart(4, "\xa0")}/{small}${mcdu.ilsFrequency.toFixed(2)}{end}`;
} else if (mcdu.ilsAutoTuned) {
ilsFrequencyCell = `{small}${mcdu.ilsAutoIdent.padStart(4, "\xa0")}/${mcdu.ilsFrequency.toFixed(2)}{end}`;
}

const lsCourse = SimVar.GetSimVarValue('L:A32NX_FM_LS_COURSE', 'number');
ilsCourseCell = "[\xa0]";
if (lsCourse >= 0) {
ilsCourseCell = `{${mcdu.ilsCourse !== undefined ? 'big' : 'small'}}F${lsCourse.toFixed(0).padStart(3, "0")}{end}`;
} else if (mcdu._ilsFrequencyPilotEntered) {
ilsCourseCell = "{amber}____{end}";
}
}
}

mcdu.onLeftInput[2] = (value, scratchpadCallback) => {
mcdu.setIlsFrequency(value, (result) => {
mcdu.setIlsFrequency(value, mcdu.backupNavTuning, (result) => {
if (result) {
mcdu.requestCall(() => {
CDUNavRadioPage.ShowPage(mcdu);
Expand All @@ -148,7 +171,7 @@ class CDUNavRadioPage {
});
};
mcdu.onLeftInput[3] = (value, scratchpadCallback) => {
mcdu.setLsCourse(value, (result) => {
mcdu.setLsCourse(value, mcdu.backupNavTuning, (result) => {
if (result) {
mcdu.requestCall(() => {
CDUNavRadioPage.ShowPage(mcdu);
Expand All @@ -158,16 +181,25 @@ class CDUNavRadioPage {
}
});
};
adf1FrequencyCell = "[\xa0]/[\xa0\xa0\xa0.]";
const adf1Ident = SimVar.GetSimVarValue(`ADF IDENT:1`, "string");
if (mcdu.adf1Frequency != 0 && !mcdu.adf1IdIsPilotEntered && mcdu.adf1FreqIsPilotEntered) {
adf1FrequencyCell = "{small}" + adf1Ident.padStart(3, "\xa0") + "{end}" + "/" + mcdu.adf1Frequency.toFixed(1);
adf1BfoOption = "<ADF1 BFO";
} else if (mcdu.adf1Frequency != 0 && mcdu.adf1IdIsPilotEntered && !mcdu.adf1FreqIsPilotEntered) {
adf1FrequencyCell = mcdu.adf1IdPilotValue.padStart(3, "\xa0") + "/" + "{small}" + mcdu.adf1Frequency.toFixed(1) + "{end}";
adf1BfoOption = "<ADF1 BFO";

if (!mcdu.backupNavTuning) {
adf1FrequencyCell = "[\xa0]/[\xa0\xa0\xa0.]";
const adf1Ident = SimVar.GetSimVarValue(`ADF IDENT:1`, "string");
if (mcdu.adf1Frequency != 0 && !mcdu.adf1IdIsPilotEntered && mcdu.adf1FreqIsPilotEntered) {
adf1FrequencyCell = "{small}" + adf1Ident.padStart(3, "\xa0") + "{end}" + "/" + mcdu.adf1Frequency.toFixed(1);
adf1BfoOption = "<ADF1 BFO";
} else if (mcdu.adf1Frequency != 0 && mcdu.adf1IdIsPilotEntered && !mcdu.adf1FreqIsPilotEntered) {
adf1FrequencyCell = mcdu.adf1IdPilotValue.padStart(3, "\xa0") + "/" + "{small}" + mcdu.adf1Frequency.toFixed(1) + "{end}";
adf1BfoOption = "<ADF1 BFO";
}
}
mcdu.onLeftInput[4] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (!isFinite(numValue) && value.length >= 2 && value.length <= 3) {
mcdu.getOrSelectNDBsByIdent(value, (navaids) => {
Expand Down Expand Up @@ -218,15 +250,24 @@ class CDUNavRadioPage {
}

if (!radioOn) {
vor2FrequencyCell = "[\xa0\xa0.\xa0]/[\xa0]";
const vor2Beacon = mcdu.radioNav.getVORBeacon(2);
const vor2Ident = vor2Beacon && vor2Beacon.ident.length >= 2 && vor2Beacon.ident.length <= 3 ? vor2Beacon.ident : "";
if (mcdu.vor2Frequency != 0 && mcdu.vor2FreqIsPilotEntered && !mcdu.vor2IdIsPilotEntered) {
vor2FrequencyCell = mcdu.vor2Frequency.toFixed(2) + "/" + "{small}" + vor2Ident.padEnd(3, "\xa0") + "{end}";
} else if (mcdu.vor2Frequency != 0 && !mcdu.vor2FreqIsPilotEntered && mcdu.vor2IdIsPilotEntered) {
vor2FrequencyCell = "{small}" + mcdu.vor2Frequency.toFixed(2) + "{end}" + "/" + mcdu.vor2IdPilotValue.padEnd(3, "\xa0");
if (!mcdu.backupNavTuning) {
vor2FrequencyCell = "[\xa0\xa0.\xa0]/[\xa0]";
const vor2Beacon = mcdu.radioNav.getVORBeacon(2);
const vor2Ident = vor2Beacon && vor2Beacon.ident.length >= 2 && vor2Beacon.ident.length <= 3 ? vor2Beacon.ident : "";
if (mcdu.vor2Frequency != 0 && mcdu.vor2FreqIsPilotEntered && !mcdu.vor2IdIsPilotEntered) {
vor2FrequencyCell = mcdu.vor2Frequency.toFixed(2) + "/" + "{small}" + vor2Ident.padEnd(3, "\xa0") + "{end}";
} else if (mcdu.vor2Frequency != 0 && !mcdu.vor2FreqIsPilotEntered && mcdu.vor2IdIsPilotEntered) {
vor2FrequencyCell = "{small}" + mcdu.vor2Frequency.toFixed(2) + "{end}" + "/" + mcdu.vor2IdPilotValue.padEnd(3, "\xa0");
}
}

mcdu.onRightInput[0] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (value === FMCMainDisplay.clrValue) {
mcdu.vor2FreqIsPilotEntered = false;
Expand Down Expand Up @@ -286,11 +327,20 @@ class CDUNavRadioPage {
scratchpadCallback();
}
};
vor2CourseCell = "[\xa0]";
if (mcdu.vor2Course > 0) {
vor2CourseCell = mcdu.vor2Course.toFixed(0).padStart(3, "0");

if (!mcdu.backupNavTuning) {
vor2CourseCell = "[\xa0]";
if (mcdu.vor2Course > 0) {
vor2CourseCell = mcdu.vor2Course.toFixed(0).padStart(3, "0");
}
}
mcdu.onRightInput[1] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (isFinite(numValue) && numValue > 0 && numValue <= 360) {
SimVar.SetSimVarValue("K:VOR2_SET", "number", numValue).then(() => {
Expand All @@ -307,16 +357,25 @@ class CDUNavRadioPage {
scratchpadCallback();
}
};
adf2FrequencyCell = "[\xa0\xa0\xa0.]/[\xa0]";
const adf2Ident = SimVar.GetSimVarValue(`ADF IDENT:2`, "string");
if (mcdu.adf2Frequency > 0 && mcdu.adf2FreqIsPilotEntered && !mcdu.adf2IdIsPilotEntered) {
adf2FrequencyCell = mcdu.adf2Frequency.toFixed(1) + "/" + "{small}" + adf2Ident.padEnd(3, "\xa0") + "{end}";
adf2BfoOption = "ADF2 BFO>";
} else if (mcdu.adf2Frequency > 0 && !mcdu.adf2FreqIsPilotEntered && mcdu.adf2IdIsPilotEntered) {
adf2FrequencyCell = "{small}" + mcdu.adf2Frequency.toFixed(1) + "{end}" + "/" + mcdu.adf2IdPilotValue.padEnd(3, "\xa0");
adf2BfoOption = "ADF2 BFO>";

if (!mcdu.backupNavTuning) {
adf2FrequencyCell = "[\xa0\xa0\xa0.]/[\xa0]";
const adf2Ident = SimVar.GetSimVarValue(`ADF IDENT:2`, "string");
if (mcdu.adf2Frequency > 0 && mcdu.adf2FreqIsPilotEntered && !mcdu.adf2IdIsPilotEntered) {
adf2FrequencyCell = mcdu.adf2Frequency.toFixed(1) + "/" + "{small}" + adf2Ident.padEnd(3, "\xa0") + "{end}";
adf2BfoOption = "ADF2 BFO>";
} else if (mcdu.adf2Frequency > 0 && !mcdu.adf2FreqIsPilotEntered && mcdu.adf2IdIsPilotEntered) {
adf2FrequencyCell = "{small}" + mcdu.adf2Frequency.toFixed(1) + "{end}" + "/" + mcdu.adf2IdPilotValue.padEnd(3, "\xa0");
adf2BfoOption = "ADF2 BFO>";
}
}
mcdu.onRightInput[4] = (value, scratchpadCallback) => {
if (mcdu.backupNavTuning) {
mcdu.setScratchpadMessage(NXSystemMessages.notAllowed);
scratchpadCallback();
return false;
}

const numValue = parseFloat(value);
if (!isFinite(numValue) && value.length >= 2 && value.length <= 3) {
mcdu.adf2FreqIsPilotEntered = false;
Expand Down
Loading