Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Minimum Wizard Requirements

Oliver edited this page Sep 25, 2016 · 6 revisions

Each footprint wizard must subclass the FootprintWizard class which is found in the FootprintWizardBase module.

e.g.

import FootprintWizardBase

class ExampleWizard(FootprintWizardBase.FootprintWizard):
    # functions, etc

Additionally, there are six required functions that need to be implemented for the wizard:

  1. GetName()

The GetName function simply returns the name of this footprint wizard (string type)

def GetName(self):
    return "ExampleWizard"
  1. GetDescription()

The GetDescription function returns a long-form description of the wizard which will be displayed in the wizard selection window within KiCad

def GetDescription(self):
    return "Example wizard used to demonstrate how to make a wizard."
  1. GetValue()

The GetValue function returns the value of the generated footprint. This must be a string value and typically the value will be dependent on one (or more) of the specified parameters. As an example, consider a very simple footprint which is a box of a given width and height (specified in millimeters):

def GetValue(self):
    return "SimpleBox_{w}x{h}mm".format(
        w = self.parameters["Shape"]["width"],
        h = self.parameters["Shape"]["height"])

4. **GenerateParameterList()**
This function is where the various footprint parameters are defined (see [Footprint Parameters](https://github.com/KiCad/Footprint_Wizards/wiki/Footprint-Parameters). 

def GenerateParameterList(self): self.AddParam("Shape", "width", self.uMM, 3.75) self.AddParam("Shape", "height", self.uMM, 4.95)

self.AddParam("PageB", "param3", self.uPercent, 33.05, min_value=20)

5. **CheckParameters()**

This function is used to perform any custom parameter checking required by the wizard. As an example, a simple test where the width should be no less than half the height:

def CheckParameters(self): h = self.parameters["Shape"]["height"]

self.CheckParam("Shape", "width", min_value=h/2)

6. **BuildThisFootprint()**

This function is responsible for actually building the footprint based on the supplied parameter values.

**TODO**

Clone this wiki locally