Skip to content

parse and render parameter set directives (record 43) - #171

Merged
ShiboSoftwareDev merged 7 commits into
tscircuit:mainfrom
anil08607:feat/schematic-parameter-set-directive
Sep 10, 2026
Merged

parse and render parameter set directives (record 43)#171
ShiboSoftwareDev merged 7 commits into
tscircuit:mainfrom
anil08607:feat/schematic-parameter-set-directive

Conversation

@anil08607

Copy link
Copy Markdown
Contributor

Summary

  • Implements a dedicated AltiumSchParameterSetRecord (and alias AltiumSchDifferentialPairRecord) for schematic RECORD=43.
  • Registers RECORD=43 in recordConstructors to eliminate fallback to AltiumUnknownRecord.
  • Adds parameterSets and differentialPairs convenience getters to AltiumSchDoc.
  • Adds native SVG rendering for parameter set / differential pair directives (draws connection marker circle and directive name text).

Background

In Altium schematic documents (.SchDoc), RECORD=43 represents a Parameter Set directive (such as Differential Pair directives like DIFFPAIR or net class directives like 1A). Previously, these records had no dedicated class and parsed as AltiumUnknownRecord, leaving directives unrendered in SVG outputs.

Changes

  • lib/records/altium-schematic-records.ts:
    • Added name, color, and isDifferentialPair accessors to AltiumSchParameterSetRecord.
    • Exported AltiumSchDifferentialPairRecord alias.
  • lib/parser/record-constructors.ts:
    • Registered "43": AltiumSchParameterSetRecord.
  • lib/altium-sch-doc.ts:
    • Added parameterSets and differentialPairs getters.
  • lib/svg-serialization/serialize-altium-sheet-to-svg.ts:
    • Rendered RECORD=43 directive marker and label.
  • tests/schematic-parameter-set.test.ts:
    • Unit tests for AST parsing, ownership, and round-trip preservation.
  • tests/svg/schematic-parameter-set.test.ts:
    • Added SVG snapshot test for schematic differential pair directives.
  • Updated snapshots:
    • tests/svg/__snapshots__/schematic-component-value-reference.snap.svg (now includes DIFFPAIR directives from stm32-st-link-v2.SchDoc).
    • tests/svg/__snapshots__/schematic-note-text-frame-repro.snap.svg (now includes 1A directive marker from pidp11-io-expander.SchDoc).

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

@anil08607 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

@ShiboSoftwareDev ShiboSoftwareDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just remove the committed artifacts

@ShiboSoftwareDev
ShiboSoftwareDev merged commit 323e924 into tscircuit:main Sep 10, 2026
5 of 6 checks passed
@anil08607
anil08607 deleted the feat/schematic-parameter-set-directive branch September 10, 2026 16:41
@tscircuitbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants