Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(efb): troubleshooting page #9747

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
1. [A380X/ND] Remove leading zeros from terrain elevation display - @BravoMike99 (bruno_pt99)
1. [A32NX/FWS] Fix autopilot instinctive disconnect button logic for 3D model - @flogross89 (floridude)
1. [A380X/EFIS] Fix VV pb indicator not turning on when TRK-FPA mode is selected - @heclak (Heclak)
1. [EFB] Added troubleshooting page, under about page, for advanced support - @tracernz (Mike)
1. [FMS] Transition altitude/level and RNP now come from navdata in MSFS2024 - @tracernz (Mike)

## 0.12.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, 0, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -231,6 +232,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, 0, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -300,6 +302,7 @@ class CDUAvailableArrivalsPage {
}
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -343,6 +346,7 @@ class CDUAvailableArrivalsPage {
}
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -373,6 +377,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, 0, false, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -400,6 +405,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, pageCurrent, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -563,6 +569,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, 0, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -627,6 +634,7 @@ class CDUAvailableArrivalsPage {
CDUAvailableArrivalsPage.ShowPage(mcdu, airport, 0, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class CDUAvailableDeparturesPage {
CDUAvailableDeparturesPage.ShowPage(mcdu, airport, 0, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -177,6 +178,7 @@ class CDUAvailableDeparturesPage {
CDUAvailableDeparturesPage.ShowPage(mcdu, airport, pageCurrent, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down Expand Up @@ -216,6 +218,7 @@ class CDUAvailableDeparturesPage {
CDUAvailableDeparturesPage.ShowPage(mcdu, airport, pageCurrent, true, forPlan, inAlternate);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);

mcdu.eraseTemporaryFlightPlan(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CDUDirectToPage {
mcdu.directToWaypoint(w).then(() => {
CDUDirectToPage.ShowPage(mcdu, w, wptsListIndex);
}).catch(err => {
mcdu.logTroubleshootingError(err);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
console.error(err);
});
Expand Down Expand Up @@ -119,6 +120,7 @@ class CDUDirectToPage {
mcdu.directToLeg(legIndex).then(() => {
CDUDirectToPage.ShowPage(mcdu, leg.terminationWaypoint(), wptsListIndex);
}).catch(err => {
mcdu.logTroubleshootingError(err);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
console.error(err);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ class CDUFlightPlanPage {
console.log("deleting element");
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
scratchpadCallback();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class CDUInitPage {
}
} catch (error) {
console.error(error);
mcdu.logTroubleshootingError(error);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
}
};
Expand Down Expand Up @@ -220,6 +221,7 @@ class CDUInitPage {
}
}).catch((error) => {
console.error(error);
mcdu.logTroubleshootingError(error);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class CDULateralRevisionPage {
await mcdu.flightPlanService.enableAltn(legIndexFP, cruiseLevel, forPlan);
} catch (e) {
console.error(e);
mcdu.logTroubleshootingError(e);
mcdu.setScratchpadMessage(NXFictionalMessages.internalError);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1594,5 +1594,9 @@ class A320_Neo_CDU_MainDisplay extends FMCMainDisplay {
CDUInitPage.ShowPage2(this);
}
}

logTroubleshootingError(msg) {
this.bus.pub('troubleshooting_log_error', msg, true, false);
}
}
registerInstrument("a320-neo-cdu-main-display", A320_Neo_CDU_MainDisplay);
26 changes: 18 additions & 8 deletions fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/MfdFmsInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { Button, ButtonMenuItem } from 'instruments/src/MFD/pages/common/Button';
import { maxCertifiedAlt } from '@shared/PerformanceConstants';
import { FmsPage } from 'instruments/src/MFD/pages/common/FmsPage';
import { NXDataStore } from '@flybywiresim/fbw-sdk';
import { logTroubleshootingError, NXDataStore } from '@flybywiresim/fbw-sdk';
import { ISimbriefData } from '../../../../../../../../fbw-common/src/systems/instruments/src/EFB/Apis/Simbrief/simbriefInterface';
import { SimBriefUplinkAdapter } from '@fmgc/flightplanning/uplink/SimBriefUplinkAdapter';
import { FmgcFlightPhase } from '@shared/flightphase';
Expand Down Expand Up @@ -204,12 +204,17 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {

this.simBriefOfp = await SimBriefUplinkAdapter.downloadOfpForUserID(navigraphUsername, overrideSimBriefUserID);

SimBriefUplinkAdapter.uplinkFlightPlanFromSimbrief(
this.props.fmcService.master,
this.props.fmcService.master.flightPlanService,
this.simBriefOfp,
{ doUplinkProcedures: false },
);
try {
SimBriefUplinkAdapter.uplinkFlightPlanFromSimbrief(
this.props.fmcService.master,
this.props.fmcService.master.flightPlanService,
this.simBriefOfp,
{ doUplinkProcedures: false },
);
} catch (e) {
console.error(e);
logTroubleshootingError(this.props.bus, e);
}
}

private async cityPairModified() {
Expand All @@ -233,7 +238,12 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {
return;
}

this.props.fmcService.master.flightPlanService.uplinkInsert();
try {
this.props.fmcService.master.flightPlanService.uplinkInsert();
} catch (e) {
console.error(e);
logTroubleshootingError(this.props.bus, e);
}
this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master.fmgc.data.atcCallsign.set(this.simBriefOfp?.callsign ?? '----------');

Expand Down
31 changes: 17 additions & 14 deletions fbw-common/src/systems/instruments/src/EFB/Efb.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 FlyByWire Simulations
// Copyright (c) 2023-2025 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

import React, { useContext, useEffect, useState } from 'react';
Expand Down Expand Up @@ -54,15 +54,16 @@ import { setFlightPlanProgress } from './Store/features/flightProgress';
import { Checklists, setAutomaticItemStates } from './Checklists/Checklists';
import { setAircraftChecklists, addTrackingChecklists } from './Store/features/checklists';
import { FlyPadPage } from './Settings/Pages/FlyPadPage';
import { NavigraphAuthProvider } from '../react/navigraph';
import { EventBus } from '@microsoft/msfs-sdk';
import { TroubleshootingContextProvider } from './TroubleshootingContext';

// './Assets/Efb.scss' is imported by the aircraft EFB instrument the wraps this file
import './Assets/Theme.css';
import './Assets/Slider.scss';

import 'react-toastify/dist/ReactToastify.css';
import './toast.css';
import { NavigraphAuthProvider } from '../react/navigraph';
import { EventBus } from '@microsoft/msfs-sdk';

export interface EfbWrapperProps {
failures: FailureDefinition[]; // TODO: Move failure definition into VFS
Expand Down Expand Up @@ -523,16 +524,18 @@ export const EfbInstrument: React.FC<EfbInstrumentProps> = ({ failures, aircraft
const [err, setErr] = useState(false);

return (
<FailuresOrchestratorProvider failures={failures}>
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={() => setErr(false)} resetKeys={[err]}>
<Router>
<ModalProvider>
<EventBusContextProvider eventBus={eventBus}>
<Efb aircraftChecklistsProp={aircraftChecklists} />
</EventBusContextProvider>
</ModalProvider>
</Router>
</ErrorBoundary>
</FailuresOrchestratorProvider>
<TroubleshootingContextProvider eventBus={eventBus}>
<FailuresOrchestratorProvider failures={failures}>
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={() => setErr(false)} resetKeys={[err]}>
<Router>
<ModalProvider>
<EventBusContextProvider eventBus={eventBus}>
<Efb aircraftChecklistsProp={aircraftChecklists} />
</EventBusContextProvider>
</ModalProvider>
</Router>
</ErrorBoundary>
</FailuresOrchestratorProvider>
</TroubleshootingContextProvider>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@
"ThrottleConfigurationReset": "Throttle Configuration Reset"
},
"Title": "Settings",
"Troubleshooting": {
"Title": "Troubleshooting"
},
"Unrealistic": "Unrealistic",
"flyPad": {
"AutoBrightness": "Auto Brightness",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 FlyByWire Simulations
// Copyright (c) 2023-2025 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

import React, { useEffect, useState } from 'react';
Expand All @@ -11,11 +11,15 @@ import {
SENTRY_CONSENT_KEY,
useSimVar,
} from '@flybywiresim/fbw-sdk';
import { t } from '@flybywiresim/flypad';
import { PageLink, pathify, t, TabRoutes } from '@flybywiresim/flypad';
import { SettingsPage } from '../Settings';
// @ts-ignore
import FbwTail from '../../Assets/FBW-Tail.svg';
import { useViewListenerEvent } from '../../Utils/listener';
import { Link, Route, Switch } from 'react-router-dom';
import { TroubleshootingPage } from './TroubleshootingPage';

const baseAboutRoute = `/settings/${pathify('About')}`;

interface BuildInfoEntryProps {
title: string;
Expand Down Expand Up @@ -59,6 +63,10 @@ export const AboutPage = () => {
const [version, setVersion] = useSessionStorage('SIM_VERSION', '');
const [sentryEnabled] = usePersistentProperty(SENTRY_CONSENT_KEY, SentryConsentState.Refused);

const subTabs: PageLink[] = [
{ alias: t('Settings.Troubleshooting.Title'), name: 'Troubleshooting', component: <TroubleshootingPage /> },
];

// Callback function to set sBuildVersion from the community panel
const onSetPlayerData = (data: CommunityPanelPlayerData) => {
setVersion(data.sBuildVersion);
Expand All @@ -72,43 +80,58 @@ export const AboutPage = () => {
}, [process.env.AIRCRAFT_PROJECT_PREFIX]);

return (
<SettingsPage name={t('Settings.About.Title')}>
<div className="pointer-events-none absolute inset-y-0 flex flex-col justify-center px-16">
<div className="flex flex-row items-center">
<div className="flex flex-col">
<Switch>
<Route exact path={baseAboutRoute}>
<SettingsPage name={t('Settings.About.Title')}>
<div className="absolute inset-y-0 flex flex-col justify-center px-16">
<div className="flex flex-row items-center">
<img className="w-[36px]" src={FbwTail} alt="" />
<h1 className="font-manrope ml-4 text-4xl font-bold">flyPadOS 3</h1>
<div className="flex flex-col">
<div className="flex flex-row items-center">
<img className="w-[36px]" src={FbwTail} alt="" />
<h1 className="font-manrope ml-4 text-4xl font-bold">flyPadOS 3</h1>
</div>

<p className="mt-3 text-2xl">
Made with love by contributors in Québec, Germany, the United States, Singapore, Indonesia, New
Zealand, Australia, Spain, the United Kingdom, France, the Netherlands, Sweden, and Switzerland!
</p>
</div>
</div>
<div className="mt-8 flex flex-col justify-center">
<p>&copy; 2020-2024 FlyByWire Simulations and its contributors, all rights reserved.</p>
<p>Licensed under the GNU General Public License Version 3</p>
</div>

<p className="mt-3 text-2xl">
Made with love by contributors in Québec, Germany, the United States, Singapore, Indonesia, New Zealand,
Australia, Spain, the United Kingdom, France, the Netherlands, Sweden, and Switzerland!
</p>
</div>
</div>
<div className="mt-8 flex flex-col justify-center">
<p>&copy; 2020-2024 FlyByWire Simulations and its contributors, all rights reserved.</p>
<p>Licensed under the GNU General Public License Version 3</p>
</div>

<div className="mt-16">
<h1 className="font-bold">Build Info</h1>
<div className="mt-4">
<BuildInfoEntry title="Sim Version" value={version} />
<BuildInfoEntry title="Aircraft Version" value={buildInfo?.version} />
<BuildInfoEntry title="Livery Title" value={title} />
<BuildInfoEntry title="Built" value={buildInfo?.built} />
<BuildInfoEntry title="Ref" value={buildInfo?.ref} />
<BuildInfoEntry title="SHA" value={buildInfo?.sha} underline={7} />
<BuildInfoEntry title="Event Name" value={buildInfo?.eventName} />
<BuildInfoEntry title="Pretty Release Name" value={buildInfo?.prettyReleaseName} />
{sentryEnabled === SentryConsentState.Given && (
<BuildInfoEntry title="Sentry Session ID" value={sessionId} />
)}
<div className="mt-16">
<h1 className="font-bold">Build Info</h1>
<div className="mt-4">
<BuildInfoEntry title="Sim Version" value={version} />
<BuildInfoEntry title="Aircraft Version" value={buildInfo?.version} />
<BuildInfoEntry title="Livery Title" value={title} />
<BuildInfoEntry title="Built" value={buildInfo?.built} />
<BuildInfoEntry title="Ref" value={buildInfo?.ref} />
<BuildInfoEntry title="SHA" value={buildInfo?.sha} underline={7} />
<BuildInfoEntry title="Event Name" value={buildInfo?.eventName} />
<BuildInfoEntry title="Pretty Release Name" value={buildInfo?.prettyReleaseName} />
{sentryEnabled === SentryConsentState.Given && (
<BuildInfoEntry title="Sentry Session ID" value={sessionId} />
)}
</div>
</div>

<div className="mt-16">
<Link
to={`${baseAboutRoute}/${pathify('Troubleshooting')}`}
className="rounded-md border-2 border-theme-highlight bg-theme-highlight px-5
py-2.5 text-theme-body transition duration-100 hover:bg-theme-body hover:text-theme-highlight"
>
{t('Settings.Troubleshooting.Title')}
</Link>
</div>
</div>
</div>
</div>
</SettingsPage>
</SettingsPage>
</Route>
<TabRoutes basePath={baseAboutRoute} tabs={subTabs} />
</Switch>
);
};
Loading
Loading