MitjaNemec / ReplicateLayout

GNU General Public License v2.0
90 stars 12 forks source link

Python error when replicating design #56

Closed houkhouk closed 1 year ago

houkhouk commented 1 year ago

Hi, I recently came across the following python error when attempting to replicate my layout: AttributeError: 'float' object has no attribute 'AsTenthsOfADegree'

Any idea how to fix it ?

Thank you in advance.

Full log is provided here:

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 359:Plugin executed on: 'linux'

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 360:Plugin executed with python v
ersion: '3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0]'

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 361:KiCad build version: 6.0.11-2627ca5db0~126~ubuntu22.04.1

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 362:Plugin version: 1.3.3
06-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 363:Frame repr: <wx._core.Frame object at 0x7f0d67e677f0>

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 387:Preparing replicator with R6 as a reference

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.replicate_layout 113:getting a list of all footprints on board

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 435:source anchor footprint is 'R6'
Located on: ['MOS_Driver', 'Phase_drive_1']
With filenames: ['/home/maxime/Documents/Nimbl-bot/PCBs/Driver_moteur_NB120/NB120_MotorDriver_Kicad_V2.1.0/Power/MOS_Driver.kicad_sch', 'Phase_drive.kicad_sch']
With sheet_id:['MOS_Driver', 'Phase_drive_1']

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 442:Corresponding footprints are
[('R15', ['MOS_Driver', 'Phase_drive_2']), ('R18', ['MOS_Driver', 'Phase_drive_3']), ('R6', ['MOS_Driver', 'Phase_drive_1'])]
05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 454:Showing dialog
05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.replicate_layout 385:constructing a list of sheets suitable for replication on level:'Phase_drive_1', file:'Phase_drive.kicad_sch'

05-22 16:29:36 com_github_MitjaNemec_ReplicateLayout.replicate_layout 422:suitable sheets are:[['MOS_Driver', 'Phase_drive_2'], ['MOS_Driver', 'Phase_drive_3']]

05-22 16:29:37 com_github_MitjaNemec_ReplicateLayout.replicate_layout 1348:Level selected: ['MOS_Driver', 'Phase_drive_1']

05-22 16:29:37 com_github_MitjaNemec_ReplicateLayout.replicate_layout 1183:Filtering list of tracks

05-22 16:29:37 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 460:Toolbar position: wx.Point(4741, 134)

05-22 16:29:37 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 465:Dialog position: wx.Point(4377, 134)

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 385:constructing a list of sheets suitable for replication on level:'Phase_drive_1', file:'Phase_drive.kicad_sch'

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 422:suitable sheets are:[['MOS_Driver', 'Phase_drive_2'], ['MOS_Driver', 'Phase_drive_3']]

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 207:Replicating layout

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 231:Starting replication of sheets: [['MOS_Driver', 'Phase_drive_2'], ['MOS_Driver', 'Phase_drive_3']]
on level: ['MOS_Driver', 'Phase_drive_1']
with tracks=True, zone=True, text=True, text=True, intersecting=False, remove=False, locked footprints=False, group_only=False

05-22 16:29:39 root 299:updating GUI message: 'Preparing for replication'

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 301:Getting the list of source footprints

05-22 16:29:39 root 304:updating GUI with: 0

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 311:Getting the list of all the remaining footprints

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 318:Getting source tracks

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 1183:Filtering list of tracks

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 322:Getting source zones

05-22 16:29:39 root 304:updating GUI with: 50

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 326:Getting source text items

05-22 16:29:39 root 304:updating GUI with: 66

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 330:Getting source drawing items

05-22 16:29:39 root 304:updating GUI with: 83

05-22 16:29:39 root 299:updating GUI message: 'Replicating footprints'

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 734:Replicating footprints

05-22 16:29:39 root 304:updating GUI with: 0

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.replicate_layout 740:Replicating footprints on sheet ['MOS_Driver', 'Phase_drive_2']

05-22 16:29:39 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 272:Fatal error when running Replicate layout plugin
Traceback (most recent call last):
  File "/home/maxime/Documents/Nimbl-bot/PCBs/Nimblbot_Libraries/user-3dmodels/plugins/com_github_MitjaNemec_ReplicateLayout/action_replicate_layout.py", line 219, in on_ok
    self.replicator.replicate_layout(self.src_anchor_fp, self.src_anchor_fp.sheet_id[0:level + 1],
  File "/home/maxime/Documents/Nimbl-bot/PCBs/Nimblbot_Libraries/user-3dmodels/plugins/com_github_MitjaNemec_ReplicateLayout/replicate_layout.py", line 269, in replicate_layout
    self.replicate_footprints()
  File "/home/maxime/Documents/Nimbl-bot/PCBs/Nimblbot_Libraries/user-3dmodels/plugins/com_github_MitjaNemec_ReplicateLayout/replicate_layout.py", line 883, in replicate_footprints
    dst_text.SetTextAngle(src_txt_orientation)
  File "/usr/lib/python3/dist-packages/pcbnewTransition/transition.py", line 79, in <lambda>
    newSetTextAngle = lambda self, angle: originalSetTextAngle(self, angle.AsTenthsOfADegree())
AttributeError: 'float' object has no attribute 'AsTenthsOfADegree'
MitjaNemec commented 1 year ago

Sorr for the late response. I've missed this one.

Anyhow, this is the same as #47, so the solution is the same. Update the "pcbnewTransition", which is part of KiKit

houkhouk commented 1 year ago

Oh sorry, I did check previous issues. Must have missed this one... Thanks you for your help !