Skip to content

Commit

Permalink
OFP page
Browse files Browse the repository at this point in the history
  • Loading branch information
flogross89 committed Jan 21, 2025
1 parent 1e661c0 commit e665ba8
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
ModalProvider,
PowerContext,
PowerStates,
setAirframeInfo,
setCabinInfo,
setFlypadInfo,
store,
} from '@flybywiresim/flypad';

Expand All @@ -21,7 +24,8 @@ import { Provider } from 'react-redux';
import { TroubleshootingContextProvider } from '../../../../../../fbw-common/src/systems/instruments/src/EFB/TroubleshootingContext';
import { ErrorBoundary } from 'react-error-boundary';
import { MemoryRouter as Router } from 'react-router';
import { useSimVar } from '@flybywiresim/fbw-sdk';
import { UniversalConfigProvider, useSimVar } from '@flybywiresim/fbw-sdk';
import { Dispatch } from '../../../../../../fbw-common/src/systems/instruments/src/EFB/Dispatch/Dispatch';

export const getDisplayIndex = () => {
const url = Array.from(document.querySelectorAll('vcockpit-panel > *'))
Expand All @@ -46,6 +50,20 @@ export const OitEfbWrapper: React.FC<OitEfbWrapperProps> = ({ eventBus }) => {

const [err, setErr] = useState(false);

useEffect(() => {
UniversalConfigProvider.fetchAirframeInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then(
(info) => store.dispatch(setAirframeInfo(info)),
);

UniversalConfigProvider.fetchFlypadInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then(
(info) => store.dispatch(setFlypadInfo(info)),
);

UniversalConfigProvider.fetchCabinInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then(
(info) => store.dispatch(setCabinInfo(info)),
);
}, []);

useEffect(() => {
document
.getElementsByTagName('a380x-oitlegacy')[0]
Expand Down Expand Up @@ -126,7 +144,10 @@ export const OitEfbWrapper: React.FC<OitEfbWrapperProps> = ({ eventBus }) => {
}}
>
<div className="flex flex-row">
<div className="h-screen w-screen p-2.5 pt-0">{showCharts === 1 && <Navigation />}</div>
<div className="h-screen w-screen p-2.5 pt-0">
{showCharts === 1 && <Navigation />}
{showOfp === 1 && <Dispatch />}
</div>
</div>
</div>
)}
Expand Down

0 comments on commit e665ba8

Please sign in to comment.