flight-indicators 1.2.2 → 1.2.3
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 +31 -2
- package/dist/index.cjs +488 -254
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +487 -254
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -54,6 +54,47 @@ function useSvgId(prefix) {
|
|
|
54
54
|
|
|
55
55
|
// src/components/Instrument.tsx
|
|
56
56
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
57
|
+
var KNOB_PLACES = {
|
|
58
|
+
"bottom-left": [46, 354, 30],
|
|
59
|
+
"bottom-right": [354, 354, 30],
|
|
60
|
+
bottom: [CENTER, 376, 17]
|
|
61
|
+
};
|
|
62
|
+
function Knob({ id, label: label2, position, angle = 0, animationDuration = DEFAULT_ANIMATION_MS }) {
|
|
63
|
+
const [cx, cy, r] = KNOB_PLACES[position];
|
|
64
|
+
const display2 = useContinuousAngle(angle);
|
|
65
|
+
const step = 360 / 28;
|
|
66
|
+
return /* @__PURE__ */ jsxs("g", { "data-testid": `knob-${id}`, children: [
|
|
67
|
+
/* @__PURE__ */ jsx("circle", { cx, cy: cy + 2, r: r + 2, fill: "#000", opacity: "0.55" }),
|
|
68
|
+
/* @__PURE__ */ jsxs("g", { "data-testid": `knob-${id}-rim`, style: motionStyle(`rotate(${display2}deg)`, animationDuration, cx, cy), children: [
|
|
69
|
+
/* @__PURE__ */ jsx("circle", { cx, cy, r, fill: "#2e2e2e", stroke: "#000", strokeWidth: "2" }),
|
|
70
|
+
/* @__PURE__ */ jsx("g", { stroke: "#111", strokeWidth: r > 20 ? 3 : 2, children: range(0, 360 - step, step).map((a) => {
|
|
71
|
+
const rad = a * Math.PI / 180;
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
"path",
|
|
74
|
+
{
|
|
75
|
+
d: `M ${cx + (r - 5) * Math.sin(rad)} ${cy - (r - 5) * Math.cos(rad)} L ${cx + r * Math.sin(rad)} ${cy - r * Math.cos(rad)}`
|
|
76
|
+
},
|
|
77
|
+
a
|
|
78
|
+
);
|
|
79
|
+
}) }),
|
|
80
|
+
/* @__PURE__ */ jsx("path", { d: `M ${cx} ${cy - r + 1} v ${r * 0.22}`, stroke: "#ddd", strokeWidth: "2", strokeLinecap: "round" })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx("circle", { cx, cy, r: r * 0.72, fill: "#1f1f1f", stroke: "#cfcfcf", strokeWidth: r > 20 ? 2 : 1.5 }),
|
|
83
|
+
label2 && /* @__PURE__ */ jsx(
|
|
84
|
+
"text",
|
|
85
|
+
{
|
|
86
|
+
x: cx,
|
|
87
|
+
y: cy,
|
|
88
|
+
fill: "#eee",
|
|
89
|
+
fontSize: Math.min(13, r * 1.15 / Math.max(1, label2.length * 0.6)),
|
|
90
|
+
fontWeight: "bold",
|
|
91
|
+
textAnchor: "middle",
|
|
92
|
+
dominantBaseline: "central",
|
|
93
|
+
children: label2
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
57
98
|
var SCREWS = [
|
|
58
99
|
[32, 32],
|
|
59
100
|
[368, 32],
|
|
@@ -63,6 +104,9 @@ var SCREWS = [
|
|
|
63
104
|
function InstrumentFrame({
|
|
64
105
|
size = 200,
|
|
65
106
|
showBox = true,
|
|
107
|
+
showKnobs = true,
|
|
108
|
+
knobs,
|
|
109
|
+
animationDuration,
|
|
66
110
|
className,
|
|
67
111
|
style,
|
|
68
112
|
title,
|
|
@@ -98,7 +142,8 @@ function InstrumentFrame({
|
|
|
98
142
|
] }),
|
|
99
143
|
/* @__PURE__ */ jsx("circle", { cx: CENTER, cy: CENTER, r: "196", fill: `url(#${bezelId})` }),
|
|
100
144
|
/* @__PURE__ */ jsx("circle", { cx: CENTER, cy: CENTER, r: "182", fill: "#111", stroke: "#000", strokeWidth: "4" }),
|
|
101
|
-
children
|
|
145
|
+
children,
|
|
146
|
+
showKnobs && knobs?.map((k) => /* @__PURE__ */ jsx(Knob, { ...k, animationDuration }, k.id))
|
|
102
147
|
]
|
|
103
148
|
}
|
|
104
149
|
);
|
|
@@ -131,6 +176,7 @@ function AttitudeIndicator({ roll = 0, pitch = 0, pitchLimit = 40, ...props }) {
|
|
|
131
176
|
{
|
|
132
177
|
...props,
|
|
133
178
|
label: `Attitude indicator: pitch ${Math.round(safePitch)}\xB0, roll ${Math.round(safeRoll)}\xB0`,
|
|
179
|
+
knobs: [{ id: "adjust", position: "bottom" }],
|
|
134
180
|
children: [
|
|
135
181
|
/* @__PURE__ */ jsx2("defs", { children: /* @__PURE__ */ jsx2("clipPath", { id: clipId, children: /* @__PURE__ */ jsx2("circle", { cx: CENTER, cy: CENTER, r: FACE_R }) }) }),
|
|
136
182
|
/* @__PURE__ */ jsxs2("g", { clipPath: `url(#${clipId})`, children: [
|
|
@@ -183,41 +229,49 @@ function HeadingIndicator({ heading = 0, ...props }) {
|
|
|
183
229
|
const safeHeading = finite(heading);
|
|
184
230
|
const normalised = (Math.round(safeHeading) % 360 + 360) % 360;
|
|
185
231
|
const displayHeading = useContinuousAngle(safeHeading);
|
|
186
|
-
return /* @__PURE__ */ jsxs3(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
232
|
+
return /* @__PURE__ */ jsxs3(
|
|
233
|
+
InstrumentFrame,
|
|
234
|
+
{
|
|
235
|
+
...props,
|
|
236
|
+
label: `Heading indicator: ${String(normalised).padStart(3, "0")}\xB0`,
|
|
237
|
+
knobs: [{ id: "set", label: "PUSH", position: "bottom-left", angle: safeHeading }],
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsxs3("g", { "data-testid": "heading-card", style: motionStyle(`rotate(${-displayHeading}deg)`, duration), children: [
|
|
240
|
+
/* @__PURE__ */ jsx3("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
|
|
241
|
+
range(0, 330, 30).map((a) => {
|
|
242
|
+
const [x, y] = polar(132, a);
|
|
243
|
+
const label2 = CARDINALS[a] ?? String(a / 10);
|
|
244
|
+
return /* @__PURE__ */ jsx3(
|
|
245
|
+
"text",
|
|
246
|
+
{
|
|
247
|
+
x,
|
|
248
|
+
y,
|
|
249
|
+
transform: `rotate(${a} ${x} ${y})`,
|
|
250
|
+
fill: a % 90 === 0 ? "#ffb000" : "#fff",
|
|
251
|
+
fontSize: a % 90 === 0 ? 30 : 26,
|
|
252
|
+
fontWeight: "bold",
|
|
253
|
+
textAnchor: "middle",
|
|
254
|
+
dominantBaseline: "central",
|
|
255
|
+
children: label2
|
|
256
|
+
},
|
|
257
|
+
a
|
|
258
|
+
);
|
|
259
|
+
})
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ jsx3("g", { stroke: "#ffb000", strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(192, 178, a) }, a)) }),
|
|
262
|
+
/* @__PURE__ */ jsx3("path", { d: `M ${CENTER} ${CENTER - 150} l -9 -26 h 18 z`, fill: "#ffb000" }),
|
|
263
|
+
/* @__PURE__ */ jsx3(
|
|
264
|
+
"path",
|
|
194
265
|
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
a
|
|
206
|
-
);
|
|
207
|
-
})
|
|
208
|
-
] }),
|
|
209
|
-
/* @__PURE__ */ jsx3("g", { stroke: "#ffb000", strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(192, 178, a) }, a)) }),
|
|
210
|
-
/* @__PURE__ */ jsx3("path", { d: `M ${CENTER} ${CENTER - 150} l -9 -26 h 18 z`, fill: "#ffb000" }),
|
|
211
|
-
/* @__PURE__ */ jsx3(
|
|
212
|
-
"path",
|
|
213
|
-
{
|
|
214
|
-
d: "M200 135 c6 0 8 8 8 16 v30 l52 18 v12 l-52 -8 v34 l18 12 v10 l-26 -6 l-26 6 v-10 l18 -12 v-34 l-52 8 v-12 l52 -18 v-30 c0 -8 2 -16 8 -16 z",
|
|
215
|
-
fill: "#ffb000",
|
|
216
|
-
stroke: "#000",
|
|
217
|
-
strokeWidth: "2"
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
] });
|
|
266
|
+
d: "M200 135 c6 0 8 8 8 16 v30 l52 18 v12 l-52 -8 v34 l18 12 v10 l-26 -6 l-26 6 v-10 l18 -12 v-34 l-52 8 v-12 l52 -18 v-30 c0 -8 2 -16 8 -16 z",
|
|
267
|
+
fill: "#ffb000",
|
|
268
|
+
stroke: "#000",
|
|
269
|
+
strokeWidth: "2"
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
);
|
|
221
275
|
}
|
|
222
276
|
|
|
223
277
|
// src/components/Airspeed.tsx
|
|
@@ -266,25 +320,33 @@ function Altimeter({ altitude = 0, pressure, pressureUnit = "hPa", ...props }) {
|
|
|
266
320
|
const alt = finite(altitude);
|
|
267
321
|
const qnh = finite(pressure, STANDARD[pressureUnit]);
|
|
268
322
|
const qnhText = pressureUnit === "inHg" ? qnh.toFixed(2) : Math.round(qnh).toString();
|
|
269
|
-
return /* @__PURE__ */ jsxs5(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
323
|
+
return /* @__PURE__ */ jsxs5(
|
|
324
|
+
InstrumentFrame,
|
|
325
|
+
{
|
|
326
|
+
...props,
|
|
327
|
+
label: `Altimeter: ${Math.round(alt)} feet, ${qnhText} ${pressureUnit}`,
|
|
328
|
+
knobs: [{ id: "baro", label: "BARO", position: "bottom-left", angle: Math.round((qnh - STANDARD[pressureUnit]) * (pressureUnit === "inHg" ? 3e4 : 1e3)) / 100 }],
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx5("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 49, 1).map((i) => /* @__PURE__ */ jsx5("path", { d: tickPath(178, i % 5 === 0 ? 150 : 164, i * 7.2), strokeWidth: i % 5 === 0 ? 4 : 2 }, i)) }),
|
|
331
|
+
range(0, 9, 1).map((n) => {
|
|
332
|
+
const [x, y] = polar(126, n * 36);
|
|
333
|
+
return /* @__PURE__ */ jsx5("text", { x, y, fill: "#fff", fontSize: "32", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: n }, n);
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 58, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: "ALT" }),
|
|
336
|
+
/* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 40, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: "100 FEET" }),
|
|
337
|
+
/* @__PURE__ */ jsx5("rect", { x: CENTER + 30, y: CENTER - 16, width: "74", height: "32", rx: "4", fill: "#000", stroke: "#666", strokeWidth: "2" }),
|
|
338
|
+
/* @__PURE__ */ jsx5("text", { "data-testid": "altimeter-pressure", x: CENTER + 67, y: CENTER + 1, fill: "#fff", fontSize: "20", fontFamily: "monospace", textAnchor: "middle", dominantBaseline: "central", children: qnhText }),
|
|
339
|
+
/* @__PURE__ */ jsx5("text", { x: CENTER + 67, y: CENTER + 30, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: pressureUnit }),
|
|
340
|
+
/* @__PURE__ */ jsxs5("g", { "data-testid": "altimeter-10000", style: motionStyle(`rotate(${alt / 1e5 * 360}deg)`, duration), children: [
|
|
341
|
+
/* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER} L ${CENTER} ${CENTER - 150}`, stroke: "#fff", strokeWidth: "3" }),
|
|
342
|
+
/* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER - 178} l -10 22 h 20 z`, fill: "#fff" })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-1000", style: motionStyle(`rotate(${alt / 1e4 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 9} ${CENTER + 14} L ${CENTER - 12} ${CENTER - 70} L ${CENTER} ${CENTER - 100} L ${CENTER + 12} ${CENTER - 70} L ${CENTER + 9} ${CENTER + 14} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
|
|
345
|
+
/* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-100", style: motionStyle(`rotate(${alt / 1e3 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 5} ${CENTER + 30} L ${CENTER - 4} ${CENTER - 140} L ${CENTER} ${CENTER - 168} L ${CENTER + 4} ${CENTER - 140} L ${CENTER + 5} ${CENTER + 30} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
|
|
346
|
+
/* @__PURE__ */ jsx5(Hub, {})
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
);
|
|
288
350
|
}
|
|
289
351
|
|
|
290
352
|
// src/components/VerticalSpeed.tsx
|
|
@@ -612,7 +674,7 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ne
|
|
|
612
674
|
const needleAngle = -(dev / FULL_SCALE_DEG) * SWING_FULL_SCALE_DEG;
|
|
613
675
|
const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
|
|
614
676
|
const label2 = signal ? `VOR indicator: course ${courseText}\xB0, needle ${devText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : `VOR indicator: course ${courseText}\xB0, no signal`;
|
|
615
|
-
return /* @__PURE__ */ jsxs9(InstrumentFrame, { ...props, label: label2, children: [
|
|
677
|
+
return /* @__PURE__ */ jsxs9(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "obs", label: "OBS", position: "bottom-left", angle: crs }], children: [
|
|
616
678
|
/* @__PURE__ */ jsxs9("g", { "data-testid": "vor-card", style: motionStyle(`rotate(${-displayCourse}deg)`, duration), children: [
|
|
617
679
|
/* @__PURE__ */ jsx9("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx9("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
|
|
618
680
|
range(0, 330, 30).map((a) => {
|
|
@@ -812,7 +874,7 @@ function IlsIndicator({
|
|
|
812
874
|
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
875
|
const clipId = useSvgId("fi-ils-clip");
|
|
814
876
|
const dots = range(1, 5, 1).flatMap((i) => [-i, i]);
|
|
815
|
-
return /* @__PURE__ */ jsxs10(InstrumentFrame, { ...props, label: label2, children: [
|
|
877
|
+
return /* @__PURE__ */ jsxs10(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "obs", label: "OBS", position: "bottom-left", angle: crs }], children: [
|
|
816
878
|
/* @__PURE__ */ jsxs10("g", { "data-testid": "ils-card", style: motionStyle(`rotate(${-displayCourse}deg)`, duration), children: [
|
|
817
879
|
/* @__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
880
|
range(0, 330, 30).map((a) => {
|
|
@@ -875,25 +937,195 @@ function IlsIndicator({
|
|
|
875
937
|
] }),
|
|
876
938
|
/* @__PURE__ */ jsx10(FlagWindow, { x: CENTER, y: CENTER + FLAG_OFFSET, axis: "h", visible: !signal, testId: "ils-nav-flag" }),
|
|
877
939
|
/* @__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" })
|
|
883
|
-
] })
|
|
940
|
+
swing && /* @__PURE__ */ jsx10("circle", { cx: GS_PIVOT_X, cy: CENTER, r: "7", fill: "#1a1a1a", stroke: "#555", strokeWidth: "2" })
|
|
884
941
|
] });
|
|
885
942
|
}
|
|
886
943
|
|
|
887
|
-
// src/components/
|
|
944
|
+
// src/components/HsiIndicator.tsx
|
|
888
945
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
889
946
|
var CARDINALS5 = { 0: "N", 90: "E", 180: "S", 270: "W" };
|
|
890
947
|
var AMBER3 = "#ffb000";
|
|
948
|
+
var COURSE = "#e6d930";
|
|
949
|
+
var BUG = "#ff7a1a";
|
|
950
|
+
var FLAG2 = "#e0342a";
|
|
951
|
+
var DOT_SPACING3 = 36;
|
|
952
|
+
var FULL_SCALE_PX3 = DOT_SPACING3 * 2;
|
|
953
|
+
var BAR_HALF = 58;
|
|
954
|
+
var GS_X = 108;
|
|
955
|
+
var GS_DOT_SPACING = 24;
|
|
956
|
+
var GS_FULL_SCALE_PX = GS_DOT_SPACING * 2;
|
|
957
|
+
var norm4 = (deg2) => (deg2 % 360 + 360) % 360;
|
|
958
|
+
var round22 = (n) => Math.round(n * 100) / 100 + 0;
|
|
959
|
+
var pad3 = (deg2) => String(Math.round(norm4(deg2)) % 360 || 360).padStart(3, "0");
|
|
960
|
+
function WarningFlag({ x, y, text, visible, testId, vertical }) {
|
|
961
|
+
const [w, h] = vertical ? [20, 46] : [44, 20];
|
|
962
|
+
return /* @__PURE__ */ jsxs11("g", { "data-testid": testId, opacity: visible ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: [
|
|
963
|
+
/* @__PURE__ */ jsx11("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: "2", fill: FLAG2, stroke: "#000", strokeWidth: "1.5" }),
|
|
964
|
+
vertical ? text.split("").map((c, i) => /* @__PURE__ */ jsx11("text", { x, y: y + (i - (text.length - 1) / 2) * 15, fill: "#111", fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: c }, i)) : /* @__PURE__ */ jsx11("text", { x, y, fill: "#111", fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: text })
|
|
965
|
+
] });
|
|
966
|
+
}
|
|
967
|
+
function GlideslopeScale({ side, y, visible, duration }) {
|
|
968
|
+
const x = CENTER + side * GS_X;
|
|
969
|
+
return /* @__PURE__ */ jsxs11("g", { children: [
|
|
970
|
+
/* @__PURE__ */ jsx11("g", { fill: "none", stroke: "#eee", strokeWidth: "2", children: [-2, -1, 1, 2].map((i) => /* @__PURE__ */ jsx11("circle", { cx: x, cy: CENTER + i * GS_DOT_SPACING, r: "4.5" }, i)) }),
|
|
971
|
+
/* @__PURE__ */ jsx11("path", { d: `M ${x - 7} ${CENTER} h 14`, stroke: "#eee", strokeWidth: "3", strokeLinecap: "round" }),
|
|
972
|
+
/* @__PURE__ */ jsx11(
|
|
973
|
+
"g",
|
|
974
|
+
{
|
|
975
|
+
"data-testid": side > 0 ? "hsi-gs-pointer" : "hsi-gs-pointer-left",
|
|
976
|
+
opacity: visible ? 1 : 0,
|
|
977
|
+
style: { ...motionStyle(`translate(0px, ${y}px)`, duration), transition: duration > 0 ? `transform ${duration}ms ease-out, opacity 200ms ease-out` : "opacity 200ms ease-out" },
|
|
978
|
+
children: /* @__PURE__ */ jsx11("path", { d: `M ${x - side * 7} ${CENTER} l ${side * 15} -9 v 18 z`, fill: "#3ddc84", stroke: "#000", strokeWidth: "1.5", strokeLinejoin: "round" })
|
|
979
|
+
}
|
|
980
|
+
)
|
|
981
|
+
] });
|
|
982
|
+
}
|
|
983
|
+
function HsiIndicator({
|
|
984
|
+
heading = 0,
|
|
985
|
+
headingBug,
|
|
986
|
+
course = 0,
|
|
987
|
+
radial,
|
|
988
|
+
deviation,
|
|
989
|
+
fullScale = 10,
|
|
990
|
+
toFrom,
|
|
991
|
+
signal = true,
|
|
992
|
+
glideslope,
|
|
993
|
+
glideslopeFullScale = 0.7,
|
|
994
|
+
glideslopeSignal,
|
|
995
|
+
...props
|
|
996
|
+
}) {
|
|
997
|
+
const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
|
|
998
|
+
const hdg = finite(heading);
|
|
999
|
+
const crs = finite(course);
|
|
1000
|
+
const hasBug = typeof headingBug === "number" && Number.isFinite(headingBug);
|
|
1001
|
+
const bug = hasBug ? headingBug : 0;
|
|
1002
|
+
const computed = typeof radial === "number" && Number.isFinite(radial) ? vorDeviation(crs, radial) : void 0;
|
|
1003
|
+
const locScale = finite(fullScale, 10) > 0 ? finite(fullScale, 10) : 10;
|
|
1004
|
+
const gsScale = finite(glideslopeFullScale, 0.7) > 0 ? finite(glideslopeFullScale, 0.7) : 0.7;
|
|
1005
|
+
const dev = signal ? clamp(finite(deviation, computed?.deviation ?? 0), -locScale, locScale) : 0;
|
|
1006
|
+
const flag = !signal ? "OFF" : toFrom ?? computed?.toFrom ?? "OFF";
|
|
1007
|
+
const hasGs = glideslopeSignal ?? (typeof glideslope === "number" && Number.isFinite(glideslope));
|
|
1008
|
+
const gs = hasGs ? clamp(finite(glideslope), -gsScale, gsScale) : 0;
|
|
1009
|
+
const barX = round22(dev / locScale * FULL_SCALE_PX3);
|
|
1010
|
+
const gsY = round22(-(gs / gsScale) * GS_FULL_SCALE_PX);
|
|
1011
|
+
const displayHeading = useContinuousAngle(hdg);
|
|
1012
|
+
const displayCourse = useContinuousAngle(crs);
|
|
1013
|
+
const displayBug = useContinuousAngle(bug);
|
|
1014
|
+
const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
|
|
1015
|
+
const gsText = !hasGs ? "glideslope off" : Math.abs(gs) < 5e-3 ? "glideslope centred" : `glideslope ${Math.abs(gs).toFixed(2)}\xB0 ${gs > 0 ? "up" : "down"}`;
|
|
1016
|
+
const navText = signal ? `course bar ${devText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : "no NAV signal";
|
|
1017
|
+
const label2 = `HSI: heading ${pad3(hdg)}\xB0, course ${pad3(crs)}\xB0, ${navText}, ${gsText}${hasBug ? `, heading bug ${pad3(bug)}\xB0` : ""}`;
|
|
1018
|
+
return /* @__PURE__ */ jsxs11(
|
|
1019
|
+
InstrumentFrame,
|
|
1020
|
+
{
|
|
1021
|
+
...props,
|
|
1022
|
+
label: label2,
|
|
1023
|
+
knobs: [
|
|
1024
|
+
{ id: "crs", label: "CRS", position: "bottom-left", angle: crs },
|
|
1025
|
+
{ id: "hdg", label: "HDG", position: "bottom-right", angle: bug }
|
|
1026
|
+
],
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ jsxs11("g", { "data-testid": "hsi-card", style: motionStyle(`rotate(${-displayHeading}deg)`, duration), children: [
|
|
1029
|
+
/* @__PURE__ */ jsx11("g", { stroke: "#eee", strokeLinecap: "butt", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(172, a % 10 === 0 ? 154 : 163, a), strokeWidth: a % 10 === 0 ? 3.5 : 2 }, a)) }),
|
|
1030
|
+
range(0, 330, 30).map((a) => {
|
|
1031
|
+
const [x, y] = polar(138, a);
|
|
1032
|
+
return /* @__PURE__ */ jsx11(
|
|
1033
|
+
"text",
|
|
1034
|
+
{
|
|
1035
|
+
x,
|
|
1036
|
+
y,
|
|
1037
|
+
transform: `rotate(${a} ${x} ${y})`,
|
|
1038
|
+
fill: "#eee",
|
|
1039
|
+
fontSize: a % 90 === 0 ? 24 : 21,
|
|
1040
|
+
fontWeight: "bold",
|
|
1041
|
+
textAnchor: "middle",
|
|
1042
|
+
dominantBaseline: "central",
|
|
1043
|
+
children: CARDINALS5[a] ?? String(a / 10)
|
|
1044
|
+
},
|
|
1045
|
+
a
|
|
1046
|
+
);
|
|
1047
|
+
}),
|
|
1048
|
+
/* @__PURE__ */ jsx11("g", { "data-testid": "hsi-heading-bug", opacity: hasBug ? 1 : 0, style: motionStyle(`rotate(${displayBug}deg)`, duration), children: /* @__PURE__ */ jsx11(
|
|
1049
|
+
"path",
|
|
1050
|
+
{
|
|
1051
|
+
d: `M ${CENTER - 13} ${CENTER - 182} h 26 v 20 h -7 l -6 -8 l -6 8 h -7 z`,
|
|
1052
|
+
fill: BUG,
|
|
1053
|
+
stroke: "#000",
|
|
1054
|
+
strokeWidth: "1.5",
|
|
1055
|
+
strokeLinejoin: "round"
|
|
1056
|
+
}
|
|
1057
|
+
) }),
|
|
1058
|
+
/* @__PURE__ */ jsxs11("g", { "data-testid": "hsi-course", style: motionStyle(`rotate(${displayCourse}deg)`, duration), children: [
|
|
1059
|
+
/* @__PURE__ */ jsx11("g", { fill: "none", stroke: "#eee", strokeWidth: "2.5", children: [-2, -1, 1, 2].map((i) => /* @__PURE__ */ jsx11("circle", { cx: CENTER + i * DOT_SPACING3, cy: CENTER, r: "6" }, i)) }),
|
|
1060
|
+
/* @__PURE__ */ jsx11(
|
|
1061
|
+
"path",
|
|
1062
|
+
{
|
|
1063
|
+
d: `M ${CENTER} ${CENTER - 126} l 13 24 h -8 v 40 h -10 v -40 h -8 z`,
|
|
1064
|
+
fill: COURSE,
|
|
1065
|
+
stroke: "#000",
|
|
1066
|
+
strokeWidth: "1.5",
|
|
1067
|
+
strokeLinejoin: "round"
|
|
1068
|
+
}
|
|
1069
|
+
),
|
|
1070
|
+
/* @__PURE__ */ jsx11("rect", { x: CENTER - 5, y: CENTER + 62, width: "10", height: "58", fill: COURSE, stroke: "#000", strokeWidth: "1.5" }),
|
|
1071
|
+
/* @__PURE__ */ jsx11("g", { "data-testid": "hsi-cdi", style: motionStyle(`translate(${barX}px, 0px)`, duration), children: /* @__PURE__ */ jsx11("rect", { x: CENTER - 5, y: CENTER - BAR_HALF, width: "10", height: BAR_HALF * 2, fill: COURSE, stroke: "#000", strokeWidth: "1.5" }) }),
|
|
1072
|
+
/* @__PURE__ */ jsx11(
|
|
1073
|
+
"path",
|
|
1074
|
+
{
|
|
1075
|
+
"data-testid": "hsi-to",
|
|
1076
|
+
d: `M ${CENTER + 26} ${CENTER - 58} l 11 18 h -22 z`,
|
|
1077
|
+
fill: "#eee",
|
|
1078
|
+
stroke: "#000",
|
|
1079
|
+
strokeWidth: "1.5",
|
|
1080
|
+
opacity: flag === "TO" ? 1 : 0,
|
|
1081
|
+
style: { transition: "opacity 200ms ease-out" }
|
|
1082
|
+
}
|
|
1083
|
+
),
|
|
1084
|
+
/* @__PURE__ */ jsx11(
|
|
1085
|
+
"path",
|
|
1086
|
+
{
|
|
1087
|
+
"data-testid": "hsi-from",
|
|
1088
|
+
d: `M ${CENTER + 26} ${CENTER + 58} l 11 -18 h -22 z`,
|
|
1089
|
+
fill: "#eee",
|
|
1090
|
+
stroke: "#000",
|
|
1091
|
+
strokeWidth: "1.5",
|
|
1092
|
+
opacity: flag === "FROM" ? 1 : 0,
|
|
1093
|
+
style: { transition: "opacity 200ms ease-out" }
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
] })
|
|
1097
|
+
] }),
|
|
1098
|
+
/* @__PURE__ */ jsx11("g", { stroke: AMBER3, strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(192, 180, a) }, a)) }),
|
|
1099
|
+
/* @__PURE__ */ jsx11("path", { d: `M ${CENTER} ${CENTER - 156} l -9 -24 h 18 z`, fill: AMBER3, stroke: "#000", strokeWidth: "1" }),
|
|
1100
|
+
/* @__PURE__ */ jsx11(
|
|
1101
|
+
"path",
|
|
1102
|
+
{
|
|
1103
|
+
d: `M ${CENTER} ${CENTER - 30} c 4 0 5 5 5 10 v 14 l 25 9 v 7 l -25 -3 v 16 l 10 6 v 6 l -15 -3 l -15 3 v -6 l 10 -6 v -16 l -25 3 v -7 l 25 -9 v -14 c 0 -5 1 -10 5 -10 z`,
|
|
1104
|
+
fill: AMBER3,
|
|
1105
|
+
stroke: "#000",
|
|
1106
|
+
strokeWidth: "1.5",
|
|
1107
|
+
strokeLinejoin: "round"
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
/* @__PURE__ */ jsx11(GlideslopeScale, { side: -1, y: gsY, visible: hasGs, duration }),
|
|
1111
|
+
/* @__PURE__ */ jsx11(GlideslopeScale, { side: 1, y: gsY, visible: hasGs, duration }),
|
|
1112
|
+
/* @__PURE__ */ jsx11(WarningFlag, { x: CENTER + GS_X, y: CENTER, text: "GS", visible: !hasGs, testId: "hsi-gs-flag", vertical: true }),
|
|
1113
|
+
/* @__PURE__ */ jsx11(WarningFlag, { x: CENTER - 62, y: CENTER - 84, text: "NAV", visible: !signal, testId: "hsi-nav-flag" })
|
|
1114
|
+
]
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// src/components/AdfIndicator.tsx
|
|
1120
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1121
|
+
var CARDINALS6 = { 0: "N", 90: "E", 180: "S", 270: "W" };
|
|
1122
|
+
var AMBER4 = "#ffb000";
|
|
891
1123
|
var NEEDLE = "#ffe14d";
|
|
892
1124
|
var PARKED_DEG = 90;
|
|
893
|
-
var
|
|
894
|
-
var
|
|
1125
|
+
var norm5 = (deg2) => (deg2 % 360 + 360) % 360;
|
|
1126
|
+
var pad32 = (deg2) => String(Math.round(norm5(deg2)) % 360).padStart(3, "0");
|
|
895
1127
|
function relativeBearing(heading, bearingToStation) {
|
|
896
|
-
return
|
|
1128
|
+
return norm5(finite(bearingToStation) - finite(heading));
|
|
897
1129
|
}
|
|
898
1130
|
function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
899
1131
|
const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
|
|
@@ -901,41 +1133,41 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
|
901
1133
|
const hdg = finite(heading);
|
|
902
1134
|
const displayCard = useContinuousAngle(hdg);
|
|
903
1135
|
const displayNeedle = useContinuousAngle(signal ? rel : PARKED_DEG);
|
|
904
|
-
const label2 = signal ? `ADF indicator: station ${
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
1136
|
+
const label2 = signal ? `ADF indicator: station ${pad32(rel)}\xB0 relative, bearing ${pad32(rel + hdg)}\xB0 to station` : "ADF indicator: no signal";
|
|
1137
|
+
return /* @__PURE__ */ jsxs12(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "hdg", label: "HDG", position: "bottom-left", angle: hdg }], children: [
|
|
1138
|
+
/* @__PURE__ */ jsxs12("g", { "data-testid": "adf-card", style: motionStyle(`rotate(${-displayCard}deg)`, duration), children: [
|
|
1139
|
+
/* @__PURE__ */ jsx12("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx12("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
|
|
908
1140
|
range(0, 330, 30).map((a) => {
|
|
909
1141
|
const [x, y] = polar(132, a);
|
|
910
|
-
return /* @__PURE__ */
|
|
1142
|
+
return /* @__PURE__ */ jsx12(
|
|
911
1143
|
"text",
|
|
912
1144
|
{
|
|
913
1145
|
x,
|
|
914
1146
|
y,
|
|
915
1147
|
transform: `rotate(${a} ${x} ${y})`,
|
|
916
|
-
fill: a % 90 === 0 ?
|
|
1148
|
+
fill: a % 90 === 0 ? AMBER4 : "#fff",
|
|
917
1149
|
fontSize: a % 90 === 0 ? 28 : 24,
|
|
918
1150
|
fontWeight: "bold",
|
|
919
1151
|
textAnchor: "middle",
|
|
920
1152
|
dominantBaseline: "central",
|
|
921
|
-
children:
|
|
1153
|
+
children: CARDINALS6[a] ?? String(a / 10)
|
|
922
1154
|
},
|
|
923
1155
|
a
|
|
924
1156
|
);
|
|
925
1157
|
})
|
|
926
1158
|
] }),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsx12("path", { d: `M ${CENTER} ${CENTER - 150} l -10 -28 h 20 z`, fill: AMBER4, stroke: "#000", strokeWidth: "1.5" }),
|
|
1160
|
+
/* @__PURE__ */ jsx12("g", { stroke: AMBER4, strokeWidth: "4", strokeLinecap: "round", children: [45, 90, 135, 180, 225, 270, 315].map((a) => /* @__PURE__ */ jsx12("path", { d: tickPath(192, 178, a) }, a)) }),
|
|
1161
|
+
/* @__PURE__ */ jsxs12("g", { stroke: AMBER4, strokeWidth: "2", strokeLinecap: "round", opacity: "0.7", children: [
|
|
1162
|
+
/* @__PURE__ */ jsx12("path", { d: `M ${CENTER - 26} ${CENTER} H ${CENTER + 26}` }),
|
|
1163
|
+
/* @__PURE__ */ jsx12("path", { d: `M ${CENTER} ${CENTER - 26} V ${CENTER + 14}` })
|
|
932
1164
|
] }),
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ jsx12("text", { x: CENTER, y: CENTER + 62, fill: "#ccc", fontSize: "15", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: "ADF" }),
|
|
1166
|
+
/* @__PURE__ */ jsxs12("g", { "data-testid": "adf-flag", opacity: signal ? 0 : 1, style: { transition: "opacity 200ms ease-out" }, children: [
|
|
1167
|
+
/* @__PURE__ */ jsx12("rect", { x: CENTER - 28, y: CENTER - 76, width: "56", height: "24", rx: "3", fill: "#d42626", stroke: "#000", strokeWidth: "1.5" }),
|
|
1168
|
+
/* @__PURE__ */ jsx12("text", { x: CENTER, y: CENTER - 63, fill: "#fff", fontSize: "15", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "ADF" })
|
|
937
1169
|
] }),
|
|
938
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ jsx12("g", { "data-testid": "adf-needle", style: motionStyle(`rotate(${displayNeedle}deg)`, duration), children: /* @__PURE__ */ jsx12(
|
|
939
1171
|
"path",
|
|
940
1172
|
{
|
|
941
1173
|
d: `M ${CENTER} ${CENTER - 146} l -13 30 h 9 V ${CENTER + 140} h 8 V ${CENTER - 116} h 9 z`,
|
|
@@ -945,12 +1177,12 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
|
|
|
945
1177
|
strokeLinejoin: "round"
|
|
946
1178
|
}
|
|
947
1179
|
) }),
|
|
948
|
-
/* @__PURE__ */
|
|
1180
|
+
/* @__PURE__ */ jsx12(Hub, { r: 10 })
|
|
949
1181
|
] });
|
|
950
1182
|
}
|
|
951
1183
|
|
|
952
1184
|
// src/components/RadioPanel.tsx
|
|
953
|
-
import { jsx as
|
|
1185
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
954
1186
|
var SIDE = 252;
|
|
955
1187
|
var ORIGIN = CENTER - SIDE / 2;
|
|
956
1188
|
var ROW_H = 60;
|
|
@@ -967,9 +1199,9 @@ var formatAdf = (khz) => usable(khz) ? Number.isInteger(khz) ? String(khz) : khz
|
|
|
967
1199
|
var formatDme = (nm) => usable(nm) ? nm < 99.95 ? nm.toFixed(1) : nm.toFixed(0) : "--.-";
|
|
968
1200
|
function Display({ x, y, width, value, color, testId, unit }) {
|
|
969
1201
|
const h = ROW_H - 16;
|
|
970
|
-
return /* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ jsxs13("g", { children: [
|
|
1203
|
+
/* @__PURE__ */ jsx13("rect", { x, y: y + 8, width, height: h, rx: "5", fill: "#1a0d00", stroke: "#3a2a14", strokeWidth: "1.5" }),
|
|
1204
|
+
/* @__PURE__ */ jsx13(
|
|
973
1205
|
"text",
|
|
974
1206
|
{
|
|
975
1207
|
"data-testid": testId,
|
|
@@ -984,18 +1216,18 @@ function Display({ x, y, width, value, color, testId, unit }) {
|
|
|
984
1216
|
children: value
|
|
985
1217
|
}
|
|
986
1218
|
),
|
|
987
|
-
unit && /* @__PURE__ */
|
|
1219
|
+
unit && /* @__PURE__ */ jsx13("text", { x: x + width - 10, y: y + ROW_H / 2 + 5, fill: "#9aa4b1", fontSize: "13", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: unit })
|
|
988
1220
|
] });
|
|
989
1221
|
}
|
|
990
1222
|
function Swap({ y }) {
|
|
991
1223
|
const cy = y + ROW_H / 2;
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
1224
|
+
return /* @__PURE__ */ jsxs13("g", { stroke: "#9aa4b1", strokeWidth: "1.8", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1225
|
+
/* @__PURE__ */ jsx13("path", { d: `M ${SWAP_X - 7} ${cy - 4} H ${SWAP_X + 7} m -4 -3 l 4 3 l -4 3` }),
|
|
1226
|
+
/* @__PURE__ */ jsx13("path", { d: `M ${SWAP_X + 7} ${cy + 4} H ${SWAP_X - 7} m 4 -3 l -4 3 l 4 3` })
|
|
995
1227
|
] });
|
|
996
1228
|
}
|
|
997
1229
|
function RowLabel({ y, children }) {
|
|
998
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsx13("text", { x: LABEL_X, y: y + ROW_H / 2 + 1, fill: "#ccc", fontSize: "14", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children });
|
|
999
1231
|
}
|
|
1000
1232
|
function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
|
|
1001
1233
|
const rows = [
|
|
@@ -1005,29 +1237,29 @@ function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
|
|
|
1005
1237
|
const dmeText = formatDme(dme);
|
|
1006
1238
|
const dmeY = FIRST_ROW + 2 * (ROW_H + ROW_GAP);
|
|
1007
1239
|
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"}`;
|
|
1008
|
-
return /* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ jsxs13(InstrumentFrame, { ...props, label: label2, children: [
|
|
1241
|
+
/* @__PURE__ */ jsx13("rect", { x: ORIGIN, y: ORIGIN, width: SIDE, height: SIDE, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1242
|
+
/* @__PURE__ */ jsxs13("g", { fill: "#9aa4b1", fontSize: "11", fontWeight: "bold", letterSpacing: "1.5", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1243
|
+
/* @__PURE__ */ jsx13("text", { x: ACTIVE_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "ACTIVE" }),
|
|
1244
|
+
/* @__PURE__ */ jsx13("text", { x: STANDBY_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "STBY" })
|
|
1013
1245
|
] }),
|
|
1014
1246
|
rows.map((r, i) => {
|
|
1015
1247
|
const y = FIRST_ROW + i * (ROW_H + ROW_GAP);
|
|
1016
|
-
return /* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ jsxs13("g", { children: [
|
|
1249
|
+
/* @__PURE__ */ jsx13(RowLabel, { y, children: r.name }),
|
|
1250
|
+
/* @__PURE__ */ jsx13(Display, { x: ACTIVE_X, y, width: DISPLAY_W, value: r.active, color, testId: `radio-${r.key}-active` }),
|
|
1251
|
+
/* @__PURE__ */ jsx13(Swap, { y }),
|
|
1252
|
+
/* @__PURE__ */ jsx13(Display, { x: STANDBY_X, y, width: DISPLAY_W, value: r.standby, color, testId: `radio-${r.key}-standby` })
|
|
1021
1253
|
] }, r.key);
|
|
1022
1254
|
}),
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx13(RowLabel, { y: dmeY, children: "DME" }),
|
|
1256
|
+
/* @__PURE__ */ jsx13(Display, { x: ACTIVE_X, y: dmeY, width: STANDBY_X + DISPLAY_W - ACTIVE_X, value: dmeText, color, testId: "radio-dme", unit: "NM" })
|
|
1025
1257
|
] });
|
|
1026
1258
|
}
|
|
1027
1259
|
|
|
1028
1260
|
// src/components/RadioStack.tsx
|
|
1029
1261
|
import { useState } from "react";
|
|
1030
|
-
import { Fragment as Fragment4, jsx as
|
|
1262
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1031
1263
|
var parseNav = (text) => {
|
|
1032
1264
|
const mhz = Math.round(Number.parseFloat(text.replace(",", ".")) * 100) / 100;
|
|
1033
1265
|
return mhz >= 108 && mhz <= 117.95 ? mhz : void 0;
|
|
@@ -1060,9 +1292,9 @@ var display = {
|
|
|
1060
1292
|
var label = { display: "flex", flexDirection: "column", justifyContent: "center", color: LABEL, fontWeight: "bold", letterSpacing: "0.06em", lineHeight: 1.15 };
|
|
1061
1293
|
var ident = { color: "#3cc8ff", fontSize: "0.72em", fontFamily: MONO, minHeight: "1.15em" };
|
|
1062
1294
|
function SwapIcon() {
|
|
1063
|
-
return /* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1295
|
+
return /* @__PURE__ */ jsxs14("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: [
|
|
1296
|
+
/* @__PURE__ */ jsx14("path", { d: "M2 5.5 H14 M11 2.5 l3 3 l-3 3" }),
|
|
1297
|
+
/* @__PURE__ */ jsx14("path", { d: "M14 10.5 H2 M5 7.5 l-3 3 l3 3" })
|
|
1066
1298
|
] });
|
|
1067
1299
|
}
|
|
1068
1300
|
function Receiver({ name, unit, value, ident: station, color, format, parse, onChange }) {
|
|
@@ -1096,13 +1328,13 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
|
|
|
1096
1328
|
if (text && standby === void 0 || standby === value.standby) return;
|
|
1097
1329
|
onChange({ active: value.active, standby });
|
|
1098
1330
|
};
|
|
1099
|
-
return /* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
1332
|
+
/* @__PURE__ */ jsxs14("div", { style: label, children: [
|
|
1333
|
+
/* @__PURE__ */ jsx14("span", { children: name }),
|
|
1334
|
+
/* @__PURE__ */ jsx14("span", { "data-testid": `radio-stack-${key}-ident`, style: ident, children: station ?? "" })
|
|
1103
1335
|
] }),
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ jsx14("div", { "data-testid": `radio-stack-${key}-active`, "aria-label": `${name} active frequency`, style: { ...display, color }, children: format(value.active) }),
|
|
1337
|
+
/* @__PURE__ */ jsx14(
|
|
1106
1338
|
"button",
|
|
1107
1339
|
{
|
|
1108
1340
|
type: "button",
|
|
@@ -1110,10 +1342,10 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
|
|
|
1110
1342
|
"aria-label": `Swap ${name} active and standby`,
|
|
1111
1343
|
title: "Swap active and standby",
|
|
1112
1344
|
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" },
|
|
1113
|
-
children: /* @__PURE__ */
|
|
1345
|
+
children: /* @__PURE__ */ jsx14(SwapIcon, {})
|
|
1114
1346
|
}
|
|
1115
1347
|
),
|
|
1116
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ jsx14(
|
|
1117
1349
|
"input",
|
|
1118
1350
|
{
|
|
1119
1351
|
type: "text",
|
|
@@ -1175,7 +1407,7 @@ function RadioStack({
|
|
|
1175
1407
|
const heading = { color: MUTED, fontSize: "0.72em", fontWeight: "bold", letterSpacing: "0.12em", textAlign: "center" };
|
|
1176
1408
|
return (
|
|
1177
1409
|
// The outer box is a size container so every inner measurement can follow the width.
|
|
1178
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ jsx14("div", { className, style: { display: "inline-block", width, maxWidth: "100%", verticalAlign: "top", containerType: "inline-size", ...style }, children: /* @__PURE__ */ jsxs14(
|
|
1179
1411
|
"div",
|
|
1180
1412
|
{
|
|
1181
1413
|
role: "group",
|
|
@@ -1198,20 +1430,20 @@ function RadioStack({
|
|
|
1198
1430
|
userSelect: "none"
|
|
1199
1431
|
},
|
|
1200
1432
|
children: [
|
|
1201
|
-
SCREWS2.map((position, i) => /* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1433
|
+
SCREWS2.map((position, i) => /* @__PURE__ */ jsxs14("svg", { viewBox: "-14 -14 28 28", "aria-hidden": "true", style: { position: "absolute", width: "0.75em", height: "0.75em", ...position }, children: [
|
|
1434
|
+
/* @__PURE__ */ jsx14("circle", { r: "12", fill: "#3a3a3a", stroke: "#111", strokeWidth: "2" }),
|
|
1435
|
+
/* @__PURE__ */ jsx14("path", { d: "M -8 3 L 8 -3", stroke: "#111", strokeWidth: "3" })
|
|
1204
1436
|
] }, i)),
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ jsx14("span", {}),
|
|
1438
|
+
/* @__PURE__ */ jsx14("span", { style: heading, children: "ACTIVE" }),
|
|
1439
|
+
/* @__PURE__ */ jsx14("span", {}),
|
|
1440
|
+
/* @__PURE__ */ jsx14("span", { style: heading, children: "STBY" }),
|
|
1441
|
+
/* @__PURE__ */ jsx14(Receiver, { name: "NAV", unit: "MHz", value: nav ?? innerNav, ident: navIdent, color, format: formatNav, parse: parseNav, onChange: changeNav }),
|
|
1442
|
+
/* @__PURE__ */ jsx14(Receiver, { name: "ADF", unit: "kHz", value: adf ?? innerAdf, ident: adfIdent, color, format: formatAdf, parse: parseAdf, onChange: changeAdf }),
|
|
1443
|
+
/* @__PURE__ */ jsx14("div", { style: label, children: "DME" }),
|
|
1444
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
1445
|
+
/* @__PURE__ */ jsx14("span", { "data-testid": "radio-stack-dme", children: formatDme(dme) }),
|
|
1446
|
+
/* @__PURE__ */ jsx14("span", { style: { color: MUTED, fontFamily: "'Helvetica Neue', Arial, sans-serif", fontSize: "0.5em" }, children: "NM" })
|
|
1215
1447
|
] })
|
|
1216
1448
|
]
|
|
1217
1449
|
}
|
|
@@ -1220,7 +1452,7 @@ function RadioStack({
|
|
|
1220
1452
|
}
|
|
1221
1453
|
|
|
1222
1454
|
// src/components/DataPanel.tsx
|
|
1223
|
-
import { jsx as
|
|
1455
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1224
1456
|
var MAX_FIELDS = 6;
|
|
1225
1457
|
var SIDE2 = 252;
|
|
1226
1458
|
var PAD = 8;
|
|
@@ -1240,9 +1472,9 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1240
1472
|
const cellH = (SIDE2 - PAD * 2 - GAP * (rows - 1)) / rows;
|
|
1241
1473
|
const valueSize = VALUE_SIZE[rows] ?? 27;
|
|
1242
1474
|
const label2 = `${heading ?? "Data panel"}: ` + (shown.length ? shown.map((f) => `${f.name} ${formatValue(f)}${f.unit ? ` ${f.unit}` : ""}`).join(", ") : "no data");
|
|
1243
|
-
return /* @__PURE__ */
|
|
1244
|
-
heading && /* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsxs15(InstrumentFrame, { ...props, label: label2, children: [
|
|
1476
|
+
heading && /* @__PURE__ */ jsx15("text", { x: CENTER, y: ORIGIN2 - 14, fill: "#ccc", fontSize: "13", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: heading.toUpperCase() }),
|
|
1477
|
+
/* @__PURE__ */ jsx15("rect", { x: ORIGIN2, y: ORIGIN2, width: SIDE2, height: SIDE2, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1246
1478
|
shown.map((f, i) => {
|
|
1247
1479
|
const col = i % cols;
|
|
1248
1480
|
const row = Math.floor(i / cols);
|
|
@@ -1250,10 +1482,10 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1250
1482
|
const y = ORIGIN2 + PAD + row * (cellH + GAP);
|
|
1251
1483
|
const value = formatValue(f);
|
|
1252
1484
|
const fit = Math.min(valueSize, (cellW - 16) / (0.62 * Math.max(1, value.length)));
|
|
1253
|
-
return /* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ jsxs15("g", { "data-testid": `data-field-${i}`, children: [
|
|
1486
|
+
/* @__PURE__ */ jsx15("rect", { x, y, width: cellW, height: cellH, rx: "6", fill: "#000", stroke: "#262a30", strokeWidth: "1" }),
|
|
1487
|
+
/* @__PURE__ */ jsx15("text", { x: x + 8, y: y + 12, fill: "#9aa4b1", fontSize: "12", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children: f.name.toUpperCase() }),
|
|
1488
|
+
/* @__PURE__ */ jsx15(
|
|
1257
1489
|
"text",
|
|
1258
1490
|
{
|
|
1259
1491
|
"data-testid": `data-value-${i}`,
|
|
@@ -1268,14 +1500,14 @@ function DataPanel({ fields = [], heading, ...props }) {
|
|
|
1268
1500
|
children: value
|
|
1269
1501
|
}
|
|
1270
1502
|
),
|
|
1271
|
-
f.unit && /* @__PURE__ */
|
|
1503
|
+
f.unit && /* @__PURE__ */ jsx15("text", { x: x + cellW - 8, y: y + cellH - 12, fill: "#9aa4b1", fontSize: "12", textAnchor: "end", dominantBaseline: "central", children: f.unit })
|
|
1272
1504
|
] }, i);
|
|
1273
1505
|
})
|
|
1274
1506
|
] });
|
|
1275
1507
|
}
|
|
1276
1508
|
|
|
1277
1509
|
// src/components/FuelIndicator.tsx
|
|
1278
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1279
1511
|
var MAX_TANKS = 4;
|
|
1280
1512
|
var GREEN2 = "#2ee05a";
|
|
1281
1513
|
var RED = "#ff3b3b";
|
|
@@ -1318,16 +1550,16 @@ function FuelIndicator({
|
|
|
1318
1550
|
return { name: t.name, qty, cap, fraction, full, isLow, text: full ? "FULL" : qty.toFixed(places) };
|
|
1319
1551
|
});
|
|
1320
1552
|
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");
|
|
1321
|
-
return /* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1553
|
+
return /* @__PURE__ */ jsxs16(InstrumentFrame, { ...props, label: title, children: [
|
|
1554
|
+
/* @__PURE__ */ jsx16("rect", { x: ORIGIN3, y: ORIGIN3, width: SIDE3, height: SIDE3, rx: "10", fill: "#000", stroke: "#3a3f47", strokeWidth: "2" }),
|
|
1323
1555
|
readings.map((r, i) => {
|
|
1324
1556
|
const cx = INNER_LEFT + colW * (i + 0.5);
|
|
1325
1557
|
const color = r.isLow ? RED : GREEN2;
|
|
1326
1558
|
const tickX = cx - barW / 2 - 14;
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
i > 0 && /* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ jsxs16("g", { "data-testid": `fuel-tank-${i}`, children: [
|
|
1560
|
+
i > 0 && /* @__PURE__ */ jsx16("path", { d: `M ${INNER_LEFT + colW * i} ${ORIGIN3 + 10} V ${FOOTER_Y}`, stroke: "#555", strokeWidth: "1.5" }),
|
|
1561
|
+
/* @__PURE__ */ jsx16("text", { x: cx, y: ORIGIN3 + 22, fill: "#fff", fontSize: Math.min(17, colW / 5), fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: r.name.toUpperCase() }),
|
|
1562
|
+
/* @__PURE__ */ jsx16("g", { strokeWidth: "2.5", strokeLinecap: "round", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ jsx16(
|
|
1331
1563
|
"path",
|
|
1332
1564
|
{
|
|
1333
1565
|
d: `M ${tickX - 7} ${BAR_BOTTOM - f * BAR_H} h 7`,
|
|
@@ -1335,9 +1567,9 @@ function FuelIndicator({
|
|
|
1335
1567
|
},
|
|
1336
1568
|
f
|
|
1337
1569
|
)) }),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx16("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: "#15181c" }),
|
|
1571
|
+
/* @__PURE__ */ jsx16("g", { "data-testid": `fuel-bar-${i}`, style: motionStyle(`scaleY(${r.fraction})`, duration, cx, BAR_BOTTOM), children: /* @__PURE__ */ jsx16("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: color }) }),
|
|
1572
|
+
/* @__PURE__ */ jsx16(
|
|
1341
1573
|
"text",
|
|
1342
1574
|
{
|
|
1343
1575
|
"data-testid": `fuel-value-${i}`,
|
|
@@ -1352,16 +1584,16 @@ function FuelIndicator({
|
|
|
1352
1584
|
children: r.text
|
|
1353
1585
|
}
|
|
1354
1586
|
),
|
|
1355
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ jsx16("text", { x: cx, y: BAR_BOTTOM + 44, fill: "#fff", fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: unit })
|
|
1356
1588
|
] }, i);
|
|
1357
1589
|
}),
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx16("path", { d: `M ${ORIGIN3 + 8} ${FOOTER_Y} H ${ORIGIN3 + SIDE3 - 8}`, stroke: "#555", strokeWidth: "1.5" }),
|
|
1591
|
+
/* @__PURE__ */ jsx16("text", { x: CENTER, y: FOOTER_Y + 19, fill: "#fff", fontSize: "24", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: label2.toUpperCase() })
|
|
1360
1592
|
] });
|
|
1361
1593
|
}
|
|
1362
1594
|
|
|
1363
1595
|
// src/components/EngineIndicator.tsx
|
|
1364
|
-
import { jsx as
|
|
1596
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1365
1597
|
var MAX_CYLINDERS = 6;
|
|
1366
1598
|
var MAX_BAR_GAUGES = 4;
|
|
1367
1599
|
var GREEN3 = "#5fe04a";
|
|
@@ -1370,11 +1602,11 @@ var RED2 = "#ff3030";
|
|
|
1370
1602
|
var BLUE = "#4fb7e8";
|
|
1371
1603
|
var LABEL2 = "#b9c8e6";
|
|
1372
1604
|
var LINE = "#8a8f99";
|
|
1373
|
-
var
|
|
1605
|
+
var round23 = (n) => Math.round(n * 100) / 100;
|
|
1374
1606
|
var DIAL_R = 182;
|
|
1375
1607
|
function chord(y, inset = 8) {
|
|
1376
1608
|
const half = Math.sqrt(Math.max(0, DIAL_R * DIAL_R - (y - CENTER) ** 2)) - inset;
|
|
1377
|
-
return `M ${
|
|
1609
|
+
return `M ${round23(CENTER - half)} ${y} H ${round23(CENTER + half)}`;
|
|
1378
1610
|
}
|
|
1379
1611
|
var DEFAULT_MANIFOLD = { min: 10, max: 35, green: [15, 29], yellow: [29, 31], high: 31, unit: "IN", decimals: 1 };
|
|
1380
1612
|
var DEFAULT_RPM = { min: 0, max: 3e3, green: [800, 2500], yellow: [2500, 2700], high: 2700, decimals: 0 };
|
|
@@ -1419,22 +1651,22 @@ function arcAt(cx, cy, r, a0, a1) {
|
|
|
1419
1651
|
}
|
|
1420
1652
|
function ArcGauge({ cx, label: label2, g, duration, testId }) {
|
|
1421
1653
|
const span = g.max - g.min;
|
|
1422
|
-
const angle = (v) =>
|
|
1423
|
-
const band = (from, to, color) => /* @__PURE__ */
|
|
1654
|
+
const angle = (v) => round23(-ARC_SWEEP + 2 * ARC_SWEEP * clamp((v - g.min) / span, 0, 1));
|
|
1655
|
+
const band = (from, to, color) => /* @__PURE__ */ jsx17("path", { d: arcAt(cx, ARC_Y, ARC_R, angle(from), angle(to)), stroke: color, strokeWidth: "6", fill: "none" });
|
|
1424
1656
|
const [tipX, tipY] = polar(ARC_R - 4, 0, cx, ARC_Y);
|
|
1425
1657
|
const [lx, ly] = polar(ARC_R - 16, -7, cx, ARC_Y);
|
|
1426
1658
|
const [rx, ry] = polar(ARC_R - 16, 7, cx, ARC_Y);
|
|
1427
|
-
return /* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ jsxs17("g", { children: [
|
|
1660
|
+
/* @__PURE__ */ jsx17("path", { d: arcAt(cx, ARC_Y, ARC_R, -ARC_SWEEP, ARC_SWEEP), stroke: "#fff", strokeWidth: "1.5", fill: "none" }),
|
|
1429
1661
|
g.green && band(g.green[0], g.green[1], GREEN3),
|
|
1430
1662
|
g.yellow && band(g.yellow[0], g.yellow[1], YELLOW2),
|
|
1431
1663
|
g.low !== void 0 && band(g.min, g.low, RED2),
|
|
1432
1664
|
g.high !== void 0 && band(g.high, g.max, RED2),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`rotate(${angle(g.value)}deg)`, duration, cx, ARC_Y), children: /* @__PURE__ */ jsx17("path", { d: `M ${tipX} ${tipY} L ${lx} ${ly} L ${rx} ${ry} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1666
|
+
/* @__PURE__ */ jsx17("text", { x: cx, y: ARC_Y - 20, fill: LABEL2, fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: label2 }),
|
|
1667
|
+
/* @__PURE__ */ jsxs17("text", { x: cx, y: ARC_Y + 4, fill: g.color, fontSize: "28", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1436
1668
|
g.text,
|
|
1437
|
-
g.unit && /* @__PURE__ */
|
|
1669
|
+
g.unit && /* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: g.unit })
|
|
1438
1670
|
] })
|
|
1439
1671
|
] });
|
|
1440
1672
|
}
|
|
@@ -1444,28 +1676,28 @@ var BAR_ROW_H = 39;
|
|
|
1444
1676
|
var BAR_TOP2 = 137;
|
|
1445
1677
|
function BarGauge({ top, g, label: label2, duration, testId }) {
|
|
1446
1678
|
const y = top + 14;
|
|
1447
|
-
const at = (v) =>
|
|
1448
|
-
const seg = (from, to, color, w = 7) => /* @__PURE__ */
|
|
1449
|
-
return /* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1679
|
+
const at = (v) => round23(BAR_X0 + (BAR_X1 - BAR_X0) * clamp((v - g.min) / (g.max - g.min), 0, 1));
|
|
1680
|
+
const seg = (from, to, color, w = 7) => /* @__PURE__ */ jsx17("path", { d: `M ${at(from)} ${y} H ${at(to)}`, stroke: color, strokeWidth: w });
|
|
1681
|
+
return /* @__PURE__ */ jsxs17("g", { children: [
|
|
1682
|
+
/* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y} H ${BAR_X1}`, stroke: "#fff", strokeWidth: "2" }),
|
|
1683
|
+
/* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y - 4} v 8 M ${BAR_X1} ${y - 4} v 8`, stroke: "#fff", strokeWidth: "2" }),
|
|
1452
1684
|
g.green && seg(g.green[0], g.green[1], GREEN3),
|
|
1453
1685
|
g.yellow && seg(g.yellow[0], g.yellow[1], YELLOW2),
|
|
1454
1686
|
g.low !== void 0 && seg(g.min, g.low, RED2),
|
|
1455
1687
|
g.high !== void 0 && seg(g.high, g.max, RED2),
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
g.unit && /* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`translate(${round23(at(g.value) - BAR_X0)}px, 0px)`, duration), children: /* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y - 3} l -5 -9 h 10 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1689
|
+
/* @__PURE__ */ jsx17("text", { x: BAR_X0, y: top + 31, fill: LABEL2, fontSize: "13", fontWeight: "bold", dominantBaseline: "central", children: label2 }),
|
|
1690
|
+
/* @__PURE__ */ jsx17("text", { x: 350, y: top + 15, fill: g.color, fontSize: "20", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.text }),
|
|
1691
|
+
g.unit && /* @__PURE__ */ jsx17("text", { x: 350, y: top + 31, fill: LABEL2, fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.unit })
|
|
1460
1692
|
] });
|
|
1461
1693
|
}
|
|
1462
1694
|
function Tank({ x, fraction, duration, testId }) {
|
|
1463
1695
|
const top = 304;
|
|
1464
1696
|
const h = 40;
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ jsxs17("g", { children: [
|
|
1698
|
+
/* @__PURE__ */ jsx17("rect", { x: x - 7, y: top, width: "14", height: h, rx: "3", fill: "#000", stroke: "#fff", strokeWidth: "1.5" }),
|
|
1699
|
+
/* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`scaleY(${fraction})`, duration, x, top + h - 2), children: /* @__PURE__ */ jsx17("rect", { x: x - 5.5, y: top + 2, width: "11", height: h - 4, fill: BLUE }) }),
|
|
1700
|
+
/* @__PURE__ */ jsx17("rect", { x: x - 5.5, y: top + h - 5, width: "11", height: "3", fill: RED2 })
|
|
1469
1701
|
] });
|
|
1470
1702
|
}
|
|
1471
1703
|
var hottest = (values) => {
|
|
@@ -1533,79 +1765,79 @@ function EngineIndicator({
|
|
|
1533
1765
|
fuelLeft !== void 0 || fuelRight !== void 0 ? `fuel ${fmt(fuelLeft)}/${fmt(fuelRight)} ${fuelUnit}` : null,
|
|
1534
1766
|
volts !== void 0 ? `${fmt(volts, 1)} V` : null
|
|
1535
1767
|
].filter(Boolean).join(", ");
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
power !== void 0 && /* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ jsxs17(InstrumentFrame, { ...props, label: label2, children: [
|
|
1769
|
+
power !== void 0 && /* @__PURE__ */ jsxs17("text", { x: CENTER, y: 44, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1770
|
+
/* @__PURE__ */ jsxs17("tspan", { fill: LABEL2, fontSize: "11", children: [
|
|
1539
1771
|
"POWER",
|
|
1540
1772
|
" "
|
|
1541
1773
|
] }),
|
|
1542
1774
|
fmt(power),
|
|
1543
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ jsx17("tspan", { fontSize: "11", children: "%" })
|
|
1544
1776
|
] }),
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1777
|
+
/* @__PURE__ */ jsx17(ArcGauge, { cx: 118, label: "MAN", g: man, duration, testId: "engine-man" }),
|
|
1778
|
+
/* @__PURE__ */ jsx17(ArcGauge, { cx: 282, label: "RPM", g: speed, duration, testId: "engine-rpm" }),
|
|
1779
|
+
/* @__PURE__ */ jsxs17("g", { stroke: LINE, strokeWidth: "1.5", children: [
|
|
1780
|
+
/* @__PURE__ */ jsx17("path", { d: chord(133) }),
|
|
1781
|
+
/* @__PURE__ */ jsx17("path", { d: "M 200 133 V 298" }),
|
|
1782
|
+
/* @__PURE__ */ jsx17("path", { d: chord(298) }),
|
|
1783
|
+
/* @__PURE__ */ jsx17("path", { d: "M 136 298 V 348 M 264 298 V 348" })
|
|
1552
1784
|
] }),
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ jsx17("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: readouts.map((r) => /* @__PURE__ */ jsxs17("g", { children: [
|
|
1786
|
+
/* @__PURE__ */ jsxs17("text", { x: r.x, y: 144, fill: LABEL2, fontSize: "13", children: [
|
|
1555
1787
|
r.name,
|
|
1556
|
-
/* @__PURE__ */
|
|
1788
|
+
/* @__PURE__ */ jsx17("tspan", { fontSize: "9", children: temperatureUnit })
|
|
1557
1789
|
] }),
|
|
1558
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsx17("text", { "data-testid": `engine-${r.name.toLowerCase()}`, x: r.x, y: 165, fill: r.color, fontSize: "22", children: fmt(r.value) })
|
|
1559
1791
|
] }, r.name)) }),
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
columns > 0 && /* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ jsx17("path", { d: "M 40 178 H 190", stroke: LINE, strokeWidth: "1" }),
|
|
1793
|
+
columns > 0 && /* @__PURE__ */ jsxs17("g", { children: [
|
|
1794
|
+
/* @__PURE__ */ jsx17("path", { d: `M ${chartX0} ${limitY} H ${chartX1}`, stroke: RED2, strokeWidth: "1.5", strokeDasharray: "5 4" }),
|
|
1795
|
+
/* @__PURE__ */ jsx17("text", { x: chartX0 - 4, y: limitY, fill: "#fff", fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: "CHT" }),
|
|
1564
1796
|
Array.from({ length: cylinders }, (_, i) => {
|
|
1565
1797
|
const x0 = chartX0 + colW * i;
|
|
1566
1798
|
const mid = x0 + colW / 2;
|
|
1567
1799
|
const c = chtValues[i];
|
|
1568
1800
|
const e = egtValues[i];
|
|
1569
|
-
return /* @__PURE__ */
|
|
1570
|
-
c !== void 0 && /* @__PURE__ */
|
|
1571
|
-
e !== void 0 && /* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ jsxs17("g", { children: [
|
|
1802
|
+
c !== void 0 && /* @__PURE__ */ jsx17("g", { "data-testid": `engine-cht-${i}`, style: motionStyle(`scaleY(${chtFrac(c)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: mid - barW - 1, y: chartBase - chartH, width: barW, height: chartH, fill: GREEN3 }) }),
|
|
1803
|
+
e !== void 0 && /* @__PURE__ */ jsx17("g", { "data-testid": `engine-egt-${i}`, style: motionStyle(`scaleY(${egtFrac(e)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: mid + 1, y: chartBase - chartH, width: barW, height: chartH, fill: BLUE }) }),
|
|
1804
|
+
/* @__PURE__ */ jsx17("text", { x: mid, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: i + 1 })
|
|
1573
1805
|
] }, i);
|
|
1574
1806
|
}),
|
|
1575
|
-
hasTit && /* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1807
|
+
hasTit && /* @__PURE__ */ jsxs17("g", { children: [
|
|
1808
|
+
/* @__PURE__ */ jsx17("g", { "data-testid": "engine-tit-bar", style: motionStyle(`scaleY(${egtFrac(tit)})`, duration, chartX1 - colW / 2, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: chartX1 - colW / 2 - barW / 2, y: chartBase - chartH, width: barW, height: chartH, fill: "#fff" }) }),
|
|
1809
|
+
/* @__PURE__ */ jsx17("text", { x: chartX1 - colW / 2, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "T" })
|
|
1578
1810
|
] })
|
|
1579
1811
|
] }),
|
|
1580
|
-
bars.map((b, i) => /* @__PURE__ */
|
|
1581
|
-
i > 0 && /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1812
|
+
bars.map((b, i) => /* @__PURE__ */ jsxs17("g", { children: [
|
|
1813
|
+
i > 0 && /* @__PURE__ */ jsx17("path", { d: `M 206 ${BAR_TOP2 + BAR_ROW_H * i - 2} H 352`, stroke: LINE, strokeWidth: "1" }),
|
|
1814
|
+
/* @__PURE__ */ jsx17(BarGauge, { top: BAR_TOP2 + BAR_ROW_H * i, g: b.g, label: b.label, duration, testId: `engine-bar-${i}` })
|
|
1583
1815
|
] }, b.label)),
|
|
1584
|
-
/* @__PURE__ */
|
|
1585
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ jsxs17("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
|
|
1817
|
+
/* @__PURE__ */ jsxs17("text", { "data-testid": "engine-amps", x: 104, y: 318, fill: "#fff", fontSize: "20", children: [
|
|
1586
1818
|
fmt(amps),
|
|
1587
|
-
/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: "A" })
|
|
1588
1820
|
] }),
|
|
1589
|
-
/* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ jsx17("text", { x: 104, y: 338, fill: LABEL2, fontSize: "13", children: "ALT" }),
|
|
1822
|
+
/* @__PURE__ */ jsx17(Tank, { x: 152, fraction: left / cap, duration, testId: "engine-fuel-left" }),
|
|
1823
|
+
/* @__PURE__ */ jsx17(Tank, { x: 248, fraction: right / cap, duration, testId: "engine-fuel-right" }),
|
|
1824
|
+
/* @__PURE__ */ jsxs17("text", { "data-testid": "engine-fuel", x: 200, y: 316, fill: "#fff", fontSize: "20", children: [
|
|
1593
1825
|
fmt(left),
|
|
1594
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ jsx17("tspan", { dx: "14", children: fmt(right) })
|
|
1595
1827
|
] }),
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx17("text", { x: 200, y: 335, fill: LABEL2, fontSize: "13", children: "Fuel" }),
|
|
1829
|
+
/* @__PURE__ */ jsx17("text", { x: 200, y: 348, fill: LABEL2, fontSize: "9", children: fuelUnit }),
|
|
1830
|
+
/* @__PURE__ */ jsxs17("text", { "data-testid": "engine-volts", x: 296, y: 318, fill: "#fff", fontSize: "20", children: [
|
|
1599
1831
|
fmt(volts, 1),
|
|
1600
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: "V" })
|
|
1601
1833
|
] }),
|
|
1602
|
-
/* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ jsx17("text", { x: 296, y: 338, fill: LABEL2, fontSize: "13", children: "BATT" })
|
|
1603
1835
|
] })
|
|
1604
1836
|
] });
|
|
1605
1837
|
}
|
|
1606
1838
|
|
|
1607
1839
|
// src/components/FlapIndicator.tsx
|
|
1608
|
-
import { jsx as
|
|
1840
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1609
1841
|
var GREEN4 = "#3ddc3d";
|
|
1610
1842
|
var YELLOW3 = "#ffd400";
|
|
1611
1843
|
var ORANGE = "#ff8a00";
|
|
@@ -1644,12 +1876,12 @@ function FlapIndicator({
|
|
|
1644
1876
|
const overspeed = limit !== void 0 && !Number.isNaN(ias) && ias > limit.speed;
|
|
1645
1877
|
const segH = BAR_H2 / count;
|
|
1646
1878
|
const title = `${label2}: ${Math.round(position)}\xB0 of ${Math.round(full)}\xB0` + (limit ? `, max ${Math.round(limit.speed)} knots${overspeed ? " (overspeed)" : ""}` : "");
|
|
1647
|
-
return /* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsxs18(InstrumentFrame, { ...props, label: title, children: [
|
|
1880
|
+
/* @__PURE__ */ jsx18("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" }),
|
|
1649
1881
|
Array.from({ length: count }, (_, i) => {
|
|
1650
1882
|
const y = BAR_TOP3 + i * segH;
|
|
1651
1883
|
const on = i < lit;
|
|
1652
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ jsx18(
|
|
1653
1885
|
"rect",
|
|
1654
1886
|
{
|
|
1655
1887
|
"data-testid": `flap-segment-${i}`,
|
|
@@ -1666,26 +1898,26 @@ function FlapIndicator({
|
|
|
1666
1898
|
i
|
|
1667
1899
|
);
|
|
1668
1900
|
}),
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsx18("g", { fill: "#fff", fontSize: "18", fontWeight: "bold", dominantBaseline: "central", children: scale.map((d) => /* @__PURE__ */ jsxs18("g", { children: [
|
|
1902
|
+
/* @__PURE__ */ jsx18("path", { d: `M ${BAR_X + BAR_W / 2 + 8} ${yAt(d)} h 8`, stroke: "#fff", strokeWidth: "2" }),
|
|
1903
|
+
/* @__PURE__ */ jsx18("text", { x: BAR_X + BAR_W / 2 + 22, y: yAt(d), children: d })
|
|
1672
1904
|
] }, d)) }),
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
limit && /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsx18("g", { "data-testid": "flap-pointer", style: motionStyle(`translate(0px, ${yAt(position) - BAR_TOP3}px)`, duration), children: /* @__PURE__ */ jsx18("path", { d: `M ${BAR_X - BAR_W / 2 - 8} ${BAR_TOP3} l -14 -8 v 16 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
|
|
1906
|
+
limit && /* @__PURE__ */ jsxs18("g", { textAnchor: "middle", dominantBaseline: "central", fill: overspeed ? RED3 : "#fff", children: [
|
|
1907
|
+
/* @__PURE__ */ jsxs18("text", { "data-testid": "flap-speed", x: 118, y: 176, fontSize: "36", fontWeight: "bold", children: [
|
|
1676
1908
|
Math.round(limit.speed),
|
|
1677
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsx18("tspan", { fontSize: "13", dx: "3", children: "KTS" })
|
|
1678
1910
|
] }),
|
|
1679
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsx18("text", { x: 118, y: 212, fontSize: "13", fontWeight: "bold", fill: "#bbb", letterSpacing: "2", children: "MAX" })
|
|
1680
1912
|
] }),
|
|
1681
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ jsx18("text", { x: CENTER, y: 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
|
|
1682
1914
|
] });
|
|
1683
1915
|
}
|
|
1684
1916
|
|
|
1685
1917
|
// src/components/AoaIndicator.tsx
|
|
1686
|
-
import { Fragment as Fragment5, jsx as
|
|
1918
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1687
1919
|
var GREEN5 = "#3ddc3d";
|
|
1688
|
-
var
|
|
1920
|
+
var AMBER5 = "#ffb000";
|
|
1689
1921
|
var RED4 = "#ff2a2a";
|
|
1690
1922
|
var UNLIT_OPACITY = 0.15;
|
|
1691
1923
|
var ROWS = [
|
|
@@ -1694,10 +1926,10 @@ var ROWS = [
|
|
|
1694
1926
|
{ shape: "bar", color: GREEN5, y: 256 },
|
|
1695
1927
|
{ shape: "bar", color: GREEN5, y: 234 },
|
|
1696
1928
|
{ shape: "donut", color: GREEN5, y: 208 },
|
|
1697
|
-
{ shape: "bar", color:
|
|
1698
|
-
{ shape: "split", color:
|
|
1699
|
-
{ shape: "chevron", color:
|
|
1700
|
-
{ shape: "chevron", color:
|
|
1929
|
+
{ shape: "bar", color: AMBER5, y: 182 },
|
|
1930
|
+
{ shape: "split", color: AMBER5, y: 160 },
|
|
1931
|
+
{ shape: "chevron", color: AMBER5, y: 125 },
|
|
1932
|
+
{ shape: "chevron", color: AMBER5, y: 103 },
|
|
1701
1933
|
{ shape: "chevron", color: RED4, y: 74 },
|
|
1702
1934
|
{ shape: "chevron", color: RED4, y: 52 }
|
|
1703
1935
|
];
|
|
@@ -1711,20 +1943,20 @@ function RowShape({ shape, y }) {
|
|
|
1711
1943
|
const r = CENTER + HALF;
|
|
1712
1944
|
switch (shape) {
|
|
1713
1945
|
case "bar":
|
|
1714
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: HALF * 2, height: BAR_H3, rx: "2" });
|
|
1715
1947
|
case "split":
|
|
1716
|
-
return /* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
1949
|
+
/* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" }),
|
|
1950
|
+
/* @__PURE__ */ jsx19("rect", { x: r - 50, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" })
|
|
1719
1951
|
] });
|
|
1720
1952
|
case "donut":
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
1954
|
+
/* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
|
|
1955
|
+
/* @__PURE__ */ jsx19("rect", { x: CENTER + 24, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
|
|
1956
|
+
/* @__PURE__ */ jsx19("circle", { cx: CENTER, cy: y, r: 13, fill: "none", strokeWidth: "7" })
|
|
1725
1957
|
] });
|
|
1726
1958
|
case "chevron":
|
|
1727
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ jsx19("path", { d: `M ${l} ${y} L ${CENTER} ${y + CHEVRON_DEPTH} L ${r} ${y}`, fill: "none", strokeWidth: "11", strokeLinejoin: "miter" });
|
|
1728
1960
|
}
|
|
1729
1961
|
}
|
|
1730
1962
|
function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false, label: label2 = "AOA", ...props }) {
|
|
@@ -1738,11 +1970,11 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
|
|
|
1738
1970
|
const reading = Number.isNaN(value) ? "---" : `${value.toFixed(1)}\xB0`;
|
|
1739
1971
|
const state = stall ? " (stall warning)" : lit > DONUT + 1 ? " (high)" : lit === DONUT + 1 ? " (optimum)" : "";
|
|
1740
1972
|
const title = `${label2}: ${reading}${Number.isNaN(value) ? "" : state}`;
|
|
1741
|
-
return /* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ jsxs19(InstrumentFrame, { ...props, label: title, children: [
|
|
1974
|
+
/* @__PURE__ */ jsx19("rect", { x: CENTER - HALF - 10, y: 40, width: (HALF + 10) * 2, height: 278, rx: "10", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
|
|
1743
1975
|
ROWS.map((row, i) => {
|
|
1744
1976
|
const on = i < lit;
|
|
1745
|
-
return /* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ jsxs19(
|
|
1746
1978
|
"g",
|
|
1747
1979
|
{
|
|
1748
1980
|
"data-testid": `aoa-row-${i}`,
|
|
@@ -1753,15 +1985,15 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
|
|
|
1753
1985
|
opacity: on ? 1 : UNLIT_OPACITY,
|
|
1754
1986
|
style: { transition: "opacity 150ms ease-out" },
|
|
1755
1987
|
children: [
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
on && stall && row.shape === "chevron" && /* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx19(RowShape, { shape: row.shape, y: row.y }),
|
|
1989
|
+
on && stall && row.shape === "chevron" && /* @__PURE__ */ jsx19("animate", { attributeName: "opacity", values: "1;0.25;1", dur: "0.6s", repeatCount: "indefinite" })
|
|
1758
1990
|
]
|
|
1759
1991
|
},
|
|
1760
1992
|
i
|
|
1761
1993
|
);
|
|
1762
1994
|
}),
|
|
1763
|
-
showValue && /* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1995
|
+
showValue && /* @__PURE__ */ jsx19("text", { "data-testid": "aoa-value", x: CENTER, y: 340, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", children: reading }),
|
|
1996
|
+
/* @__PURE__ */ jsx19("text", { x: CENTER, y: showValue ? 362 : 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
|
|
1765
1997
|
] });
|
|
1766
1998
|
}
|
|
1767
1999
|
export {
|
|
@@ -1778,6 +2010,7 @@ export {
|
|
|
1778
2010
|
FlapIndicator,
|
|
1779
2011
|
FuelIndicator,
|
|
1780
2012
|
HeadingIndicator,
|
|
2013
|
+
HsiIndicator,
|
|
1781
2014
|
IlsIndicator,
|
|
1782
2015
|
MAX_BAR_GAUGES,
|
|
1783
2016
|
MAX_CYLINDERS,
|