From 6679decc8d1c4367193eca6e78bac5593eef3737 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 20 Jun 2022 20:29:28 +0200 Subject: [PATCH] Fix syntax issues in footprint wizards Fixes #11867 https://gitlab.com/kicad/code/kicad/issues/11867 --- pcbnew/python/plugins/FPC_wizard.py | 10 +++++----- pcbnew/python/plugins/PadArray.py | 2 +- pcbnew/python/plugins/qfn_wizard.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pcbnew/python/plugins/FPC_wizard.py b/pcbnew/python/plugins/FPC_wizard.py index 9bf239529b..07e7b8473c 100644 --- a/pcbnew/python/plugins/FPC_wizard.py +++ b/pcbnew/python/plugins/FPC_wizard.py @@ -70,8 +70,8 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard): shl_from_top = p["Shield"]["from_top"] offsetX = pad_pitch * ( pad_count-1 ) / 2 - size_pad = pcbnew.wxSize( pad_width, pad_height ) - size_shld = pcbnew.wxSize(shl_width, shl_height) + size_pad = pcbnew.VECTOR2I( int(pad_width), int(pad_height) ) + size_shld = pcbnew.VECTOR2I(shl_width, shl_height) size_text = self.GetTextSize() # IPC nominal # Gives a position and size to ref and value texts: @@ -90,11 +90,11 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard): # Mechanical shield pads: left pad and right pad - xpos = (int)(-shl_to_pad-offsetX) - pad_s0_pos = pcbnew.VECTOR2I( xpos, (int)shl_from_top ) + xpos = -shl_to_pad-offsetX + pad_s0_pos = pcbnew.VECTOR2I( int(xpos), int(shl_from_top) ) pad_s0 = self.smdRectPad(self.module, size_shld, pad_s0_pos, "0") xpos = (pad_count-1) * pad_pitch+shl_to_pad - offsetX - pad_s1_pos = pcbnew.VECTOR2I( xpos, (int)shl_from_top ) + pad_s1_pos = pcbnew.VECTOR2I( int(xpos), int(shl_from_top) ) pad_s1 = self.smdRectPad(self.module, size_shld, pad_s1_pos, "0") self.module.Add(pad_s0) diff --git a/pcbnew/python/plugins/PadArray.py b/pcbnew/python/plugins/PadArray.py index e13a07898e..5c6965c7bb 100644 --- a/pcbnew/python/plugins/PadArray.py +++ b/pcbnew/python/plugins/PadArray.py @@ -89,7 +89,7 @@ class PadMaker(object): @param rot_degree: the pad rotation, in degrees """ pad = pcbnew.PAD(self.module) - pad.SetSize(pcbnew.VECTOR2I(Hsize, Vsize)) + pad.SetSize(pcbnew.VECTOR2I( int(Hsize), int(Vsize) ) ) pad.SetShape(shape) pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD) pad.SetLayerSet(pad.SMDMask()) diff --git a/pcbnew/python/plugins/qfn_wizard.py b/pcbnew/python/plugins/qfn_wizard.py index 08c1fd9200..d2416893e0 100644 --- a/pcbnew/python/plugins/qfn_wizard.py +++ b/pcbnew/python/plugins/qfn_wizard.py @@ -103,7 +103,7 @@ class QFNWizard(FootprintWizardBase.FootprintWizard): v_pitch = (int)(v_pitch / 2 - pad_length +pad_offset + pad_length/2) #left row - pin1Pos = pcbnew.VECTOR2I( -h_pitch), 0) + pin1Pos = pcbnew.VECTOR2I( -h_pitch, 0) array = PA.PadLineArray(h_pad, pads_per_row, pad_pitch, True, pin1Pos) array.SetFirstPadInArray(1) array.AddPadsToModule(self.draw)