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(pfd): Improve FMA font size, mode change box & positions #8235

Merged
merged 29 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
873e21b
fix(fma): add smaller font size & center CLB
BravoMike99 Sep 28, 2023
4578574
fix(fma): AB font size, CLB pos
Sep 28, 2023
73f8bc0
fix(fma): revert font back to medium
Sep 29, 2023
e6329b0
fix(fma): CLB alingment and armed font size
Oct 1, 2023
b437a64
fix(fma): flex text box and alignments
Oct 4, 2023
7eb8526
Merge branch 'flybywiresim:master' into fix-fma-clb-armed
BravoMike99 Oct 4, 2023
8b78463
fix(fma): MAN pos in non flex fma
Oct 5, 2023
c1f08bd
fix(fma): mode change box size of A1 cell
Oct 6, 2023
7f08b1a
slightly reduce armed fma font size
BravoMike99 Oct 6, 2023
591e297
fix armed mode y pos & A3 cell
BravoMike99 Oct 7, 2023
433e943
fix(fma): Y & X pos of vertical armed modes
BravoMike99 Oct 7, 2023
f668f68
revert ATHR & AB message Y pos
BravoMike99 Oct 8, 2023
c3cc0bf
fix vertical armed mode X & mode change size
BravoMike99 Oct 8, 2023
1b71819
hide + sign if V/S or FPA is 0
BravoMike99 Oct 13, 2023
ebb8d89
change lateral & vertical mode change
BravoMike99 Oct 13, 2023
c7c4207
adjust V/S & FPA for new mode change
BravoMike99 Oct 13, 2023
25ca54a
Merge branch 'flybywiresim:master' into fix-fma-clb-armed
BravoMike99 Oct 13, 2023
a381c28
improve vertical mode armed pos
BravoMike99 Oct 13, 2023
9678beb
reduce font size on THR idle
BravoMike99 Oct 14, 2023
c61360a
fix typo in G/S* and FINAL pos
BravoMike99 Oct 14, 2023
b9c2873
update changelog
BravoMike99 Oct 15, 2023
3cfef09
remove leftover comment
BravoMike99 Oct 16, 2023
9bf7d0b
Merge branch 'master' into fix-fma-clb-armed
tracernz Oct 24, 2023
82edff9
Merge branch 'master' into fix-fma-clb-armed
lukecologne Nov 23, 2023
e2b4aad
use whitespaces for CLB armed pos
BravoMike99 Nov 23, 2023
4d24b8a
Merge branch 'master' into fix-fma-clb-armed
lukecologne Nov 24, 2023
8767b17
fix: fix TCAS armed position after font size change
lukecologne Nov 24, 2023
e4d8a3c
fix(fma): center TCAS armed position
lukecologne Nov 25, 2023
9ffaa95
Merge branch 'master' into fix-fma-clb-armed
beheh Dec 1, 2023
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
2 changes: 2 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
1. [EFCS] Add precontrol to roll angle controller to improve dynamic response - @lukecologne (luke)
1. [EFCS] Increase maximum sim rate limit to 8 due to improvements in roll law stability - @lukecologne (luke)
1. [HOPPIE] Remove ATSU/AOC source checks - @auroraisluna (alepouna)
1. [PFD] Graphical improvements and updates to the FMA - @BravoMike99 (bruno_pt99)
1. [PFD] Hide '+' sign on V/S & FPA FMA if selected value is 0 - @BravoMike99 (bruno_pt99)

## 0.11.0

Expand Down
67 changes: 39 additions & 28 deletions fbw-a32nx/src/systems/instruments/src/PFD/FMA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Row2 extends DisplayComponent<{ bus: ArincEventBus, isAttExcessive: Subscr
class A2Cell extends DisplayComponent<{ bus: ArincEventBus }> {
private text = Subject.create('');

private className = Subject.create('FontMedium MiddleAlign Cyan');
private className = Subject.create('FontMediumSmaller MiddleAlign Cyan');

private autoBrkRef = FSComponent.createRef<SVGTextElement>();

Expand Down Expand Up @@ -381,15 +381,15 @@ class A1A2Cell extends ShowForSecondsComponent<CellProps> {
this.displayModeChangedPath(true);
text = `
<path class="NormalStroke White" d="m25.114 1.8143v13.506h-16.952v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">TOGA</text>
`;
break;
case 2:
this.displayModeChangedPath(true);
text = `<g>
<path class="NormalStroke White" d="m31.521 1.8143v13.506h-30.217v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">GA SOFT</text>
</g>`;
break;
Expand All @@ -398,11 +398,11 @@ class A1A2Cell extends ShowForSecondsComponent<CellProps> {
const FlexTemp = Math.round(this.flexTemp);
const FlexText = FlexTemp >= 0 ? (`+${FlexTemp}`) : FlexTemp.toString();
text = `<g>
<path class="NormalStroke White" d="m31.521 1.8143v13.506h-30.217v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">
<tspan xml:space="preserve">FLX </tspan>
<tspan class="Cyan">${FlexText}</tspan>
<path class="NormalStroke White" d="m30.521 1.8143v13.506h-27.217v-13.506z" />
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="9.669141" y="14.351689">FLX</text>
<text class="FontMedium MiddleAlign Cyan" x="24.099141" y="14.351689">
${FlexText}
</text>
</g>`;

Expand All @@ -411,23 +411,23 @@ class A1A2Cell extends ShowForSecondsComponent<CellProps> {
this.displayModeChangedPath(true);
text = `<g>
<path class="NormalStroke White" d="m25.114 1.8143v13.506h-16.952v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">DTO</text>
</g>`;
break;
case 5:
this.displayModeChangedPath(true);
text = `<g>
<path class="NormalStroke White" d="m25.114 1.8143v13.506h-16.952v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">MCT</text>
</g>`;
break;
case 6:
this.displayModeChangedPath(true);
text = `<g>
<path class="NormalStroke Amber" d="m25.114 1.8143v13.506h-16.952v-13.506z" />
<text class="FontMedium MiddleAlign White" x="16.782249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="17.052249" y="7.1280665">MAN</text>
<text class="FontMedium MiddleAlign White" x="16.869141" y="14.351689">THR</text>
</g>`;
break;
Expand All @@ -452,7 +452,7 @@ class A1A2Cell extends ShowForSecondsComponent<CellProps> {
this.displayModeChangedPath();
break;
case 12:
text = '<text class="FontMedium MiddleAlign Green" x="16.782249" y="7.1280665">THR IDLE</text>';
text = '<text class="FontMediumSmaller MiddleAlign Green" x="16.782249" y="7.1280665">THR IDLE</text>';
this.displayModeChangedPath();
break;
case 13:
Expand Down Expand Up @@ -527,7 +527,7 @@ class A1A2Cell extends ShowForSecondsComponent<CellProps> {
render(): VNode {
return (
<>
<path ref={this.modeChangedPathRef} visibility="hidden" class="NormalStroke White" d="m0.70556 1.8143h30.927v6.0476h-30.927z" />
<path ref={this.modeChangedPathRef} visibility="hidden" class="NormalStroke White" d="m3.3 1.8143h27.127v6.0476h-27.127z" />
<g ref={this.cellRef} />
</>
);
Expand Down Expand Up @@ -582,7 +582,7 @@ class A3Cell extends DisplayComponent<A3CellProps> {
private handleAutobrakeMode() {
if (this.autobrakeMode === 3 && !this.AB3Message) {
this.textSub.set('BRK MAX');
this.classSub.set('FontMedium MiddleAlign Cyan');
this.classSub.set('FontMediumSmaller MiddleAlign Cyan');
} else {
this.textSub.set('');
}
Expand Down Expand Up @@ -680,6 +680,8 @@ class B1Cell extends ShowForSecondsComponent<CellProps> {

private activeVerticalModeSub = Subject.create(0);

private activeVerticalModeClassSub = Subject.create('');

private speedProtectionPathRef = FSComponent.createRef<SVGPathElement>();

private inModeReversionPathRef = FSComponent.createRef<SVGPathElement>();
Expand Down Expand Up @@ -772,14 +774,18 @@ class B1Cell extends ShowForSecondsComponent<CellProps> {
text = 'ALT CRZ';
break; */
case VerticalMode.FPA: {
const FPAText = `${(this.FPA >= 0 ? '+' : '')}${(Math.round(this.FPA * 10) / 10).toFixed(1)}°`;
const FPAText = `${(this.FPA > 0 ? '+' : '')}${(Math.round(this.FPA * 10) / 10).toFixed(1)}°`;

text = 'FPA';
// if FPA is 0 give it an empty space for where the '+' and '-' will be.
if (this.FPA === 0) {
text += ' ';
}
additionalText = FPAText;
break;
}
case VerticalMode.VS: {
const VSText = `${(this.selectedVS >= 0 ? '+' : '')}${Math.round(this.selectedVS).toString()}`.padStart(5, ' ');
const VSText = `${(this.selectedVS > 0 ? '+' : '')}${Math.round(this.selectedVS).toString()}`.padStart(5, ' ');

text = 'V/S';

Expand All @@ -806,10 +812,15 @@ class B1Cell extends ShowForSecondsComponent<CellProps> {
this.speedProtectionPathRef.instance.setAttribute('visibility', 'hidden');
}

const boxPathString = this.activeVerticalModeSub.get() === 50 && this.tcasModeDisarmed ? 'm34.656 1.8143h29.918v13.506h-29.918z' : 'm34.656 1.8143h29.918v6.0476h-29.918z';
const boxPathString = this.activeVerticalModeSub.get() === 50 && this.tcasModeDisarmed ? 'm35.756 1.8143h27.918v13.506h-27.918z' : 'm35.756 1.8143h27.918v6.0476h-27.918z';

this.boxPathStringSub.set(boxPathString);

// VS FPA has a smaller font than the other active modes
const VsFPA = this.activeVerticalModeSub.get() === 14 || this.activeVerticalModeSub.get() === 15;

this.activeVerticalModeClassSub.set(VsFPA ? 'FontMediumSmaller MiddleAlign Green' : 'FontMedium MiddleAlign Green');

this.fmaTextRef.instance.innerHTML = `<tspan>${text}</tspan><tspan xml:space="preserve" class=${inSpeedProtection ? 'PulseCyanFill' : 'Cyan'}>${additionalText}</tspan>`;

return text.length > 0;
Expand Down Expand Up @@ -873,10 +884,10 @@ class B1Cell extends ShowForSecondsComponent<CellProps> {

<path ref={this.modeChangedPathRef} class={this.boxClassSub} visibility="hidden" d={this.boxPathStringSub} />

<path ref={this.speedProtectionPathRef} class="NormalStroke Amber BlinkInfinite" d="m34.656 1.8143h29.918v6.0476h-29.918z" />
<path ref={this.inModeReversionPathRef} class="NormalStroke White BlinkInfinite" d="m34.656 1.8143h29.918v6.0476h-29.918z" />
<path ref={this.speedProtectionPathRef} class="NormalStroke Amber BlinkInfinite" d="m35.756 1.8143h27.918v6.0476h-27.918z" />
<path ref={this.inModeReversionPathRef} class="NormalStroke White BlinkInfinite" d="m35.756 1.8143h27.918v6.0476h-27.918z" />

<text ref={this.fmaTextRef} style="white-space: pre" class="FontMedium MiddleAlign Green" x="49.921795" y="7.1040988">
<text ref={this.fmaTextRef} style="white-space: pre" class={this.activeVerticalModeClassSub} x="49.921795" y="7.1040988">

{/* set directly via innerhtml as tspan was invisble for some reason when set here */}

Expand Down Expand Up @@ -909,7 +920,7 @@ class B2Cell extends DisplayComponent<CellProps> {
let text1: string;
let color1 = 'Cyan';
if (clbArmed) {
text1 = 'CLB';
text1 = ' CLB'; // spaces added to center armed FMA as per newer DMC stnadards
} else if (desArmed) {
text1 = 'DES';
} else if (altCstArmed) {
Expand All @@ -932,15 +943,15 @@ class B2Cell extends DisplayComponent<CellProps> {

this.text1Sub.set(text1);
this.text2Sub.set(text2);
this.classSub.set(`FontMedium MiddleAlign ${color1}`);
this.classSub.set(`FontMediumSmaller MiddleAlign ${color1}`);
});
}

render(): VNode {
return (
<g>
<text class={this.classSub} x="41.477474" y="14.329653">{this.text1Sub}</text>
<text class="FontMedium MiddleAlign Cyan" x="54.59803" y="14.382949">{this.text2Sub}</text>
<text class={this.classSub} style="white-space: pre" x="40.777474" y="13.629653">{this.text1Sub}</text>
<text class="FontMediumSmaller MiddleAlign Cyan" x="56.19803" y="13.629653">{this.text2Sub}</text>
</g>
);
}
Expand Down Expand Up @@ -1061,7 +1072,7 @@ class C1Cell extends ShowForSecondsComponent<CellProps> {

return (
<g>
<path ref={this.modeChangedPathRef} class="NormalStroke White" visibility="hidden" d="m100.87 1.8143v6.0476h-33.075l1e-6 -6.0476z" />
<path ref={this.modeChangedPathRef} class="NormalStroke White" visibility="hidden" d="m99.87 1.8143v6.0476h-31.075l1e-6 -6.0476z" />
<text class="FontMedium MiddleAlign Green" x="84.856567" y="6.9873109">{this.textSub}</text>
</g>
);
Expand Down Expand Up @@ -1123,7 +1134,7 @@ class C2Cell extends DisplayComponent<CellProps> {

render(): VNode {
return (
<text class="FontMedium MiddleAlign Cyan" x="84.734184" y="14.440415">{this.textSub}</text>
<text class="FontMediumSmaller MiddleAlign Cyan" x="84.234184" y="13.629653">{this.textSub}</text>
);
}
}
Expand Down Expand Up @@ -1223,8 +1234,8 @@ const getBC3Message = (
text = 'FOR GA: SET TOGA';
className = 'FontMedium PulseAmber9Seconds Amber';
} else if (TCASArmed && !isAttExcessive) {
text = ' TCAS ';
className = 'FontMedium Cyan';
text = 'TCAS ';
className = 'FontMediumSmaller Cyan';
} else if (false) {
text = 'DISCONNECT AP FOR LDG';
className = 'FontMedium PulseAmber9Seconds Amber';
Expand Down
4 changes: 4 additions & 0 deletions fbw-a32nx/src/systems/instruments/src/PFD/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
font-size: 6px;
}

.FontMediumSmaller {
font-size: 5.4px;
}

.FontSmall {
font-size: 5px;
}
Expand Down
Loading