forked from flybywiresim/aircraft
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(a380x): TERR ON ND (flybywiresim#8778)
* prepare EFIS CP and ND (cherry picked from commit 59ebb5a) * change elec supply * add VD
- Loading branch information
1 parent
7bd5b1d
commit 5d35148
Showing
8 changed files
with
243 additions
and
142 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
82 changes: 82 additions & 0 deletions
82
fbw-a380x/src/systems/instruments/src/ND/VerticalDisplay.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,82 @@ | ||
import { | ||
A380EfisNdRangeValue, | ||
ArincEventBus, | ||
EfisNdMode, | ||
EfisSide, | ||
a380EfisRangeSettings, | ||
} from '@flybywiresim/fbw-sdk'; | ||
import { ComponentProps, DisplayComponent, FSComponent, VNode } from '@microsoft/msfs-sdk'; | ||
|
||
export interface VerticalDisplayProps extends ComponentProps { | ||
bus: ArincEventBus; | ||
side: EfisSide; | ||
} | ||
|
||
export interface GenericFcuEvents { | ||
ndMode: EfisNdMode; | ||
ndRangeSetting: A380EfisNdRangeValue; | ||
} | ||
|
||
export class VerticalDisplayDummy extends DisplayComponent<VerticalDisplayProps> { | ||
private topRef = FSComponent.createRef<SVGElement>(); | ||
|
||
private ndMode: EfisNdMode = EfisNdMode.ARC; | ||
|
||
private ndRangeSetting: A380EfisNdRangeValue = 10; | ||
|
||
private updateVisibility() { | ||
if (this.ndMode === EfisNdMode.PLAN) { | ||
this.topRef.instance.style.display = 'none'; | ||
} else if (this.ndRangeSetting === -1) { | ||
this.topRef.instance.style.display = 'none'; | ||
} else { | ||
this.topRef.instance.style.display = 'block'; | ||
} | ||
} | ||
|
||
public onAfterRender(node: VNode): void { | ||
super.onAfterRender(node); | ||
|
||
const sub = this.props.bus.getSubscriber<GenericFcuEvents>(); | ||
|
||
sub | ||
.on('ndMode') | ||
.whenChanged() | ||
.handle((mode) => { | ||
this.ndMode = mode; | ||
this.updateVisibility(); | ||
}); | ||
|
||
sub | ||
.on('ndRangeSetting') | ||
.whenChanged() | ||
.handle((range) => { | ||
this.ndRangeSetting = a380EfisRangeSettings[range]; | ||
this.updateVisibility(); | ||
}); | ||
} | ||
|
||
render(): VNode { | ||
return ( | ||
<svg ref={this.topRef} viewBox="0 0 768 1024" xmlns="http://www.w3.org/2000/svg"> | ||
<g> | ||
<line x1="105" x2="105" y1="800" y2="1000" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="820" y2="820" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="850" y2="850" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="880" y2="880" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="910" y2="910" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="940" y2="940" stroke="red" stroke-width="2" /> | ||
<line x1="105" x2="120" y1="970" y2="970" stroke="red" stroke-width="2" /> | ||
</g> | ||
<g> | ||
<line x1="150" x2="690" y1="800" y2="800" stroke="red" stroke-width="2" /> | ||
<line x1="150" x2="150" y1="800" y2="1000" stroke="red" stroke-width="2" stroke-dasharray="8" /> | ||
<line x1="285" x2="285" y1="800" y2="1000" stroke="red" stroke-width="2" stroke-dasharray="8" /> | ||
<line x1="420" x2="420" y1="800" y2="1000" stroke="red" stroke-width="2" stroke-dasharray="8" /> | ||
<line x1="555" x2="555" y1="800" y2="1000" stroke="red" stroke-width="2" stroke-dasharray="8" /> | ||
<line x1="690" x2="690" y1="800" y2="1000" stroke="red" stroke-width="2" /> | ||
</g> | ||
</svg> | ||
); | ||
} | ||
} |
Oops, something went wrong.