-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcb83f6
commit f1eb495
Showing
12 changed files
with
259 additions
and
32 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
1 change: 1 addition & 0 deletions
1
fbw-common/src/systems/instruments/src/MsfsAvionicsCommon/index.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 @@ | ||
export * from './providers'; |
15 changes: 15 additions & 0 deletions
15
fbw-common/src/systems/instruments/src/MsfsAvionicsCommon/providers/RopRowOansPublisher.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,15 @@ | ||
import { EventBus, SimVarPublisher, SimVarValueType } from '@microsoft/msfs-sdk'; | ||
|
||
export interface RopRowOansSimVars { | ||
rowRopWord1Raw: number; | ||
oansWord1Raw: number; | ||
} | ||
|
||
export class RopRowOansPublisher extends SimVarPublisher<RopRowOansSimVars> { | ||
constructor(bus: EventBus) { | ||
super(new Map([ | ||
['rowRopWord1Raw', { name: 'L:A32NX_ROW_ROP_WORD_1', type: SimVarValueType.Number }], | ||
['oansWord1Raw', { name: 'L:A32NX_OANS_WORD_1', type: SimVarValueType.Number }], | ||
]), bus); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
fbw-common/src/systems/instruments/src/MsfsAvionicsCommon/providers/index.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 @@ | ||
export * from './RopRowOansPublisher'; |
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
42 changes: 42 additions & 0 deletions
42
fbw-common/src/systems/instruments/src/ND/shared/RwyAheadAdvisory.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,42 @@ | ||
import { DisplayComponent, FSComponent, Subject, VNode } from '@microsoft/msfs-sdk'; | ||
import { Arinc429Word, ArincEventBus } from 'index-no-react'; | ||
import { FmsOansData } from 'instruments/src/OANC'; | ||
import { RopRowOansSimVars } from '../../MsfsAvionicsCommon/providers'; | ||
|
||
export interface RwyAheadAdvisoryProps { | ||
bus: ArincEventBus, | ||
} | ||
|
||
export class RwyAheadAdvisory extends DisplayComponent<RwyAheadAdvisoryProps> { | ||
private readonly flagRef = FSComponent.createRef<SVGTextElement>(); | ||
|
||
private readonly qfu = Subject.create<string>(''); | ||
|
||
onAfterRender(node: VNode) { | ||
super.onAfterRender(node); | ||
|
||
this.props.bus.getSubscriber<RopRowOansSimVars>().on('oansWord1Raw').whenChanged().handle((it) => { | ||
const w = new Arinc429Word(it); | ||
this.flagRef.instance.style.display = w.getBitValueOr(11, false) ? 'block' : 'none'; | ||
}); | ||
|
||
this.props.bus.getSubscriber<FmsOansData>().on('ndRwyAheadQfu').whenChanged().handle((it) => this.qfu.set(it)); | ||
} | ||
|
||
render(): VNode | null { | ||
return ( | ||
<g ref={this.flagRef}> | ||
<rect x="273" y="209" width="210" height="40" stroke="yellow" stroke-width="3" fill="black" style="RwyAheadAnimation" /> | ||
<text | ||
x={378} | ||
y={241} | ||
class="FontLarge Yellow MiddleAlign RwyAheadAnimation TextOutline" | ||
style="stroke-width: 0.25mm;" | ||
> | ||
{this.qfu} | ||
</text> | ||
</g> | ||
|
||
); | ||
} | ||
} |
Oops, something went wrong.