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

fix: Fixed additional issues which prevented ACE to work #7668

Merged
merged 1 commit into from
Dec 28, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,19 @@ 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");
this.sendUpdate();
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': {
Expand Down
6 changes: 3 additions & 3 deletions src/simbridge-client/src/components/McduServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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') {
Expand Down