[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

input validation (was: gEDA-user: pcb refdes name restrictions?)



Hi,
Moving this thread to geda-dev...

El vie, 03-11-2006 a las 12:47 +0000, Peter Clifton escribiÃ:
[snip]
> Peter B and I were looking at the possibility of introducing some
> plugable input validation / auto-complete modules into the gschem
> attribute editing system. The down side of course, is these must be
> configured (by default if you will) to understand what attributes are
> necessary, and what is legal.

I was thinking about this for a while before you post this mail...

My two wishes are:

 1) gschem should know what attributes can have a given object (and hide
the rest in the attribute editor window). Example: if editing the
attributes of a net, don't show the refdes, slot,... attributes as
options in the drop down menu.

 2) user configurable input validation (both for the content of the
attribute, as well as attribute bounds (don't allow to set slot=5 for a
part with only 2 slots), and object checking (don't allow to set the
refdes attribute for a net, for example).

At that time, I thought to:
 1) add a scheme function which takes an object list (a list with the
objects selected), and returned the common attributes of all the
objects. This would be used to fill the attribute name list in the
attribute editor. Of course we need a way to define the object type an
attribute can be attached to, but that's a simple problem.

 2) add a new scheme function to check the attribute. When the user adds
a new attribute, call this function, which would return a string showing
the problem description. Thus, an error window can be raised, and the
message and checks are user configurable. A general regular expression
can be defined for each attribute as well as any other check function.

> One idea was "footprint" (assuming your config states that validation
> and auto-complete for this attribute should be for "PCB", not some other
> layout package).
> 
> The user setting the footprint attribute would auto-complete with a
> drop-down list of the available footprints - obviously requires a
> knowledge of how / where PCB finds its footprint lists, or a library
> interface to this functionality in PCB.

The validation method described above relies on scheme, and maybe it's
not as flexible and powerful as you may want. I don't see how to do the
PCB stuff that way.

Do you have some thoughts about how to do it?

Regards,

Carlos



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user