-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(atsu/efb): use msfs metar rather than fsx cloud data (#8256)
* efb: use msfs metar rather than fsx cloud data * EFB: Rename MSFS Option * atsu: use msfs metar rather than fsx cloud data * doc: changelog
- Loading branch information
Showing
7 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
fbw-common/src/systems/datalink/router/src/msfs/MsfsConnector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2023 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import { AtsuStatusCodes, WeatherMessage } from '@datalink/common'; | ||
import { Metar } from '@microsoft/msfs-sdk'; | ||
|
||
export class MsfsConnector { | ||
public static async receiveMsfsMetar(icao: string, message: WeatherMessage): Promise<AtsuStatusCodes> { | ||
try { | ||
const metar: Metar = await Coherent.call('GET_METAR_BY_IDENT', icao); | ||
let report = metar.metarString; | ||
if (!report || metar.icao !== icao) { | ||
report = 'NO METAR AVAILABLE'; | ||
} | ||
message.Reports.push({ airport: icao, report }); | ||
return AtsuStatusCodes.Ok; | ||
} catch { | ||
message.Reports.push({ airport: icao, report: 'NO METAR AVAILABLE' }); | ||
return AtsuStatusCodes.Ok; | ||
} | ||
} | ||
} |