From 89d350a7d2fb7a23339482b9a668466668f38446 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 15 Mar 2018 10:37:36 -0400 Subject: [PATCH] Footprint editor: fix bug in footprint wizard 2D barcode generator. The text height and thickness settings were never implemented so they didn't get updated when the options were changed. Added the missing code to update both parameters. Added text width parameter so text height and width do not need to be the same value. Currently both the value and reference fields are set to the same height and width. Please feel free to change this if you feel the need to have separate text settings for both the value and reference fields. Fixes lp:1751309 https://bugs.launchpad.net/kicad/+bug/1751309 --- pcbnew/python/plugins/qrcode_footprint_wizard.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcbnew/python/plugins/qrcode_footprint_wizard.py b/pcbnew/python/plugins/qrcode_footprint_wizard.py index 1284a240c9..0fc8aa1289 100644 --- a/pcbnew/python/plugins/qrcode_footprint_wizard.py +++ b/pcbnew/python/plugins/qrcode_footprint_wizard.py @@ -37,6 +37,7 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard): self.AddParam("Barcode", "Use Cu layer", self.uBool, True) self.AddParam("Caption", "Enabled", self.uBool, True) self.AddParam("Caption", "Height", self.uMM, 1.2) + self.AddParam("Caption", "Width", self.uMM, 1.2) self.AddParam("Caption", "Thickness", self.uMM, 0.12) @@ -48,7 +49,9 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard): self.UseCu = self.parameters['Barcode']['Use Cu layer'] self.border = int(self.parameters['Barcode']['Border']) self.textHeight = int(self.parameters['Caption']['Height']) - self.module.Value().SetText(str(self.Barcode) ) + self.textThickness = int(self.parameters['Caption']['Thickness']) + self.textWidth = int(self.parameters['Caption']['Width']) + self.module.Value().SetText(str(self.Barcode)) # Build Qrcode self.qr = qrcode.QRCode() @@ -133,7 +136,13 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard): #int((5 + half_number_of_elements) * self.X)) textPosition = int((self.textHeight) + ((1 + half_number_of_elements) * self.X)) self.module.Value().SetPosition(pcbnew.wxPoint(0, - textPosition)) + self.module.Value().SetTextHeight(self.textHeight) + self.module.Value().SetTextWidth(self.textWidth) + self.module.Value().SetThickness(self.textThickness) self.module.Reference().SetPosition(pcbnew.wxPoint(0, textPosition)) + self.module.Reference().SetTextHeight(self.textHeight) + self.module.Reference().SetTextWidth(self.textWidth) + self.module.Reference().SetThickness(self.textThickness) self.module.Value().SetLayer(pcbnew.F_SilkS) QRCodeWizard().register()