Skip to content

Commit

Permalink
fix(api): set origin/destination for api
Browse files Browse the repository at this point in the history
fix

update api-client package
  • Loading branch information
Revyn112 committed Nov 6, 2023
1 parent 002a06c commit 9426194
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -47,6 +48,7 @@ export class NXApiConnector {
freetextEnabled: freetext,
flight: NXApiConnector.flightNumber,
aircraftType: acType,
airline
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -47,6 +48,7 @@ export class NXApiConnector {
freetextEnabled: freetext,
flight: NXApiConnector.flightNumber,
aircraftType: acType,
airline
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ class FMCMainDisplay extends BaseAirliners {
if (!this.managedSpeedCruiseIsPilotEntered) {
this.managedSpeedCruise = this.getCrzManagedSpeedFromCostIndex();
}

this.managedSpeedDescend = this.getDesManagedSpeedFromCostIndex();
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -3775,7 +3777,7 @@ class FMCMainDisplay extends BaseAirliners {
}
return true;
}

const spd = parseInt(s);
if (!Number.isFinite(spd)) {
this.setScratchpadMessage(NXSystemMessages.formatError);
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9426194

Please sign in to comment.