-
-
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.
Merge branch 'master' into fix/oans-ir-position
- Loading branch information
Showing
57 changed files
with
632 additions
and
149 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
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
15 changes: 15 additions & 0 deletions
15
fbw-a380x/src/systems/instruments/src/AtcMailbox/.eslintrc.js
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,15 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: ['../../../../../../.eslintrc.js', 'plugin:jsdoc/recommended-typescript-error'], | ||
|
||
plugins: ['eslint-plugin-jsdoc'], | ||
|
||
// overrides airbnb, use sparingly | ||
rules: { | ||
'react/no-unknown-property': 'off', | ||
'react/style-prop-object': 'off', | ||
'arrow-body-style': 'off', | ||
camelcase: 'off', | ||
}, | ||
}; |
61 changes: 61 additions & 0 deletions
61
fbw-a380x/src/systems/instruments/src/AtcMailbox/AtcMailbox.tsx
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,61 @@ | ||
// Copyright (c) 2024 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import { DisplayComponent, EventBus, FSComponent, Subject, VNode } from '@microsoft/msfs-sdk'; | ||
import { Button } from 'instruments/src/MFD/pages/common/Button'; | ||
import { MouseCursor } from 'instruments/src/MFD/pages/common/MouseCursor'; | ||
import { CdsDisplayUnit, DisplayUnitID } from '../MsfsAvionicsCommon/CdsDisplayUnit'; | ||
|
||
import './style.scss'; | ||
|
||
export interface AtcMailboxProps { | ||
readonly bus: EventBus; | ||
} | ||
|
||
export class AtcMailbox extends DisplayComponent<AtcMailboxProps> { | ||
private readonly topRef = FSComponent.createRef<HTMLDivElement>(); | ||
|
||
private readonly mouseCursorRef = FSComponent.createRef<MouseCursor>(); | ||
|
||
private onMouseMove(ev: MouseEvent) { | ||
this.mouseCursorRef.getOrDefault()?.updatePosition(ev.clientX, ev.clientY - 768); | ||
} | ||
|
||
private onMouseMoveHandler = this.onMouseMove.bind(this); | ||
|
||
public onAfterRender(node: VNode): void { | ||
super.onAfterRender(node); | ||
|
||
this.topRef.instance.addEventListener('mousemove', this.onMouseMoveHandler); | ||
} | ||
|
||
destroy(): void { | ||
this.topRef.getOrDefault()?.removeEventListener('mousemove', this.onMouseMoveHandler); | ||
|
||
super.destroy(); | ||
} | ||
|
||
render(): VNode | null { | ||
return ( | ||
<CdsDisplayUnit bus={this.props.bus} displayUnitId={DisplayUnitID.Sd}> | ||
<div ref={this.topRef} class="atc-mailbox-top-layout"> | ||
<div class="atc-mailbox-left-layout"> | ||
<Button label="RECALL" onClick={() => {}} buttonStyle="height: 50px;"></Button> | ||
</div> | ||
<div class="atc-mailbox-center-layout"> | ||
<div class="atc-mailbox-center-top"></div> | ||
<div class="atc-mailbox-center-bottom"> | ||
<div class="atc-mailbox-cb-1" /> | ||
<div class="atc-mailbox-cb-2" /> | ||
</div> | ||
</div> | ||
<div class="atc-mailbox-right-layout"> | ||
<Button label="CLOSE" onClick={() => {}} buttonStyle="height: 50px; justify-content: flex-end;"></Button> | ||
<Button label="PRINT" onClick={() => {}} buttonStyle="height: 50px; justify-content: flex-end;"></Button> | ||
</div> | ||
<MouseCursor side={Subject.create('CAPT')} ref={this.mouseCursorRef} /> | ||
</div> | ||
</CdsDisplayUnit> | ||
); | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"index": "./instrument.tsx", | ||
"name": "AtcMailbox", | ||
"isInteractive": true | ||
} |
Oops, something went wrong.