MitjaNemec / SaveRestoreLayout

GNU General Public License v2.0
22 stars 6 forks source link

Restoring a loyout failed with "Source and destination schematics don't match!" #17

Closed worldwidemv closed 11 months ago

worldwidemv commented 12 months ago

Hello,

thanks for the plugin, it looks very promising. Unfortunately, it does not work for me under Linux with KiCad 7.0.7

It looks like you compare hashes of the two schematic files, and this fails because the instances section of every symbol instance in the schematic is updated as soon as I copy the hierarchical sheet into the new project.

So, if I make a diff for the two sheets:

Workflow

  1. Copy the schematic of the hierarchical sheet from the module project to the new project.
  2. Open the new project and the module project and copy the hierarchical sheet block from the module project and past the block into the new projects schematic.
  3. Go to new projects PCB and update the board.
  4. Select a part and run the "Save/Restore Layout" plugin; chose restore ....

No editing the copied schematic, re-annotation parts or anything like that.

Here is the save_restore_layout.log

KiCad Info

Application: KiCad x86_64 on x86_64

Version: 7.0.7-7.0.7~ubuntu22.04.1, release build

Libraries: wxWidgets 3.2.1 FreeType 2.11.1 HarfBuzz 6.0.0 FontConfig 2.13.1 libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16

Platform: KDE neon 5.27, 64 bit, Little endian, wxGTK, KDE, x11

Build Info: Date: Aug 13 2023 23:14:49 wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24 Boost: 1.74.0 OCC: 7.5.2 Curl: 7.88.1 ngspice: 38 Compiler: GCC 11.4.0 with C++ ABI 1016

Build settings: KICAD_SPICE=ON

MitjaNemec commented 11 months ago

Hi, thanks for the thorough bug report. It looks like schematics saving was changed a bit during the 7.0.x releases. IIRC I've already seen something on this by Wayne (lead KiCad dev) but I haven't put two and two together that this would impact my plugins. Anyhow, I already ignore some things when calculating the hashes, so I'll have to additionally exclude the "instances" sections.

Again thanks for the thorough bug report. It dose help a lot and it will help with the bugfix

worldwidemv commented 11 months ago

My pleasure. I think giving you as much information as possible is the least I can do.... Especially considering the time/work/convenience you are going to save me :-) Thanks again...

For other affected users of 7.0: Commenting line 744 and 745 in save_restore_layout.py works as a workaround.

MitjaNemec commented 11 months ago

This should be fixed in 2.1.1. Can you please install it from file and test it before I push it to be available via PCM.

worldwidemv commented 11 months ago

Works like a charm. Thanks.