From c53d3aa6e9bd2bd8af0cd35424a1b41767b39905 Mon Sep 17 00:00:00 2001 From: Frank Kopp Date: Sun, 25 Dec 2022 21:55:40 +0100 Subject: [PATCH] Fixed additional issues which prevented ACE to work --- .../FlyByWire_A320_Neo/CDU/A320_Neo_CDU_MainDisplay.js | 6 +++--- src/simbridge-client/src/components/McduServerClient.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_MainDisplay.js b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_MainDisplay.js index 362c1cce19c..d5695e0cd16 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_MainDisplay.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_MainDisplay.js @@ -185,7 +185,7 @@ class A320_Neo_CDU_MainDisplay extends FMCMainDisplay { mcduServerClientEventHandler(event) { switch (event.type) { case 'open': { - console.log(`[MCDU] Websocket connection to SimBridge opened. (${SimBridgeClient.McduServerClient.url})`); + console.log(`[MCDU] Websocket connection to SimBridge opened. (${SimBridgeClient.McduServerClient.url()})`); (new NXNotifManager).showNotification({title: "MCDU CONNECTED", message: "A32NX MCDU successfully connected to SimBridge MCDU Server.", timeout: 5000}); this.sendToMcduServerClient("mcduConnected"); @@ -193,11 +193,11 @@ class A320_Neo_CDU_MainDisplay extends FMCMainDisplay { break; } case 'close': { - console.log(`[MCDU] Websocket connection to SimBridge closed. (${SimBridgeClient.McduServerClient.url})`); + console.log(`[MCDU] Websocket connection to SimBridge closed. (${SimBridgeClient.McduServerClient.url()})`); break; } case 'error': { - console.log(`[MCDU] Websocket connection to SimBridge error. (${SimBridgeClient.McduServerClient.url}): ${event.get()}`); + console.log(`[MCDU] Websocket connection to SimBridge error. (${SimBridgeClient.McduServerClient.url()}): ${event.get()}`); break; } case 'message': { diff --git a/src/simbridge-client/src/components/McduServerClient.ts b/src/simbridge-client/src/components/McduServerClient.ts index 0159467f23c..972fec7f39d 100644 --- a/src/simbridge-client/src/components/McduServerClient.ts +++ b/src/simbridge-client/src/components/McduServerClient.ts @@ -8,9 +8,9 @@ import { ClientState } from './ClientState'; * Class to communicate with the SimBridge MCDU server */ export class McduServerClient { - public static port = () => NXDataStore.get('CONFIG_SIMBRIDGE_PORT', '8380'); + public static port = ():string => NXDataStore.get('CONFIG_SIMBRIDGE_PORT', '8380'); - public static url: string = `ws://127.0.0.1:${this.port()}/interfaces/v1/mcdu`.replace(/\s+/g, ''); + public static url = ():string => `ws://127.0.0.1:${this.port()}/interfaces/v1/mcdu`.replace(/\s+/g, ''); private state: ClientState = ClientState.getInstance(); @@ -32,7 +32,7 @@ export class McduServerClient { this.disconnect(); // Connect web socket - this.socket = new WebSocket(McduServerClient.url); + this.socket = new WebSocket(McduServerClient.url()); // Setup up event handler from the caller if (eventHandler && typeof (eventHandler) === 'function') {