flight-indicators 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/dist/index.cjs +439 -214
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -2
- package/dist/index.d.ts +48 -2
- package/dist/index.js +439 -215
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ var DEFAULT_ANIMATION_MS = 300;
|
|
|
7
7
|
var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
8
8
|
var finite = (value, fallback = 0) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
9
9
|
var round = (n) => Math.round(n * 100) / 100;
|
|
10
|
-
function polar(r,
|
|
11
|
-
const a =
|
|
10
|
+
function polar(r, deg2, cx = CENTER, cy = CENTER) {
|
|
11
|
+
const a = deg2 * Math.PI / 180;
|
|
12
12
|
return [round(cx + r * Math.sin(a)), round(cy - r * Math.cos(a))];
|
|
13
13
|
}
|
|
14
14
|
function arcPath(r, startDeg, endDeg) {
|
|
@@ -18,9 +18,9 @@ function arcPath(r, startDeg, endDeg) {
|
|
|
18
18
|
const sweep = endDeg >= startDeg ? 1 : 0;
|
|
19
19
|
return `M ${x1} ${y1} A ${r} ${r} 0 ${largeArc} ${sweep} ${x2} ${y2}`;
|
|
20
20
|
}
|
|
21
|
-
function tickPath(r1, r2,
|
|
22
|
-
const [x1, y1] = polar(r1,
|
|
23
|
-
const [x2, y2] = polar(r2,
|
|
21
|
+
function tickPath(r1, r2, deg2) {
|
|
22
|
+
const [x1, y1] = polar(r1, deg2);
|
|
23
|
+
const [x2, y2] = polar(r2, deg2);
|
|
24
24
|
return `M ${x1} ${y1} L ${x2} ${y2}`;
|
|
25
25
|
}
|
|
26
26
|
function range(start, end, step) {
|
|
@@ -158,9 +158,9 @@ function AttitudeIndicator({ roll = 0, pitch = 0, pitchLimit = 40, ...props }) {
|
|
|
158
158
|
]
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
|
-
/* @__PURE__ */ jsx2("g", { stroke: "#fff", strokeWidth: "4", strokeLinecap: "round", children: ROLL_MARKS.flatMap(([
|
|
162
|
-
/* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, -
|
|
163
|
-
/* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len,
|
|
161
|
+
/* @__PURE__ */ jsx2("g", { stroke: "#fff", strokeWidth: "4", strokeLinecap: "round", children: ROLL_MARKS.flatMap(([deg2, len]) => [
|
|
162
|
+
/* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, -deg2) }, `l${deg2}`),
|
|
163
|
+
/* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, deg2) }, `r${deg2}`)
|
|
164
164
|
]) }),
|
|
165
165
|
/* @__PURE__ */ jsx2("path", { d: `M ${CENTER} ${CENTER - 158} l -10 -18 h 20 z`, fill: "#fff" }),
|
|
166
166
|
/* @__PURE__ */ jsx2("g", { "data-testid": "attitude-roll-pointer", style: motionStyle(`rotate(${-displayRoll}deg)`, duration), children: /* @__PURE__ */ jsx2("path", { d: `M ${CENTER} ${CENTER - 156} l -10 18 h 20 z`, fill: "#ffb000" }) })
|
|
@@ -328,8 +328,8 @@ var TUBE_CY = 40;
|
|
|
328
328
|
var TUBE_R = 240;
|
|
329
329
|
var TUBE_SPAN = 16;
|
|
330
330
|
var BALL_TRAVEL = 13;
|
|
331
|
-
function tubePoint(
|
|
332
|
-
const a =
|
|
331
|
+
function tubePoint(deg2) {
|
|
332
|
+
const a = deg2 * Math.PI / 180;
|
|
333
333
|
return [CENTER + TUBE_R * Math.sin(a), TUBE_CY + TUBE_R * Math.cos(a)];
|
|
334
334
|
}
|
|
335
335
|
function TurnCoordinator({ turnRate = 0, slip = 0, ...props }) {
|
|
@@ -380,7 +380,7 @@ var MIRROR = { L: "R", C: "C", R: "L" };
|
|
|
380
380
|
var WIND = "#3cc8ff";
|
|
381
381
|
var AMBER = "#ffb000";
|
|
382
382
|
var GREEN = "#3ddc84";
|
|
383
|
-
var norm = (
|
|
383
|
+
var norm = (deg2) => (deg2 % 360 + 360) % 360;
|
|
384
384
|
function designator(heading) {
|
|
385
385
|
const n = Math.round(norm(heading) / 10) % 36;
|
|
386
386
|
return String(n === 0 ? 36 : n).padStart(2, "0");
|
|
@@ -562,13 +562,18 @@ function WindIndicator({
|
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
// src/components/VorIndicator.tsx
|
|
565
|
-
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
565
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
566
566
|
var CARDINALS3 = { 0: "N", 90: "E", 180: "S", 270: "W" };
|
|
567
567
|
var AMBER2 = "#ffb000";
|
|
568
568
|
var FULL_SCALE_DEG = 10;
|
|
569
569
|
var DOT_SPACING = 22;
|
|
570
570
|
var FULL_SCALE_PX = DOT_SPACING * 5;
|
|
571
|
-
var
|
|
571
|
+
var PIVOT_Y = CENTER - 100;
|
|
572
|
+
var SWING_LENGTH = 165;
|
|
573
|
+
var SWING_DOT_RADIUS = 156;
|
|
574
|
+
var SWING_DEG_PER_DOT = 7.5;
|
|
575
|
+
var SWING_FULL_SCALE_DEG = SWING_DEG_PER_DOT * 5;
|
|
576
|
+
var norm2 = (deg2) => (deg2 % 360 + 360) % 360;
|
|
572
577
|
var signedDiff = (a, b) => ((a - b) % 360 + 540) % 360 - 180;
|
|
573
578
|
function vorDeviation(course, radial) {
|
|
574
579
|
const d = signedDiff(radial, course);
|
|
@@ -593,7 +598,7 @@ function Flag({ y, up, visible, testId }) {
|
|
|
593
598
|
/* @__PURE__ */ jsx9("text", { x: CENTER + 22, y, fill: "#fff", fontSize: "15", fontWeight: "bold", dominantBaseline: "central", children: up ? "TO" : "FROM" })
|
|
594
599
|
] });
|
|
595
600
|
}
|
|
596
|
-
function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ...props }) {
|
|
601
|
+
function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, needle = "slide", ...props }) {
|
|
597
602
|
const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
|
|
598
603
|
const crs = finite(course);
|
|
599
604
|
const computed = typeof radial === "number" && Number.isFinite(radial) ? vorDeviation(crs, radial) : void 0;
|
|
@@ -602,7 +607,9 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ..
|
|
|
602
607
|
const flag = !signal ? "OFF" : toFrom ?? computed?.toFrom ?? "OFF";
|
|
603
608
|
const displayCourse = useContinuousAngle(crs);
|
|
604
609
|
const courseText = String(Math.round(norm2(crs)) || 360).padStart(3, "0");
|
|
610
|
+
const swing = needle === "swing";
|
|
605
611
|
const needleX = dev / FULL_SCALE_DEG * FULL_SCALE_PX;
|
|
612
|
+
const needleAngle = -(dev / FULL_SCALE_DEG) * SWING_FULL_SCALE_DEG;
|
|
606
613
|
const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
|
|
607
614
|
const label2 = signal ? `VOR indicator: course ${courseText}\xB0, needle ${devText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : `VOR indicator: course ${courseText}\xB0, no signal`;
|
|
608
615
|
return /* @__PURE__ */ jsxs9(InstrumentFrame, { ...props, label: label2, children: [
|
|
@@ -630,11 +637,77 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ..
|
|
|
630
637
|
/* @__PURE__ */ jsx9("path", { d: `M ${CENTER} ${CENTER - 150} l -10 -28 h 20 z`, fill: AMBER2, stroke: "#000", strokeWidth: "1.5" }),
|
|
631
638
|
/* @__PURE__ */ jsx9("path", { d: `M ${CENTER} ${CENTER + 150} l -8 24 h 16 z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }),
|
|
632
639
|
/* @__PURE__ */ jsx9("g", { stroke: AMBER2, strokeWidth: "4", strokeLinecap: "round", children: [45, 90, 135, 225, 270, 315].map((a) => /* @__PURE__ */ jsx9("path", { d: tickPath(192, 178, a) }, a)) }),
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
640
|
+
swing ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
641
|
+
/* @__PURE__ */ jsx9("g", { fill: "#fff", stroke: "#000", strokeWidth: "1", children: range(1, 5, 1).flatMap((i) => [-i, i]).map((i) => {
|
|
642
|
+
const [x, y] = polar(SWING_DOT_RADIUS, 180 - i * SWING_DEG_PER_DOT, CENTER, PIVOT_Y);
|
|
643
|
+
return /* @__PURE__ */ jsx9("circle", { cx: x, cy: y, r: "5" }, i);
|
|
644
|
+
}) }),
|
|
645
|
+
/* @__PURE__ */ jsx9(
|
|
646
|
+
"rect",
|
|
647
|
+
{
|
|
648
|
+
x: CENTER - 6,
|
|
649
|
+
y: PIVOT_Y + SWING_DOT_RADIUS - 10,
|
|
650
|
+
width: "12",
|
|
651
|
+
height: "20",
|
|
652
|
+
rx: "2",
|
|
653
|
+
fill: "none",
|
|
654
|
+
stroke: "#fff",
|
|
655
|
+
strokeWidth: "2.5"
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ jsx9("rect", { x: CENTER + 46, y: CENTER - 72, width: "46", height: "76", rx: "5", fill: "#000", stroke: "#555", strokeWidth: "2" }),
|
|
659
|
+
/* @__PURE__ */ jsxs9("g", { fill: "#ccc", fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
660
|
+
/* @__PURE__ */ jsx9("text", { x: CENTER + 69, y: CENTER - 59, children: "TO" }),
|
|
661
|
+
/* @__PURE__ */ jsx9("text", { x: CENTER + 69, y: CENTER - 9, children: "FR" })
|
|
662
|
+
] }),
|
|
663
|
+
/* @__PURE__ */ jsxs9("g", { stroke: "#000", strokeWidth: "1.5", strokeLinejoin: "round", fill: "#fff", children: [
|
|
664
|
+
/* @__PURE__ */ jsx9(
|
|
665
|
+
"path",
|
|
666
|
+
{
|
|
667
|
+
"data-testid": "vor-to",
|
|
668
|
+
d: `M ${CENTER + 69} ${CENTER - 44} l 11 18 h -22 z`,
|
|
669
|
+
opacity: flag === "TO" ? 1 : 0,
|
|
670
|
+
style: { transition: "opacity 200ms ease-out" }
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
/* @__PURE__ */ jsx9(
|
|
674
|
+
"path",
|
|
675
|
+
{
|
|
676
|
+
"data-testid": "vor-from",
|
|
677
|
+
d: `M ${CENTER + 69} ${CENTER - 22} l 11 -18 h -22 z`,
|
|
678
|
+
opacity: flag === "FROM" ? 1 : 0,
|
|
679
|
+
style: { transition: "opacity 200ms ease-out" }
|
|
680
|
+
}
|
|
681
|
+
)
|
|
682
|
+
] }),
|
|
683
|
+
/* @__PURE__ */ jsxs9("g", { "data-testid": "vor-needle", style: motionStyle(`rotate(${needleAngle}deg)`, duration, CENTER, PIVOT_Y), children: [
|
|
684
|
+
/* @__PURE__ */ jsx9(
|
|
685
|
+
"path",
|
|
686
|
+
{
|
|
687
|
+
d: `M ${CENTER} ${PIVOT_Y} V ${PIVOT_Y + SWING_LENGTH}`,
|
|
688
|
+
stroke: "#000",
|
|
689
|
+
strokeWidth: "7",
|
|
690
|
+
strokeLinecap: "round"
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ jsx9(
|
|
694
|
+
"path",
|
|
695
|
+
{
|
|
696
|
+
d: `M ${CENTER} ${PIVOT_Y} V ${PIVOT_Y + SWING_LENGTH}`,
|
|
697
|
+
stroke: "#fff",
|
|
698
|
+
strokeWidth: "4",
|
|
699
|
+
strokeLinecap: "round"
|
|
700
|
+
}
|
|
701
|
+
)
|
|
702
|
+
] }),
|
|
703
|
+
/* @__PURE__ */ jsx9("circle", { cx: CENTER, cy: PIVOT_Y, r: "6", fill: "#333", stroke: "#fff", strokeWidth: "2" })
|
|
704
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
705
|
+
/* @__PURE__ */ jsx9("g", { fill: "#fff", stroke: "#000", strokeWidth: "1", children: range(1, 5, 1).flatMap((i) => [-i, i]).map((i) => /* @__PURE__ */ jsx9("circle", { cx: CENTER + i * DOT_SPACING, cy: CENTER, r: "5" }, i)) }),
|
|
706
|
+
/* @__PURE__ */ jsx9("circle", { cx: CENTER, cy: CENTER, r: "9", fill: "none", stroke: "#fff", strokeWidth: "2.5" }),
|
|
707
|
+
/* @__PURE__ */ jsx9(Flag, { y: CENTER - 54, up: true, visible: flag === "TO", testId: "vor-to" }),
|
|
708
|
+
/* @__PURE__ */ jsx9(Flag, { y: CENTER + 54, up: false, visible: flag === "FROM", testId: "vor-from" }),
|
|
709
|
+
/* @__PURE__ */ jsx9("g", { "data-testid": "vor-needle", style: motionStyle(`translate(${needleX}px, 0px)`, duration), children: /* @__PURE__ */ jsx9("rect", { x: CENTER - 3, y: CENTER - 68, width: "6", height: "136", rx: "3", fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) })
|
|
710
|
+
] }),
|
|
638
711
|
/* @__PURE__ */ jsx9("rect", { x: CENTER - 44, y: CENTER + 72, width: "88", height: "26", rx: "4", fill: "#000", stroke: "#555", strokeWidth: "2" }),
|
|
639
712
|
/* @__PURE__ */ jsxs9(
|
|
640
713
|
"text",
|
|
@@ -654,23 +727,173 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ..
|
|
|
654
727
|
]
|
|
655
728
|
}
|
|
656
729
|
),
|
|
657
|
-
/* @__PURE__ */ jsxs9(
|
|
658
|
-
|
|
659
|
-
|
|
730
|
+
/* @__PURE__ */ jsxs9(
|
|
731
|
+
"g",
|
|
732
|
+
{
|
|
733
|
+
"data-testid": "vor-nav-flag",
|
|
734
|
+
opacity: signal ? 0 : 1,
|
|
735
|
+
style: { transition: "opacity 200ms ease-out" },
|
|
736
|
+
transform: swing ? "translate(-64 52)" : void 0,
|
|
737
|
+
children: [
|
|
738
|
+
/* @__PURE__ */ jsx9("rect", { x: CENTER - 28, y: CENTER - 98, width: "56", height: "24", rx: "3", fill: "#d42626", stroke: "#000", strokeWidth: "1.5" }),
|
|
739
|
+
/* @__PURE__ */ jsx9("text", { x: CENTER, y: CENTER - 85, fill: "#fff", fontSize: "15", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "NAV" })
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
)
|
|
743
|
+
] });
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// src/components/IlsIndicator.tsx
|
|
747
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
748
|
+
var CARDINALS4 = { 0: "N", 90: "E", 180: "S", 270: "W" };
|
|
749
|
+
var YELLOW = "#d8e03a";
|
|
750
|
+
var FLAG = "#d9814f";
|
|
751
|
+
var SCALE_GREY = "#2c2c2c";
|
|
752
|
+
var DOT_SPACING2 = 18;
|
|
753
|
+
var FULL_SCALE_PX2 = DOT_SPACING2 * 5;
|
|
754
|
+
var LOC_PIVOT_Y = CENTER + 108;
|
|
755
|
+
var GS_PIVOT_X = CENTER - 108;
|
|
756
|
+
var SWING_LENGTH2 = 260;
|
|
757
|
+
var FLAG_OFFSET = 108;
|
|
758
|
+
var NEEDLE_CLIP_R = 150;
|
|
759
|
+
var SCALE_HALF = 112;
|
|
760
|
+
var GS_PARK_PX = -120;
|
|
761
|
+
var norm3 = (deg2) => (deg2 % 360 + 360) % 360;
|
|
762
|
+
var round2 = (n) => Math.round(n * 100) / 100 + 0;
|
|
763
|
+
var deg = (rad) => round2(rad * 180 / Math.PI);
|
|
764
|
+
function FlagWindow({ x, y, axis, visible, testId }) {
|
|
765
|
+
const [w, h] = axis === "h" ? [52, 24] : [24, 52];
|
|
766
|
+
const arrow = axis === "h" ? `M ${x - 18} ${y} H ${x + 18} M ${x - 12} ${y - 6} L ${x - 18} ${y} L ${x - 12} ${y + 6} M ${x + 12} ${y - 6} L ${x + 18} ${y} L ${x + 12} ${y + 6}` : `M ${x} ${y - 18} V ${y + 18} M ${x - 6} ${y - 12} L ${x} ${y - 18} L ${x + 6} ${y - 12} M ${x - 6} ${y + 12} L ${x} ${y + 18} L ${x + 6} ${y + 12}`;
|
|
767
|
+
return /* @__PURE__ */ jsxs10("g", { children: [
|
|
768
|
+
/* @__PURE__ */ jsx10("rect", { x: x - w / 2 - 3, y: y - h / 2 - 3, width: w + 6, height: h + 6, rx: "3", fill: "#050505", stroke: "#444", strokeWidth: "1.5" }),
|
|
769
|
+
/* @__PURE__ */ jsxs10("g", { "data-testid": testId, opacity: visible ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: [
|
|
770
|
+
/* @__PURE__ */ jsx10("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: "2", fill: FLAG }),
|
|
771
|
+
/* @__PURE__ */ jsx10("path", { d: arrow, stroke: "#1a1a1a", strokeWidth: "3", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
772
|
+
] })
|
|
773
|
+
] });
|
|
774
|
+
}
|
|
775
|
+
function NeedleLine({ d }) {
|
|
776
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
777
|
+
/* @__PURE__ */ jsx10("path", { d, stroke: "#000", strokeWidth: "7", strokeLinecap: "round" }),
|
|
778
|
+
/* @__PURE__ */ jsx10("path", { d, stroke: "#eee", strokeWidth: "4", strokeLinecap: "round" })
|
|
779
|
+
] });
|
|
780
|
+
}
|
|
781
|
+
function IlsIndicator({
|
|
782
|
+
course = 0,
|
|
783
|
+
radial,
|
|
784
|
+
deviation,
|
|
785
|
+
fullScale = 10,
|
|
786
|
+
toFrom,
|
|
787
|
+
signal = true,
|
|
788
|
+
glideslope,
|
|
789
|
+
glideslopeFullScale = 0.7,
|
|
790
|
+
glideslopeSignal,
|
|
791
|
+
needles = "slide",
|
|
792
|
+
...props
|
|
793
|
+
}) {
|
|
794
|
+
const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
|
|
795
|
+
const crs = finite(course);
|
|
796
|
+
const computed = typeof radial === "number" && Number.isFinite(radial) ? vorDeviation(crs, radial) : void 0;
|
|
797
|
+
const locScale = finite(fullScale, 10) > 0 ? finite(fullScale, 10) : 10;
|
|
798
|
+
const gsScale = finite(glideslopeFullScale, 0.7) > 0 ? finite(glideslopeFullScale, 0.7) : 0.7;
|
|
799
|
+
const dev = signal ? clamp(finite(deviation, computed?.deviation ?? 0), -locScale, locScale) : 0;
|
|
800
|
+
const flag = !signal ? "OFF" : toFrom ?? computed?.toFrom ?? "OFF";
|
|
801
|
+
const hasGs = glideslopeSignal ?? (typeof glideslope === "number" && Number.isFinite(glideslope));
|
|
802
|
+
const gs = hasGs ? clamp(finite(glideslope), -gsScale, gsScale) : 0;
|
|
803
|
+
const swing = needles === "swing";
|
|
804
|
+
const locX = round2(dev / locScale * FULL_SCALE_PX2);
|
|
805
|
+
const gsY = hasGs ? round2(-(gs / gsScale) * FULL_SCALE_PX2) : swing ? GS_PARK_PX : 0;
|
|
806
|
+
const locAngle = deg(Math.atan2(locX, LOC_PIVOT_Y - CENTER));
|
|
807
|
+
const gsAngle = deg(Math.atan2(gsY, CENTER - GS_PIVOT_X));
|
|
808
|
+
const displayCourse = useContinuousAngle(crs);
|
|
809
|
+
const courseText = String(Math.round(norm3(crs)) || 360).padStart(3, "0");
|
|
810
|
+
const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
|
|
811
|
+
const gsText = !hasGs ? "glideslope off" : Math.abs(gs) < 5e-3 ? "glideslope centred" : `glideslope ${Math.abs(gs).toFixed(2)}\xB0 ${gs > 0 ? "up" : "down"}`;
|
|
812
|
+
const label2 = signal ? `ILS indicator: course ${courseText}\xB0, course needle ${devText}, ${gsText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : `ILS indicator: course ${courseText}\xB0, no NAV signal, ${gsText}`;
|
|
813
|
+
const clipId = useSvgId("fi-ils-clip");
|
|
814
|
+
const dots = range(1, 5, 1).flatMap((i) => [-i, i]);
|
|
815
|
+
return /* @__PURE__ */ jsxs10(InstrumentFrame, { ...props, label: label2, children: [
|
|
816
|
+
/* @__PURE__ */ jsxs10("g", { "data-testid": "ils-card", style: motionStyle(`rotate(${-displayCourse}deg)`, duration), children: [
|
|
817
|
+
/* @__PURE__ */ jsx10("g", { stroke: "#eee", strokeLinecap: "butt", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx10("path", { d: tickPath(170, a % 10 === 0 ? 154 : 162, a), strokeWidth: a % 10 === 0 ? 4 : 2.5 }, a)) }),
|
|
818
|
+
range(0, 330, 30).map((a) => {
|
|
819
|
+
const [x, y] = polar(136, a);
|
|
820
|
+
return /* @__PURE__ */ jsx10(
|
|
821
|
+
"text",
|
|
822
|
+
{
|
|
823
|
+
x,
|
|
824
|
+
y,
|
|
825
|
+
transform: `rotate(${a} ${x} ${y})`,
|
|
826
|
+
fill: "#ddd",
|
|
827
|
+
fontSize: a % 90 === 0 ? 26 : 22,
|
|
828
|
+
fontWeight: "bold",
|
|
829
|
+
textAnchor: "middle",
|
|
830
|
+
dominantBaseline: "central",
|
|
831
|
+
children: CARDINALS4[a] ?? String(a / 10)
|
|
832
|
+
},
|
|
833
|
+
a
|
|
834
|
+
);
|
|
835
|
+
})
|
|
836
|
+
] }),
|
|
837
|
+
/* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER - 151} l -11 -19 h 22 z`, fill: YELLOW, stroke: "#000", strokeWidth: "1" }),
|
|
838
|
+
/* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER + 151} l -8 13 h 16 z`, fill: YELLOW, stroke: "#000", strokeWidth: "1" }),
|
|
839
|
+
/* @__PURE__ */ jsxs10("g", { fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
840
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER + 34, y: CENTER - 86, width: "40", height: "22", rx: "2", fill: "#050505", stroke: "#333" }),
|
|
841
|
+
/* @__PURE__ */ jsx10("text", { "data-testid": "ils-to", x: CENTER + 54, y: CENTER - 75, fill: "#eee", opacity: flag === "TO" ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: "TO" }),
|
|
842
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER - 74, y: CENTER + 64, width: "40", height: "22", rx: "2", fill: "#050505", stroke: "#333" }),
|
|
843
|
+
/* @__PURE__ */ jsx10("text", { "data-testid": "ils-from", x: CENTER - 54, y: CENTER + 75, fill: "#eee", opacity: flag === "FROM" ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: "FR" })
|
|
844
|
+
] }),
|
|
845
|
+
swing ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
846
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER - SCALE_HALF, y: CENTER - 9, width: SCALE_HALF * 2, height: "18", rx: "3", fill: SCALE_GREY }),
|
|
847
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER - 9, y: CENTER - SCALE_HALF, width: "18", height: SCALE_HALF * 2, rx: "3", fill: SCALE_GREY }),
|
|
848
|
+
/* @__PURE__ */ jsxs10("g", { fill: "#eee", stroke: "#eee", children: [
|
|
849
|
+
dots.map((i) => /* @__PURE__ */ jsxs10("g", { children: [
|
|
850
|
+
/* @__PURE__ */ jsx10("circle", { cx: CENTER + i * DOT_SPACING2, cy: CENTER, r: "4", stroke: "none" }),
|
|
851
|
+
/* @__PURE__ */ jsx10("path", { d: `M ${CENTER + i * DOT_SPACING2} ${CENTER - 8} V ${CENTER + 8}`, strokeWidth: "1.5" })
|
|
852
|
+
] }, i)),
|
|
853
|
+
range(-5, 5, 0.5).filter((i) => i !== 0).map((i) => /* @__PURE__ */ jsx10("path", { d: `M ${CENTER - (i % 1 ? 4 : 7)} ${CENTER + i * DOT_SPACING2} h ${i % 1 ? 8 : 14}`, strokeWidth: "2" }, i))
|
|
854
|
+
] })
|
|
855
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
856
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER - SCALE_HALF, y: CENTER - 9, width: SCALE_HALF * 2, height: "18", rx: "3", fill: SCALE_GREY }),
|
|
857
|
+
/* @__PURE__ */ jsx10("rect", { x: CENTER - 9, y: CENTER - SCALE_HALF, width: "18", height: SCALE_HALF * 2, rx: "3", fill: SCALE_GREY }),
|
|
858
|
+
/* @__PURE__ */ jsx10("g", { stroke: "#eee", strokeWidth: "2", children: range(-5, 5, 0.5).filter((i) => i !== 0).map((i) => {
|
|
859
|
+
const half = i % 1 ? 4 : 7;
|
|
860
|
+
return /* @__PURE__ */ jsxs10("g", { children: [
|
|
861
|
+
/* @__PURE__ */ jsx10("path", { d: `M ${CENTER + i * DOT_SPACING2} ${CENTER - half} v ${half * 2}` }),
|
|
862
|
+
/* @__PURE__ */ jsx10("path", { d: `M ${CENTER - half} ${CENTER + i * DOT_SPACING2} h ${half * 2}` })
|
|
863
|
+
] }, i);
|
|
864
|
+
}) })
|
|
865
|
+
] }),
|
|
866
|
+
/* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: "16", fill: "none", stroke: "#000", strokeWidth: "7" }),
|
|
867
|
+
/* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: "16", fill: "none", stroke: "#eee", strokeWidth: "4" }),
|
|
868
|
+
/* @__PURE__ */ jsx10("clipPath", { id: clipId, children: /* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: NEEDLE_CLIP_R }) }),
|
|
869
|
+
swing ? /* @__PURE__ */ jsxs10("g", { clipPath: `url(#${clipId})`, children: [
|
|
870
|
+
/* @__PURE__ */ jsx10("g", { "data-testid": "ils-gs-needle", style: motionStyle(`rotate(${gsAngle}deg)`, duration, GS_PIVOT_X, CENTER), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${GS_PIVOT_X} ${CENTER} H ${GS_PIVOT_X + SWING_LENGTH2}` }) }),
|
|
871
|
+
/* @__PURE__ */ jsx10("g", { "data-testid": "ils-loc-needle", style: motionStyle(`rotate(${locAngle}deg)`, duration, CENTER, LOC_PIVOT_Y), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER} ${LOC_PIVOT_Y} V ${LOC_PIVOT_Y - SWING_LENGTH2}` }) })
|
|
872
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
873
|
+
/* @__PURE__ */ jsx10("g", { "data-testid": "ils-gs-needle", style: motionStyle(`translate(0px, ${gsY}px)`, duration), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER - 104} ${CENTER} H ${CENTER + 104}` }) }),
|
|
874
|
+
/* @__PURE__ */ jsx10("g", { "data-testid": "ils-loc-needle", style: motionStyle(`translate(${locX}px, 0px)`, duration), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER} ${CENTER - 104} V ${CENTER + 104}` }) })
|
|
875
|
+
] }),
|
|
876
|
+
/* @__PURE__ */ jsx10(FlagWindow, { x: CENTER, y: CENTER + FLAG_OFFSET, axis: "h", visible: !signal, testId: "ils-nav-flag" }),
|
|
877
|
+
/* @__PURE__ */ jsx10(FlagWindow, { x: CENTER + FLAG_OFFSET, y: CENTER, axis: "v", visible: !hasGs, testId: "ils-gs-flag" }),
|
|
878
|
+
swing && /* @__PURE__ */ jsx10("circle", { cx: GS_PIVOT_X, cy: CENTER, r: "7", fill: "#1a1a1a", stroke: "#555", strokeWidth: "2" }),
|
|
879
|
+
props.showBox !== false && /* @__PURE__ */ jsxs10("g", { "data-testid": "ils-obs", children: [
|
|
880
|
+
/* @__PURE__ */ jsx10("circle", { cx: 44, cy: 356, r: "30", fill: "#1a1a1a", stroke: "#000", strokeWidth: "2" }),
|
|
881
|
+
/* @__PURE__ */ jsx10("circle", { cx: 44, cy: 356, r: "24", fill: "#2a2a2a", stroke: "#ddd", strokeWidth: "2" }),
|
|
882
|
+
/* @__PURE__ */ jsx10("text", { x: 44, y: 356, fill: "#eee", fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "OBS" })
|
|
660
883
|
] })
|
|
661
884
|
] });
|
|
662
885
|
}
|
|
663
886
|
|
|
664
887
|
// src/components/AdfIndicator.tsx
|
|
665
|
-
import { jsx as
|
|
666
|
-
var
|
|
888
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
889
|
+
var CARDINALS5 = { 0: "N", 90: "E", 180: "S", 270: "W" };
|
|
667
890
|
var AMBER3 = "#ffb000";
|
|
668
891
|
var NEEDLE = "#ffe14d";
|
|
669
892
|
var PARKED_DEG = 90;
|
|
670
|
-
var
|
|
671
|
-
var pad3 = (
|
|
893
|
+
var norm4 = (deg2) => (deg2 % 360 + 360) % 360;
|
|
894
|
+
var pad3 = (deg2) => String(Math.round(norm4(deg2)) % 360).padStart(3, "0");
|
|
672
895
|
function relativeBearing(heading, bearingToStation) {
|
|
673
|
-
return
|
|
896
|
+
return norm4(finite(bearingToStation) - finite(heading));
|
|
674
897
|
}
|
|
675
898
|
function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
676
899
|
const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
|
|
@@ -679,12 +902,12 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
|
679
902
|
const displayCard = useContinuousAngle(hdg);
|
|
680
903
|
const displayNeedle = useContinuousAngle(signal ? rel : PARKED_DEG);
|
|
681
904
|
const label2 = signal ? `ADF indicator: station ${pad3(rel)}\xB0 relative, bearing ${pad3(rel + hdg)}\xB0 to station` : "ADF indicator: no signal";
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ jsxs11(InstrumentFrame, { ...props, label: label2, children: [
|
|
906
|
+
/* @__PURE__ */ jsxs11("g", { "data-testid": "adf-card", style: motionStyle(`rotate(${-displayCard}deg)`, duration), children: [
|
|
907
|
+
/* @__PURE__ */ jsx11("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
|
|
685
908
|
range(0, 330, 30).map((a) => {
|
|
686
909
|
const [x, y] = polar(132, a);
|
|
687
|
-
return /* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ jsx11(
|
|
688
911
|
"text",
|
|
689
912
|
{
|
|
690
913
|
x,
|
|
@@ -695,24 +918,24 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
|
695
918
|
fontWeight: "bold",
|
|
696
919
|
textAnchor: "middle",
|
|
697
920
|
dominantBaseline: "central",
|
|
698
|
-
children:
|
|
921
|
+
children: CARDINALS5[a] ?? String(a / 10)
|
|
699
922
|
},
|
|
700
923
|
a
|
|
701
924
|
);
|
|
702
925
|
})
|
|
703
926
|
] }),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ jsx11("path", { d: `M ${CENTER} ${CENTER - 150} l -10 -28 h 20 z`, fill: AMBER3, stroke: "#000", strokeWidth: "1.5" }),
|
|
928
|
+
/* @__PURE__ */ jsx11("g", { stroke: AMBER3, strokeWidth: "4", strokeLinecap: "round", children: [45, 90, 135, 180, 225, 270, 315].map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(192, 178, a) }, a)) }),
|
|
929
|
+
/* @__PURE__ */ jsxs11("g", { stroke: AMBER3, strokeWidth: "2", strokeLinecap: "round", opacity: "0.7", children: [
|
|
930
|
+
/* @__PURE__ */ jsx11("path", { d: `M ${CENTER - 26} ${CENTER} H ${CENTER + 26}` }),
|
|
931
|
+
/* @__PURE__ */ jsx11("path", { d: `M ${CENTER} ${CENTER - 26} V ${CENTER + 14}` })
|
|
709
932
|
] }),
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ jsx11("text", { x: CENTER, y: CENTER + 62, fill: "#ccc", fontSize: "15", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: "ADF" }),
|
|
934
|
+
/* @__PURE__ */ jsxs11("g", { "data-testid": "adf-flag", opacity: signal ? 0 : 1, style: { transition: "opacity 200ms ease-out" }, children: [
|
|
935
|
+
/* @__PURE__ */ jsx11("rect", { x: CENTER - 28, y: CENTER - 76, width: "56", height: "24", rx: "3", fill: "#d42626", stroke: "#000", strokeWidth: "1.5" }),
|
|
936
|
+
/* @__PURE__ */ jsx11("text", { x: CENTER, y: CENTER - 63, fill: "#fff", fontSize: "15", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "ADF" })
|
|
714
937
|
] }),
|
|
715
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsx11("g", { "data-testid": "adf-needle", style: motionStyle(`rotate(${displayNeedle}deg)`, duration), children: /* @__PURE__ */ jsx11(
|
|
716
939
|
"path",
|
|
717
940
|
{
|
|
718
941
|
d: `M ${CENTER} ${CENTER - 146} l -13 30 h 9 V ${CENTER + 140} h 8 V ${CENTER - 116} h 9 z`,
|
|
@@ -722,12 +945,12 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
|
722
945
|
strokeLinejoin: "round"
|
|
723
946
|
}
|
|
724
947
|
) }),
|
|
725
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ jsx11(Hub, { r: 10 })
|
|
726
949
|
] });
|
|
727
950
|
}
|
|
728
951
|
|
|
729
952
|
// src/components/RadioPanel.tsx
|
|
730
|
-
import { jsx as
|
|
953
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
731
954
|
var SIDE = 252;
|
|
732
955
|
var ORIGIN = CENTER - SIDE / 2;
|
|
733
956
|
var ROW_H = 60;
|
|
@@ -744,9 +967,9 @@ var formatAdf = (khz) => usable(khz) ? Number.isInteger(khz) ? String(khz) : khz
|
|
|
744
967
|
var formatDme = (nm) => usable(nm) ? nm < 99.95 ? nm.toFixed(1) : nm.toFixed(0) : "--.-";
|
|
745
968
|
function Display({ x, y, width, value, color, testId, unit }) {
|
|
746
969
|
const h = ROW_H - 16;
|
|
747
|
-
return /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ jsxs12("g", { children: [
|
|
971
|
+
/* @__PURE__ */ jsx12("rect", { x, y: y + 8, width, height: h, rx: "5", fill: "#1a0d00", stroke: "#3a2a14", strokeWidth: "1.5" }),
|
|
972
|
+
/* @__PURE__ */ jsx12(
|
|
750
973
|
"text",
|
|
751
974
|
{
|
|
752
975
|
"data-testid": testId,
|
|
@@ -761,18 +984,18 @@ function Display({ x, y, width, value, color, testId, unit }) {
|
|
|
761
984
|
children: value
|
|
762
985
|
}
|
|
763
986
|
),
|
|
764
|
-
unit && /* @__PURE__ */
|
|
987
|
+
unit && /* @__PURE__ */ jsx12("text", { x: x + width - 10, y: y + ROW_H / 2 + 5, fill: "#9aa4b1", fontSize: "13", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: unit })
|
|
765
988
|
] });
|
|
766
989
|
}
|
|
767
990
|
function Swap({ y }) {
|
|
768
991
|
const cy = y + ROW_H / 2;
|
|
769
|
-
return /* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ jsxs12("g", { stroke: "#9aa4b1", strokeWidth: "1.8", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
993
|
+
/* @__PURE__ */ jsx12("path", { d: `M ${SWAP_X - 7} ${cy - 4} H ${SWAP_X + 7} m -4 -3 l 4 3 l -4 3` }),
|
|
994
|
+
/* @__PURE__ */ jsx12("path", { d: `M ${SWAP_X + 7} ${cy + 4} H ${SWAP_X - 7} m 4 -3 l -4 3 l 4 3` })
|
|
772
995
|
] });
|
|
773
996
|
}
|
|
774
997
|
function RowLabel({ y, children }) {
|
|
775
|
-
return /* @__PURE__ */
|
|
998
|
+
return /* @__PURE__ */ jsx12("text", { x: LABEL_X, y: y + ROW_H / 2 + 1, fill: "#ccc", fontSize: "14", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children });
|
|
776
999
|
}
|
|
777
1000
|
function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
|
|
778
1001
|
const rows = [
|
|
@@ -782,29 +1005,29 @@ function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
|
|
|
782
1005
|
const dmeText = formatDme(dme);
|
|
783
1006
|
const dmeY = FIRST_ROW + 2 * (ROW_H + ROW_GAP);
|
|
784
1007
|
const label2 = "Radio panel: " + rows.map((r) => `${r.name} ${r.tuned ? `${r.active} ${r.unit}` : "not tuned"}`).join(", ") + `, DME ${usable(dme) ? `${dmeText} NM` : "no distance"}`;
|
|
785
|
-
return /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsxs12(InstrumentFrame, { ...props, label: label2, children: [
|
|
1009
|
+
/* @__PURE__ */ jsx12("rect", { x: ORIGIN, y: ORIGIN, width: SIDE, height: SIDE, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1010
|
+
/* @__PURE__ */ jsxs12("g", { fill: "#9aa4b1", fontSize: "11", fontWeight: "bold", letterSpacing: "1.5", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1011
|
+
/* @__PURE__ */ jsx12("text", { x: ACTIVE_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "ACTIVE" }),
|
|
1012
|
+
/* @__PURE__ */ jsx12("text", { x: STANDBY_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "STBY" })
|
|
790
1013
|
] }),
|
|
791
1014
|
rows.map((r, i) => {
|
|
792
1015
|
const y = FIRST_ROW + i * (ROW_H + ROW_GAP);
|
|
793
|
-
return /* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ jsxs12("g", { children: [
|
|
1017
|
+
/* @__PURE__ */ jsx12(RowLabel, { y, children: r.name }),
|
|
1018
|
+
/* @__PURE__ */ jsx12(Display, { x: ACTIVE_X, y, width: DISPLAY_W, value: r.active, color, testId: `radio-${r.key}-active` }),
|
|
1019
|
+
/* @__PURE__ */ jsx12(Swap, { y }),
|
|
1020
|
+
/* @__PURE__ */ jsx12(Display, { x: STANDBY_X, y, width: DISPLAY_W, value: r.standby, color, testId: `radio-${r.key}-standby` })
|
|
798
1021
|
] }, r.key);
|
|
799
1022
|
}),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ jsx12(RowLabel, { y: dmeY, children: "DME" }),
|
|
1024
|
+
/* @__PURE__ */ jsx12(Display, { x: ACTIVE_X, y: dmeY, width: STANDBY_X + DISPLAY_W - ACTIVE_X, value: dmeText, color, testId: "radio-dme", unit: "NM" })
|
|
802
1025
|
] });
|
|
803
1026
|
}
|
|
804
1027
|
|
|
805
1028
|
// src/components/RadioStack.tsx
|
|
806
1029
|
import { useState } from "react";
|
|
807
|
-
import { Fragment as
|
|
1030
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
808
1031
|
var parseNav = (text) => {
|
|
809
1032
|
const mhz = Math.round(Number.parseFloat(text.replace(",", ".")) * 100) / 100;
|
|
810
1033
|
return mhz >= 108 && mhz <= 117.95 ? mhz : void 0;
|
|
@@ -837,9 +1060,9 @@ var display = {
|
|
|
837
1060
|
var label = { display: "flex", flexDirection: "column", justifyContent: "center", color: LABEL, fontWeight: "bold", letterSpacing: "0.06em", lineHeight: 1.15 };
|
|
838
1061
|
var ident = { color: "#3cc8ff", fontSize: "0.72em", fontFamily: MONO, minHeight: "1.15em" };
|
|
839
1062
|
function SwapIcon() {
|
|
840
|
-
return /* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsxs13("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1064
|
+
/* @__PURE__ */ jsx13("path", { d: "M2 5.5 H14 M11 2.5 l3 3 l-3 3" }),
|
|
1065
|
+
/* @__PURE__ */ jsx13("path", { d: "M14 10.5 H2 M5 7.5 l-3 3 l3 3" })
|
|
843
1066
|
] });
|
|
844
1067
|
}
|
|
845
1068
|
function Receiver({ name, unit, value, ident: station, color, format, parse, onChange }) {
|
|
@@ -873,13 +1096,13 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
|
|
|
873
1096
|
if (text && standby === void 0 || standby === value.standby) return;
|
|
874
1097
|
onChange({ active: value.active, standby });
|
|
875
1098
|
};
|
|
876
|
-
return /* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
1099
|
+
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1100
|
+
/* @__PURE__ */ jsxs13("div", { style: label, children: [
|
|
1101
|
+
/* @__PURE__ */ jsx13("span", { children: name }),
|
|
1102
|
+
/* @__PURE__ */ jsx13("span", { "data-testid": `radio-stack-${key}-ident`, style: ident, children: station ?? "" })
|
|
880
1103
|
] }),
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ jsx13("div", { "data-testid": `radio-stack-${key}-active`, "aria-label": `${name} active frequency`, style: { ...display, color }, children: format(value.active) }),
|
|
1105
|
+
/* @__PURE__ */ jsx13(
|
|
883
1106
|
"button",
|
|
884
1107
|
{
|
|
885
1108
|
type: "button",
|
|
@@ -887,10 +1110,10 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
|
|
|
887
1110
|
"aria-label": `Swap ${name} active and standby`,
|
|
888
1111
|
title: "Swap active and standby",
|
|
889
1112
|
style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "2em", padding: 0, margin: 0, border: "0.08em solid #555", borderRadius: "0.3em", background: "#3a3a3a", color: "#ddd", font: "inherit", fontSize: "1.2em", cursor: "pointer" },
|
|
890
|
-
children: /* @__PURE__ */
|
|
1113
|
+
children: /* @__PURE__ */ jsx13(SwapIcon, {})
|
|
891
1114
|
}
|
|
892
1115
|
),
|
|
893
|
-
/* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ jsx13(
|
|
894
1117
|
"input",
|
|
895
1118
|
{
|
|
896
1119
|
type: "text",
|
|
@@ -952,7 +1175,7 @@ function RadioStack({
|
|
|
952
1175
|
const heading = { color: MUTED, fontSize: "0.72em", fontWeight: "bold", letterSpacing: "0.12em", textAlign: "center" };
|
|
953
1176
|
return (
|
|
954
1177
|
// The outer box is a size container so every inner measurement can follow the width.
|
|
955
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsx13("div", { className, style: { display: "inline-block", width, maxWidth: "100%", verticalAlign: "top", containerType: "inline-size", ...style }, children: /* @__PURE__ */ jsxs13(
|
|
956
1179
|
"div",
|
|
957
1180
|
{
|
|
958
1181
|
role: "group",
|
|
@@ -975,20 +1198,20 @@ function RadioStack({
|
|
|
975
1198
|
userSelect: "none"
|
|
976
1199
|
},
|
|
977
1200
|
children: [
|
|
978
|
-
SCREWS2.map((position, i) => /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
1201
|
+
SCREWS2.map((position, i) => /* @__PURE__ */ jsxs13("svg", { viewBox: "-14 -14 28 28", "aria-hidden": "true", style: { position: "absolute", width: "0.75em", height: "0.75em", ...position }, children: [
|
|
1202
|
+
/* @__PURE__ */ jsx13("circle", { r: "12", fill: "#3a3a3a", stroke: "#111", strokeWidth: "2" }),
|
|
1203
|
+
/* @__PURE__ */ jsx13("path", { d: "M -8 3 L 8 -3", stroke: "#111", strokeWidth: "3" })
|
|
981
1204
|
] }, i)),
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ jsx13("span", {}),
|
|
1206
|
+
/* @__PURE__ */ jsx13("span", { style: heading, children: "ACTIVE" }),
|
|
1207
|
+
/* @__PURE__ */ jsx13("span", {}),
|
|
1208
|
+
/* @__PURE__ */ jsx13("span", { style: heading, children: "STBY" }),
|
|
1209
|
+
/* @__PURE__ */ jsx13(Receiver, { name: "NAV", unit: "MHz", value: nav ?? innerNav, ident: navIdent, color, format: formatNav, parse: parseNav, onChange: changeNav }),
|
|
1210
|
+
/* @__PURE__ */ jsx13(Receiver, { name: "ADF", unit: "kHz", value: adf ?? innerAdf, ident: adfIdent, color, format: formatAdf, parse: parseAdf, onChange: changeAdf }),
|
|
1211
|
+
/* @__PURE__ */ jsx13("div", { style: label, children: "DME" }),
|
|
1212
|
+
/* @__PURE__ */ jsxs13("div", { "aria-label": "DME distance", style: { ...display, gridColumn: "span 3", display: "flex", alignItems: "baseline", justifyContent: "flex-end", gap: "0.4em", padding: "0 0.5em", color }, children: [
|
|
1213
|
+
/* @__PURE__ */ jsx13("span", { "data-testid": "radio-stack-dme", children: formatDme(dme) }),
|
|
1214
|
+
/* @__PURE__ */ jsx13("span", { style: { color: MUTED, fontFamily: "'Helvetica Neue', Arial, sans-serif", fontSize: "0.5em" }, children: "NM" })
|
|
992
1215
|
] })
|
|
993
1216
|
]
|
|
994
1217
|
}
|
|
@@ -997,7 +1220,7 @@ function RadioStack({
|
|
|
997
1220
|
}
|
|
998
1221
|
|
|
999
1222
|
// src/components/DataPanel.tsx
|
|
1000
|
-
import { jsx as
|
|
1223
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1001
1224
|
var MAX_FIELDS = 6;
|
|
1002
1225
|
var SIDE2 = 252;
|
|
1003
1226
|
var PAD = 8;
|
|
@@ -1017,9 +1240,9 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1017
1240
|
const cellH = (SIDE2 - PAD * 2 - GAP * (rows - 1)) / rows;
|
|
1018
1241
|
const valueSize = VALUE_SIZE[rows] ?? 27;
|
|
1019
1242
|
const label2 = `${heading ?? "Data panel"}: ` + (shown.length ? shown.map((f) => `${f.name} ${formatValue(f)}${f.unit ? ` ${f.unit}` : ""}`).join(", ") : "no data");
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
heading && /* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1243
|
+
return /* @__PURE__ */ jsxs14(InstrumentFrame, { ...props, label: label2, children: [
|
|
1244
|
+
heading && /* @__PURE__ */ jsx14("text", { x: CENTER, y: ORIGIN2 - 14, fill: "#ccc", fontSize: "13", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: heading.toUpperCase() }),
|
|
1245
|
+
/* @__PURE__ */ jsx14("rect", { x: ORIGIN2, y: ORIGIN2, width: SIDE2, height: SIDE2, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1023
1246
|
shown.map((f, i) => {
|
|
1024
1247
|
const col = i % cols;
|
|
1025
1248
|
const row = Math.floor(i / cols);
|
|
@@ -1027,10 +1250,10 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1027
1250
|
const y = ORIGIN2 + PAD + row * (cellH + GAP);
|
|
1028
1251
|
const value = formatValue(f);
|
|
1029
1252
|
const fit = Math.min(valueSize, (cellW - 16) / (0.62 * Math.max(1, value.length)));
|
|
1030
|
-
return /* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ jsxs14("g", { "data-testid": `data-field-${i}`, children: [
|
|
1254
|
+
/* @__PURE__ */ jsx14("rect", { x, y, width: cellW, height: cellH, rx: "6", fill: "#000", stroke: "#262a30", strokeWidth: "1" }),
|
|
1255
|
+
/* @__PURE__ */ jsx14("text", { x: x + 8, y: y + 12, fill: "#9aa4b1", fontSize: "12", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children: f.name.toUpperCase() }),
|
|
1256
|
+
/* @__PURE__ */ jsx14(
|
|
1034
1257
|
"text",
|
|
1035
1258
|
{
|
|
1036
1259
|
"data-testid": `data-value-${i}`,
|
|
@@ -1045,14 +1268,14 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1045
1268
|
children: value
|
|
1046
1269
|
}
|
|
1047
1270
|
),
|
|
1048
|
-
f.unit && /* @__PURE__ */
|
|
1271
|
+
f.unit && /* @__PURE__ */ jsx14("text", { x: x + cellW - 8, y: y + cellH - 12, fill: "#9aa4b1", fontSize: "12", textAnchor: "end", dominantBaseline: "central", children: f.unit })
|
|
1049
1272
|
] }, i);
|
|
1050
1273
|
})
|
|
1051
1274
|
] });
|
|
1052
1275
|
}
|
|
1053
1276
|
|
|
1054
1277
|
// src/components/FuelIndicator.tsx
|
|
1055
|
-
import { jsx as
|
|
1278
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1056
1279
|
var MAX_TANKS = 4;
|
|
1057
1280
|
var GREEN2 = "#2ee05a";
|
|
1058
1281
|
var RED = "#ff3b3b";
|
|
@@ -1095,16 +1318,16 @@ function FuelIndicator({
|
|
|
1095
1318
|
return { name: t.name, qty, cap, fraction, full, isLow, text: full ? "FULL" : qty.toFixed(places) };
|
|
1096
1319
|
});
|
|
1097
1320
|
const title = `${label2}: ` + (readings.length ? readings.map((r) => `${r.name} ${r.full ? "full" : `${r.text} of ${r.cap.toFixed(places)} ${unit}`}${r.isLow ? " (low)" : ""}`).join(", ") : "no tanks");
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ jsxs15(InstrumentFrame, { ...props, label: title, children: [
|
|
1322
|
+
/* @__PURE__ */ jsx15("rect", { x: ORIGIN3, y: ORIGIN3, width: SIDE3, height: SIDE3, rx: "10", fill: "#000", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1100
1323
|
readings.map((r, i) => {
|
|
1101
1324
|
const cx = INNER_LEFT + colW * (i + 0.5);
|
|
1102
1325
|
const color = r.isLow ? RED : GREEN2;
|
|
1103
1326
|
const tickX = cx - barW / 2 - 14;
|
|
1104
|
-
return /* @__PURE__ */
|
|
1105
|
-
i > 0 && /* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsxs15("g", { "data-testid": `fuel-tank-${i}`, children: [
|
|
1328
|
+
i > 0 && /* @__PURE__ */ jsx15("path", { d: `M ${INNER_LEFT + colW * i} ${ORIGIN3 + 10} V ${FOOTER_Y}`, stroke: "#555", strokeWidth: "1.5" }),
|
|
1329
|
+
/* @__PURE__ */ jsx15("text", { x: cx, y: ORIGIN3 + 22, fill: "#fff", fontSize: Math.min(17, colW / 5), fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: r.name.toUpperCase() }),
|
|
1330
|
+
/* @__PURE__ */ jsx15("g", { strokeWidth: "2.5", strokeLinecap: "round", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ jsx15(
|
|
1108
1331
|
"path",
|
|
1109
1332
|
{
|
|
1110
1333
|
d: `M ${tickX - 7} ${BAR_BOTTOM - f * BAR_H} h 7`,
|
|
@@ -1112,9 +1335,9 @@ function FuelIndicator({
|
|
|
1112
1335
|
},
|
|
1113
1336
|
f
|
|
1114
1337
|
)) }),
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ jsx15("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: "#15181c" }),
|
|
1339
|
+
/* @__PURE__ */ jsx15("g", { "data-testid": `fuel-bar-${i}`, style: motionStyle(`scaleY(${r.fraction})`, duration, cx, BAR_BOTTOM), children: /* @__PURE__ */ jsx15("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: color }) }),
|
|
1340
|
+
/* @__PURE__ */ jsx15(
|
|
1118
1341
|
"text",
|
|
1119
1342
|
{
|
|
1120
1343
|
"data-testid": `fuel-value-${i}`,
|
|
@@ -1129,29 +1352,29 @@ function FuelIndicator({
|
|
|
1129
1352
|
children: r.text
|
|
1130
1353
|
}
|
|
1131
1354
|
),
|
|
1132
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx15("text", { x: cx, y: BAR_BOTTOM + 44, fill: "#fff", fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: unit })
|
|
1133
1356
|
] }, i);
|
|
1134
1357
|
}),
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ jsx15("path", { d: `M ${ORIGIN3 + 8} ${FOOTER_Y} H ${ORIGIN3 + SIDE3 - 8}`, stroke: "#555", strokeWidth: "1.5" }),
|
|
1359
|
+
/* @__PURE__ */ jsx15("text", { x: CENTER, y: FOOTER_Y + 19, fill: "#fff", fontSize: "24", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: label2.toUpperCase() })
|
|
1137
1360
|
] });
|
|
1138
1361
|
}
|
|
1139
1362
|
|
|
1140
1363
|
// src/components/EngineIndicator.tsx
|
|
1141
|
-
import { jsx as
|
|
1364
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1142
1365
|
var MAX_CYLINDERS = 6;
|
|
1143
1366
|
var MAX_BAR_GAUGES = 4;
|
|
1144
1367
|
var GREEN3 = "#5fe04a";
|
|
1145
|
-
var
|
|
1368
|
+
var YELLOW2 = "#ffd400";
|
|
1146
1369
|
var RED2 = "#ff3030";
|
|
1147
1370
|
var BLUE = "#4fb7e8";
|
|
1148
1371
|
var LABEL2 = "#b9c8e6";
|
|
1149
1372
|
var LINE = "#8a8f99";
|
|
1150
|
-
var
|
|
1373
|
+
var round22 = (n) => Math.round(n * 100) / 100;
|
|
1151
1374
|
var DIAL_R = 182;
|
|
1152
1375
|
function chord(y, inset = 8) {
|
|
1153
1376
|
const half = Math.sqrt(Math.max(0, DIAL_R * DIAL_R - (y - CENTER) ** 2)) - inset;
|
|
1154
|
-
return `M ${
|
|
1377
|
+
return `M ${round22(CENTER - half)} ${y} H ${round22(CENTER + half)}`;
|
|
1155
1378
|
}
|
|
1156
1379
|
var DEFAULT_MANIFOLD = { min: 10, max: 35, green: [15, 29], yellow: [29, 31], high: 31, unit: "IN", decimals: 1 };
|
|
1157
1380
|
var DEFAULT_RPM = { min: 0, max: 3e3, green: [800, 2500], yellow: [2500, 2700], high: 2700, decimals: 0 };
|
|
@@ -1177,7 +1400,7 @@ function resolve(g, defaults = {}) {
|
|
|
1177
1400
|
min,
|
|
1178
1401
|
max,
|
|
1179
1402
|
fraction,
|
|
1180
|
-
color: inRed ? RED2 : inYellow ?
|
|
1403
|
+
color: inRed ? RED2 : inYellow ? YELLOW2 : "#fff",
|
|
1181
1404
|
text: value.toFixed(decimals),
|
|
1182
1405
|
unit: g.unit ?? defaults.unit,
|
|
1183
1406
|
green: g.green ?? defaults.green,
|
|
@@ -1196,22 +1419,22 @@ function arcAt(cx, cy, r, a0, a1) {
|
|
|
1196
1419
|
}
|
|
1197
1420
|
function ArcGauge({ cx, label: label2, g, duration, testId }) {
|
|
1198
1421
|
const span = g.max - g.min;
|
|
1199
|
-
const angle = (v) =>
|
|
1200
|
-
const band = (from, to, color) => /* @__PURE__ */
|
|
1422
|
+
const angle = (v) => round22(-ARC_SWEEP + 2 * ARC_SWEEP * clamp((v - g.min) / span, 0, 1));
|
|
1423
|
+
const band = (from, to, color) => /* @__PURE__ */ jsx16("path", { d: arcAt(cx, ARC_Y, ARC_R, angle(from), angle(to)), stroke: color, strokeWidth: "6", fill: "none" });
|
|
1201
1424
|
const [tipX, tipY] = polar(ARC_R - 4, 0, cx, ARC_Y);
|
|
1202
1425
|
const [lx, ly] = polar(ARC_R - 16, -7, cx, ARC_Y);
|
|
1203
1426
|
const [rx, ry] = polar(ARC_R - 16, 7, cx, ARC_Y);
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ jsxs16("g", { children: [
|
|
1428
|
+
/* @__PURE__ */ jsx16("path", { d: arcAt(cx, ARC_Y, ARC_R, -ARC_SWEEP, ARC_SWEEP), stroke: "#fff", strokeWidth: "1.5", fill: "none" }),
|
|
1206
1429
|
g.green && band(g.green[0], g.green[1], GREEN3),
|
|
1207
|
-
g.yellow && band(g.yellow[0], g.yellow[1],
|
|
1430
|
+
g.yellow && band(g.yellow[0], g.yellow[1], YELLOW2),
|
|
1208
1431
|
g.low !== void 0 && band(g.min, g.low, RED2),
|
|
1209
1432
|
g.high !== void 0 && band(g.high, g.max, RED2),
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ jsx16("g", { "data-testid": testId, style: motionStyle(`rotate(${angle(g.value)}deg)`, duration, cx, ARC_Y), children: /* @__PURE__ */ jsx16("path", { d: `M ${tipX} ${tipY} L ${lx} ${ly} L ${rx} ${ry} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1434
|
+
/* @__PURE__ */ jsx16("text", { x: cx, y: ARC_Y - 20, fill: LABEL2, fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: label2 }),
|
|
1435
|
+
/* @__PURE__ */ jsxs16("text", { x: cx, y: ARC_Y + 4, fill: g.color, fontSize: "28", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1213
1436
|
g.text,
|
|
1214
|
-
g.unit && /* @__PURE__ */
|
|
1437
|
+
g.unit && /* @__PURE__ */ jsx16("tspan", { fontSize: "11", dx: "2", children: g.unit })
|
|
1215
1438
|
] })
|
|
1216
1439
|
] });
|
|
1217
1440
|
}
|
|
@@ -1221,28 +1444,28 @@ var BAR_ROW_H = 39;
|
|
|
1221
1444
|
var BAR_TOP2 = 137;
|
|
1222
1445
|
function BarGauge({ top, g, label: label2, duration, testId }) {
|
|
1223
1446
|
const y = top + 14;
|
|
1224
|
-
const at = (v) =>
|
|
1225
|
-
const seg = (from, to, color, w = 7) => /* @__PURE__ */
|
|
1226
|
-
return /* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1447
|
+
const at = (v) => round22(BAR_X0 + (BAR_X1 - BAR_X0) * clamp((v - g.min) / (g.max - g.min), 0, 1));
|
|
1448
|
+
const seg = (from, to, color, w = 7) => /* @__PURE__ */ jsx16("path", { d: `M ${at(from)} ${y} H ${at(to)}`, stroke: color, strokeWidth: w });
|
|
1449
|
+
return /* @__PURE__ */ jsxs16("g", { children: [
|
|
1450
|
+
/* @__PURE__ */ jsx16("path", { d: `M ${BAR_X0} ${y} H ${BAR_X1}`, stroke: "#fff", strokeWidth: "2" }),
|
|
1451
|
+
/* @__PURE__ */ jsx16("path", { d: `M ${BAR_X0} ${y - 4} v 8 M ${BAR_X1} ${y - 4} v 8`, stroke: "#fff", strokeWidth: "2" }),
|
|
1229
1452
|
g.green && seg(g.green[0], g.green[1], GREEN3),
|
|
1230
|
-
g.yellow && seg(g.yellow[0], g.yellow[1],
|
|
1453
|
+
g.yellow && seg(g.yellow[0], g.yellow[1], YELLOW2),
|
|
1231
1454
|
g.low !== void 0 && seg(g.min, g.low, RED2),
|
|
1232
1455
|
g.high !== void 0 && seg(g.high, g.max, RED2),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
g.unit && /* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ jsx16("g", { "data-testid": testId, style: motionStyle(`translate(${round22(at(g.value) - BAR_X0)}px, 0px)`, duration), children: /* @__PURE__ */ jsx16("path", { d: `M ${BAR_X0} ${y - 3} l -5 -9 h 10 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1457
|
+
/* @__PURE__ */ jsx16("text", { x: BAR_X0, y: top + 31, fill: LABEL2, fontSize: "13", fontWeight: "bold", dominantBaseline: "central", children: label2 }),
|
|
1458
|
+
/* @__PURE__ */ jsx16("text", { x: 350, y: top + 15, fill: g.color, fontSize: "20", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.text }),
|
|
1459
|
+
g.unit && /* @__PURE__ */ jsx16("text", { x: 350, y: top + 31, fill: LABEL2, fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.unit })
|
|
1237
1460
|
] });
|
|
1238
1461
|
}
|
|
1239
1462
|
function Tank({ x, fraction, duration, testId }) {
|
|
1240
1463
|
const top = 304;
|
|
1241
1464
|
const h = 40;
|
|
1242
|
-
return /* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ jsxs16("g", { children: [
|
|
1466
|
+
/* @__PURE__ */ jsx16("rect", { x: x - 7, y: top, width: "14", height: h, rx: "3", fill: "#000", stroke: "#fff", strokeWidth: "1.5" }),
|
|
1467
|
+
/* @__PURE__ */ jsx16("g", { "data-testid": testId, style: motionStyle(`scaleY(${fraction})`, duration, x, top + h - 2), children: /* @__PURE__ */ jsx16("rect", { x: x - 5.5, y: top + 2, width: "11", height: h - 4, fill: BLUE }) }),
|
|
1468
|
+
/* @__PURE__ */ jsx16("rect", { x: x - 5.5, y: top + h - 5, width: "11", height: "3", fill: RED2 })
|
|
1246
1469
|
] });
|
|
1247
1470
|
}
|
|
1248
1471
|
var hottest = (values) => {
|
|
@@ -1310,81 +1533,81 @@ function EngineIndicator({
|
|
|
1310
1533
|
fuelLeft !== void 0 || fuelRight !== void 0 ? `fuel ${fmt(fuelLeft)}/${fmt(fuelRight)} ${fuelUnit}` : null,
|
|
1311
1534
|
volts !== void 0 ? `${fmt(volts, 1)} V` : null
|
|
1312
1535
|
].filter(Boolean).join(", ");
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
power !== void 0 && /* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ jsxs16(InstrumentFrame, { ...props, label: label2, children: [
|
|
1537
|
+
power !== void 0 && /* @__PURE__ */ jsxs16("text", { x: CENTER, y: 44, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1538
|
+
/* @__PURE__ */ jsxs16("tspan", { fill: LABEL2, fontSize: "11", children: [
|
|
1316
1539
|
"POWER",
|
|
1317
1540
|
" "
|
|
1318
1541
|
] }),
|
|
1319
1542
|
fmt(power),
|
|
1320
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsx16("tspan", { fontSize: "11", children: "%" })
|
|
1321
1544
|
] }),
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsx16(ArcGauge, { cx: 118, label: "MAN", g: man, duration, testId: "engine-man" }),
|
|
1546
|
+
/* @__PURE__ */ jsx16(ArcGauge, { cx: 282, label: "RPM", g: speed, duration, testId: "engine-rpm" }),
|
|
1547
|
+
/* @__PURE__ */ jsxs16("g", { stroke: LINE, strokeWidth: "1.5", children: [
|
|
1548
|
+
/* @__PURE__ */ jsx16("path", { d: chord(133) }),
|
|
1549
|
+
/* @__PURE__ */ jsx16("path", { d: "M 200 133 V 298" }),
|
|
1550
|
+
/* @__PURE__ */ jsx16("path", { d: chord(298) }),
|
|
1551
|
+
/* @__PURE__ */ jsx16("path", { d: "M 136 298 V 348 M 264 298 V 348" })
|
|
1329
1552
|
] }),
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ jsx16("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: readouts.map((r) => /* @__PURE__ */ jsxs16("g", { children: [
|
|
1554
|
+
/* @__PURE__ */ jsxs16("text", { x: r.x, y: 144, fill: LABEL2, fontSize: "13", children: [
|
|
1332
1555
|
r.name,
|
|
1333
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ jsx16("tspan", { fontSize: "9", children: temperatureUnit })
|
|
1334
1557
|
] }),
|
|
1335
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ jsx16("text", { "data-testid": `engine-${r.name.toLowerCase()}`, x: r.x, y: 165, fill: r.color, fontSize: "22", children: fmt(r.value) })
|
|
1336
1559
|
] }, r.name)) }),
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
columns > 0 && /* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ jsx16("path", { d: "M 40 178 H 190", stroke: LINE, strokeWidth: "1" }),
|
|
1561
|
+
columns > 0 && /* @__PURE__ */ jsxs16("g", { children: [
|
|
1562
|
+
/* @__PURE__ */ jsx16("path", { d: `M ${chartX0} ${limitY} H ${chartX1}`, stroke: RED2, strokeWidth: "1.5", strokeDasharray: "5 4" }),
|
|
1563
|
+
/* @__PURE__ */ jsx16("text", { x: chartX0 - 4, y: limitY, fill: "#fff", fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: "CHT" }),
|
|
1341
1564
|
Array.from({ length: cylinders }, (_, i) => {
|
|
1342
1565
|
const x0 = chartX0 + colW * i;
|
|
1343
1566
|
const mid = x0 + colW / 2;
|
|
1344
1567
|
const c = chtValues[i];
|
|
1345
1568
|
const e = egtValues[i];
|
|
1346
|
-
return /* @__PURE__ */
|
|
1347
|
-
c !== void 0 && /* @__PURE__ */
|
|
1348
|
-
e !== void 0 && /* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ jsxs16("g", { children: [
|
|
1570
|
+
c !== void 0 && /* @__PURE__ */ jsx16("g", { "data-testid": `engine-cht-${i}`, style: motionStyle(`scaleY(${chtFrac(c)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx16("rect", { x: mid - barW - 1, y: chartBase - chartH, width: barW, height: chartH, fill: GREEN3 }) }),
|
|
1571
|
+
e !== void 0 && /* @__PURE__ */ jsx16("g", { "data-testid": `engine-egt-${i}`, style: motionStyle(`scaleY(${egtFrac(e)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx16("rect", { x: mid + 1, y: chartBase - chartH, width: barW, height: chartH, fill: BLUE }) }),
|
|
1572
|
+
/* @__PURE__ */ jsx16("text", { x: mid, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: i + 1 })
|
|
1350
1573
|
] }, i);
|
|
1351
1574
|
}),
|
|
1352
|
-
hasTit && /* @__PURE__ */
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1575
|
+
hasTit && /* @__PURE__ */ jsxs16("g", { children: [
|
|
1576
|
+
/* @__PURE__ */ jsx16("g", { "data-testid": "engine-tit-bar", style: motionStyle(`scaleY(${egtFrac(tit)})`, duration, chartX1 - colW / 2, chartBase), children: /* @__PURE__ */ jsx16("rect", { x: chartX1 - colW / 2 - barW / 2, y: chartBase - chartH, width: barW, height: chartH, fill: "#fff" }) }),
|
|
1577
|
+
/* @__PURE__ */ jsx16("text", { x: chartX1 - colW / 2, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "T" })
|
|
1355
1578
|
] })
|
|
1356
1579
|
] }),
|
|
1357
|
-
bars.map((b, i) => /* @__PURE__ */
|
|
1358
|
-
i > 0 && /* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1580
|
+
bars.map((b, i) => /* @__PURE__ */ jsxs16("g", { children: [
|
|
1581
|
+
i > 0 && /* @__PURE__ */ jsx16("path", { d: `M 206 ${BAR_TOP2 + BAR_ROW_H * i - 2} H 352`, stroke: LINE, strokeWidth: "1" }),
|
|
1582
|
+
/* @__PURE__ */ jsx16(BarGauge, { top: BAR_TOP2 + BAR_ROW_H * i, g: b.g, label: b.label, duration, testId: `engine-bar-${i}` })
|
|
1360
1583
|
] }, b.label)),
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ jsxs16("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1585
|
+
/* @__PURE__ */ jsxs16("text", { "data-testid": "engine-amps", x: 104, y: 318, fill: "#fff", fontSize: "20", children: [
|
|
1363
1586
|
fmt(amps),
|
|
1364
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ jsx16("tspan", { fontSize: "11", dx: "2", children: "A" })
|
|
1365
1588
|
] }),
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1369
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ jsx16("text", { x: 104, y: 338, fill: LABEL2, fontSize: "13", children: "ALT" }),
|
|
1590
|
+
/* @__PURE__ */ jsx16(Tank, { x: 152, fraction: left / cap, duration, testId: "engine-fuel-left" }),
|
|
1591
|
+
/* @__PURE__ */ jsx16(Tank, { x: 248, fraction: right / cap, duration, testId: "engine-fuel-right" }),
|
|
1592
|
+
/* @__PURE__ */ jsxs16("text", { "data-testid": "engine-fuel", x: 200, y: 316, fill: "#fff", fontSize: "20", children: [
|
|
1370
1593
|
fmt(left),
|
|
1371
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx16("tspan", { dx: "14", children: fmt(right) })
|
|
1372
1595
|
] }),
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ jsx16("text", { x: 200, y: 335, fill: LABEL2, fontSize: "13", children: "Fuel" }),
|
|
1597
|
+
/* @__PURE__ */ jsx16("text", { x: 200, y: 348, fill: LABEL2, fontSize: "9", children: fuelUnit }),
|
|
1598
|
+
/* @__PURE__ */ jsxs16("text", { "data-testid": "engine-volts", x: 296, y: 318, fill: "#fff", fontSize: "20", children: [
|
|
1376
1599
|
fmt(volts, 1),
|
|
1377
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx16("tspan", { fontSize: "11", dx: "2", children: "V" })
|
|
1378
1601
|
] }),
|
|
1379
|
-
/* @__PURE__ */
|
|
1602
|
+
/* @__PURE__ */ jsx16("text", { x: 296, y: 338, fill: LABEL2, fontSize: "13", children: "BATT" })
|
|
1380
1603
|
] })
|
|
1381
1604
|
] });
|
|
1382
1605
|
}
|
|
1383
1606
|
|
|
1384
1607
|
// src/components/FlapIndicator.tsx
|
|
1385
|
-
import { jsx as
|
|
1608
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1386
1609
|
var GREEN4 = "#3ddc3d";
|
|
1387
|
-
var
|
|
1610
|
+
var YELLOW3 = "#ffd400";
|
|
1388
1611
|
var ORANGE = "#ff8a00";
|
|
1389
1612
|
var RED3 = "#ff2a2a";
|
|
1390
1613
|
var BAR_X = 226;
|
|
@@ -1394,7 +1617,7 @@ var BAR_BOTTOM2 = 302;
|
|
|
1394
1617
|
var BAR_H2 = BAR_BOTTOM2 - BAR_TOP3;
|
|
1395
1618
|
function segmentColor(fraction) {
|
|
1396
1619
|
if (fraction < 0.25) return GREEN4;
|
|
1397
|
-
if (fraction < 0.5) return
|
|
1620
|
+
if (fraction < 0.5) return YELLOW3;
|
|
1398
1621
|
if (fraction < 0.75) return ORANGE;
|
|
1399
1622
|
return RED3;
|
|
1400
1623
|
}
|
|
@@ -1415,18 +1638,18 @@ function FlapIndicator({
|
|
|
1415
1638
|
const count = Math.max(1, Math.floor(finite(segments, 20)));
|
|
1416
1639
|
const lit = Math.round(fraction * count);
|
|
1417
1640
|
const scale = (detents ?? Array.from({ length: Math.floor(full / 10) + 1 }, (_, i) => i * 10)).filter((d) => d >= 0 && d <= full);
|
|
1418
|
-
const yAt = (
|
|
1641
|
+
const yAt = (deg2) => Math.round((BAR_TOP3 + deg2 / full * BAR_H2) * 100) / 100;
|
|
1419
1642
|
const limit = (speedLimits ?? []).filter((l) => Number.isFinite(l.flaps) && Number.isFinite(l.speed) && l.flaps <= position).sort((a, b) => b.flaps - a.flaps)[0];
|
|
1420
1643
|
const ias = finite(airspeed, NaN);
|
|
1421
1644
|
const overspeed = limit !== void 0 && !Number.isNaN(ias) && ias > limit.speed;
|
|
1422
1645
|
const segH = BAR_H2 / count;
|
|
1423
1646
|
const title = `${label2}: ${Math.round(position)}\xB0 of ${Math.round(full)}\xB0` + (limit ? `, max ${Math.round(limit.speed)} knots${overspeed ? " (overspeed)" : ""}` : "");
|
|
1424
|
-
return /* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ jsxs17(InstrumentFrame, { ...props, label: title, children: [
|
|
1648
|
+
/* @__PURE__ */ jsx17("rect", { x: BAR_X - BAR_W / 2 - 4, y: BAR_TOP3 - 4, width: BAR_W + 8, height: BAR_H2 + 8, rx: "4", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
|
|
1426
1649
|
Array.from({ length: count }, (_, i) => {
|
|
1427
1650
|
const y = BAR_TOP3 + i * segH;
|
|
1428
1651
|
const on = i < lit;
|
|
1429
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ jsx17(
|
|
1430
1653
|
"rect",
|
|
1431
1654
|
{
|
|
1432
1655
|
"data-testid": `flap-segment-${i}`,
|
|
@@ -1443,24 +1666,24 @@ function FlapIndicator({
|
|
|
1443
1666
|
i
|
|
1444
1667
|
);
|
|
1445
1668
|
}),
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ jsx17("g", { fill: "#fff", fontSize: "18", fontWeight: "bold", dominantBaseline: "central", children: scale.map((d) => /* @__PURE__ */ jsxs17("g", { children: [
|
|
1670
|
+
/* @__PURE__ */ jsx17("path", { d: `M ${BAR_X + BAR_W / 2 + 8} ${yAt(d)} h 8`, stroke: "#fff", strokeWidth: "2" }),
|
|
1671
|
+
/* @__PURE__ */ jsx17("text", { x: BAR_X + BAR_W / 2 + 22, y: yAt(d), children: d })
|
|
1449
1672
|
] }, d)) }),
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
limit && /* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsx17("g", { "data-testid": "flap-pointer", style: motionStyle(`translate(0px, ${yAt(position) - BAR_TOP3}px)`, duration), children: /* @__PURE__ */ jsx17("path", { d: `M ${BAR_X - BAR_W / 2 - 8} ${BAR_TOP3} l -14 -8 v 16 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1674
|
+
limit && /* @__PURE__ */ jsxs17("g", { textAnchor: "middle", dominantBaseline: "central", fill: overspeed ? RED3 : "#fff", children: [
|
|
1675
|
+
/* @__PURE__ */ jsxs17("text", { "data-testid": "flap-speed", x: 118, y: 176, fontSize: "36", fontWeight: "bold", children: [
|
|
1453
1676
|
Math.round(limit.speed),
|
|
1454
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ jsx17("tspan", { fontSize: "13", dx: "3", children: "KTS" })
|
|
1455
1678
|
] }),
|
|
1456
|
-
/* @__PURE__ */
|
|
1679
|
+
/* @__PURE__ */ jsx17("text", { x: 118, y: 212, fontSize: "13", fontWeight: "bold", fill: "#bbb", letterSpacing: "2", children: "MAX" })
|
|
1457
1680
|
] }),
|
|
1458
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx17("text", { x: CENTER, y: 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
|
|
1459
1682
|
] });
|
|
1460
1683
|
}
|
|
1461
1684
|
|
|
1462
1685
|
// src/components/AoaIndicator.tsx
|
|
1463
|
-
import { Fragment as
|
|
1686
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1464
1687
|
var GREEN5 = "#3ddc3d";
|
|
1465
1688
|
var AMBER4 = "#ffb000";
|
|
1466
1689
|
var RED4 = "#ff2a2a";
|
|
@@ -1488,20 +1711,20 @@ function RowShape({ shape, y }) {
|
|
|
1488
1711
|
const r = CENTER + HALF;
|
|
1489
1712
|
switch (shape) {
|
|
1490
1713
|
case "bar":
|
|
1491
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsx18("rect", { x: l, y: y - BAR_H3 / 2, width: HALF * 2, height: BAR_H3, rx: "2" });
|
|
1492
1715
|
case "split":
|
|
1493
|
-
return /* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
1717
|
+
/* @__PURE__ */ jsx18("rect", { x: l, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" }),
|
|
1718
|
+
/* @__PURE__ */ jsx18("rect", { x: r - 50, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" })
|
|
1496
1719
|
] });
|
|
1497
1720
|
case "donut":
|
|
1498
|
-
return /* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
1722
|
+
/* @__PURE__ */ jsx18("rect", { x: l, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
|
|
1723
|
+
/* @__PURE__ */ jsx18("rect", { x: CENTER + 24, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
|
|
1724
|
+
/* @__PURE__ */ jsx18("circle", { cx: CENTER, cy: y, r: 13, fill: "none", strokeWidth: "7" })
|
|
1502
1725
|
] });
|
|
1503
1726
|
case "chevron":
|
|
1504
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ jsx18("path", { d: `M ${l} ${y} L ${CENTER} ${y + CHEVRON_DEPTH} L ${r} ${y}`, fill: "none", strokeWidth: "11", strokeLinejoin: "miter" });
|
|
1505
1728
|
}
|
|
1506
1729
|
}
|
|
1507
1730
|
function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false, label: label2 = "AOA", ...props }) {
|
|
@@ -1515,11 +1738,11 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
|
|
|
1515
1738
|
const reading = Number.isNaN(value) ? "---" : `${value.toFixed(1)}\xB0`;
|
|
1516
1739
|
const state = stall ? " (stall warning)" : lit > DONUT + 1 ? " (high)" : lit === DONUT + 1 ? " (optimum)" : "";
|
|
1517
1740
|
const title = `${label2}: ${reading}${Number.isNaN(value) ? "" : state}`;
|
|
1518
|
-
return /* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1741
|
+
return /* @__PURE__ */ jsxs18(InstrumentFrame, { ...props, label: title, children: [
|
|
1742
|
+
/* @__PURE__ */ jsx18("rect", { x: CENTER - HALF - 10, y: 40, width: (HALF + 10) * 2, height: 278, rx: "10", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
|
|
1520
1743
|
ROWS.map((row, i) => {
|
|
1521
1744
|
const on = i < lit;
|
|
1522
|
-
return /* @__PURE__ */
|
|
1745
|
+
return /* @__PURE__ */ jsxs18(
|
|
1523
1746
|
"g",
|
|
1524
1747
|
{
|
|
1525
1748
|
"data-testid": `aoa-row-${i}`,
|
|
@@ -1530,15 +1753,15 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
|
|
|
1530
1753
|
opacity: on ? 1 : UNLIT_OPACITY,
|
|
1531
1754
|
style: { transition: "opacity 150ms ease-out" },
|
|
1532
1755
|
children: [
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
on && stall && row.shape === "chevron" && /* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsx18(RowShape, { shape: row.shape, y: row.y }),
|
|
1757
|
+
on && stall && row.shape === "chevron" && /* @__PURE__ */ jsx18("animate", { attributeName: "opacity", values: "1;0.25;1", dur: "0.6s", repeatCount: "indefinite" })
|
|
1535
1758
|
]
|
|
1536
1759
|
},
|
|
1537
1760
|
i
|
|
1538
1761
|
);
|
|
1539
1762
|
}),
|
|
1540
|
-
showValue && /* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1763
|
+
showValue && /* @__PURE__ */ jsx18("text", { "data-testid": "aoa-value", x: CENTER, y: 340, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", children: reading }),
|
|
1764
|
+
/* @__PURE__ */ jsx18("text", { x: CENTER, y: showValue ? 362 : 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
|
|
1542
1765
|
] });
|
|
1543
1766
|
}
|
|
1544
1767
|
export {
|
|
@@ -1555,6 +1778,7 @@ export {
|
|
|
1555
1778
|
FlapIndicator,
|
|
1556
1779
|
FuelIndicator,
|
|
1557
1780
|
HeadingIndicator,
|
|
1781
|
+
IlsIndicator,
|
|
1558
1782
|
MAX_BAR_GAUGES,
|
|
1559
1783
|
MAX_CYLINDERS,
|
|
1560
1784
|
MAX_FIELDS,
|