copperflow 0.0.0-stage → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +265 -2
- package/dist/app/THIRD_PARTY_LICENSES.txt +118 -0
- package/dist/app/assets/NewPartDialog-Qb7NwhBb.js +160 -0
- package/dist/app/assets/index-CSWIIMFE.css +1 -0
- package/dist/app/assets/index-C_TXwo-N.js +19 -0
- package/dist/app/index.html +15 -0
- package/dist/app/theme-boot.js +3 -0
- package/dist/cli-commands.d.ts +14 -0
- package/dist/cli-commands.js +285 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +24 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/analyze.d.ts +29 -0
- package/dist/core/analyze.js +284 -0
- package/dist/core/analyze.js.map +1 -0
- package/dist/core/annotations.d.ts +77 -0
- package/dist/core/annotations.js +138 -0
- package/dist/core/annotations.js.map +1 -0
- package/dist/core/board-edits.d.ts +8 -0
- package/dist/core/board-edits.js +56 -0
- package/dist/core/board-edits.js.map +1 -0
- package/dist/core/board-items.d.ts +40 -0
- package/dist/core/board-items.js +95 -0
- package/dist/core/board-items.js.map +1 -0
- package/dist/core/bom.d.ts +35 -0
- package/dist/core/bom.js +146 -0
- package/dist/core/bom.js.map +1 -0
- package/dist/core/check.d.ts +42 -0
- package/dist/core/check.js +91 -0
- package/dist/core/check.js.map +1 -0
- package/dist/core/checks-line.d.ts +7 -0
- package/dist/core/checks-line.js +8 -0
- package/dist/core/checks-line.js.map +1 -0
- package/dist/core/connection-names.d.ts +2 -0
- package/dist/core/connection-names.js +16 -0
- package/dist/core/connection-names.js.map +1 -0
- package/dist/core/design-source.d.ts +6 -0
- package/dist/core/design-source.js +14 -0
- package/dist/core/design-source.js.map +1 -0
- package/dist/core/drawing-edits.d.ts +19 -0
- package/dist/core/drawing-edits.js +158 -0
- package/dist/core/drawing-edits.js.map +1 -0
- package/dist/core/drawing-identity.d.ts +12 -0
- package/dist/core/drawing-identity.js +32 -0
- package/dist/core/drawing-identity.js.map +1 -0
- package/dist/core/drawing-names.d.ts +10 -0
- package/dist/core/drawing-names.js +30 -0
- package/dist/core/drawing-names.js.map +1 -0
- package/dist/core/drawing-scan.d.ts +41 -0
- package/dist/core/drawing-scan.js +82 -0
- package/dist/core/drawing-scan.js.map +1 -0
- package/dist/core/edit-error.d.ts +5 -0
- package/dist/core/edit-error.js +9 -0
- package/dist/core/edit-error.js.map +1 -0
- package/dist/core/edit-text.d.ts +28 -0
- package/dist/core/edit-text.js +89 -0
- package/dist/core/edit-text.js.map +1 -0
- package/dist/core/edit.d.ts +13 -0
- package/dist/core/edit.js +341 -0
- package/dist/core/edit.js.map +1 -0
- package/dist/core/fabrication.d.ts +39 -0
- package/dist/core/fabrication.js +94 -0
- package/dist/core/fabrication.js.map +1 -0
- package/dist/core/file-writes.d.ts +18 -0
- package/dist/core/file-writes.js +81 -0
- package/dist/core/file-writes.js.map +1 -0
- package/dist/core/fs-utils.d.ts +13 -0
- package/dist/core/fs-utils.js +51 -0
- package/dist/core/fs-utils.js.map +1 -0
- package/dist/core/history.d.ts +80 -0
- package/dist/core/history.js +161 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/index.d.ts +21 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/instance-edits.d.ts +15 -0
- package/dist/core/instance-edits.js +69 -0
- package/dist/core/instance-edits.js.map +1 -0
- package/dist/core/instance-locks.d.ts +10 -0
- package/dist/core/instance-locks.js +16 -0
- package/dist/core/instance-locks.js.map +1 -0
- package/dist/core/instance-requests.d.ts +45 -0
- package/dist/core/instance-requests.js +93 -0
- package/dist/core/instance-requests.js.map +1 -0
- package/dist/core/layout-edits.d.ts +51 -0
- package/dist/core/layout-edits.js +82 -0
- package/dist/core/layout-edits.js.map +1 -0
- package/dist/core/layout-file.d.ts +80 -0
- package/dist/core/layout-file.js +209 -0
- package/dist/core/layout-file.js.map +1 -0
- package/dist/core/layout-locks.d.ts +38 -0
- package/dist/core/layout-locks.js +39 -0
- package/dist/core/layout-locks.js.map +1 -0
- package/dist/core/layout-records.d.ts +72 -0
- package/dist/core/layout-records.js +146 -0
- package/dist/core/layout-records.js.map +1 -0
- package/dist/core/library.d.ts +128 -0
- package/dist/core/library.js +378 -0
- package/dist/core/library.js.map +1 -0
- package/dist/core/literals.d.ts +19 -0
- package/dist/core/literals.js +106 -0
- package/dist/core/literals.js.map +1 -0
- package/dist/core/make-sheet.d.ts +44 -0
- package/dist/core/make-sheet.js +130 -0
- package/dist/core/make-sheet.js.map +1 -0
- package/dist/core/netlist.d.ts +41 -0
- package/dist/core/netlist.js +147 -0
- package/dist/core/netlist.js.map +1 -0
- package/dist/core/new-circuit-sheets.d.ts +35 -0
- package/dist/core/new-circuit-sheets.js +146 -0
- package/dist/core/new-circuit-sheets.js.map +1 -0
- package/dist/core/new-circuit.d.ts +65 -0
- package/dist/core/new-circuit.js +83 -0
- package/dist/core/new-circuit.js.map +1 -0
- package/dist/core/page-edits.d.ts +25 -0
- package/dist/core/page-edits.js +180 -0
- package/dist/core/page-edits.js.map +1 -0
- package/dist/core/pin-types.d.ts +8 -0
- package/dist/core/pin-types.js +10 -0
- package/dist/core/pin-types.js.map +1 -0
- package/dist/core/place.d.ts +30 -0
- package/dist/core/place.js +77 -0
- package/dist/core/place.js.map +1 -0
- package/dist/core/placement-write.d.ts +56 -0
- package/dist/core/placement-write.js +222 -0
- package/dist/core/placement-write.js.map +1 -0
- package/dist/core/pour-edits.d.ts +20 -0
- package/dist/core/pour-edits.js +241 -0
- package/dist/core/pour-edits.js.map +1 -0
- package/dist/core/project-text.d.ts +15 -0
- package/dist/core/project-text.js +58 -0
- package/dist/core/project-text.js.map +1 -0
- package/dist/core/project.d.ts +23 -0
- package/dist/core/project.js +63 -0
- package/dist/core/project.js.map +1 -0
- package/dist/core/rename-designators.d.ts +23 -0
- package/dist/core/rename-designators.js +83 -0
- package/dist/core/rename-designators.js.map +1 -0
- package/dist/core/rename-parts.d.ts +12 -0
- package/dist/core/rename-parts.js +129 -0
- package/dist/core/rename-parts.js.map +1 -0
- package/dist/core/rules-edit.d.ts +7 -0
- package/dist/core/rules-edit.js +56 -0
- package/dist/core/rules-edit.js.map +1 -0
- package/dist/core/selectors.d.ts +11 -0
- package/dist/core/selectors.js +33 -0
- package/dist/core/selectors.js.map +1 -0
- package/dist/core/sheet-cut-layout.d.ts +13 -0
- package/dist/core/sheet-cut-layout.js +62 -0
- package/dist/core/sheet-cut-layout.js.map +1 -0
- package/dist/core/sheet-cut-text.d.ts +23 -0
- package/dist/core/sheet-cut-text.js +129 -0
- package/dist/core/sheet-cut-text.js.map +1 -0
- package/dist/core/sheet-cut.d.ts +55 -0
- package/dist/core/sheet-cut.js +204 -0
- package/dist/core/sheet-cut.js.map +1 -0
- package/dist/core/sheet-edits.d.ts +12 -0
- package/dist/core/sheet-edits.js +107 -0
- package/dist/core/sheet-edits.js.map +1 -0
- package/dist/core/sheet-files.d.ts +31 -0
- package/dist/core/sheet-files.js +134 -0
- package/dist/core/sheet-files.js.map +1 -0
- package/dist/core/sheet-layout.d.ts +27 -0
- package/dist/core/sheet-layout.js +60 -0
- package/dist/core/sheet-layout.js.map +1 -0
- package/dist/core/summary.d.ts +10 -0
- package/dist/core/summary.js +79 -0
- package/dist/core/summary.js.map +1 -0
- package/dist/core/track-split.d.ts +22 -0
- package/dist/core/track-split.js +24 -0
- package/dist/core/track-split.js.map +1 -0
- package/dist/core/types.d.ts +309 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/unroute.d.ts +56 -0
- package/dist/core/unroute.js +87 -0
- package/dist/core/unroute.js.map +1 -0
- package/dist/core/workspace.d.ts +94 -0
- package/dist/core/workspace.js +376 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/engine/autoplace.d.ts +18 -0
- package/dist/engine/autoplace.js +68 -0
- package/dist/engine/autoplace.js.map +1 -0
- package/dist/engine/board.d.ts +12 -0
- package/dist/engine/board.js +60 -0
- package/dist/engine/board.js.map +1 -0
- package/dist/engine/checks/copper-clearance.d.ts +7 -0
- package/dist/engine/checks/copper-clearance.js +116 -0
- package/dist/engine/checks/copper-clearance.js.map +1 -0
- package/dist/engine/checks/copper-notes.d.ts +11 -0
- package/dist/engine/checks/copper-notes.js +17 -0
- package/dist/engine/checks/copper-notes.js.map +1 -0
- package/dist/engine/checks/copper-pieces.d.ts +26 -0
- package/dist/engine/checks/copper-pieces.js +42 -0
- package/dist/engine/checks/copper-pieces.js.map +1 -0
- package/dist/engine/checks/copper-violation.d.ts +9 -0
- package/dist/engine/checks/copper-violation.js +11 -0
- package/dist/engine/checks/copper-violation.js.map +1 -0
- package/dist/engine/checks/drc-copper.d.ts +14 -0
- package/dist/engine/checks/drc-copper.js +139 -0
- package/dist/engine/checks/drc-copper.js.map +1 -0
- package/dist/engine/checks/drc-pads.d.ts +8 -0
- package/dist/engine/checks/drc-pads.js +172 -0
- package/dist/engine/checks/drc-pads.js.map +1 -0
- package/dist/engine/checks/drc-parts.d.ts +5 -0
- package/dist/engine/checks/drc-parts.js +208 -0
- package/dist/engine/checks/drc-parts.js.map +1 -0
- package/dist/engine/checks/drc-pours.d.ts +6 -0
- package/dist/engine/checks/drc-pours.js +240 -0
- package/dist/engine/checks/drc-pours.js.map +1 -0
- package/dist/engine/checks/erc.d.ts +6 -0
- package/dist/engine/checks/erc.js +94 -0
- package/dist/engine/checks/erc.js.map +1 -0
- package/dist/engine/checks/fillet-guard.d.ts +29 -0
- package/dist/engine/checks/fillet-guard.js +75 -0
- package/dist/engine/checks/fillet-guard.js.map +1 -0
- package/dist/engine/checks/geometry.d.ts +25 -0
- package/dist/engine/checks/geometry.js +182 -0
- package/dist/engine/checks/geometry.js.map +1 -0
- package/dist/engine/checks/grid-index.d.ts +24 -0
- package/dist/engine/checks/grid-index.js +57 -0
- package/dist/engine/checks/grid-index.js.map +1 -0
- package/dist/engine/checks/index.d.ts +16 -0
- package/dist/engine/checks/index.js +55 -0
- package/dist/engine/checks/index.js.map +1 -0
- package/dist/engine/checks/limits.d.ts +7 -0
- package/dist/engine/checks/limits.js +10 -0
- package/dist/engine/checks/limits.js.map +1 -0
- package/dist/engine/checks/unplaced-parts.d.ts +4 -0
- package/dist/engine/checks/unplaced-parts.js +29 -0
- package/dist/engine/checks/unplaced-parts.js.map +1 -0
- package/dist/engine/checks/violation.d.ts +14 -0
- package/dist/engine/checks/violation.js +7 -0
- package/dist/engine/checks/violation.js.map +1 -0
- package/dist/engine/component.d.ts +34 -0
- package/dist/engine/component.js +125 -0
- package/dist/engine/component.js.map +1 -0
- package/dist/engine/copper.d.ts +63 -0
- package/dist/engine/copper.js +276 -0
- package/dist/engine/copper.js.map +1 -0
- package/dist/engine/design.d.ts +21 -0
- package/dist/engine/design.js +63 -0
- package/dist/engine/design.js.map +1 -0
- package/dist/engine/diagnostics.d.ts +2 -0
- package/dist/engine/diagnostics.js +6 -0
- package/dist/engine/diagnostics.js.map +1 -0
- package/dist/engine/drawing-ids.d.ts +23 -0
- package/dist/engine/drawing-ids.js +45 -0
- package/dist/engine/drawing-ids.js.map +1 -0
- package/dist/engine/drawing-kinds.d.ts +18 -0
- package/dist/engine/drawing-kinds.js +102 -0
- package/dist/engine/drawing-kinds.js.map +1 -0
- package/dist/engine/drawing-reader.d.ts +42 -0
- package/dist/engine/drawing-reader.js +97 -0
- package/dist/engine/drawing-reader.js.map +1 -0
- package/dist/engine/drawings.d.ts +35 -0
- package/dist/engine/drawings.js +94 -0
- package/dist/engine/drawings.js.map +1 -0
- package/dist/engine/elaborate.d.ts +8 -0
- package/dist/engine/elaborate.js +490 -0
- package/dist/engine/elaborate.js.map +1 -0
- package/dist/engine/engine-worker.d.ts +1 -0
- package/dist/engine/engine-worker.js +17 -0
- package/dist/engine/engine-worker.js.map +1 -0
- package/dist/engine/engine.d.ts +41 -0
- package/dist/engine/engine.js +95 -0
- package/dist/engine/engine.js.map +1 -0
- package/dist/engine/evaluate.d.ts +10 -0
- package/dist/engine/evaluate.js +125 -0
- package/dist/engine/evaluate.js.map +1 -0
- package/dist/engine/fab/bom-csv.d.ts +5 -0
- package/dist/engine/fab/bom-csv.js +16 -0
- package/dist/engine/fab/bom-csv.js.map +1 -0
- package/dist/engine/fab/csv.d.ts +4 -0
- package/dist/engine/fab/csv.js +11 -0
- package/dist/engine/fab/csv.js.map +1 -0
- package/dist/engine/fab/designators.d.ts +42 -0
- package/dist/engine/fab/designators.js +109 -0
- package/dist/engine/fab/designators.js.map +1 -0
- package/dist/engine/fab/excellon.d.ts +23 -0
- package/dist/engine/fab/excellon.js +82 -0
- package/dist/engine/fab/excellon.js.map +1 -0
- package/dist/engine/fab/export.d.ts +33 -0
- package/dist/engine/fab/export.js +105 -0
- package/dist/engine/fab/export.js.map +1 -0
- package/dist/engine/fab/gerber.d.ts +53 -0
- package/dist/engine/fab/gerber.js +151 -0
- package/dist/engine/fab/gerber.js.map +1 -0
- package/dist/engine/fab/layers.d.ts +26 -0
- package/dist/engine/fab/layers.js +162 -0
- package/dist/engine/fab/layers.js.map +1 -0
- package/dist/engine/fab/names.d.ts +20 -0
- package/dist/engine/fab/names.js +58 -0
- package/dist/engine/fab/names.js.map +1 -0
- package/dist/engine/fab/pick-and-place.d.ts +5 -0
- package/dist/engine/fab/pick-and-place.js +36 -0
- package/dist/engine/fab/pick-and-place.js.map +1 -0
- package/dist/engine/fab/stroke-font.d.ts +8 -0
- package/dist/engine/fab/stroke-font.js +83 -0
- package/dist/engine/fab/stroke-font.js.map +1 -0
- package/dist/engine/fab/zip.d.ts +14 -0
- package/dist/engine/fab/zip.js +93 -0
- package/dist/engine/fab/zip.js.map +1 -0
- package/dist/engine/fillet-plan.d.ts +39 -0
- package/dist/engine/fillet-plan.js +87 -0
- package/dist/engine/fillet-plan.js.map +1 -0
- package/dist/engine/fillet.d.ts +54 -0
- package/dist/engine/fillet.js +175 -0
- package/dist/engine/fillet.js.map +1 -0
- package/dist/engine/footprints/bga.d.ts +14 -0
- package/dist/engine/footprints/bga.js +122 -0
- package/dist/engine/footprints/bga.js.map +1 -0
- package/dist/engine/footprints/chip.d.ts +3 -0
- package/dist/engine/footprints/chip.js +52 -0
- package/dist/engine/footprints/chip.js.map +1 -0
- package/dist/engine/footprints/crystal.d.ts +4 -0
- package/dist/engine/footprints/crystal.js +47 -0
- package/dist/engine/footprints/crystal.js.map +1 -0
- package/dist/engine/footprints/dfn.d.ts +13 -0
- package/dist/engine/footprints/dfn.js +52 -0
- package/dist/engine/footprints/dfn.js.map +1 -0
- package/dist/engine/footprints/dip.d.ts +8 -0
- package/dist/engine/footprints/dip.js +65 -0
- package/dist/engine/footprints/dip.js.map +1 -0
- package/dist/engine/footprints/dual.d.ts +14 -0
- package/dist/engine/footprints/dual.js +171 -0
- package/dist/engine/footprints/dual.js.map +1 -0
- package/dist/engine/footprints/exposed.d.ts +27 -0
- package/dist/engine/footprints/exposed.js +50 -0
- package/dist/engine/footprints/exposed.js.map +1 -0
- package/dist/engine/footprints/file.d.ts +65 -0
- package/dist/engine/footprints/file.js +141 -0
- package/dist/engine/footprints/file.js.map +1 -0
- package/dist/engine/footprints/ic.d.ts +34 -0
- package/dist/engine/footprints/ic.js +31 -0
- package/dist/engine/footprints/ic.js.map +1 -0
- package/dist/engine/footprints/index.d.ts +17 -0
- package/dist/engine/footprints/index.js +104 -0
- package/dist/engine/footprints/index.js.map +1 -0
- package/dist/engine/footprints/ipc7251.d.ts +30 -0
- package/dist/engine/footprints/ipc7251.js +44 -0
- package/dist/engine/footprints/ipc7251.js.map +1 -0
- package/dist/engine/footprints/ipc7351.d.ts +179 -0
- package/dist/engine/footprints/ipc7351.js +194 -0
- package/dist/engine/footprints/ipc7351.js.map +1 -0
- package/dist/engine/footprints/jedec.d.ts +24 -0
- package/dist/engine/footprints/jedec.js +148 -0
- package/dist/engine/footprints/jedec.js.map +1 -0
- package/dist/engine/footprints/known.d.ts +6 -0
- package/dist/engine/footprints/known.js +76 -0
- package/dist/engine/footprints/known.js.map +1 -0
- package/dist/engine/footprints/molded.d.ts +8 -0
- package/dist/engine/footprints/molded.js +76 -0
- package/dist/engine/footprints/molded.js.map +1 -0
- package/dist/engine/footprints/outline.d.ts +64 -0
- package/dist/engine/footprints/outline.js +187 -0
- package/dist/engine/footprints/outline.js.map +1 -0
- package/dist/engine/footprints/parse.d.ts +32 -0
- package/dist/engine/footprints/parse.js +68 -0
- package/dist/engine/footprints/parse.js.map +1 -0
- package/dist/engine/footprints/pinrow.d.ts +11 -0
- package/dist/engine/footprints/pinrow.js +102 -0
- package/dist/engine/footprints/pinrow.js.map +1 -0
- package/dist/engine/footprints/quad.d.ts +7 -0
- package/dist/engine/footprints/quad.js +135 -0
- package/dist/engine/footprints/quad.js.map +1 -0
- package/dist/engine/footprints/radial.d.ts +7 -0
- package/dist/engine/footprints/radial.js +62 -0
- package/dist/engine/footprints/radial.js.map +1 -0
- package/dist/engine/footprints/sod.d.ts +8 -0
- package/dist/engine/footprints/sod.js +60 -0
- package/dist/engine/footprints/sod.js.map +1 -0
- package/dist/engine/footprints/sot.d.ts +4 -0
- package/dist/engine/footprints/sot.js +72 -0
- package/dist/engine/footprints/sot.js.map +1 -0
- package/dist/engine/footprints/sotpower.d.ts +4 -0
- package/dist/engine/footprints/sotpower.js +98 -0
- package/dist/engine/footprints/sotpower.js.map +1 -0
- package/dist/engine/footprints/to220.d.ts +4 -0
- package/dist/engine/footprints/to220.js +49 -0
- package/dist/engine/footprints/to220.js.map +1 -0
- package/dist/engine/footprints/to92.d.ts +4 -0
- package/dist/engine/footprints/to92.js +43 -0
- package/dist/engine/footprints/to92.js.map +1 -0
- package/dist/engine/footprints/types.d.ts +50 -0
- package/dist/engine/footprints/types.js +3 -0
- package/dist/engine/footprints/types.js.map +1 -0
- package/dist/engine/hole.d.ts +15 -0
- package/dist/engine/hole.js +28 -0
- package/dist/engine/hole.js.map +1 -0
- package/dist/engine/index.d.ts +6 -0
- package/dist/engine/index.js +6 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/instance-anchor.d.ts +16 -0
- package/dist/engine/instance-anchor.js +45 -0
- package/dist/engine/instance-anchor.js.map +1 -0
- package/dist/engine/jsx-runtime.d.ts +26 -0
- package/dist/engine/jsx-runtime.js +49 -0
- package/dist/engine/jsx-runtime.js.map +1 -0
- package/dist/engine/keepout.d.ts +9 -0
- package/dist/engine/keepout.js +50 -0
- package/dist/engine/keepout.js.map +1 -0
- package/dist/engine/kinds.d.ts +34 -0
- package/dist/engine/kinds.js +134 -0
- package/dist/engine/kinds.js.map +1 -0
- package/dist/engine/model.d.ts +310 -0
- package/dist/engine/model.js +5 -0
- package/dist/engine/model.js.map +1 -0
- package/dist/engine/nets.d.ts +6 -0
- package/dist/engine/nets.js +49 -0
- package/dist/engine/nets.js.map +1 -0
- package/dist/engine/no-connect.d.ts +28 -0
- package/dist/engine/no-connect.js +36 -0
- package/dist/engine/no-connect.js.map +1 -0
- package/dist/engine/order.d.ts +7 -0
- package/dist/engine/order.js +25 -0
- package/dist/engine/order.js.map +1 -0
- package/dist/engine/pad-text.d.ts +20 -0
- package/dist/engine/pad-text.js +26 -0
- package/dist/engine/pad-text.js.map +1 -0
- package/dist/engine/part-labels.d.ts +29 -0
- package/dist/engine/part-labels.js +28 -0
- package/dist/engine/part-labels.js.map +1 -0
- package/dist/engine/pcb-place/blocks.d.ts +46 -0
- package/dist/engine/pcb-place/blocks.js +186 -0
- package/dist/engine/pcb-place/blocks.js.map +1 -0
- package/dist/engine/pcb-place/constructive.d.ts +73 -0
- package/dist/engine/pcb-place/constructive.js +515 -0
- package/dist/engine/pcb-place/constructive.js.map +1 -0
- package/dist/engine/pcb-place/edge.d.ts +7 -0
- package/dist/engine/pcb-place/edge.js +78 -0
- package/dist/engine/pcb-place/edge.js.map +1 -0
- package/dist/engine/pcb-place/fit-board.d.ts +22 -0
- package/dist/engine/pcb-place/fit-board.js +48 -0
- package/dist/engine/pcb-place/fit-board.js.map +1 -0
- package/dist/engine/pcb-place/geometry.d.ts +45 -0
- package/dist/engine/pcb-place/geometry.js +158 -0
- package/dist/engine/pcb-place/geometry.js.map +1 -0
- package/dist/engine/pcb-place/index.d.ts +81 -0
- package/dist/engine/pcb-place/index.js +98 -0
- package/dist/engine/pcb-place/index.js.map +1 -0
- package/dist/engine/pcb-place/refine.d.ts +32 -0
- package/dist/engine/pcb-place/refine.js +220 -0
- package/dist/engine/pcb-place/refine.js.map +1 -0
- package/dist/engine/pcb-place/roles.d.ts +37 -0
- package/dist/engine/pcb-place/roles.js +127 -0
- package/dist/engine/pcb-place/roles.js.map +1 -0
- package/dist/engine/pcb-place/scope.d.ts +80 -0
- package/dist/engine/pcb-place/scope.js +107 -0
- package/dist/engine/pcb-place/scope.js.map +1 -0
- package/dist/engine/pcb-place/score.d.ts +40 -0
- package/dist/engine/pcb-place/score.js +140 -0
- package/dist/engine/pcb-place/score.js.map +1 -0
- package/dist/engine/pcb.d.ts +72 -0
- package/dist/engine/pcb.js +153 -0
- package/dist/engine/pcb.js.map +1 -0
- package/dist/engine/pour/build.d.ts +32 -0
- package/dist/engine/pour/build.js +108 -0
- package/dist/engine/pour/build.js.map +1 -0
- package/dist/engine/pour/cache.d.ts +8 -0
- package/dist/engine/pour/cache.js +55 -0
- package/dist/engine/pour/cache.js.map +1 -0
- package/dist/engine/pour/clip.d.ts +50 -0
- package/dist/engine/pour/clip.js +72 -0
- package/dist/engine/pour/clip.js.map +1 -0
- package/dist/engine/pour/fill.d.ts +22 -0
- package/dist/engine/pour/fill.js +112 -0
- package/dist/engine/pour/fill.js.map +1 -0
- package/dist/engine/pour/islands.d.ts +8 -0
- package/dist/engine/pour/islands.js +19 -0
- package/dist/engine/pour/islands.js.map +1 -0
- package/dist/engine/pour/joins.d.ts +18 -0
- package/dist/engine/pour/joins.js +74 -0
- package/dist/engine/pour/joins.js.map +1 -0
- package/dist/engine/pour/obstacles.d.ts +45 -0
- package/dist/engine/pour/obstacles.js +85 -0
- package/dist/engine/pour/obstacles.js.map +1 -0
- package/dist/engine/pour/resolve.d.ts +21 -0
- package/dist/engine/pour/resolve.js +19 -0
- package/dist/engine/pour/resolve.js.map +1 -0
- package/dist/engine/pour/shapes.d.ts +9 -0
- package/dist/engine/pour/shapes.js +62 -0
- package/dist/engine/pour/shapes.js.map +1 -0
- package/dist/engine/pour/thermal.d.ts +16 -0
- package/dist/engine/pour/thermal.js +38 -0
- package/dist/engine/pour/thermal.js.map +1 -0
- package/dist/engine/project-files.d.ts +18 -0
- package/dist/engine/project-files.js +58 -0
- package/dist/engine/project-files.js.map +1 -0
- package/dist/engine/ratsnest.d.ts +16 -0
- package/dist/engine/ratsnest.js +69 -0
- package/dist/engine/ratsnest.js.map +1 -0
- package/dist/engine/read-props.d.ts +22 -0
- package/dist/engine/read-props.js +74 -0
- package/dist/engine/read-props.js.map +1 -0
- package/dist/engine/router/astar.d.ts +74 -0
- package/dist/engine/router/astar.js +231 -0
- package/dist/engine/router/astar.js.map +1 -0
- package/dist/engine/router/blockers.d.ts +4 -0
- package/dist/engine/router/blockers.js +69 -0
- package/dist/engine/router/blockers.js.map +1 -0
- package/dist/engine/router/cleanup.d.ts +21 -0
- package/dist/engine/router/cleanup.js +157 -0
- package/dist/engine/router/cleanup.js.map +1 -0
- package/dist/engine/router/clear.d.ts +18 -0
- package/dist/engine/router/clear.js +39 -0
- package/dist/engine/router/clear.js.map +1 -0
- package/dist/engine/router/congestion.d.ts +79 -0
- package/dist/engine/router/congestion.js +212 -0
- package/dist/engine/router/congestion.js.map +1 -0
- package/dist/engine/router/connect.d.ts +79 -0
- package/dist/engine/router/connect.js +174 -0
- package/dist/engine/router/connect.js.map +1 -0
- package/dist/engine/router/ends.d.ts +25 -0
- package/dist/engine/router/ends.js +135 -0
- package/dist/engine/router/ends.js.map +1 -0
- package/dist/engine/router/grid.d.ts +131 -0
- package/dist/engine/router/grid.js +297 -0
- package/dist/engine/router/grid.js.map +1 -0
- package/dist/engine/router/keep-clear.d.ts +10 -0
- package/dist/engine/router/keep-clear.js +60 -0
- package/dist/engine/router/keep-clear.js.map +1 -0
- package/dist/engine/router/obstacles.d.ts +18 -0
- package/dist/engine/router/obstacles.js +66 -0
- package/dist/engine/router/obstacles.js.map +1 -0
- package/dist/engine/router/path.d.ts +34 -0
- package/dist/engine/router/path.js +41 -0
- package/dist/engine/router/path.js.map +1 -0
- package/dist/engine/router/pour-rounds.d.ts +17 -0
- package/dist/engine/router/pour-rounds.js +124 -0
- package/dist/engine/router/pour-rounds.js.map +1 -0
- package/dist/engine/router/replicate.d.ts +32 -0
- package/dist/engine/router/replicate.js +143 -0
- package/dist/engine/router/replicate.js.map +1 -0
- package/dist/engine/router/rip-up.d.ts +5 -0
- package/dist/engine/router/rip-up.js +95 -0
- package/dist/engine/router/rip-up.js.map +1 -0
- package/dist/engine/router/route-board.d.ts +109 -0
- package/dist/engine/router/route-board.js +223 -0
- package/dist/engine/router/route-board.js.map +1 -0
- package/dist/engine/rules/classes.d.ts +14 -0
- package/dist/engine/rules/classes.js +50 -0
- package/dist/engine/rules/classes.js.map +1 -0
- package/dist/engine/rules/load.d.ts +14 -0
- package/dist/engine/rules/load.js +146 -0
- package/dist/engine/rules/load.js.map +1 -0
- package/dist/engine/rules/profiles.d.ts +5 -0
- package/dist/engine/rules/profiles.js +53 -0
- package/dist/engine/rules/profiles.js.map +1 -0
- package/dist/engine/rules/rotations.d.ts +31 -0
- package/dist/engine/rules/rotations.js +124 -0
- package/dist/engine/rules/rotations.js.map +1 -0
- package/dist/engine/rules/schema.d.ts +82 -0
- package/dist/engine/rules/schema.js +59 -0
- package/dist/engine/rules/schema.js.map +1 -0
- package/dist/engine/rules/track-defaults.d.ts +23 -0
- package/dist/engine/rules/track-defaults.js +26 -0
- package/dist/engine/rules/track-defaults.js.map +1 -0
- package/dist/engine/schematic-astar.d.ts +37 -0
- package/dist/engine/schematic-astar.js +202 -0
- package/dist/engine/schematic-astar.js.map +1 -0
- package/dist/engine/schematic-geometry.d.ts +23 -0
- package/dist/engine/schematic-geometry.js +49 -0
- package/dist/engine/schematic-geometry.js.map +1 -0
- package/dist/engine/schematic-grid.d.ts +60 -0
- package/dist/engine/schematic-grid.js +150 -0
- package/dist/engine/schematic-grid.js.map +1 -0
- package/dist/engine/schematic-nets.d.ts +38 -0
- package/dist/engine/schematic-nets.js +157 -0
- package/dist/engine/schematic-nets.js.map +1 -0
- package/dist/engine/schematic-pages.d.ts +9 -0
- package/dist/engine/schematic-pages.js +52 -0
- package/dist/engine/schematic-pages.js.map +1 -0
- package/dist/engine/schematic-place-chains.d.ts +22 -0
- package/dist/engine/schematic-place-chains.js +111 -0
- package/dist/engine/schematic-place-chains.js.map +1 -0
- package/dist/engine/schematic-place-plan.d.ts +43 -0
- package/dist/engine/schematic-place-plan.js +155 -0
- package/dist/engine/schematic-place-plan.js.map +1 -0
- package/dist/engine/schematic-place-units.d.ts +38 -0
- package/dist/engine/schematic-place-units.js +101 -0
- package/dist/engine/schematic-place-units.js.map +1 -0
- package/dist/engine/schematic-place.d.ts +5 -0
- package/dist/engine/schematic-place.js +268 -0
- package/dist/engine/schematic-place.js.map +1 -0
- package/dist/engine/schematic-route.d.ts +37 -0
- package/dist/engine/schematic-route.js +288 -0
- package/dist/engine/schematic-route.js.map +1 -0
- package/dist/engine/schematic-sheets.d.ts +22 -0
- package/dist/engine/schematic-sheets.js +104 -0
- package/dist/engine/schematic-sheets.js.map +1 -0
- package/dist/engine/schematic.d.ts +64 -0
- package/dist/engine/schematic.js +200 -0
- package/dist/engine/schematic.js.map +1 -0
- package/dist/engine/selectors.d.ts +25 -0
- package/dist/engine/selectors.js +28 -0
- package/dist/engine/selectors.js.map +1 -0
- package/dist/engine/sheet-ports.d.ts +44 -0
- package/dist/engine/sheet-ports.js +126 -0
- package/dist/engine/sheet-ports.js.map +1 -0
- package/dist/engine/sheet-symbol.d.ts +52 -0
- package/dist/engine/sheet-symbol.js +92 -0
- package/dist/engine/sheet-symbol.js.map +1 -0
- package/dist/engine/sheets.d.ts +79 -0
- package/dist/engine/sheets.js +159 -0
- package/dist/engine/sheets.js.map +1 -0
- package/dist/engine/symbols/box.d.ts +8 -0
- package/dist/engine/symbols/box.js +83 -0
- package/dist/engine/symbols/box.js.map +1 -0
- package/dist/engine/symbols/index.d.ts +8 -0
- package/dist/engine/symbols/index.js +58 -0
- package/dist/engine/symbols/index.js.map +1 -0
- package/dist/engine/symbols/passives.d.ts +16 -0
- package/dist/engine/symbols/passives.js +58 -0
- package/dist/engine/symbols/passives.js.map +1 -0
- package/dist/engine/symbols/power.d.ts +5 -0
- package/dist/engine/symbols/power.js +10 -0
- package/dist/engine/symbols/power.js.map +1 -0
- package/dist/engine/symbols/semis.d.ts +10 -0
- package/dist/engine/symbols/semis.js +62 -0
- package/dist/engine/symbols/semis.js.map +1 -0
- package/dist/engine/symbols/types.d.ts +83 -0
- package/dist/engine/symbols/types.js +61 -0
- package/dist/engine/symbols/types.js.map +1 -0
- package/dist/engine/traces.d.ts +29 -0
- package/dist/engine/traces.js +102 -0
- package/dist/engine/traces.js.map +1 -0
- package/dist/engine/units.d.ts +4 -0
- package/dist/engine/units.js +31 -0
- package/dist/engine/units.js.map +1 -0
- package/dist/engine/worker-env.d.ts +9 -0
- package/dist/engine/worker-env.js +12 -0
- package/dist/engine/worker-env.js.map +1 -0
- package/dist/library/attach-datasheet.d.ts +20 -0
- package/dist/library/attach-datasheet.js +61 -0
- package/dist/library/attach-datasheet.js.map +1 -0
- package/dist/library/easyeda-footprint.d.ts +41 -0
- package/dist/library/easyeda-footprint.js +255 -0
- package/dist/library/easyeda-footprint.js.map +1 -0
- package/dist/library/easyeda-path.d.ts +13 -0
- package/dist/library/easyeda-path.js +133 -0
- package/dist/library/easyeda-path.js.map +1 -0
- package/dist/library/easyeda-symbol.d.ts +20 -0
- package/dist/library/easyeda-symbol.js +53 -0
- package/dist/library/easyeda-symbol.js.map +1 -0
- package/dist/library/import-lcsc.d.ts +30 -0
- package/dist/library/import-lcsc.js +155 -0
- package/dist/library/import-lcsc.js.map +1 -0
- package/dist/library/lcsc-part.d.ts +40 -0
- package/dist/library/lcsc-part.js +153 -0
- package/dist/library/lcsc-part.js.map +1 -0
- package/dist/library/new-part.d.ts +50 -0
- package/dist/library/new-part.js +160 -0
- package/dist/library/new-part.js.map +1 -0
- package/dist/library/pin-table.d.ts +23 -0
- package/dist/library/pin-table.js +92 -0
- package/dist/library/pin-table.js.map +1 -0
- package/dist/mcp/batch.d.ts +111 -0
- package/dist/mcp/batch.js +241 -0
- package/dist/mcp/batch.js.map +1 -0
- package/dist/mcp/board-summary.d.ts +19 -0
- package/dist/mcp/board-summary.js +144 -0
- package/dist/mcp/board-summary.js.map +1 -0
- package/dist/mcp/compact-sheets.d.ts +31 -0
- package/dist/mcp/compact-sheets.js +63 -0
- package/dist/mcp/compact-sheets.js.map +1 -0
- package/dist/mcp/compact-tool-list.d.ts +8 -0
- package/dist/mcp/compact-tool-list.js +42 -0
- package/dist/mcp/compact-tool-list.js.map +1 -0
- package/dist/mcp/compact.d.ts +33 -0
- package/dist/mcp/compact.js +189 -0
- package/dist/mcp/compact.js.map +1 -0
- package/dist/mcp/copper-summary.d.ts +26 -0
- package/dist/mcp/copper-summary.js +122 -0
- package/dist/mcp/copper-summary.js.map +1 -0
- package/dist/mcp/copper-tools.d.ts +93 -0
- package/dist/mcp/copper-tools.js +228 -0
- package/dist/mcp/copper-tools.js.map +1 -0
- package/dist/mcp/copper-under.d.ts +16 -0
- package/dist/mcp/copper-under.js +46 -0
- package/dist/mcp/copper-under.js.map +1 -0
- package/dist/mcp/create-part.d.ts +71 -0
- package/dist/mcp/create-part.js +31 -0
- package/dist/mcp/create-part.js.map +1 -0
- package/dist/mcp/datasheet-tools.d.ts +14 -0
- package/dist/mcp/datasheet-tools.js +15 -0
- package/dist/mcp/datasheet-tools.js.map +1 -0
- package/dist/mcp/fillet-tools.d.ts +24 -0
- package/dist/mcp/fillet-tools.js +52 -0
- package/dist/mcp/fillet-tools.js.map +1 -0
- package/dist/mcp/guide.d.ts +37 -0
- package/dist/mcp/guide.js +78 -0
- package/dist/mcp/guide.js.map +1 -0
- package/dist/mcp/import-part.d.ts +13 -0
- package/dist/mcp/import-part.js +20 -0
- package/dist/mcp/import-part.js.map +1 -0
- package/dist/mcp/make-sheet.d.ts +18 -0
- package/dist/mcp/make-sheet.js +29 -0
- package/dist/mcp/make-sheet.js.map +1 -0
- package/dist/mcp/new-circuit.d.ts +77 -0
- package/dist/mcp/new-circuit.js +114 -0
- package/dist/mcp/new-circuit.js.map +1 -0
- package/dist/mcp/place-tools.d.ts +46 -0
- package/dist/mcp/place-tools.js +121 -0
- package/dist/mcp/place-tools.js.map +1 -0
- package/dist/mcp/pour-tools.d.ts +126 -0
- package/dist/mcp/pour-tools.js +105 -0
- package/dist/mcp/pour-tools.js.map +1 -0
- package/dist/mcp/project-tools.d.ts +36 -0
- package/dist/mcp/project-tools.js +115 -0
- package/dist/mcp/project-tools.js.map +1 -0
- package/dist/mcp/route-by-ref.d.ts +20 -0
- package/dist/mcp/route-by-ref.js +70 -0
- package/dist/mcp/route-by-ref.js.map +1 -0
- package/dist/mcp/route-tools.d.ts +54 -0
- package/dist/mcp/route-tools.js +173 -0
- package/dist/mcp/route-tools.js.map +1 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.js +290 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/skill-install.d.ts +13 -0
- package/dist/skill-install.js +28 -0
- package/dist/skill-install.js.map +1 -0
- package/dist/studio/fit-board.d.ts +11 -0
- package/dist/studio/fit-board.js +15 -0
- package/dist/studio/fit-board.js.map +1 -0
- package/dist/studio/layout-schema.d.ts +157 -0
- package/dist/studio/layout-schema.js +32 -0
- package/dist/studio/layout-schema.js.map +1 -0
- package/dist/studio/live.d.ts +79 -0
- package/dist/studio/live.js +187 -0
- package/dist/studio/live.js.map +1 -0
- package/dist/studio/place-events.d.ts +60 -0
- package/dist/studio/place-events.js +42 -0
- package/dist/studio/place-events.js.map +1 -0
- package/dist/studio/place-runner.d.ts +62 -0
- package/dist/studio/place-runner.js +205 -0
- package/dist/studio/place-runner.js.map +1 -0
- package/dist/studio/place-worker.d.ts +1 -0
- package/dist/studio/place-worker.js +23 -0
- package/dist/studio/place-worker.js.map +1 -0
- package/dist/studio/route-events.d.ts +64 -0
- package/dist/studio/route-events.js +61 -0
- package/dist/studio/route-events.js.map +1 -0
- package/dist/studio/route-runner.d.ts +90 -0
- package/dist/studio/route-runner.js +272 -0
- package/dist/studio/route-runner.js.map +1 -0
- package/dist/studio/router-worker.d.ts +1 -0
- package/dist/studio/router-worker.js +17 -0
- package/dist/studio/router-worker.js.map +1 -0
- package/dist/studio/server.d.ts +32 -0
- package/dist/studio/server.js +610 -0
- package/dist/studio/server.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +64 -4
- package/skills/copperflow/SKILL.md +199 -0
- package/skills/copperflow/references/copper.md +82 -0
- package/skills/copperflow/references/design-rules.md +163 -0
- package/skills/copperflow/references/design-workflow.md +199 -0
- package/skills/copperflow/references/editable-subset.md +83 -0
- package/skills/copperflow/references/parts-library.md +83 -0
- package/skills/copperflow/references/writing-circuits.md +62 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { diagnostic } from "./diagnostics.js";
|
|
2
|
+
import { drawingIds, drawingName, indexId } from "./drawing-ids.js";
|
|
3
|
+
import { busMembers, DEFAULT_FONT_SIZE, DEFAULT_STROKE_WIDTH, drawingTag, LINE_STYLES, TEXT_ANCHORS } from "./drawing-kinds.js";
|
|
4
|
+
import { DrawingReader, nonEmpty, pointList } from "./drawing-reader.js";
|
|
5
|
+
const COLOUR = /^#[0-9a-fA-F]{6}$/;
|
|
6
|
+
const colour = (value) => (typeof value === "string" && COLOUR.test(value) ? value : undefined);
|
|
7
|
+
const flag = (value) => (typeof value === "boolean" ? value : undefined);
|
|
8
|
+
const POINTS = "a list of two or more points with x and y";
|
|
9
|
+
const BUS_NAME = 'a net name such as "CLK" or a range such as "D[0:7]"';
|
|
10
|
+
/** The colour when the file gives one; none otherwise, so the Studio picks the theme's. */
|
|
11
|
+
function colorOf(reader) {
|
|
12
|
+
const color = reader.optional("color", colour, 'a colour such as "#000080"', undefined);
|
|
13
|
+
return color === undefined ? {} : { color };
|
|
14
|
+
}
|
|
15
|
+
function stroke(reader) {
|
|
16
|
+
const strokeWidth = reader.number("strokeWidth", DEFAULT_STROKE_WIDTH, "not-negative");
|
|
17
|
+
const lineStyle = reader.choice("lineStyle", LINE_STYLES, "solid");
|
|
18
|
+
return { strokeWidth, lineStyle, ...colorOf(reader) };
|
|
19
|
+
}
|
|
20
|
+
/** x and y, 0 when absent, with the groups' offset added. */
|
|
21
|
+
function corner(reader, offset) {
|
|
22
|
+
return { x: reader.number("x", 0) + offset.schX, y: reader.number("y", 0) + offset.schY };
|
|
23
|
+
}
|
|
24
|
+
function points(reader, offset) {
|
|
25
|
+
return reader.required("points", pointList, POINTS, []).map((p) => ({ x: p.x + offset.schX, y: p.y + offset.schY }));
|
|
26
|
+
}
|
|
27
|
+
const filled = (reader) => reader.optional("filled", flag, "true or false", false);
|
|
28
|
+
/** One reader per kind; the props each one reads are the props that kind has. */
|
|
29
|
+
const SHAPES = {
|
|
30
|
+
path: (r, o) => ({ kind: "path", points: points(r, o), ...stroke(r) }),
|
|
31
|
+
rect: (r, o) => ({ kind: "rect", ...corner(r, o), width: r.need("width", "positive"), height: r.need("height", "positive"), filled: filled(r), ...stroke(r) }),
|
|
32
|
+
circle: (r, o) => ({ kind: "circle", ...corner(r, o), radius: r.need("radius", "positive"), filled: filled(r), ...stroke(r) }),
|
|
33
|
+
arc: (r, o) => ({ kind: "arc", ...corner(r, o), radius: r.need("radius", "positive"), startAngle: r.need("startAngle"), endAngle: r.need("endAngle"), ...stroke(r) }),
|
|
34
|
+
text: (r, o) => ({
|
|
35
|
+
kind: "text",
|
|
36
|
+
...corner(r, o),
|
|
37
|
+
text: r.required("text", nonEmpty, "a non-empty string", ""),
|
|
38
|
+
fontSize: r.number("fontSize", DEFAULT_FONT_SIZE, "positive"),
|
|
39
|
+
anchor: r.choice("anchor", TEXT_ANCHORS, "left"),
|
|
40
|
+
...colorOf(r),
|
|
41
|
+
}),
|
|
42
|
+
bus: (r, o) => {
|
|
43
|
+
const named = (value) => {
|
|
44
|
+
const members = typeof value === "string" ? busMembers(value) : undefined;
|
|
45
|
+
return members && { name: value, members };
|
|
46
|
+
};
|
|
47
|
+
const { name, members } = r.required("name", named, BUS_NAME, { name: "", members: [] });
|
|
48
|
+
return { kind: "bus", name, points: points(r, o), members };
|
|
49
|
+
},
|
|
50
|
+
junction: (r, o) => ({ kind: "junction", ...corner(r, o), ...colorOf(r) }),
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Builds one drawing from its tag's props and how many children the tag has. A bad or missing value is
|
|
54
|
+
* reported and leaves the drawing out; an unknown prop or a child is reported and ignored.
|
|
55
|
+
*/
|
|
56
|
+
export function buildDrawing(kind, props, children, origin) {
|
|
57
|
+
const name = drawingName(kind, props["name"]);
|
|
58
|
+
const id = name ?? indexId(kind, origin.index);
|
|
59
|
+
const reader = new DrawingReader(props, id, origin.source);
|
|
60
|
+
// A bus reads its name with its shape; for the other kinds a name is optional, but a given one must be usable.
|
|
61
|
+
if (kind !== "bus")
|
|
62
|
+
reader.optional("name", nonEmpty, "a non-empty string", undefined);
|
|
63
|
+
const shape = SHAPES[kind](reader, origin.offset);
|
|
64
|
+
reader.reportUnread(drawingTag(kind));
|
|
65
|
+
if (children > 0)
|
|
66
|
+
reader.reportChildren(drawingTag(kind));
|
|
67
|
+
if (!reader.usable)
|
|
68
|
+
return { diagnostics: reader.diagnostics };
|
|
69
|
+
const groupOffset = { x: origin.offset.schX, y: origin.offset.schY };
|
|
70
|
+
const drawing = { ...shape, id, ...(name === undefined ? {} : { name }), groupOffset, source: origin.source };
|
|
71
|
+
return { drawing, diagnostics: reader.diagnostics };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Gives each drawing its id by the shared rule (drawing-ids.ts), over every drawing tag in source order, the
|
|
75
|
+
* ones a bad value left out included. A repeated name gets one duplicate-name warning; a bus repeating an
|
|
76
|
+
* earlier bus's name is a piece of the same bus and is quiet.
|
|
77
|
+
*/
|
|
78
|
+
export function uniqueDrawingIds(entries, parts) {
|
|
79
|
+
const ids = drawingIds(entries, parts.map((part) => part.id));
|
|
80
|
+
const warned = new Set();
|
|
81
|
+
const diagnostics = [];
|
|
82
|
+
const drawings = [];
|
|
83
|
+
entries.forEach((entry, index) => {
|
|
84
|
+
const { id, base, repeat } = ids[index];
|
|
85
|
+
if (repeat === "duplicate" && !warned.has(base)) {
|
|
86
|
+
warned.add(base);
|
|
87
|
+
diagnostics.push(diagnostic("duplicate-name", "warning", `More than one part or drawing is named ${base}`, [base], entry.source));
|
|
88
|
+
}
|
|
89
|
+
if (entry.drawing)
|
|
90
|
+
drawings.push(entry.drawing.id === id ? entry.drawing : { ...entry.drawing, id });
|
|
91
|
+
});
|
|
92
|
+
return { drawings, diagnostics };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=drawings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawings.js","sourceRoot":"","sources":["../../src/engine/drawings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC/H,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAA;AAyBpF,MAAM,MAAM,GAAG,mBAAmB,CAAA;AAClC,MAAM,MAAM,GAAkB,CAAC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,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,SAAS,EAAE,0CAA0C,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QACnI,CAAC;QACD,IAAI,KAAK,CAAC,OAAO;YAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACtG,CAAC,CAAC,CAAA;IACF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Evaluated } from "./evaluate.js";
|
|
2
|
+
import { type Circuit } from "./model.js";
|
|
3
|
+
export interface ElaborateOptions {
|
|
4
|
+
/** How many pads a footprint string has, if known. */
|
|
5
|
+
padCount(footprint: string): number | undefined;
|
|
6
|
+
}
|
|
7
|
+
/** Turns the evaluated element tree into the circuit model. */
|
|
8
|
+
export declare function elaborate(evaluated: Evaluated, file: string, options: ElaborateOptions): Circuit;
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { LIBRARY_OWNED_PROPS } from "../core/library.js";
|
|
2
|
+
import { buildBoard } from "./board.js";
|
|
3
|
+
import { buildPart, NO_OFFSET, pcbPoint } from "./component.js";
|
|
4
|
+
import { diagnostic } from "./diagnostics.js";
|
|
5
|
+
import { drawingName } from "./drawing-ids.js";
|
|
6
|
+
import { drawingKindOf } from "./drawing-kinds.js";
|
|
7
|
+
import { buildDrawing, uniqueDrawingIds } from "./drawings.js";
|
|
8
|
+
import { CircuitCodeError } from "./evaluate.js";
|
|
9
|
+
import { PIN_ROW_DEFAULT_PITCH, pinRowName } from "./footprints/pinrow.js";
|
|
10
|
+
import { Fragment, isElement } from "./jsx-runtime.js";
|
|
11
|
+
import { buildHole } from "./hole.js";
|
|
12
|
+
import { buildKeepout } from "./keepout.js";
|
|
13
|
+
import { kindOf } from "./kinds.js";
|
|
14
|
+
import { MAIN_PAGE, } from "./model.js";
|
|
15
|
+
import { mergeNets } from "./nets.js";
|
|
16
|
+
import { naturalCompare } from "./order.js";
|
|
17
|
+
import { buildPour, resolvePours } from "./pour/build.js";
|
|
18
|
+
import { PropReader } from "./read-props.js";
|
|
19
|
+
import { placePorts, portMembers, readPorts, readSheetSize } from "./sheet-ports.js";
|
|
20
|
+
import { Bases, flatNet, readBase, readConnections, SHEET_FILE, sheetName, traceScope, withBase } from "./sheets.js";
|
|
21
|
+
import { resolveTraces } from "./traces.js";
|
|
22
|
+
/**
|
|
23
|
+
* The footprint a part declares, or the one its kind implies: a pinheader with a pin count gets a pin
|
|
24
|
+
* row at its `pitch`, 2.54 mm when it has none. A pitch that is not a length gets a bad-value warning
|
|
25
|
+
* from `reader` and no footprint.
|
|
26
|
+
*/
|
|
27
|
+
function footprintOf(tag, props, reader) {
|
|
28
|
+
const declared = props["footprint"];
|
|
29
|
+
if (typeof declared === "string" && declared !== "")
|
|
30
|
+
return declared;
|
|
31
|
+
const count = props["pinCount"];
|
|
32
|
+
if (tag !== "pinheader" || typeof count !== "number" || !Number.isInteger(count) || count < 1)
|
|
33
|
+
return undefined;
|
|
34
|
+
if (props["pitch"] === undefined)
|
|
35
|
+
return pinRowName(count, PIN_ROW_DEFAULT_PITCH);
|
|
36
|
+
const pitch = reader.length("pitch");
|
|
37
|
+
return pitch === undefined ? undefined : pinRowName(count, pitch);
|
|
38
|
+
}
|
|
39
|
+
/** Tags that are accepted but have no effect until their stage lands. */
|
|
40
|
+
const LATER_STAGE = new Set(["via", "netlabel"]);
|
|
41
|
+
const LIBRARY_PATH = /^parts\/([^/]+)\//;
|
|
42
|
+
const MAX_DEPTH = 200;
|
|
43
|
+
/** An angle as the nearest quarter turn, 0 to 270: a sheet symbol turns as a part's does. */
|
|
44
|
+
const quarterTurn = (angle) => (((Math.round(angle / 90) * 90) % 360) + 360) % 360;
|
|
45
|
+
/** A port as the design lists it: its place, and the net (or for a bus port, the parent bus) it joins. */
|
|
46
|
+
function instancePort(port, scope, written) {
|
|
47
|
+
if (!port.bus)
|
|
48
|
+
return { ...port, net: flatNet(scope, port.name) };
|
|
49
|
+
const members = portMembers({ name: port.name, bus: true });
|
|
50
|
+
return { ...port, net: written.get(port.name) ?? `${scope.path}/${port.name}`, members };
|
|
51
|
+
}
|
|
52
|
+
/** `{ page }` for a thing on a page other than the first, nothing on the first. */
|
|
53
|
+
const onPage = (page) => (page === undefined ? {} : { page });
|
|
54
|
+
class Elaboration {
|
|
55
|
+
evaluated;
|
|
56
|
+
file;
|
|
57
|
+
options;
|
|
58
|
+
components = [];
|
|
59
|
+
traces = [];
|
|
60
|
+
diagnostics = [];
|
|
61
|
+
board;
|
|
62
|
+
keepouts = [];
|
|
63
|
+
pours = [];
|
|
64
|
+
holes = [];
|
|
65
|
+
/** The pages in the order they are first written, MAIN_PAGE first. */
|
|
66
|
+
pages = [MAIN_PAGE];
|
|
67
|
+
/** Every drawing tag; ids are given after the walk, so a drawing never renames a part. */
|
|
68
|
+
drawings = [];
|
|
69
|
+
drawingCounts = new Map();
|
|
70
|
+
/**
|
|
71
|
+
* Every `<copperpour>` and `<hole>` tag met so far, kept or not, counted per file as parts are named: the circuit's
|
|
72
|
+
* own and each sub-sheet instance's apart, keyed by tag and instance path ("" for the circuit). Their ids count them
|
|
73
|
+
* all, as the core's edits of that file do.
|
|
74
|
+
*/
|
|
75
|
+
boardItemTags = new Map();
|
|
76
|
+
/** The keepouts, pours and holes, each kept or not: one with no board is warned about once the walk is done. */
|
|
77
|
+
boardThings = [];
|
|
78
|
+
nameCounts = new Map();
|
|
79
|
+
duplicated = new Set();
|
|
80
|
+
/** The sub-sheet instances, outer before inner, each set once the walk inside it is done. */
|
|
81
|
+
instances = [];
|
|
82
|
+
/** The instance path that made each part name; "" for the circuit itself. */
|
|
83
|
+
owners = new Map();
|
|
84
|
+
bases = new Bases();
|
|
85
|
+
/** Pairs of instance paths already reported for sharing a base, so their designators are not reported again. */
|
|
86
|
+
clashingPairs = new Set();
|
|
87
|
+
instancePaths = new Map();
|
|
88
|
+
/** Whether the file built is a sheet itself, so its `<port>` elements are expected. */
|
|
89
|
+
rootIsSheet = false;
|
|
90
|
+
/** The file built, when it is a sheet: its ports and symbol size. */
|
|
91
|
+
sheet;
|
|
92
|
+
/** The sheet files whose ports and size have been reported on, so each finding is reported once, not per instance. */
|
|
93
|
+
sheetsRead = new Set();
|
|
94
|
+
constructor(evaluated, file, options) {
|
|
95
|
+
this.evaluated = evaluated;
|
|
96
|
+
this.file = file;
|
|
97
|
+
this.options = options;
|
|
98
|
+
}
|
|
99
|
+
sourceOf(element, frame) {
|
|
100
|
+
return frame.callSite ?? element.source ?? { file: this.file, line: 1, column: 1, offset: 0 };
|
|
101
|
+
}
|
|
102
|
+
visit(node, frame) {
|
|
103
|
+
if (Array.isArray(node))
|
|
104
|
+
return node.forEach((child) => this.visit(child, frame));
|
|
105
|
+
if (!isElement(node))
|
|
106
|
+
return;
|
|
107
|
+
if (frame.depth > MAX_DEPTH)
|
|
108
|
+
throw new CircuitCodeError(`${this.file}: components nest more than ${MAX_DEPTH} levels deep`);
|
|
109
|
+
const next = { ...frame, depth: frame.depth + 1 };
|
|
110
|
+
if (typeof node.type === "function")
|
|
111
|
+
return this.call(node, node.type, next);
|
|
112
|
+
this.tag(node, node.type, next);
|
|
113
|
+
}
|
|
114
|
+
invoke(element, fn, origin) {
|
|
115
|
+
try {
|
|
116
|
+
return fn({ ...element.props, children: element.children });
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (error instanceof CircuitCodeError)
|
|
120
|
+
throw error;
|
|
121
|
+
const message = error?.message;
|
|
122
|
+
const where = origin ?? element.source?.file ?? this.file;
|
|
123
|
+
throw new CircuitCodeError(`${where}: ${typeof message === "string" ? message : String(error)}`, { cause: error });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
call(element, fn, frame) {
|
|
127
|
+
const origin = this.evaluated.definedIn(fn);
|
|
128
|
+
if (origin !== undefined && SHEET_FILE.test(origin))
|
|
129
|
+
return this.instance(element, fn, origin, frame);
|
|
130
|
+
const result = this.invoke(element, fn, origin);
|
|
131
|
+
const library = LIBRARY_PATH.exec(origin ?? "")?.[1] ?? frame.library;
|
|
132
|
+
if (library !== undefined && frame.library === undefined)
|
|
133
|
+
this.libraryOverrides(element, library, this.sourceOf(element, frame));
|
|
134
|
+
this.visit(result, { ...frame, callSite: frame.callSite ?? element.source, library });
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A library part's generated component spreads the instance's props last, so a prop the part owns
|
|
138
|
+
* (its footprint, MPN, supplier numbers, pin labels or attributes) set on the instance replaces
|
|
139
|
+
* what a person verified. The BOM then marks the line not verified when the values differ.
|
|
140
|
+
*/
|
|
141
|
+
libraryOverrides(element, library, source) {
|
|
142
|
+
const owned = Object.keys(element.props).filter((key) => LIBRARY_OWNED_PROPS.includes(key));
|
|
143
|
+
if (owned.length === 0)
|
|
144
|
+
return;
|
|
145
|
+
const name = typeof element.props["name"] === "string" && element.props["name"] !== "" ? element.props["name"] : library;
|
|
146
|
+
const message = `${name} sets ${owned.join(", ")}, which library part ${library} owns; parts/${library}/part.yaml no longer describes it`;
|
|
147
|
+
this.diagnostics.push(diagnostic("library-override", "warning", message, owned.map((key) => `${name}.${key}`), source));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* One instance of a sub-sheet: its parts get the base added to their designators, its nets are its own unless a
|
|
151
|
+
* port connects them or they are power or ground, and its positions are relative to the instance.
|
|
152
|
+
*/
|
|
153
|
+
instance(element, fn, file, frame) {
|
|
154
|
+
const source = this.sourceOf(element, frame);
|
|
155
|
+
const sheet = sheetName(file);
|
|
156
|
+
const name = element.props["name"];
|
|
157
|
+
if (typeof name !== "string" || name === "") {
|
|
158
|
+
this.diagnostics.push(diagnostic("missing-name", "error", `An instance of ${sheet} needs a name`, [sheet], source));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const parent = frame.instance;
|
|
162
|
+
const path = this.instancePath(parent ? `${parent.path}/${name}` : name, source);
|
|
163
|
+
if (parent?.files.includes(file)) {
|
|
164
|
+
const message = `${file} contains itself (${path}); a sheet cannot import itself`;
|
|
165
|
+
this.diagnostics.push(diagnostic("sheet-recursion", "error", message, [path], source));
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const result = this.invoke(element, fn, file);
|
|
169
|
+
if (!isElement(result) || result.type !== "sheet") {
|
|
170
|
+
this.diagnostics.push(diagnostic("not-a-sheet", "error", `${file} must return <sheet>; ${name} is left out`, [name], source));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const symbol = this.sheetPorts(result, file, sheet, frame, source);
|
|
174
|
+
const ports = symbol.ports.map((port) => port.name);
|
|
175
|
+
const buses = new Map(symbol.ports.filter((port) => port.bus).map((port) => [port.name, portMembers({ name: port.name, bus: true })]));
|
|
176
|
+
const read = readConnections(element.props["connections"], { name, sheet, ports, buses, source });
|
|
177
|
+
this.diagnostics.push(...read.diagnostics);
|
|
178
|
+
const { base, written } = this.instanceBase(element.props["base"], name, path, parent, source);
|
|
179
|
+
const files = [...(parent?.files ?? []), file];
|
|
180
|
+
const scope = { name, path, sheet, base: (parent?.base ?? 0) + base, files, parent, ports, connections: read.joins, parts: new Map() };
|
|
181
|
+
const placed = this.instancePlacement(element.props, name, frame.offset, source);
|
|
182
|
+
const index = this.instances.length;
|
|
183
|
+
this.instances.push({});
|
|
184
|
+
this.visit(result.children, { ...frame, offset: placed.offset, instance: scope });
|
|
185
|
+
this.bases.finish(parent?.path ?? "", path, base, written);
|
|
186
|
+
const parts = this.components.filter((c) => c.instance === path || c.instance?.startsWith(`${path}/`)).map((c) => c.id);
|
|
187
|
+
this.instances[index] = {
|
|
188
|
+
name,
|
|
189
|
+
path,
|
|
190
|
+
sheet,
|
|
191
|
+
file,
|
|
192
|
+
base,
|
|
193
|
+
designatorBase: scope.base,
|
|
194
|
+
connections: Object.fromEntries(read.connections),
|
|
195
|
+
ports: symbol.ports.map((port) => instancePort(port, scope, read.connections)),
|
|
196
|
+
...(symbol.size ? { size: symbol.size } : {}),
|
|
197
|
+
parts: parts.sort(naturalCompare),
|
|
198
|
+
...placed.record,
|
|
199
|
+
...onPage(frame.page),
|
|
200
|
+
source,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/** A sheet's ports placed on its symbol and its symbol size; what is wrong with them is reported once per sheet file. */
|
|
204
|
+
sheetPorts(body, file, sheet, frame, at) {
|
|
205
|
+
const written = readPorts(body.children, (port) => this.sourceOf(port, frame));
|
|
206
|
+
const placed = placePorts(written.ports, sheet, at);
|
|
207
|
+
const size = readSheetSize(body.props, sheet, at);
|
|
208
|
+
if (!this.sheetsRead.has(file)) {
|
|
209
|
+
this.sheetsRead.add(file);
|
|
210
|
+
this.diagnostics.push(...written.diagnostics, ...placed.diagnostics, ...size.diagnostics);
|
|
211
|
+
}
|
|
212
|
+
const ports = placed.ports.map(({ name, side, order, bus }) => ({ name, side, order, ...(bus ? { bus: true } : {}) }));
|
|
213
|
+
return { ports, ...(Object.keys(size.size).length > 0 ? { size: size.size } : {}) };
|
|
214
|
+
}
|
|
215
|
+
/** A unique path: a second instance of the same name in the same parent is an error and gets "~2", "~3" and so on. */
|
|
216
|
+
instancePath(path, source) {
|
|
217
|
+
const count = (this.instancePaths.get(path) ?? 0) + 1;
|
|
218
|
+
this.instancePaths.set(path, count);
|
|
219
|
+
if (count === 1)
|
|
220
|
+
return path;
|
|
221
|
+
if (count === 2)
|
|
222
|
+
this.diagnostics.push(diagnostic("duplicate-name", "error", `More than one instance is named ${path}`, [path], source));
|
|
223
|
+
return `${path}~${count}`;
|
|
224
|
+
}
|
|
225
|
+
/** The base written, or the next default (see Bases); a base two siblings share is an error. */
|
|
226
|
+
instanceBase(value, name, path, parent, source) {
|
|
227
|
+
const read = readBase(value, name, source);
|
|
228
|
+
this.diagnostics.push(...read.diagnostics);
|
|
229
|
+
const { base, clashWith } = this.bases.claim(parent?.path ?? "", path, read.base);
|
|
230
|
+
if (clashWith !== undefined) {
|
|
231
|
+
this.clashingPairs.add(`${clashWith}|${path}`);
|
|
232
|
+
const message = `${name} has base ${base}, as ${clashWith.split("/").pop() ?? clashWith} does; give one of them another base`;
|
|
233
|
+
this.diagnostics.push(diagnostic("base-clash", "error", message, [clashWith, path], source));
|
|
234
|
+
}
|
|
235
|
+
return { base, written: read.base !== undefined };
|
|
236
|
+
}
|
|
237
|
+
/** The offset inside the instance, and the instance's own position as the design records it. */
|
|
238
|
+
instancePlacement(props, name, offset, source) {
|
|
239
|
+
const reader = new PropReader(props, name, source);
|
|
240
|
+
const [pcbX, pcbY, schX, schY] = [reader.length("pcbX"), reader.length("pcbY"), reader.length("schX"), reader.length("schY")];
|
|
241
|
+
const turn = reader.angle("pcbRotation");
|
|
242
|
+
const schTurn = reader.angle("schRotation");
|
|
243
|
+
this.diagnostics.push(...reader.diagnostics);
|
|
244
|
+
const at = pcbPoint(offset, pcbX ?? 0, pcbY ?? 0);
|
|
245
|
+
const rotation = ((((offset.pcbRotation ?? 0) + (turn ?? 0)) % 360) + 360) % 360;
|
|
246
|
+
const sch = { x: offset.schX + (schX ?? 0), y: offset.schY + (schY ?? 0) };
|
|
247
|
+
const record = {
|
|
248
|
+
...(schX !== undefined || schY !== undefined ? { sch: { ...sch, ...(schTurn === undefined ? {} : { rotation: quarterTurn(schTurn) }) } } : {}),
|
|
249
|
+
// Kept without a position too: Rotate on an auto-placed symbol writes schRotation alone.
|
|
250
|
+
...(schTurn === undefined ? {} : { schRotation: quarterTurn(schTurn) }),
|
|
251
|
+
...(pcbX !== undefined || pcbY !== undefined || turn !== undefined ? { pcb: { ...at, rotation } } : {}),
|
|
252
|
+
};
|
|
253
|
+
return { offset: { pcbX: at.x, pcbY: at.y, schX: sch.x, schY: sch.y, pcbRotation: rotation }, record };
|
|
254
|
+
}
|
|
255
|
+
tag(element, tag, frame) {
|
|
256
|
+
const source = this.sourceOf(element, frame);
|
|
257
|
+
if (tag === Fragment)
|
|
258
|
+
return this.visit(element.children, frame);
|
|
259
|
+
if (tag === "sheet")
|
|
260
|
+
return this.sheetElement(element, frame, source);
|
|
261
|
+
if (tag === "port")
|
|
262
|
+
return this.port(frame, source);
|
|
263
|
+
if (tag === "group")
|
|
264
|
+
return this.group(element, frame, source);
|
|
265
|
+
if (tag === "page")
|
|
266
|
+
return this.page(element, frame, source);
|
|
267
|
+
if (tag === "board")
|
|
268
|
+
return this.boardElement(element, frame, source);
|
|
269
|
+
if (tag === "keepout")
|
|
270
|
+
return this.keepout(element, frame, source);
|
|
271
|
+
if (tag === "copperpour")
|
|
272
|
+
return this.copperpour(element, frame, source);
|
|
273
|
+
if (tag === "hole")
|
|
274
|
+
return this.hole(element, frame, source);
|
|
275
|
+
if (tag === "trace") {
|
|
276
|
+
this.traces.push({ props: element.props, source, ...onPage(frame.page), ...(frame.instance ? { scope: traceScope(frame.instance) } : {}) });
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const drawing = drawingKindOf(tag);
|
|
280
|
+
if (drawing)
|
|
281
|
+
return this.drawing(element, drawing, frame, source);
|
|
282
|
+
if (kindOf(tag))
|
|
283
|
+
return this.part(element, tag, frame, source);
|
|
284
|
+
const severity = LATER_STAGE.has(tag) ? "warning" : "error";
|
|
285
|
+
const message = LATER_STAGE.has(tag) ? `<${tag}> is not supported yet and is ignored` : `<${tag}> is not a copperflow element`;
|
|
286
|
+
this.diagnostics.push(diagnostic("unsupported-element", severity, message, [tag], source));
|
|
287
|
+
}
|
|
288
|
+
/** A `<sheet>` is the body of a sheet file: the file built alone is its contents; anywhere else it is an error. */
|
|
289
|
+
sheetElement(element, frame, source) {
|
|
290
|
+
if (frame.depth === 1 && !frame.instance) {
|
|
291
|
+
this.rootIsSheet = true;
|
|
292
|
+
const name = sheetName(this.file);
|
|
293
|
+
this.sheet = { name, ...this.sheetPorts(element, this.file, name, frame, source) };
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
const message = "<sheet> is the body of a <name>.sheet.tsx file; use that sheet as a component instead";
|
|
297
|
+
this.diagnostics.push(diagnostic("unsupported-element", "error", message, ["sheet"], source));
|
|
298
|
+
}
|
|
299
|
+
this.visit(element.children, frame);
|
|
300
|
+
}
|
|
301
|
+
/** Ports were read when the instance began; outside a sheet a port joins nothing. */
|
|
302
|
+
port(frame, source) {
|
|
303
|
+
if (frame.instance || this.rootIsSheet)
|
|
304
|
+
return;
|
|
305
|
+
const message = "<port> has an effect only in a sub-sheet (<name>.sheet.tsx); it is ignored";
|
|
306
|
+
this.diagnostics.push(diagnostic("unsupported-element", "warning", message, ["port"], source));
|
|
307
|
+
}
|
|
308
|
+
group(element, frame, source) {
|
|
309
|
+
const reader = new PropReader(element.props, "group", source);
|
|
310
|
+
const { offset } = frame;
|
|
311
|
+
const at = pcbPoint(offset, reader.length("pcbX") ?? 0, reader.length("pcbY") ?? 0);
|
|
312
|
+
const next = {
|
|
313
|
+
...offset,
|
|
314
|
+
pcbX: at.x,
|
|
315
|
+
pcbY: at.y,
|
|
316
|
+
schX: offset.schX + (reader.length("schX") ?? 0),
|
|
317
|
+
schY: offset.schY + (reader.length("schY") ?? 0),
|
|
318
|
+
};
|
|
319
|
+
this.diagnostics.push(...reader.diagnostics);
|
|
320
|
+
this.visit(element.children, { ...frame, offset: next });
|
|
321
|
+
}
|
|
322
|
+
/** A page holds what it wraps; a second page of the same name adds to the first, and `Main` is the first page. */
|
|
323
|
+
page(element, frame, source) {
|
|
324
|
+
const name = element.props["name"];
|
|
325
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
326
|
+
this.diagnostics.push(diagnostic("missing-name", "error", "<page> needs a name; what it holds stays on the page around it", ["page"], source));
|
|
327
|
+
return this.visit(element.children, frame);
|
|
328
|
+
}
|
|
329
|
+
if (frame.instance) {
|
|
330
|
+
const message = `A sheet is drawn on its instance's page: page ${name} in ${frame.instance.sheet} is ignored`;
|
|
331
|
+
this.diagnostics.push(diagnostic("page-in-sheet", "error", message, [name], source));
|
|
332
|
+
return this.visit(element.children, frame);
|
|
333
|
+
}
|
|
334
|
+
if (frame.page !== undefined) {
|
|
335
|
+
const message = `Pages do not nest: page ${name} is inside page ${frame.page}, and what it holds stays on ${frame.page}`;
|
|
336
|
+
this.diagnostics.push(diagnostic("nested-page", "error", message, [name], source));
|
|
337
|
+
return this.visit(element.children, frame);
|
|
338
|
+
}
|
|
339
|
+
if (!this.pages.includes(name))
|
|
340
|
+
this.pages.push(name);
|
|
341
|
+
this.visit(element.children, { ...frame, page: name === MAIN_PAGE ? undefined : name });
|
|
342
|
+
}
|
|
343
|
+
boardElement(element, frame, source) {
|
|
344
|
+
if (frame.instance) {
|
|
345
|
+
const message = `A sheet has no <board>; the one in ${frame.instance.sheet} is ignored`;
|
|
346
|
+
this.diagnostics.push(diagnostic("board-in-sheet", "error", message, ["board"], source));
|
|
347
|
+
}
|
|
348
|
+
else if (this.board)
|
|
349
|
+
this.diagnostics.push(diagnostic("two-boards", "error", "A circuit has one <board>; the second is ignored", ["board"], source));
|
|
350
|
+
else {
|
|
351
|
+
const built = buildBoard(element.props, source);
|
|
352
|
+
this.board = built.board;
|
|
353
|
+
this.diagnostics.push(...built.diagnostics);
|
|
354
|
+
}
|
|
355
|
+
this.visit(element.children, frame);
|
|
356
|
+
}
|
|
357
|
+
/** Keepouts are collected wherever they are and given to the board after the walk, so a keepout may come before its board. */
|
|
358
|
+
keepout(element, frame, source) {
|
|
359
|
+
const built = buildKeepout(element.props, frame.offset, this.keepouts.length + 1, source);
|
|
360
|
+
this.diagnostics.push(...built.diagnostics);
|
|
361
|
+
this.boardThings.push({ tag: "keepout", source });
|
|
362
|
+
if (built.keepout)
|
|
363
|
+
this.keepouts.push(built.keepout);
|
|
364
|
+
}
|
|
365
|
+
/** The 1-based place of a pour or hole tag among those of its kind in its own file (its instance's, or the circuit's). */
|
|
366
|
+
boardItemIndex(tag, frame) {
|
|
367
|
+
const key = `${tag} ${frame.instance?.path ?? ""}`;
|
|
368
|
+
const index = (this.boardItemTags.get(key) ?? 0) + 1;
|
|
369
|
+
this.boardItemTags.set(key, index);
|
|
370
|
+
return index;
|
|
371
|
+
}
|
|
372
|
+
/** Pours are collected like keepouts; their nets are checked once the nets are known. */
|
|
373
|
+
copperpour(element, frame, source) {
|
|
374
|
+
const built = buildPour(element.props, frame.offset, this.boardItemIndex("copperpour", frame), source, frame.instance?.path);
|
|
375
|
+
this.diagnostics.push(...built.diagnostics);
|
|
376
|
+
this.boardThings.push({ tag: "copperpour", source });
|
|
377
|
+
if (built.pour)
|
|
378
|
+
this.pours.push(built.pour);
|
|
379
|
+
}
|
|
380
|
+
hole(element, frame, source) {
|
|
381
|
+
const built = buildHole(element.props, frame.offset, this.boardItemIndex("hole", frame), source, frame.instance?.path);
|
|
382
|
+
this.diagnostics.push(...built.diagnostics);
|
|
383
|
+
this.boardThings.push({ tag: "hole", source });
|
|
384
|
+
if (built.hole)
|
|
385
|
+
this.holes.push(built.hole);
|
|
386
|
+
}
|
|
387
|
+
drawing(element, kind, frame, source) {
|
|
388
|
+
const index = (this.drawingCounts.get(kind) ?? 0) + 1;
|
|
389
|
+
this.drawingCounts.set(kind, index);
|
|
390
|
+
const built = buildDrawing(kind, element.props, element.children.length, { offset: frame.offset, index, source });
|
|
391
|
+
this.diagnostics.push(...built.diagnostics);
|
|
392
|
+
const inside = frame.instance ? { instance: frame.instance.path } : {};
|
|
393
|
+
const drawn = built.drawing ? { drawing: { ...built.drawing, ...onPage(frame.page), ...inside } } : {};
|
|
394
|
+
const name = drawingName(kind, element.props["name"]);
|
|
395
|
+
// A named drawing in a sheet is named per instance, so two instances do not repeat a name; a bus keeps its net names.
|
|
396
|
+
const scoped = name !== undefined && frame.instance && kind !== "bus" ? `${frame.instance.path}/${name}` : name;
|
|
397
|
+
this.drawings.push({ kind, name: scoped, source, ...drawn });
|
|
398
|
+
}
|
|
399
|
+
/** One warning for each <keepout>, <copperpour> and <hole> of a circuit that has no <board>. */
|
|
400
|
+
boardlessThings() {
|
|
401
|
+
if (this.board)
|
|
402
|
+
return [];
|
|
403
|
+
return this.boardThings.map(({ tag, source }) => diagnostic("bad-value", "warning", `<${tag}> needs a <board>; it is ignored`, [tag], source));
|
|
404
|
+
}
|
|
405
|
+
/** The board with what was collected around it: keepouts, and the pours and holes when there are any. */
|
|
406
|
+
finishBoard(nets) {
|
|
407
|
+
if (!this.board)
|
|
408
|
+
return { diagnostics: [] };
|
|
409
|
+
const resolved = resolvePours(this.pours, nets, this.board);
|
|
410
|
+
const pours = resolved.pours.length > 0 ? { pours: resolved.pours } : {};
|
|
411
|
+
const holes = this.holes.length > 0 ? { holes: this.holes } : {};
|
|
412
|
+
return { board: { ...this.board, keepouts: this.keepouts, ...pours, ...holes }, diagnostics: resolved.diagnostics };
|
|
413
|
+
}
|
|
414
|
+
part(element, tag, frame, source) {
|
|
415
|
+
const name = element.props["name"];
|
|
416
|
+
if (typeof name !== "string" || name === "") {
|
|
417
|
+
this.diagnostics.push(diagnostic("missing-name", "error", `<${tag}> needs a name`, [tag], source));
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const scope = frame.instance;
|
|
421
|
+
const id = scope ? this.instancePartId(name, scope, source) : this.uniqueId(name, source);
|
|
422
|
+
const reader = new PropReader(element.props, id, source);
|
|
423
|
+
const footprint = footprintOf(tag, element.props, reader);
|
|
424
|
+
const padCount = footprint === undefined ? undefined : this.options.padCount(footprint);
|
|
425
|
+
const origin = { source, library: frame.library, offset: frame.offset };
|
|
426
|
+
const built = buildPart(tag, id, element.props, origin, { name: footprint, padCount });
|
|
427
|
+
const hierarchy = scope ? { instance: scope.path, localId: name } : {};
|
|
428
|
+
this.components.push({ ...built.component, ...onPage(frame.page), ...hierarchy });
|
|
429
|
+
this.diagnostics.push(...reader.diagnostics, ...built.diagnostics);
|
|
430
|
+
}
|
|
431
|
+
/** The flattened designator of a part in an instance; one that another part already has is a base clash. */
|
|
432
|
+
instancePartId(name, scope, source) {
|
|
433
|
+
const flat = withBase(name, scope.base);
|
|
434
|
+
const owner = this.owners.get(flat);
|
|
435
|
+
if (owner !== undefined && owner !== scope.path && !this.duplicated.has(flat)) {
|
|
436
|
+
this.duplicated.add(flat);
|
|
437
|
+
if (!this.clashingPairs.has(`${owner}|${scope.path}`)) {
|
|
438
|
+
const message = `${name} of ${scope.path} becomes ${flat}, which is already a part; give ${scope.name} another base`;
|
|
439
|
+
this.diagnostics.push(diagnostic("base-clash", "error", message, [scope.path, flat], source));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const id = this.uniqueId(flat, source, scope.path);
|
|
443
|
+
if (!scope.parts.has(name))
|
|
444
|
+
scope.parts.set(name, id);
|
|
445
|
+
return id;
|
|
446
|
+
}
|
|
447
|
+
uniqueId(name, source, owner = "") {
|
|
448
|
+
const count = (this.nameCounts.get(name) ?? 0) + 1;
|
|
449
|
+
this.nameCounts.set(name, count);
|
|
450
|
+
if (count === 1) {
|
|
451
|
+
this.owners.set(name, owner);
|
|
452
|
+
return name;
|
|
453
|
+
}
|
|
454
|
+
const first = this.owners.get(name) ?? "";
|
|
455
|
+
if (first !== "" && owner === "" && !this.duplicated.has(name)) {
|
|
456
|
+
this.duplicated.add(name);
|
|
457
|
+
const message = `${name} is already a part of ${first}; give ${first.split("/").pop() ?? first} another base`;
|
|
458
|
+
this.diagnostics.push(diagnostic("base-clash", "error", message, [first, name], source));
|
|
459
|
+
}
|
|
460
|
+
if (!this.duplicated.has(name)) {
|
|
461
|
+
this.duplicated.add(name);
|
|
462
|
+
this.diagnostics.push(diagnostic("duplicate-name", "error", `More than one part is named ${name}`, [name], source));
|
|
463
|
+
}
|
|
464
|
+
return `${name}~${count}`;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
/** Turns the evaluated element tree into the circuit model. */
|
|
468
|
+
export function elaborate(evaluated, file, options) {
|
|
469
|
+
const run = new Elaboration(evaluated, file, options);
|
|
470
|
+
run.visit(evaluated.root, { offset: NO_OFFSET, callSite: undefined, library: undefined, depth: 0, page: undefined });
|
|
471
|
+
const instances = run.instances.length > 0 ? { instances: run.instances } : {};
|
|
472
|
+
const traces = resolveTraces(run.traces, run.components, (path) => run.instances.find((instance) => instance.path === path)?.file);
|
|
473
|
+
const nets = mergeNets(traces.nodes, traces.links);
|
|
474
|
+
const drawings = uniqueDrawingIds(run.drawings, run.components);
|
|
475
|
+
const board = run.finishBoard(nets);
|
|
476
|
+
const joined = nets.filter((net) => net.names.length > 1).map((net) => diagnostic("nets-joined", "warning", `Nets ${net.names.join(" and ")} are joined by a trace`, net.names));
|
|
477
|
+
return {
|
|
478
|
+
file,
|
|
479
|
+
pages: run.pages,
|
|
480
|
+
components: run.components,
|
|
481
|
+
nets,
|
|
482
|
+
connections: traces.connections,
|
|
483
|
+
...(board.board ? { board: board.board } : {}),
|
|
484
|
+
drawings: drawings.drawings,
|
|
485
|
+
...instances,
|
|
486
|
+
...(run.sheet ? { sheet: run.sheet } : {}),
|
|
487
|
+
diagnostics: [...run.diagnostics, ...drawings.diagnostics, ...run.boardlessThings(), ...traces.diagnostics, ...board.diagnostics, ...joined],
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
//# sourceMappingURL=elaborate.js.map
|