Skip to content

Commit

Permalink
fix(atsu/efb): use msfs metar rather than fsx cloud data
Browse files Browse the repository at this point in the history
FBW PR 8256
  • Loading branch information
Revyn112 committed Oct 20, 2023
1 parent 38bb213 commit 9e57202
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const AtsuAocPage = () => {
];

const metarSourceButtons: ButtonType[] = [
{ name: 'MeteoBlue', setting: 'MSFS' },
{ name: 'MSFS', setting: 'MSFS' },
{ name: 'PilotEdge', setting: 'PILOTEDGE' },
{ name: 'IVAO', setting: 'IVAO' },
{ name: 'VATSIM', setting: 'VATSIM' },
Expand Down Expand Up @@ -208,7 +208,7 @@ export const AtsuAocPage = () => {

<SettingItem name={t('Settings.AtsuAoc.HoppieUserId')}>
<SimpleInput
className="text-center w-30"
className="w-30 text-center"
value={hoppieUserId}
onBlur={(value) => handleHoppieUsernameInput(value.replace(/\s/g, ''))}
onChange={(value) => setHoppieUserId(value)}
Expand Down
17 changes: 13 additions & 4 deletions hdw-a339x/src/systems/instruments/src/EFB/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0

/* eslint-disable max-len */
import React, { useState, useEffect } from 'react';
import { MemoryRouter as Router } from 'react-router-dom';
Expand Down Expand Up @@ -50,7 +54,7 @@ export const ErrorFallback = ({ resetErrorBoundary }: ErrorFallbackProps) => {
const [sentryEnabled] = usePersistentProperty(SENTRY_CONSENT_KEY, SentryConsentState.Refused);

return (
<div className="flex justify-center items-center w-full h-screen bg-theme-body">
<div className="bg-theme-body flex h-screen w-full items-center justify-center">
<div className="max-w-4xl">
<Error />
<div className="mt-6 space-y-12">
Expand All @@ -64,12 +68,12 @@ export const ErrorFallback = ({ resetErrorBoundary }: ErrorFallbackProps) => {
You have opted into anonymous error reporting and this issue has been relayed to us. If you want immediate support, please share the following code to a member of staff in the #support channel on the Headwind Simulations Discord server:
</h2>

<h1 className="text-4xl font-extrabold tracking-wider text-center">{sessionId}</h1>
<h1 className="text-center text-4xl font-extrabold tracking-wider">{sessionId}</h1>
</>
)}

<div className="py-4 px-8 w-full text-theme-body hover:text-utility-red bg-utility-red hover:bg-theme-body rounded-md border-2 border-utility-red transition duration-100" onClick={resetErrorBoundary}>
<h2 className="font-bold text-center text-current">Reset Display</h2>
<div className="text-theme-body hover:text-utility-red bg-utility-red hover:bg-theme-body border-utility-red w-full rounded-md border-2 px-8 py-4 transition duration-100" onClick={resetErrorBoundary}>
<h2 className="text-center font-bold text-current">Reset Display</h2>
</div>
</div>
</div>
Expand All @@ -90,6 +94,11 @@ const setup = () => {
readSettingsFromPersistentStorage();
migrateSettings();
setSessionId();

// Needed to fetch METARs from the sim
RegisterViewListener('JS_LISTENER_FACILITY', () => {
console.log('JS_LISTENER_FACILITY registered.');
}, true);
};

if (process.env.VITE_BUILD) {
Expand Down
5 changes: 5 additions & 0 deletions hdw-a339x/src/systems/systems-host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class SystemsHost extends BaseInstrument {

this.powerSupply.connectedCallback();
this.atsu.connectedCallback();

// Needed to fetch METARs from the sim
RegisterViewListener('JS_LISTENER_FACILITY', () => {
console.log('JS_LISTENER_FACILITY registered.');
}, true);
}

public Update(): void {
Expand Down

0 comments on commit 9e57202

Please sign in to comment.