MitjaNemec / Kicad_action_plugins

Kicad action plugins
414 stars 62 forks source link

Save/restore "index out of range" #138

Closed Checcoraffa closed 3 years ago

Checcoraffa commented 3 years ago

Hello,

I am using Kicad 5.1.10 and when I use the save/restore layout plugin I get the above error "index out of range". The replicate_layout plugin does work well for me, so I don't know what is the issue. The log file is the following:

08-12 11:42:49 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 160:Plugin executed on: 'win32' 08-12 11:42:49 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 161:Plugin executed with python version: '2.7.18 (default, Apr 20 2020, 16:57:11) [GCC 9.3.0 64 bit (AMD64)]' 08-12 11:42:49 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 162:KiCad build version: (5.1.10)-1 08-12 11:42:49 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 163:Save/Restore Layout plugin version: 51 started 08-12 11:42:49 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 274:Restore layout chosen 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 393:Getting board info 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 395:Getting schematics info 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 180:getting project hierarchy from schematics 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 182:Project hierarchy looks like: {u'5D4D90C3': [u'HW_CTRL', u'G:\Shared drives\Team - Tech & Engineering\QKD v0_1 Electronic Hardware\QKD_TX_I_CTRL\PCB\2021_04_DC_CURR_DRIVER_v_2_1_0 - Copy - Copy\HW_CTRL.sch'], u'5D4D90D6': [u'DC_CURR_DRIVER', u'G:\Shared drives\Team - Tech & Engineering\QKD v0_1 Electronic Hardware\QKD_TX_I_CTRL\PCB\2021_04_DC_CURR_DRIVER_v_2_1_0 - Copy - Copy\DC_CURR_DRIVER.sch'], u'5CBC2655': [u'DC_CURR_0', u'G:\Shared drives\Team - Tech & Engineering\QKD v0_1 Electronic Hardware\QKD_TX_I_CTRL\PCB\2021_04_DC_CURR_DRIVER_v_2_1_0 - Copy - Copy\DC_CURR_0.sch'], u'5CBDB4B7': [u'DC_CURR_2', u'G:\Shared drives\Team - Tech & Engineering\QKD v0_1 Electronic Hardware\QKD_TX_I_CTRL\PCB\2021_04_DC_CURR_DRIVER_v_2_1_0 - Copy - Copy\DC_CURR_0.sch'], u'5CBDB3B6': [u'DC_CURR_1', u'G:\Shared drives\Team - Tech & Engineering\QKD v0_1 Electronic Hardware\QKD_TX_I_CTRL\PCB\2021_04_DC_CURR_DRIVER_v_2_1_0 - Copy - Copy\DC_CURR_0.sch']} 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 397:Getting layout info 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 256:getting a list of all footprints on board 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 399:Updating layout info with schematics info 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 739:Loading saved design 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 746:Source level is:[u'DC_CURR_DRIVER.sch', u'DC_CURR_0.sch'] 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 753:Destination footprint is:u'U4' 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 754:Destination levels available are:[u'DC_CURR_DRIVER.sch', u'DC_CURR_0.sch'] 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 765:Destination level is:[u'DC_CURR_DRIVER.sch', u'DC_CURR_0.sch'] 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 770:All sch files required are: [u'DC_CURR_0.sch'] 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 772:Getting current schematics hash 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 782:Source hash is:'10422b8e02218db428c8cbcdd3a58078' 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 783:Destination hash is: '10422b8e02218db428c8cbcdd3a58078' 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 800:Get layout data from saved board 08-12 11:42:53 Kicad_action_plugins-master.save_restore_layout.save_restore_layout 256:getting a list of all footprints on board 08-12 11:42:55 Kicad_action_plugins-master.save_restore_layout.action_save_restore_layout 311:Error when restoring layout Traceback (most recent call last): File "C:\Program Files\KiCad\share\kicad\scripting\plugins/Kicad_action_plugins-master/save_restore_layout/action_save_restore_layout.py", line 304, in Run restore_layout.restore_layout(pivot_mod, layout_file) File "C:\Program Files\KiCad\share\kicad\scripting\plugins/Kicad_action_plugins-master/save_restore_layout/save_restore_layout.py", line 819, in restore_layout net_pairs = self.get_net_pairs(modules_to_place, modules_saved) File "C:\Program Files\KiCad\share\kicad\scripting\plugins/Kicad_action_plugins-master/save_restore_layout/save_restore_layout.py", line 496, in get_net_pairs net_pairs.append((p_nets[index][1], s_nets[index][1])) IndexError: list index out of range

Checcoraffa commented 3 years ago

Solved. It was due to a dodgy component with pads not numbered correctly

MitjaNemec commented 3 years ago

Thanks for reporting, and solving the issue all by yourself. As I try to make the plugin as robust as I can, I'd appreciate if you could share the project with the dodgy symbol/footprint in place, so that I might be able to test for this in the future (if I find the time)

Checcoraffa commented 3 years ago

Dear Mitja,

I won't be able to share the files, because it contains some sensitive information.

However the issue was that I had inherited the circuit from someone else and they had not correctly linked the schematic symbol with the PCB footprint. The schematic symbol was a QFN type part with a ground pad in the centre. In the footprint this pad was missing and it had been added manually. I believe that the "list index out of range" error (or similar) was due to the fact that the index number was different between schematic and layout such that the array index had gone beyond the array size.

So I conclude that the plugin itself is very solid, provided that the schematic and layout are done correctly, which was not the case in my first attempt.

Kind regards, Francesco

On Mon, Aug 16, 2021 at 8:59 AM Mitja Nemec @.***> wrote:

Thanks for reporting, and solving the issue all by yourself. As I try to make the plugin as robust as I can, I'd appreciate if you could share the project with the dodgy symbol/footprint in place, so that I might be able to test for this in the future (if I find the time)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/MitjaNemec/Kicad_action_plugins/issues/138#issuecomment-899304838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFXMBP6M5IHBGDMGBTJMSTT5DAN5ANCNFSM5CA4SKIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Francesco Raffaelli, PhD Lead Integrated Quantum Photonics Engineer KETS Quantum Security Ltd. www.kets-quantum.com E: @. @.> T: +44 (0) 7519247461 Follow us on Twitter @kets_quantum

https://cyberexchange.uk.net/#/news/823

KETS Quantum Security is a limited company registered in England and Wales. Reg No. 10297688, Unit Dx, St Philips Central, Albert Road, St. Philips, Bristol, England, BS2 0XJ