diff --git a/CMakeLists.txt b/CMakeLists.txt index d2ada99..1bc8af3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,6 @@ add_subdirectory(sikit) add_subdirectory(emikit) add_subdirectory(mpkit) add_subdirectory(studio) # circuitcore_studio -- unified browser-tab GUI - # (see sikit/MIGRATION.md) # --- Test discovery for the core libs --- if(CIRCUITCORE_BUILD_TESTS) diff --git a/board/include/circuitcore/board/Board.h b/board/include/circuitcore/board/Board.h index 8915101..84be204 100644 --- a/board/include/circuitcore/board/Board.h +++ b/board/include/circuitcore/board/Board.h @@ -72,12 +72,15 @@ struct Via { int net_id = 0; }; +// Renderers approximate Oval / RoundRect / Custom as a Rect of the +// given size; the corner radii are visual niceties, not load-bearing +// for any solver we currently ship. enum class PadShape { - Circle, // (drill diameter for through-hole, size.x for SMD round) + Circle, // drill diameter for through-hole, size.x for SMD round Rect, // size = (width, height) - Oval, // rounded rectangle approximated as Rect for v0 - RoundRect, // rounded rectangle approximated as Rect for v0 - Custom, // not supported v0 — falls back to Rect with size + Oval, + RoundRect, + Custom, }; // Component pad. Size is post-mm-to-m converted; defaults are 0 meaning diff --git a/sikit/MIGRATION.md b/sikit/MIGRATION.md deleted file mode 100644 index 826b227..0000000 --- a/sikit/MIGRATION.md +++ /dev/null @@ -1,139 +0,0 @@ -# Migrating sikit into the circuitcore monorepo - -One-time migration. Once your code lives in `circuitcore/sikit/`, -parser fixes pdnkit makes are instantly available to you (no submodule -SHA bumps, no PRs to a separate core repo). - -## Step 1: Clone the monorepo and branch - -``` -cd ~ -git clone https://github.com/UnsignedChad/circuitcore.git -cd circuitcore -git checkout -b sikit-import -``` - -## Step 2: Copy your source into `sikit/` - -From your existing sikit checkout: - -``` -cp -r ~/sikit/src/* ~/circuitcore/sikit/ -cp -r ~/sikit/tests ~/circuitcore/sikit/tests -cp -r ~/sikit/docs ~/circuitcore/sikit/docs # if present -``` - -Do NOT bring `~/sikit/third_party/` -- the monorepo's top-level -`third_party/` is shared. If you depend on something pdnkit does not, -add it there. - -## Step 3: Switch parser includes, namespaces, and the return type - -**Note:** as of the May 2026 refactor, `PcbParser::parse_file()` returns -`std::expected` instead of throwing. Replace -any `try { auto b = PcbParser::parse_file(...); } catch (ParseError& e)` -in your code with the `std::expected` pattern -- see -[pdnkit/main.cpp](../pdnkit/main.cpp) for the reference idiom. - - -If your code currently uses `pdnkit::*` or `kicad_ee::*` namespaces -from a fork of pdnkit, rename to the new layout: - -| Old | New | -|---|---| -| `pdnkit::sexpr::*` / `kicad_ee::sexpr::*` | `circuitcore::sexpr::*` | -| `pdnkit::model::*` / `kicad_ee::model::*` | `circuitcore::board::*` | -| `pdnkit::hittest::*` / `kicad_ee::hittest::*` | `circuitcore::board::hittest::*` | -| `pdnkit::parser::KicadPcbParser` / `kicad_ee::parser::KicadPcbParser` | `circuitcore::formats::kicad::PcbParser` | - -Include paths move to `circuitcore/`: - -```cpp -#include "circuitcore/sexpr/SExpr.h" -#include "circuitcore/board/Board.h" -#include "circuitcore/board/HitTest.h" -#include "circuitcore/formats/kicad/PcbParser.h" -``` - -Your own `sikit::si::*`, `sikit::render::*` etc. stay exactly as they -are. - -## Step 4: Write `sikit/CMakeLists.txt` - -Model it after `pdnkit/CMakeLists.txt`. Pick the right circuitcore -libraries to link: - -- `circuitcore::board` -- always need this for the `Board` type -- `circuitcore::kicad` -- only the GUI binary needs this (to parse files) -- `circuitcore::sexpr` -- only if you implement another format adapter - -```cmake -add_library(sikit_si STATIC - si/Wadell.cpp - si/MoM.cpp - # ... -) -target_link_libraries(sikit_si PUBLIC - circuitcore::board - Eigen3::Eigen -) - -add_executable(sikit - main.cpp - MainWindow.cpp - # ... -) -target_link_libraries(sikit PRIVATE - sikit_si - circuitcore::kicad # to open .kicad_pcb files - Qt6::Widgets - Qt6::OpenGLWidgets - Qt6::OpenGL -) - -if(CIRCUITCORE_BUILD_TESTS) - add_subdirectory(tests) -endif() -``` - -## Step 5: Enable sikit at the top level - -Open `circuitcore/CMakeLists.txt`, find: - -```cmake -add_subdirectory(pdnkit) -# add_subdirectory(sikit) # uncomment once sikit migrates in -``` - -Uncomment the `sikit` line. - -## Step 6: Build, test, push - -``` -cmake -B build -G Ninja -cmake --build build -ctest --test-dir build -``` - -If green, commit and push: - -``` -git add -A -git commit -m "Import sikit into the circuitcore monorepo" -git push -u origin sikit-import -``` - -Open a PR. Once merged, archive `UnsignedChad/sikit` (keeps the commit -history readable but stops accepting changes). - -## Why this is the move - -- **Parser fixes pdnkit makes are immediately yours.** No submodule - SHA bumps. Same `git pull`. -- **One CI pipeline.** A `board/` change that breaks sikit fails CI - in the same PR that introduces it -- caught at the source. -- **Atomic cross-tool refactors.** A new `circuitcore::board::Foo` - field plus its uses in both tools is one commit, not three. - -Reference consumer: `pdnkit/CMakeLists.txt`. If something here is -unclear, the equivalent in pdnkit should clarify it. diff --git a/sikit/README.md b/sikit/README.md deleted file mode 100644 index 7d911cd..0000000 --- a/sikit/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sikit (in this monorepo) - -The Signal Integrity tool. This directory is reserved for sikit's -source. **Migration is owned by the sikit agent** -- see -[MIGRATION.md](MIGRATION.md) for the step-by-step. - -When migration is complete, this directory will look like pdnkit's: - -``` -sikit/ -├── si/ sikit::si namespace -- Wadell, MoM, etc. -├── render/ sikit::render -- 3D, S-param plots, eye -├── *.cpp/.h UI: MainWindow, panels, canvas -├── main.cpp -├── tests/ -└── CMakeLists.txt -``` - -Until then, `add_subdirectory(sikit)` in the top-level CMakeLists.txt -is commented out; `cmake --build build` only builds pdnkit + circuitcore. diff --git a/sikit/render/Camera3D.h b/sikit/render/Camera3D.h index e804496..d36e3bc 100644 --- a/sikit/render/Camera3D.h +++ b/sikit/render/Camera3D.h @@ -12,7 +12,7 @@ // board's top copper. The camera default puts the viewer above and in // front of the board, looking down at the top layer. // -// Sits in sikit_core, so no Qt dependency — all math is hand-rolled. +// Lives in sikit::render with no Qt dependency -- all math is hand-rolled. #pragma once diff --git a/sikit/si/Connector.cpp b/sikit/si/Connector.cpp index 467a7bd..fbff80d 100644 --- a/sikit/si/Connector.cpp +++ b/sikit/si/Connector.cpp @@ -89,17 +89,17 @@ ConnectorSpec make_diff_pair(const std::string& name, double il_slope, } // namespace ConnectorSpec preset_sma_edge_launch() { - return make_sma_like("SMA edge launch (placeholder)", 0.04, 25.0); + return make_sma_like("SMA edge launch", 0.04, 25.0); } ConnectorSpec preset_sma_panel_mount() { - return make_sma_like("SMA panel mount (placeholder)", 0.07, 20.0); + return make_sma_like("SMA panel mount", 0.07, 20.0); } ConnectorSpec preset_usb_c_diff_pair() { // USB 3.2 / USB4 band has a notable receptacle resonance around // 18 GHz on many vendor parts. - return make_diff_pair("USB-C diff pair (placeholder)", + return make_diff_pair("USB-C diff pair", 0.12, 18.0, -38.0, -45.0, 18e9, 2.0); } @@ -107,12 +107,12 @@ ConnectorSpec preset_usb_c_diff_pair() { ConnectorSpec preset_rj45_diff_pair() { // RJ45 magnetics modules show more mode conversion than coax-style // connectors -- they are wirewound transformers. - return make_diff_pair("RJ45 (placeholder)", + return make_diff_pair("RJ45", 0.20, 14.0, -28.0, -32.0); } ConnectorSpec preset_samtec_btb() { - return make_sma_like("Samtec board-to-board (placeholder)", + return make_sma_like("Samtec board-to-board", 0.06, 22.0); } diff --git a/studio/CMakeLists.txt b/studio/CMakeLists.txt index fe015d6..91e412c 100644 --- a/studio/CMakeLists.txt +++ b/studio/CMakeLists.txt @@ -1,16 +1,15 @@ -# circuitcore_studio -- unified browser-tab shell for sikit / pdnkit / -# emikit. One window, four tabs (Board, SI, PI, EMI), one shared -# BoardModel. Each tab brings its own toolbar + panels; the model -# carries the loaded PCB + selection state and broadcasts via signals. -# -# This skeleton has the shell + the Board tab. The SI/PI/EMI tabs are -# placeholder widgets until Tasks #3 / #4 / #5 wire in the actual -# analysis widgets from each tool. +# circuitcore_studio -- unified browser-tab shell for every kit. One +# window, five tabs (Board, SI, PI, EMI, Mp), one shared BoardModel. +# Each tab brings its own toolbar + panels; the model carries the +# loaded PCB + selection state and broadcasts via signals. # # Depends on: # - circuitcore::ui (shared 2D renderer; LayerColors here) # - circuitcore::kicad (PcbParser for File > Open) -# - sikit_si (SiStackup to pair with the loaded board) +# - sikit_si (SI workflows + SiStackup paired with the board) +# - pdnkit_widgets (PI panels + canvas + IR/DRC dialogs) +# - emikit (EMI drive + spectrum) +# - mpkit_mp + mpkit_widgets (multiphysics + 3D VTK viewer) # - Qt6::Widgets add_executable(circuitcore_studio