Skip to content

Commit

Permalink
Merge branch 'master' into disabled-input-field-css
Browse files Browse the repository at this point in the history
  • Loading branch information
jet2code authored Jan 19, 2025
2 parents 1c871e2 + 886180b commit 1331b03
Show file tree
Hide file tree
Showing 21 changed files with 376 additions and 239 deletions.
7 changes: 6 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@
1. [A380X/FCU] Add TRUE indication on FCU when TRUE North reference is selected on AFS CP - @heclak (Heclak)
1. [A380X/MFD] Add airport data page into the MFD (DATA > AIRPORT) - @bulenteroglu (senolitam)
1. [A380X/EFB] Adds PRIM/SEC/FCDC failures to EFB - @flogross89 (floridude)

1. [A380X/PFD] Fix precision of pitch trim indicator - @flogross89 (floridude)
1. [A380X/MFD] Add leading zero to altitude prediction and track from last waypoint on FPLN page - @bulenteroglu (senolitam)
1. [FMS] Improved nav database error handling, preserving as much valid data as possible - @tracernz (Mike)
1. [A32NX/FMS] Sort instrument procedures for display on the MCDU - @tracernz (Mike)
1. [A380X/ELEC] Various fixes in the electrical system (battery voltage indicator switchup, AC GND SVC BUS and correct behavior of battery contactors) - @Gurgel100 (Pascal)
1. [A380X/FMS] Use cruise mach above crossover altitude - @flogross89 (floridude)

