velxio/frontend/src
davidmonterocrespo24 61b04e46f8 feat(sim): Phase 1b continued, steps 2 + 3 — loadCircuit, resolveDc, onMcuPinChange
Wires the second half of the mixed-mode event loop on top of the
voltage cache that step 1 added.

Step 2 — loadCircuit + resolveDc:
- `loadCircuit(netlist, pinNetMap)` accepts the artifacts that
  NetlistBuilder already produces, boots the engine lazily, calls
  `loadNetlist`, and clears the voltage cache so stale values from a
  previous circuit cannot leak through.
- `resolveDc()` runs `op` and walks the pinNetMap, calling readVec for
  each non-ground net and publishVoltage for each pin. Ground pins
  short-circuit to 0 V without an extra round-trip. Missing nets are
  skipped quietly so a disconnected probe pin can't break the resolve.

Step 3 — onMcuPinChange:
- Issues `alter V_<board>_<pin> dc <volts>` and re-resolves. Caller
  decides the volts: `state ? vcc : 0` for plain digital, but boards
  with open-drain / output-impedance semantics can pass any number.
- Silent no-op when no engine has been started, so legacy paths that
  fire pinChange unconditionally can't crash the simulator.

NgSpiceClient interface added and exported so unit tests can inject a
fake engine that records alter() calls and returns canned readVec
values — `__setSchedulerEngineFactoryForTests`. 7 new tests cover the
load → resolve → alter → republish loop end-to-end without booting
the real WASM worker.

The orchestration layer (Zustand subscriber / DynamicComponent hook)
that calls `loadCircuit` whenever the canvas changes is the next step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 17:11:10 +02:00
..
__pro_stub__
__tests__ feat(sim): Phase 1b continued, steps 2 + 3 — loadCircuit, resolveDc, onMcuPinChange 2026-05-15 17:11:10 +02:00
assets
components feat(sim): Phase 3 — logic families (TTL/CMOS-5V/LVCMOS33/AVR_HC/Schmitt) 2026-05-15 16:42:11 +02:00
data fix(examples/pico-doom): wire ILI9341 power + MISO 2026-05-14 23:22:31 -03:00
hooks refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
i18n i18n: admin.users keys for "Reset agent usage" button 2026-05-14 23:29:21 +02:00
lib feat(oss): portable .vlx project export/import for self-hosters 2026-05-14 16:33:00 -03:00
pages feat(examples): /example/<id> route with pinned URL 2026-05-15 00:14:36 -03:00
services refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
simulation feat(sim): Phase 1b continued, steps 2 + 3 — loadCircuit, resolveDc, onMcuPinChange 2026-05-15 17:11:10 +02:00
store fix(store): addBoard promotes itself to active when none is valid 2026-05-15 03:38:34 +02:00
tokens feat(landing+theme): multiplier pricing copy + softer canvas 2026-05-13 21:02:48 +02:00
types
utils fix(loadExample): clear currentProject before mutating stores 2026-05-15 00:02:05 -03:00
velxio-elements
App.css
App.tsx feat(examples): /example/<id> route with pinned URL 2026-05-15 00:14:36 -03:00
entry-server.tsx
index.css
main.tsx refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
seoRoutes.ts
vite-env.d.ts