Skip to content

Commit

Permalink
feat(rmp): RMP navigation tuning flybywiresim#7241 (@fd42302)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueberryKing authored and igor8518 committed Nov 1, 2022
1 parent 78278e4 commit ea6869e
Show file tree
Hide file tree
Showing 23 changed files with 1,173 additions and 316 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
1. [MCDU] Support coroute loading and viewing - @lucky38i (Alex)
1. [HYD] Fixed autobrake controller tuning - @Crocket63 (crocket)
1. [EFB] Added pause at T/D function - @2hwk (2Cas#1022)
1. [RMP] RMPs navigation backup - Julian Sebline (Julian Sebline#8476 on Discord)

## 0.8.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 @@ -370,6 +370,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 @@ -386,6 +390,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 @@ -1010,6 +1050,15 @@
GOAROUND | 6
DONE | 7

- A32NX_FMGC_RADIONAV_TUNING_MODE
- Enum
- Hold the FMGCs current tuning mode
Value | Meaning
--- | ---
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

0 comments on commit ea6869e

Please sign in to comment.