fix: update templates to KiCAD 9 format + remove corrupt _TEMPLATE_ blocks
Verified by live test: created a fresh schematic via MCP, result shows
format version 20250114, 0 _TEMPLATE_ hits, 0 (lib_id -100) hits, 24
real components placed cleanly.
--- Format version bump (20230121 KiCAD 7 -> 20250114 KiCAD 9) ---
Files: python/templates/*.kicad_sch, python/commands/project.py,
python/commands/schematic.py
Root cause: the MCP server targets KiCAD 9 exclusively - pcbnew.pyd is
compiled for KiCAD 9.0 / Python 3.11.5, and server.ts explicitly selects
the KiCAD 9 bundled Python on Windows. Generating new schematics with a
2-year-old format tag caused a spurious 'This file was created with an
older KiCAD version' warning on every newly created schematic.
--- Remove corrupt _TEMPLATE_* placed-symbol blocks ---
File: python/templates/template_with_symbols_expanded.kicad_sch
Root cause: the expanded template was generated by the old sexpdata
serializer (same corruption PR #40 fixed for DynamicSymbolLoader add-path).
The serializer converted the string 'Device:R' to integer -100, producing
(lib_id -100) instead of (lib_id Device:R). KiCAD cannot resolve an
integer as a library reference and crashes with a null-pointer when the
user attempts to select these symbols. They appeared as grey _TEMPLATE_R?,
_TEMPLATE_C?, _TEMPLATE_U_REG? etc. ~5000mm off-sheet - invisible during
normal work but triggering a crash on accidental box-select.
Discovered via live testing on a real JLCPCB/KiCAD 9 project.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
(kicad_sch (version 20230121) (generator "KiCAD-MCP-Server")
|
||||
(kicad_sch (version 20250114) (generator "KiCAD-MCP-Server")
|
||||
|
||||
(uuid a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d)
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at -100 -100 0) (unit 1)
|
||||
(symbol (lib_id "Device:R") (at -10000 -10000 0) (unit 1)
|
||||
(in_bom no) (on_board no) (dnp yes)
|
||||
(uuid 00000000-0000-0000-0000-000000000001)
|
||||
(property "Reference" "_TEMPLATE_R" (at -100 -102.54 0)
|
||||
@@ -143,14 +143,14 @@
|
||||
(property "Footprint" "" (at -100 -100 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at -100 -100 0)
|
||||
(property "Datasheet" "~" (at -10000 -10000 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 00000000-0000-0000-0000-000000000010))
|
||||
(pin "2" (uuid 00000000-0000-0000-0000-000000000011))
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C") (at -100 -110 0) (unit 1)
|
||||
(symbol (lib_id "Device:C") (at -10000 -10000 0) (unit 1)
|
||||
(in_bom no) (on_board no) (dnp yes)
|
||||
(uuid 00000000-0000-0000-0000-000000000002)
|
||||
(property "Reference" "_TEMPLATE_C" (at -100 -107.46 0)
|
||||
@@ -159,17 +159,17 @@
|
||||
(property "Value" "C_TEMPLATE" (at -100 -112.54 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at -100 -110 0)
|
||||
(property "Footprint" "" (at -10000 -10000 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at -100 -110 0)
|
||||
(property "Datasheet" "~" (at -10000 -10000 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 00000000-0000-0000-0000-000000000020))
|
||||
(pin "2" (uuid 00000000-0000-0000-0000-000000000021))
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:LED") (at -100 -120 0) (unit 1)
|
||||
(symbol (lib_id "Device:LED") (at -10000 -10000 0) (unit 1)
|
||||
(in_bom no) (on_board no) (dnp yes)
|
||||
(uuid 00000000-0000-0000-0000-000000000003)
|
||||
(property "Reference" "_TEMPLATE_D" (at -100 -117.46 0)
|
||||
@@ -178,10 +178,10 @@
|
||||
(property "Value" "LED_TEMPLATE" (at -100 -122.54 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at -100 -120 0)
|
||||
(property "Footprint" "" (at -10000 -10000 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at -100 -120 0)
|
||||
(property "Datasheet" "~" (at -10000 -10000 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 00000000-0000-0000-0000-000000000030))
|
||||
|
||||
Reference in New Issue
Block a user