diff --git a/flybywire b/flybywire index 0f032936..9ccbc107 160000 --- a/flybywire +++ b/flybywire @@ -1 +1 @@ -Subproject commit 0f032936bdecec5e1bfcde95c4f2126858902605 +Subproject commit 9ccbc1071fcac7566d8eafcadb76c39a4587019a diff --git a/hdw-a333x/src/base/headwindsim-aircraft-a330-300/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A333X/FMC/A32NX_FMCMainDisplay.js b/hdw-a333x/src/base/headwindsim-aircraft-a330-300/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A333X/FMC/A32NX_FMCMainDisplay.js index d0f5370e..94400806 100644 --- a/hdw-a333x/src/base/headwindsim-aircraft-a330-300/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A333X/FMC/A32NX_FMCMainDisplay.js +++ b/hdw-a333x/src/base/headwindsim-aircraft-a330-300/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A333X/FMC/A32NX_FMCMainDisplay.js @@ -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) { diff --git a/hdw-a339x/src/base/headwindsim-aircraft-a330-900/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A339X/FMC/A32NX_FMCMainDisplay.js b/hdw-a339x/src/base/headwindsim-aircraft-a330-900/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A339X/FMC/A32NX_FMCMainDisplay.js index 5b602cb5..06d7a150 100644 --- a/hdw-a339x/src/base/headwindsim-aircraft-a330-900/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A339X/FMC/A32NX_FMCMainDisplay.js +++ b/hdw-a339x/src/base/headwindsim-aircraft-a330-900/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_A339X/FMC/A32NX_FMCMainDisplay.js @@ -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) { diff --git a/hdw-su95x/src/base/headwindsim-aircraft-su100-95/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_SU95X/FMC/A32NX_FMCMainDisplay.js b/hdw-su95x/src/base/headwindsim-aircraft-su100-95/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_SU95X/FMC/A32NX_FMCMainDisplay.js index 8a03e662..c84449b1 100644 --- a/hdw-su95x/src/base/headwindsim-aircraft-su100-95/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_SU95X/FMC/A32NX_FMCMainDisplay.js +++ b/hdw-su95x/src/base/headwindsim-aircraft-su100-95/html_ui/Pages/VCockpit/Instruments/Airliners/Headwind_SU95X/FMC/A32NX_FMCMainDisplay.js @@ -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) {