Skip to content

Commit

Permalink
fix(pfd): speed tape outline at low speeds (#6219)
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh authored and aguther committed Dec 12, 2021
1 parent 1f4b8dc commit 42f134b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## 0.7.4
1. [FBW] Intermediate support for aileron keyboard events - @aguther (Andreas Guther)
1. [MODEL] Adjust heat effect on ENG1+2 - @bouveng (Johan Bouveng)
1. [PFD] Fixed speed tape outline at low speeds - @beheh (Benedict Etzel)

## 0.7.3

Expand Down
5 changes: 3 additions & 2 deletions src/instruments/src/PFD/SpeedIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ export const AirspeedIndicatorOfftape = ({ airspeed, targetSpeed, speedIsManaged

const clampedSpeed = Math.max(Math.min(airspeed, 660), 30);
const clampedTargetSpeed = Math.max(Math.min(targetSpeed, 660), 30);
const showLower = clampedSpeed > 72;
return (
<g id="SpeedOfftapeGroup">
<path id="SpeedTapeOutlineUpper" className="NormalStroke White" d="m1.9058 38.086h21.859" />
<path id="SpeedTapeOutlineLower" className="NormalStroke White" d="m1.9058 123.56h21.859" />
{showLower ? <path id="SpeedTapeOutlineLower" className="NormalStroke White" d="m1.9058 123.56h21.859" /> : null}
<SpeedTarget airspeed={clampedSpeed} targetSpeed={clampedTargetSpeed} isManaged={speedIsManaged} />
<path className="Fill Yellow SmallOutline" d="m13.994 80.46v0.7257h6.5478l3.1228 1.1491v-3.0238l-3.1228 1.1491z" />
<path className="Fill Yellow SmallOutline" d="m0.092604 81.185v-0.7257h2.0147v0.7257z" />
Expand All @@ -220,7 +221,7 @@ const SpeedTarget = ({ airspeed, targetSpeed, isManaged }) => {
};

const SpeedTapeOutline = ({ airspeed, isRed = false }) => {
const length = Math.max(Math.min(airspeed, 72), 30) * 1.01754 + 12.2104;
const length = 42.9 + Math.max(Math.max(Math.min(airspeed, 72.1), 30) - 30, 0);
const className = isRed ? 'NormalStroke Red' : 'NormalStroke White';

return (
Expand Down

0 comments on commit 42f134b

Please sign in to comment.