feat: integrate tangential force HUD
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
HudConfigLink,
|
||||
HudNoticeTone,
|
||||
HudPacket,
|
||||
HudSpatialForce,
|
||||
PressureColorMapPreset,
|
||||
HudSignalPanel,
|
||||
HudSignalSeries,
|
||||
@@ -228,6 +229,7 @@
|
||||
let signalPanels: HudSignalPanel[] = buildInactivePanels();
|
||||
let summary: HudSummary = buildEmptySummary();
|
||||
let pressureMatrix: number[] | null = null;
|
||||
let spatialForce: HudSpatialForce | null = null;
|
||||
let matrixRows = 12;
|
||||
let matrixCols = 7;
|
||||
let rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
@@ -717,6 +719,7 @@
|
||||
|
||||
function resetReplayVisualState(): void {
|
||||
pressureMatrix = buildZeroMatrix();
|
||||
spatialForce = null;
|
||||
signalPanels = buildInactivePanels();
|
||||
summary = buildEmptySummary();
|
||||
hasSignalData = false;
|
||||
@@ -752,6 +755,7 @@
|
||||
replayHasDisplayedFrame = true;
|
||||
replayProgress = replayFrames.length > 1 ? safeIndex / (replayFrames.length - 1) : 1;
|
||||
pressureMatrix = frameValuesToMatrix(replayFrames[safeIndex].values);
|
||||
spatialForce = null;
|
||||
signalPanels = buildInactivePanels();
|
||||
summary = buildReplaySummaryAt(safeIndex);
|
||||
hasSignalData = true;
|
||||
@@ -1006,7 +1010,8 @@
|
||||
summary = packet.summary;
|
||||
}
|
||||
pressureMatrix = packet.pressureMatrix;
|
||||
hasSignalData = signalPanels.length > 0 || packet.summary.points.length > 0;
|
||||
spatialForce = packet.spatialForce ?? null;
|
||||
hasSignalData = signalPanels.length > 0 || packet.summary.points.length > 0 || spatialForce !== null;
|
||||
}
|
||||
|
||||
function clearHudPanels(): void {
|
||||
@@ -1014,17 +1019,18 @@
|
||||
signalPanels = buildInactivePanels();
|
||||
summary = buildEmptySummary();
|
||||
pressureMatrix = null;
|
||||
spatialForce = null;
|
||||
}
|
||||
|
||||
function startMockFeed(push: (packet: HudPacket) => void): () => void {
|
||||
let panels = buildInactivePanels();
|
||||
let summaryValue = buildSummary(createSummaryPoints(randomBetween(480, 1440)));
|
||||
push({ ts: Date.now(), panels, summary: summaryValue, pressureMatrix: null });
|
||||
push({ ts: Date.now(), panels, summary: summaryValue, pressureMatrix: null, spatialForce: null });
|
||||
|
||||
const timerId = window.setInterval(() => {
|
||||
summaryValue = evolveSummary(summaryValue);
|
||||
|
||||
push({ ts: Date.now(), panels, summary: summaryValue, pressureMatrix: null });
|
||||
push({ ts: Date.now(), panels, summary: summaryValue, pressureMatrix: null, spatialForce: null });
|
||||
}, signalRenderTickMs);
|
||||
|
||||
return () => {
|
||||
@@ -1930,6 +1936,7 @@
|
||||
leftPanels={leftSignalPanels}
|
||||
rightPanels={rightSignalPanels}
|
||||
{pressureMatrix}
|
||||
{spatialForce}
|
||||
showConfigPanel={isConfigPanelOpen}
|
||||
showPrecisionTestPanel={isPrecisionTestOpen}
|
||||
{summary}
|
||||
|
||||
Reference in New Issue
Block a user