Skip to content

Add simulation_oscilloscope_trace and remove probe display_options#615

Draft
seveibar wants to merge 1 commit into
mainfrom
codex/remove-display_options-from-probe-object
Draft

Add simulation_oscilloscope_trace and remove probe display_options#615
seveibar wants to merge 1 commit into
mainfrom
codex/remove-display_options-from-probe-object

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Motivation

  • The existing display_options on probes bundled graph/legend rendering with probe definitions, which conflates measurement and presentation concerns.
  • Field names like label and units_per_div were unclear for an oscilloscope-style UI and units is ambiguous between volts and amps.
  • Introduce an explicit object that models the relationship between a measurement (probe or transient graph) and how it should be rendered as an oscilloscope trace.

Description

  • Removed display_options schemas and the display_options field from simulation_voltage_probe and simulation_current_probe, keeping probe connectivity/measurement logic unchanged.
  • Added a new simulation_oscilloscope_trace Zod schema and TypeScript interface that captures display/legend/scale properties (display_name, color, volts_per_div, amps_per_div, vertical_center, vertical_offset_divs) and references to either a transient graph or a probe.
  • Validation enforces that each trace references exactly one of a voltage graph, current graph, voltage probe, or current probe, and that voltage traces use volts_per_div while current traces use amps_per_div.
  • Exported the new trace type from the simulation index and registered it in the any_circuit_element union, and updated tests to remove probe-level display_options checks and to add tests for the new trace object.

Testing

  • Ran bun test tests/simulation_voltage_probe.test.ts tests/simulation_current_probe.test.ts tests/simulation_experiment.test.ts and all tests passed (21 pass, 0 fail).
  • Ran bunx tsc --noEmit to typecheck and bun run format to format code, both completed successfully.
  • Existing probe validation tests remain intact and new oscilloscope-trace tests cover valid configurations and invalid/ambiguous cases.

Codex Task

@seveibar

Copy link
Copy Markdown
Contributor Author

Cc @ShiboSoftwareDev i dont like this yet but this is conceptually an api update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant