← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH][RFC] Footprint wizards

 

Le 14/09/2016 à 14:09, Oliver Walters a écrit :
> Hi all,
> 
> First time submitting a patch, so here goes....
> 
> The attached patch deals with a number of issues with regards to the footprint wizards manager. It
> started off as what I imagined was a fairly simple task to improve the UX of the FP wizards
> interface, but it evolved into something a bit more complex as I delved deeper into the source!
> 
> Improvements are as follows:
> 
> 1. I have done away with the use of a leading asterisk to designate the "units" of a wizard
> parameter. Multiple parameter types can now be defined (integer, float, mm, mils, bool, etc..)
> 
> 2. Input validation. Each type of parameter is now validated properly within the wizards screen.
> Integer parameters can only be set to integers, dimensions can only be floating point, etc.

Unfortunately, it does not work in countries which use a comma as floating point separator:
I cannot enter floating point values:

The validator expects a comma as floating point separator, and the python script expects a point as
separator.

> 
> 3. Boolean values are now treated properly. Simply click the cell to toggle, rather than awkwardly
> typing "True" or "False"
> 
> 4. Multiple choice options available - If the python script specifies a list of options, then a
> drop-down box will be displayed for that parameter
> 
> 5. Param designators. Instead of the row numbers being shown, each param can optionally be assigned
> a designator (such as 'e' for pitch) which will be show to the left of that row.
> 
> 6. "Reset to default" - A new button in the top toolbar which resets all wizard parameters to their
> default values
> 
> 7. More logical parameter checking within the python wizard helpers. Currently each parameter needs
> to be explicitly checked e.g. "CheckInt" to make sure the value is a valid integer. This patch
> defines a Parameter holder class that automatically checks values based on their specified type.
> Additionally, parameters can have other checks specified when they are added, e.g:
> 
> AddParam("Pads","width",uMM, 2.5, min_value=0.1, max_value=5.5)
> 
> 8. Fixed script import errors in the case of "bad" scripts. Currently if a wizard contains any
> errors, the LoadPlugins functions fail and no subsequent wizards are loaded. A simple try-except
> block has been added around the specific file loading so that one bad plugin file does not break the
> others
> 
> 9. Auto-sizing of the parameter grid. Not a huge deal but the grid width now expands to fill the
> available space.
> 
> General Notes:
> 
> a) To provide the functionality for multiple unit types I have had to slightly break compatibility
> with the way that parameter types were defined in the current wizards. However, I have designed the
> new Parameter class (in kicadplugins.i) to be as close-to-compatible as it can be. 
> 
> I have updated each of the default plugins to be compatible with the new system. Only minor changes
> were required.
> 
> b) I have also consolidated the helper classes (HelpfulFootprintWizardPlugin) into the simpler
> FootprintWizard base class. 
> 
> c) There is now a GitHub repository for FootprintWizards
> - https://github.com/KiCad/Footprint_Wizards - should this patch be accepted I propose that the
> default wizards be further improved, and removed from the source files. Instead, provide a link to
> the GitHub page or a download-helper for the scripts. This way the community can contribute quality
> wizards, and I shall endeavour to add some good documentation to the wiki page for wizard creation.
> 
> .diff is attached - hopefully this is the right way of doing this?
> 
> Please let me know what I can do to help this process along.
> 
> Regards,
> 
> Oliver

Thanks for your contribution.

-- 
Jean-Pierre CHARRAS


Follow ups

References