Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 10x 10x | import type { IOPinRecord } from "@shared/schema";
import type { SimulationStatus } from "@shared/types/arduino.types";
/**
* Runtime snapshots are authoritative while a simulation is running (or
* paused). Before the first runtime snapshot, and after the run has ended,
* the current static analysis remains visible.
*/
export function getEffectiveIoRegistry(
staticIoRegistry: IOPinRecord[],
runtimeIoRegistry: IOPinRecord[] | null,
simulationStatus: SimulationStatus,
): IOPinRecord[] {
const simulationActive =
simulationStatus === "running" || simulationStatus === "paused";
return simulationActive && runtimeIoRegistry !== null
? runtimeIoRegistry
: staticIoRegistry;
}
|