MitjaNemec/SwapStubs

on update PCB after swapping, sch is not aware PCB is already open

Opened this issue · 7 comments

Hi Mitja
Great stuff !
issue- SCH seems to have lost a link to the PCB ? or that it was open ? (windows10, 8RC2)
Got this one :
UPDATE PCB From Schematic
image

then it opens a new editor with a blank PCB.

then if I go back to SCH, and do Update PCB again
it places all the parts on the schematic on the PCB like a new project.

Somehow, it has lost the link to the open PCB ?

Hmmm, this is something completely new. A couple of questions:

  1. Can you attach a swap_stubs.log file?
  2. Is this repeatable? If it is, can save schematics before and after the plugin has run. The schematics after the plugin has touched it has to be opened and saved by KiCad to restore formating. And then can you look at the diff?
  3. Did you close the schematics editor manually or did you let the plugin to do it?
  1. Also if it is repeatable, can you share this project?

Hi Mitja
The swap did work- the swap did reflect back to the SCH. this is a good start !
The plug in did close the SCH. But had not swapped when I reopened it.
I did it again by closing SCH BEFORE I did the swap..... and it worked- when I reopened it, swap was done
But then,. it lost PCB sync on Update PCB.
swap log is in the zip
test1.zip

I did it a 2nd time, no problem .
I did it a 3rd time. no problem.
so then I tried something different.
I tried the swap with SCH open.
-Swaptool closed the SCH, and displayed dialog "sch editor might be open.....". I clicked OK

  • the swap tool did not proceed, nothign swapped.
  • OK, so SCH MUST be closed. If the swap tool closes the schematic, I must redone the swap. OK, I understand !
  • Now, It will not fail
  • Something that was about the first time it was run causes some issue with the linkage.
  • Now it is OK.

Yeah I added the code to close the schematics if it is opened but:

  1. On windows platform the close does not work as it should (the schematics window is closed, but the window handler stays in memory for quite some time. On Linux I had no such issues
  2. obviously something else also happens

So I'll remove the automatic close code and the plugin will exit if schematics is open with proper message to close it manually

Understood.
Usually my platform is debian linux, but today, windows 10.

I have to make the plugin work on all platforms. And based upon previous experience when you hit a strange behavior with wx on one platform chances are something similar will lurk on other platforms. So, while I maybe could add a platform depended code, I'd rather play it safe and simple and keep code same on all platforms.

Thanks for testing.