kicad-developers team mailing list archive
Mailing list archive
Re: BUG FIX: module text move
>> Lastly, I feel a subsetting mechanism other than visibility, or layer, which we have now,
>> must be done using a python or other type of expression, not just some noisy dialog with a
>> million checkboxes.
There are two paths to travel down this "python expression" path:
a) either a tricked out "selection filter" which subsets those items which are visible, or
b) an elaborate visibility filter which simply draws a very specific subset of your board.
How to implement: a)))))))))))))))))))
We are actually very close to this capability the infrastructure is actually nearly all
there. We have the COLLECTOR class, and its Inspect() function. We just have:
1) Create a python interpreter instance within a C++ class. We need a C++ wrapper hide
the details of instantiating a python interpreter instance. This needs to be lean enough
so that expressions can be passed to it and it gives back results in some form. Maybe
that return form is some variable type like double or bool. Call this the "INTERPRETER"
class for the sake of discussion.
2) Extend our current class COLLECTOR, and give such extended class a member INTERPRETER.
In the COLLECTOR's Inspect() function, call the INTERPRETER with the expression. The
constructor to this class should take the python expression, and a BOARD pointer perhaps.
So now you simply have to use a different kind of COLLECTOR than what we use now in hit
testing. Lets say you have resistors with values in a range: R29 - R48. You could write
a python expression to allow selection of ONLY those resistors and only modules. Lets say
you have a number of opto isolators. You could write an expression that allows selection
of only opto isolators by having the python expression examine a piece of module text, say
the "value" and perform a regular expression check on it or other evaluation.
How to implement: b))))))))))))))))))))
The new GAL code uses a VIEW stack, so the python expression can be used as a means of
filtering object on their way into one or more of the VIEWs. After they are in there,
this is no performance cost in the python expression evaluation, because the BOARD has
been subsetted already, once up front.