gEDA-dev: Proof of concept PCB Library picker (PCB Patch)

Peter TB Brett peter at peter-b.co.uk
Wed May 30 02:56:58 EDT 2007


On Wednesday 30 May 2007 02:43:42 DJ Delorie wrote:
> > 1. Given an attribute name / value, provide validation (yes / no /
> > unknown)
>
> Values may be legitimate or not based on other validated attributes.
> If "device=resistor", then "value=10uF" is not valid.
>
> > 2. Given a partial value string for a named attribute, provide a list of
> > auto-complete alternatives
>
> I like wildcards.
>
> > 3. Given a named attribute, provide means to launch a helper program /
> > function to fill in the value
>
> My idea is, given a list of filled in values *and* another named
> attribute, provide a list of values that are allowed given the other
> attributes.
>
> > What this doesn't quite address (as I understand your comment), is the
> > possibility that the validation / selection process is based up other
> > attributes attached already / in the schematic etc..
> >
> > Any insight about how you see this being used would be greatly
> > appreciated. Seems to me it goes some way to providing "integration" in
> > a much needed area, without tying programs too explicitly to each other.

To start with, I'd like to see a system which provides a Scheme API something 
like the following:

  gschem:add-attribute-check* checkerfunc

Where checkerfunc is a Scheme procedure or closure:

  checkerfunc name value other-attributes

Which returns #t or #f.  A helper could be added, too:

  gschem:add-attribute-check name checkerfunc1

  checkerfunc1 value other-attributes

When gschem wants to show the user whether or not it thinks a given attribute 
is "valid" or not, it would call any checker functions registered, in order, 
returning the results OR'd together.

The other-attributes would be a list of pairs:

  '( (footprint . "1206") (device . "resistor") )

For instance, a footprint name checker would check that the footprint 
specified actually existed in the PCB library.

For autocompletion:

  gschem:add-attribute-complete* completionfunc
  gschem:add-attribute-complete name completionfunc1

  completionfunc name currentvalue other-attributes
  completionfunc1 currentvalue other-attributes

Would return a list of possible completions for the current value of an 
attribute, and should be able to accept "currentvalue" as the empty string 
(in which case it could e.g. return all possible values).

It might be possible to roll these together in some way.

Also, probably want a function like gschem:add-attribute-selector in there 
somewhere (note that Scheme procedures implemented in C could most certainly 
be added as callbacks, but adding them via Scheme makes it possible for users 
to easily disable them if they're annoying).

> My idea was to have a helper API that took name/value pairs.  Each
> value was either fully qualified, or included a wildcard.  The helper
> would, taking the available values into account, return a list of
> potential values for each wildcarded value.
>
> For example: Given a "device=resistor, value=1.2k, footprint=0*,
> vendor=digikey, vendor_part_number=*", it would return a list for each
> of footprint and vendor_part_number.  Footprint values would be
> anything that matched device, value, and vendor, and started with "0".
> vendor_part_number values would match device, value, vendor, and any
> footprint that started with "0".

Although I want to see this, I was hoping to add something like this to the 
component library, because it seems like the intuitive sort of place for it.  
Soon® I'm going to be writing a symbol database which would take one symbol 
(e.g. generic resistor) and generate a whole bunch of components from it 
using a spreadsheet of attribute values (dynamically, using my new command 
backend).  I also want to add selection functions to my component library 
API, so that selection can be done reasonably quickly even if the component 
database is on a remote server.

Peter


-- 
Fisher Society                              http://tinyurl.com/o39w2
CU Small-Bore Club                          http://tinyurl.com/mwrc9

      09f911029d74e35bd84156c5635688c0            peter-b.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20070530/5acd3a71/attachment.pgp 


More information about the geda-dev mailing list