## 0.12.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class CDUAvailableArrivalsPage {
// Filter out approaches with no matching runway
// Approaches not going to a specific runway (i.e circling approaches are filtered out at DB level)
.filter((a) => !!runways.find((rw) => rw.ident === a.runwayIdent))
// Sort the approaches in Honeywell's documented order
.sort((a, b) => ApproachTypeOrder[a.type] - ApproachTypeOrder[b.type])
// Sort the approaches in Honeywell's documented order, and alphabetical in between
.sort((a, b) => a.type != b.type ? ApproachTypeOrder[a.type] - ApproachTypeOrder[b.type] : a.ident.localeCompare(b.ident))
.map((approach) => ({ approach }))
.concat(
// Runway-by-itself approaches
Expand Down Expand Up @@ -252,7 +252,7 @@ class CDUAvailableArrivalsPage {
const destinationRunway = targetPlan.destinationRunway;

if (destinationRunway) {
const arrivals = targetPlan.availableArrivals;
const arrivals = [...targetPlan.availableArrivals].sort((a, b) => a.ident.localeCompare(b.ident));

for (let i = 0; i < arrivals.length; i++) {
const arrival = arrivals[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CDUAvailableDeparturesPage {

/** @type {import('msfs-navdata').Runway[]} */
const availableRunways = [...targetPlan.availableOriginRunways];
let availableSids = [...targetPlan.availableDepartures];
let availableSids = [...targetPlan.availableDepartures].sort((a, b) => a.ident.localeCompare(b.ident));
let availableTransitions = [];

if (selectedRunway) {
Expand Down
16 changes: 8 additions & 8 deletions fbw-a32nx/src/systems/shared/src/performance/a32nx_takeoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class A320251NTakeoffPerformanceCalculator implements TakeoffPerformanceC

/** CONF 1+F runway limited weights at sea level/ISA/0 slope/no bleed/fwd cg/no wind/dry, MTOW [kg], runway length [metres] => lookup key = (runway length) */
private static readonly runwayPerfLimitConf1 = new LerpLookupTable([
[54_000, 1000],
[53_950, 1000],
[59_300, 1219],
[68_700, 1604],
[75_700, 1959],
Expand Down Expand Up @@ -914,31 +914,31 @@ export class A320251NTakeoffPerformanceCalculator implements TakeoffPerformanceC
};

private static readonly v2SecondSegBrakeThresholds: Record<number, [number, number]> = {
1: [-0.009368, 186.79],
1: [-0.011031, 189.0],
2: [0.02346, 68.33],
3: [0.022112, 83.141],
3: [0.014175, 106.14],
};

private static readonly v2SecondSegBrakeBaseTable1: Record<number, [number, number]> = {
1: [0.72637, 101.077],
2: [0.74005, 97.073],
2: [0.74005, 97.048],
3: [0.3746, 130.078],
};

private static readonly v2SecondSegBrakeBaseTable2: Record<number, [number, number]> = {
1: [0.63964, 102.127],
2: [0.692636, 92.9863],
1: [0.868263, 85.8],
2: [0.46666, 111.0],
3: [0.859926, 82.4377],
};

private static readonly v2SecondSegBrakeRunwayTable1: Record<number, [number, number]> = {
1: [3180, -0.015997],
2: [3180, -0.014862],
2: [3180, -0.012],
3: [3180, -0.019296],
};

private static readonly v2SecondSegBrakeRunwayTable2: Record<number, [number, number]> = {
1: [3180, -0.003612],
1: [3180, -0.007],
2: [3180, -0.007],
3: [3180, -0.013],
};
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/docs/a380-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
- Number
- The position of the battery display knob from left to right
- ESS=0, APU=1, OFF=2, BAT1=3, BAT2=4
- Mapped to battery voltage indexes: {bat_index} = ESS=4 | APU=3 | OFF=0 | BAT1=1 | BAT2=2
- Mapped to battery voltage indexes: {bat_index} = ESS=3 | APU=4 | OFF=0 | BAT1=1 | BAT2=2
- A32NX_ELEC_BAT_{bat_index}_POTENTIAL is used to get the voltage

- A32NX_NOSE_WHEEL_LEFT_ANIM_ANGLE
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/src/systems/instruments/src/BAT/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const BatRoot = () => {
}

// mapping of knob (lvar) values to battery numbers to allow easy lvar and model values
const batteryMap = [4, 3, 0, 1, 2]; // ESS, APU, OFF, BAT1, BAT2
const batteryMap = [3, 4, 0, 1, 2]; // ESS, APU, OFF, BAT1, BAT2

return (
<svg className={`bat-svg${selectedBattery == 2 ? ' off' : ''}`} viewBox="0 0 200 100">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0

import { ConsumerValue, EventBus, GameStateProvider, SimVarValueType, Subject, UnitType } from '@microsoft/msfs-sdk';
import { Arinc429SignStatusMatrix, Arinc429Word, FmsOansData } from '@flybywiresim/fbw-sdk';
import { Arinc429SignStatusMatrix, Arinc429Word, FmsOansData, MathUtils } from '@flybywiresim/fbw-sdk';
import { FlapConf } from '@fmgc/guidance/vnav/common';
import { FlightPlanService } from '@fmgc/index';
import { MmrRadioTuningStatus } from '@fmgc/navigation/NavaidTuner';
Expand Down Expand Up @@ -1170,17 +1170,16 @@ export class FmcAircraftInterface {
this.fmgc.data.approachFlapRetractionSpeed.set(Math.ceil(approachSpeeds.f3));
this.speedVapp.set(Math.round(approachSpeeds.vapp));

// Retrieve CAS and altitude from ADRs
const cas = this.fmc.navigation.getComputedAirspeed();
// Retrieve altitude from ADRs
const alt = this.fmc.navigation.getPressureAltitude();

if (cas !== null && alt !== null) {
// Only update speeds if ADR data valid
if (alt !== null) {
// Only update speeds if ADR altitude data valid.

const flapLever = SimVar.GetSimVarValue('L:A32NX_FLAPS_HANDLE_INDEX', 'Enum');
const speeds = new A380OperatingSpeeds(
grossWeight,
cas,
this.fmc.navigation.getComputedAirspeed() ?? 0, // CAS is NCD for low speeds/standstill, leading to null here
flapLever,
this.flightPhase.get(),
this.fmgc.getV2Speed(),
Expand Down Expand Up @@ -1612,10 +1611,21 @@ export class FmcAircraftInterface {
return SimVar.GetSimVarValue('AUTOPILOT ALTITUDE SLOT INDEX', 'number') === 2;
}

getManagedTargets(v: number, m: number) {
const alt = ADIRS.getBaroCorrectedAltitude();
const vM = SimVar.GetGameVarValue('FROM MACH TO KIAS', 'number', m);
return alt && alt.isNormalOperation() && alt.value > 20_000 && v > vM ? [vM, true] : [v, false];
getManagedTargets(v: number, m: number): [number, boolean] {
const sat = ADIRS.getStaticAirTemperature();
const press = ADIRS.getCorrectedAverageStaticPressure();

if (
sat !== undefined &&
(sat.isNormalOperation() || sat.isFunctionalTest()) &&
press !== undefined &&
(press.isNormalOperation() || press.isFunctionalTest())
) {
const vM = MathUtils.convertMachToKCas(m, press.value);
return v > vM ? [vM, true] : [v, false];
} else {
return [v, false];
}
}

// TODO/VNAV: Speed constraint
Expand Down
15 changes: 10 additions & 5 deletions fbw-a380x/src/systems/instruments/src/MFD/FMC/fmgc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export enum ClimbDerated {
* Temporary place for data which is found nowhere else. Not associated to flight plans right now, which should be the case for some of these values
*/
export class FmgcData {
static fmcFormatSpeed(sub: Subscribable<number | null>) {
return sub.map((it) => (it !== null ? it.toFixed(0) : '---'));
}

public readonly cpnyFplnAvailable = Subject.create(false);

public readonly cpnyFplnUplinkInProgress = Subject.create(false);
Expand Down Expand Up @@ -217,11 +221,11 @@ export class FmgcData {

public readonly takeoffFlapsSetting = Subject.create<FlapConf>(FlapConf.CONF_1);

public readonly flapRetractionSpeed = Subject.create<Knots | null>(141);
public readonly flapRetractionSpeed = Subject.create<Knots | null>(null);

public readonly slatRetractionSpeed = Subject.create<Knots | null>(159);
public readonly slatRetractionSpeed = Subject.create<Knots | null>(null);

public readonly greenDotSpeed = Subject.create<Knots | null>(190);
public readonly greenDotSpeed = Subject.create<Knots | null>(null);

public readonly approachSpeed = Subject.create<Knots | null>(null);

Expand Down Expand Up @@ -454,10 +458,11 @@ export class FmgcDataService implements Fmgc {
return preSel;
}

if (this.flightPlanService.has(FlightPlanIndex.Active)) {
// FIXME need to rework the cost index based speed calculations
/* if (this.flightPlanService.has(FlightPlanIndex.Active)) {
const dCI = ((this.flightPlanService.active.performanceData.costIndex ?? 100) / 999) ** 2;
return 290 * (1 - dCI) + 330 * dCI;
}
}*/
return 310;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ class FplnLegLine extends DisplayComponent<FplnLegLineProps> {
this.fpaRef.instance.innerText = '';
} else {
this.trackRef.instance.innerText = data.trackFromLastWpt
? `${data.trackFromLastWpt.toFixed(0)}°${this.props.trueTrack.get() ? 'T' : ''}`
? `${data.trackFromLastWpt.toFixed(0).padStart(3, '0')}°${this.props.trueTrack.get() ? 'T' : ''}`
: '';
this.distRef.instance.innerText = data.distFromLastWpt?.toFixed(0) ?? '';
this.fpaRef.instance.innerText = data.fpa ? data.fpa.toFixed(1) : '';
Expand Down Expand Up @@ -1445,7 +1445,11 @@ class FplnLegLine extends DisplayComponent<FplnLegLineProps> {
) {
altStr = <span style="font-family: HoneywellMCDU, monospace;">"</span>;
} else if (!isBelowTransAlt) {
altStr = <span>{`FL${Math.round(data.altitudePrediction / 100).toString()}`}</span>;
altStr = (
<span>{`FL${Math.round(data.altitudePrediction / 100)
.toString()
.padStart(3, '0')}`}</span>
);
} else {
const roundedAltitude = MathUtils.round(data.altitudePrediction, 10).toFixed(0);
altStr = <span>{roundedAltitude}</span>;
Expand Down
Loading

0 comments on commit 1331b03

Please sign in to comment.