MitjaNemec / SaveRestoreLayout

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

File Name Handling #6

Closed MitjaNemec closed 1 year ago

MitjaNemec commented 1 year ago
    If this is unrelated, I'm happy to open a new issue. I get this failure which looks like it is at the hash check stage:

image

From log file

10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 149:Plugin executed on: 'win32'
10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 150:Plugin executed with python version: '3.9.14 (main, Sep 19 2022, 05:11:57) [MSC v.1932 64 bit (AMD64)]'
10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 151:KiCad build version: (6.0.8)
10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 152:Plugin version: 1.1.3
10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 153:Frame repr: <wx._core.Frame object at 0x000002331921A550>
10-21 15:07:07 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 171:Anchor footprint reference is 'U201'
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 180:Save layout chosen
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 287:Working on C:/Users/local/Repos/_/hardware/TC_Radio_standalone/TC_Radio_standalone.kicad_pcb
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 132:getting a list of all footprints on board
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 144:Footprint REF** does not have Sheetfile property, it will not be considered for placement. Most likely it is only in layout
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 292:Saving the current board temporary in order to leave current layout intact
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 298:Saving board as tempfile: C:\Users\local\AppData\Local\Temp\temp_board_file_for_save.kicad_pcb
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 303:Loaded temp boardfile: C:\Users\local\AppData\Local\Temp\temp_board_file_for_save.kicad_pcb
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 304:Get project schematics and layout data
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 132:getting a list of all footprints on board
10-21 15:07:09 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 144:Footprint REF** does not have Sheetfile property, it will not be considered for placement. Most likely it is only in layout
10-21 15:07:17 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 219:Saving the layout in 'C:\\Users\\local\\Repos\\_\\hardware\\TC_Radio_standalone\\TC_Radio_standalone.pckl' for level 0
10-21 15:07:17 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 315:Saving layout for level: ['Radio']
10-21 15:07:17 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 316:Calculating hash of the layout schematics
10-21 15:07:17 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 320:Saving hash for files: ['File: Radio_.kicad_sch']

I'm afraid I can't share the project but grateful if any workaround is known. The sub-sheet I'm trying to save layout for is sheet 2 in the hierarchy (root is sheet 1).

Originally posted by @SimonMerrett in https://github.com/MitjaNemec/SaveRestoreLayout/issues/3#issuecomment-1287028683

MitjaNemec commented 1 year ago

Yeah, this is caused due to changes how 6.0.8 encodes footprint properties. I am working on a fix. But it will take a day or two for new version to become available in PCM.

SimonMerrett commented 1 year ago

Thanks for the quick reply and for working on the fix. Happy to wait for the fix.

MitjaNemec commented 1 year ago

Ok, as it turns out this is due to the bug in KiCad specifically in version 6.0.8. It is not a bug in the plugin.

As proper workaround would be quite ridiculous to implement, there will be no patch to fix this. The only thing I can do is to recomment that you switch to the nightly 6.0.x release. For windows these are available in https://downloads.kicad.org/kicad/windows/explore/6.0-testing and I can confirm that https://downloads.kicad.org/kicad/windows/explore/6.0-testing/download/kicad-6.0-testing_r26953.0593663462-x86_64-lite.exe does not have a bug anymore.

SimonMerrett commented 1 year ago

Thanks for looking at this - I will use a different version of KiCAD as you are right, it isn't your problem to fix.

MitjaNemec commented 1 year ago

If you saved the layout with 6.0.8 you'll have to save it again

SimonMerrett commented 1 year ago

Sorry if I'm doing something wrong but I'm getting a very similar error and log:

10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 149:Plugin executed on: 'win32'
10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 150:Plugin executed with python version: '3.9.14 (main, Sep 19 2022, 05:11:57) [MSC v.1932 64 bit (AMD64)]'
10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 151:KiCad build version: (6.0.8-122-g2d2912c23d)
10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 152:Plugin version: 1.1.3
10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 153:Frame repr: <wx._core.Frame object at 0x000001E4694BA550>
10-25 21:18:28 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 171:Anchor footprint reference is 'U201'
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 180:Save layout chosen
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 287:Working on C:/Users/local/Repos/project_name/hardware/TC_project_name_standalone/TC_project_name_standalone.kicad_pcb
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 132:getting a list of all footprints on board
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 292:Saving the current board temporary in order to leave current layout intact
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 298:Saving board as tempfile: C:\Users\local\AppData\Local\Temp\temp_board_file_for_save.kicad_pcb
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 303:Loaded temp boardfile: C:\Users\local\AppData\Local\Temp\temp_board_file_for_save.kicad_pcb
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 304:Get project schematics and layout data
10-25 21:18:29 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 132:getting a list of all footprints on board
10-25 21:18:39 com_github_MitjaNemec_SaveRestoreLayout.action_save_restore_layout 219:Saving the layout in 'C:\\Users\\local\\Repos\\project_name\\hardware\\TC_project_name_standalone\\TC_project_name_standalone.pckl' for level 0
10-25 21:18:39 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 315:Saving layout for level: ['project_name']
10-25 21:18:39 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 316:Calculating hash of the layout schematics
10-25 21:18:39 com_github_MitjaNemec_SaveRestoreLayout.save_restore_layout 320:Saving hash for files: ['File: project_name_standalone.kicad_sch']

image

I used https://downloads.kicad.org/kicad/windows/explore/6.0-testing/download/kicad-6.0-testing_r26956.2d2912c23d-x86_64-lite.exe After installing, I opened up the project, opened the PCB layout and refreshed the copper zones by pressing b. Then I saved, closed KiCAD, reopened it and tried to save layout using one of the hierarchical sheets. Is there anything I should do differently or try again?

SimonMerrett commented 1 year ago

I just rolled back to 6.0.7 and had the same issue. Is there part of the schematic / PCB file I can hand-edit to work around this?

MitjaNemec commented 1 year ago

Ah yeah, I should have been more specific. When you switch from 6.0.8 to either 6.0.7 or 6.0.x testing you have also to update the PCB from schematics, so that the footprints properties get reset. Then you should be able to save the layout.

The issue arises only and only when you updated the PCB from schematics in 6.0.8

SimonMerrett commented 1 year ago

Thanks - I haven't been able to confirm the restore function but the save function now completes without error!