-
Notifications
You must be signed in to change notification settings - Fork 9
Updating Older Wizards
Older wizards that subclass HelpfulFootprintWizardPlugin
will need some slight adjustments to work with the upgraded wizard scripting interface.
A slightly different import process is required.
import HelpfulFootprinWizardPlugin
class MyWizard(HelpfulFootprinWizardPlugin.HelpfulFootprinWizardPlugin):
# code goes here
becomes
import FootprintWizardBase
class MyWizard(FootprintWizardBase.FootprintWizard):
# code still goes here
New parameter types have been defined, and some have been removed.
+ uFloat
+ uInteger*
+ uRadians
+ uDegrees
+ uPercent
- uNatural*
*uInteger replaces uNatural
The * symbol is no longer used to differentiate between different types of parameters (this is handled by the new units property). Parameters which were referenced in older scripts with a leading * symbol will need to have this symbol expunged.
Example
pads_per_row = pads["*n"] // 4
becomes
pads_per_row = pads["n"] // 4
The CheckParameters()
function should no longer contain code for validating a single parameter. The functions CheckParamInt
and CheckParamBool
are no longer supported. Instead, these checks are performed automatically for each parameter, if limits (etc) are specified for that parameter.
Old Code
def GenerateParameterList(self):
self.AddParam("Pads", "n", self.uNatural, 100)
...
self.AddParam("Pads", "oval", self.uBool, True)
def CheckParameters(self):
self.CheckParamInt("Pads", "n", is_multiple_of=4)
self.CheckParamBool("Pads", "*oval")
New Code
def GenerateParameterList(self):
self.AddParam("Pads", "n", self.uInteger, 100, multiple=4)
self.AddParam("Pads", "oval", self.uBool, True)
def CheckParameters(self):
pass # All checks are already taken care of!
The CheckParameters()
function is sill provided to allow one parameter to be checked against another.
The PutOnGridMM
and PutOnGridMils
functions have been moved to pcbnew.py. Thus:
self.PutOnGridMM(dim, grid_size)
becomes
pcbnew.PutOnGridMM(dim, grid_size)