Skip to content

Commit

Permalink
fix: keep flight number set even if already taken
Browse files Browse the repository at this point in the history
FBW PR 8656
  • Loading branch information
Revyn112 committed Nov 25, 2024
1 parent 84c5196 commit 6a36d0e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 45 deletions.
2 changes: 1 addition & 1 deletion flybywire
Submodule flybywire updated 20 files
+2 −0 .github/CHANGELOG.md
+2 −2 ...ft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_NewWaypoint.js
+4 −5 ...a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_PilotsWaypoint.js
+10 −15 ...rcraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js
+21 −16 fbw-a32nx/src/systems/fmgc/src/flightplanning/DataManager.ts
+3 −7 fbw-a32nx/src/systems/fmgc/src/flightplanning/WaypointEntryUtils.ts
+4 −4 fbw-a32nx/src/systems/fmgc/src/flightplanning/interface/DataInterface.ts
+1 −0 fbw-a380x/mach.config.js
+1 −0 fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/panel.cfg
+1 −1 fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/sound/sound.xml
+15 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/.eslintrc.js
+61 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/AtcMailbox.tsx
+5 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/config.json
+105 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/instrument.tsx
+54 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/style.scss
+33 −0 fbw-a380x/src/systems/instruments/src/AtcMailbox/tsconfig.json
+4 −3 fbw-a380x/src/systems/instruments/src/Common/LegacyCdsDisplayUnit.tsx
+3 −11 fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts
+0 −46 fbw-a380x/src/systems/instruments/src/SD/Mailbox.tsx
+1 −3 fbw-a380x/src/systems/instruments/src/SD/SystemDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2424,26 +2424,22 @@ class FMCMainDisplay extends BaseAirliners {
return SimVar.SetSimVarValue('L:A32NX_FM_LS_COURSE', 'number', course);
}

updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
async updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
if (flightNo.length > 7) {
this.setScratchpadMessage(NXSystemMessages.notAllowed);
return callback(false);
}

SimVar.SetSimVarValue('ATC FLIGHT NUMBER', 'string', flightNo, 'FMC').then(() => {
this.atsu.connectToNetworks(flightNo).then((code) => {
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 0);
this.addNewAtsuMessage(code);
this.flightNo = '';
return callback(false);
}
this.flightNumber = flightNo;
await SimVar.SetSimVarValue("ATC FLIGHT NUMBER", "string", flightNo, "FMC");

SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 1);
this.flightNumber = flightNo;
return callback(true);
});
});
// FIXME move ATSU code to ATSU
const code = await this.atsu.connectToNetworks(flightNo);
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
this.addNewAtsuMessage(code);
}

return callback(true);
}

async updateCoRoute(coRouteNum, callback = EmptyCallback.Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2424,26 +2424,22 @@ class FMCMainDisplay extends BaseAirliners {
return SimVar.SetSimVarValue('L:A32NX_FM_LS_COURSE', 'number', course);
}

updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
async updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
if (flightNo.length > 7) {
this.setScratchpadMessage(NXSystemMessages.notAllowed);
return callback(false);
this.setScratchpadMessage(NXSystemMessages.notAllowed);
return callback(false);
}

SimVar.SetSimVarValue('ATC FLIGHT NUMBER', 'string', flightNo, 'FMC').then(() => {
this.atsu.connectToNetworks(flightNo).then((code) => {
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 0);
this.addNewAtsuMessage(code);
this.flightNo = '';
return callback(false);
}
this.flightNumber = flightNo;
await SimVar.SetSimVarValue("ATC FLIGHT NUMBER", "string", flightNo, "FMC");

SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 1);
this.flightNumber = flightNo;
return callback(true);
});
});
// FIXME move ATSU code to ATSU
const code = await this.atsu.connectToNetworks(flightNo);
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
this.addNewAtsuMessage(code);
}

return callback(true);
}

async updateCoRoute(coRouteNum, callback = EmptyCallback.Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2424,26 +2424,22 @@ class FMCMainDisplay extends BaseAirliners {
return SimVar.SetSimVarValue('L:A32NX_FM_LS_COURSE', 'number', course);
}

updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
async updateFlightNo(flightNo, callback = EmptyCallback.Boolean) {
if (flightNo.length > 7) {
this.setScratchpadMessage(NXSystemMessages.notAllowed);
return callback(false);
}

SimVar.SetSimVarValue('ATC FLIGHT NUMBER', 'string', flightNo, 'FMC').then(() => {
this.atsu.connectToNetworks(flightNo).then((code) => {
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 0);
this.addNewAtsuMessage(code);
this.flightNo = '';
return callback(false);
}
this.flightNumber = flightNo;
await SimVar.SetSimVarValue("ATC FLIGHT NUMBER", "string", flightNo, "FMC");

SimVar.SetSimVarValue('L:A32NX_MCDU_FLT_NO_SET', 'boolean', 1);
this.flightNumber = flightNo;
return callback(true);
});
});
// FIXME move ATSU code to ATSU
const code = await this.atsu.connectToNetworks(flightNo);
if (code !== AtsuCommon.AtsuStatusCodes.Ok) {
this.addNewAtsuMessage(code);
}

return callback(true);
}

async updateCoRoute(coRouteNum, callback = EmptyCallback.Boolean) {
Expand Down

0 comments on commit 6a36d0e

Please sign in to comment.