From 942619498fffd52c34548fbb5cbd214784221d83 Mon Sep 17 00:00:00 2001 From: Denis Freund Date: Mon, 6 Nov 2023 15:48:13 +0100 Subject: [PATCH] fix(api): set origin/destination for api fix update api-client package --- .../datalink/router/src/webinterfaces/NXApiConnector.ts | 4 +++- .../Airliners/Headwind_A333X/FMC/A32NX_FMCMainDisplay.js | 2 ++ .../datalink/router/src/webinterfaces/NXApiConnector.ts | 4 +++- .../Airliners/Headwind_A339X/FMC/A32NX_FMCMainDisplay.js | 6 ++++-- package-lock.json | 8 ++++---- package.json | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/hdw-a333x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts b/hdw-a333x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts index 82f13c19a..5422f156a 100644 --- a/hdw-a333x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts +++ b/hdw-a333x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts @@ -30,7 +30,8 @@ export class NXApiConnector { const long = SimVar.GetSimVarValue('PLANE LONGITUDE', 'degree longitude'); const alt = SimVar.GetSimVarValue('PLANE ALTITUDE', 'feet'); const heading = SimVar.GetSimVarValue('PLANE HEADING DEGREES TRUE', 'degree'); - const acType = SimVar.GetSimVarValue('TITLE', 'string'); + const acType = 'A333X'; + const airline = SimVar.GetSimVarValue('ATC AIRLINE', 'string'); const origin = NXDataStore.get('PLAN_ORIGIN', ''); const destination = NXDataStore.get('PLAN_DESTINATION', ''); const freetext = NXDataStore.get('CONFIG_ONLINE_FEATURES_STATUS', 'DISABLED') === 'ENABLED'; @@ -47,6 +48,7 @@ export class NXApiConnector { freetextEnabled: freetext, flight: NXApiConnector.flightNumber, aircraftType: acType, + airline }; } 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 c97aed173..f42241dfe 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 @@ -2062,6 +2062,8 @@ class FMCMainDisplay extends BaseAirliners { if (!airportFrom || !airportTo) { throw NXSystemMessages.notInDatabase; } + NXDataStore.set("PLAN_ORIGIN", from); + NXDataStore.set("PLAN_DESTINATION", to); } catch (e) { console.log(e); throw NXSystemMessages.notInDatabase; diff --git a/hdw-a339x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts b/hdw-a339x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts index 82f13c19a..a9bcdd161 100644 --- a/hdw-a339x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts +++ b/hdw-a339x-common/src/systems/datalink/router/src/webinterfaces/NXApiConnector.ts @@ -30,7 +30,8 @@ export class NXApiConnector { const long = SimVar.GetSimVarValue('PLANE LONGITUDE', 'degree longitude'); const alt = SimVar.GetSimVarValue('PLANE ALTITUDE', 'feet'); const heading = SimVar.GetSimVarValue('PLANE HEADING DEGREES TRUE', 'degree'); - const acType = SimVar.GetSimVarValue('TITLE', 'string'); + const acType = 'A339X'; + const airline = SimVar.GetSimVarValue('ATC AIRLINE', 'string'); const origin = NXDataStore.get('PLAN_ORIGIN', ''); const destination = NXDataStore.get('PLAN_DESTINATION', ''); const freetext = NXDataStore.get('CONFIG_ONLINE_FEATURES_STATUS', 'DISABLED') === 'ENABLED'; @@ -47,6 +48,7 @@ export class NXApiConnector { freetextEnabled: freetext, flight: NXApiConnector.flightNumber, aircraftType: acType, + airline }; } 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 e7feb42ac..cf74868ff 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 @@ -1126,7 +1126,7 @@ class FMCMainDisplay extends BaseAirliners { if (!this.managedSpeedCruiseIsPilotEntered) { this.managedSpeedCruise = this.getCrzManagedSpeedFromCostIndex(); } - + this.managedSpeedDescend = this.getDesManagedSpeedFromCostIndex(); } @@ -2116,6 +2116,8 @@ class FMCMainDisplay extends BaseAirliners { if (!airportFrom || !airportTo) { throw NXSystemMessages.notInDatabase; } + NXDataStore.set("PLAN_ORIGIN", from); + NXDataStore.set("PLAN_DESTINATION", to); } catch (e) { console.log(e); throw NXSystemMessages.notInDatabase; @@ -3775,7 +3777,7 @@ class FMCMainDisplay extends BaseAirliners { } return true; } - + const spd = parseInt(s); if (!Number.isFinite(spd)) { this.setScratchpadMessage(NXSystemMessages.formatError); diff --git a/package-lock.json b/package-lock.json index 1cea1dd33..f53c221e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@flybywiresim/react-components": "^0.3.1", "@flybywiresim/tailwind-config": "^0.5.0", - "@headwindsimulations/api-client": "^1.1.0", + "@headwindsimulations/api-client": "^1.1.1", "@localazy/cli": "^1.6.0", "@microsoft/msfs-sdk": "^0.6.0", "@reduxjs/toolkit": "^1.6.2", @@ -2546,9 +2546,9 @@ "integrity": "sha512-MV0IZltNoHm2vAhpL+rOIgK6G7tUu4w7wQf+vPTQDmyCbNfpe5QwfbtF+yjKmqryclm3DQ8smPDDRPFuBAIgbQ==" }, "node_modules/@headwindsimulations/api-client": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@headwindsimulations/api-client/-/api-client-1.1.0.tgz", - "integrity": "sha512-/pNf4+FI0FQ0vBoV9HPV867IKBMEdU2UrhzdI2IeUmF83bE6XLbUiVWNs2xsMI4xsvYx2E4FZhaZqLyi3ID+lA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@headwindsimulations/api-client/-/api-client-1.1.1.tgz", + "integrity": "sha512-v7662LYSD1FJO+7FeYp7wPtYLca+7bfopPZy1P0fKvPJEFf1bjtdZnp9C3Nwtk5VwLWGSC0rEQj3wB5ngd0ZTQ==", "dependencies": { "axios": "^0.21.4" } diff --git a/package.json b/package.json index b1311baae..edc1dfee5 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "vite-tsconfig-paths": "^4.2.1" }, "dependencies": { - "@headwindsimulations/api-client": "^1.1.0", + "@headwindsimulations/api-client": "^1.1.1", "@flybywiresim/react-components": "^0.3.1", "@flybywiresim/tailwind-config": "^0.5.0", "@localazy/cli": "^1.6.0",