kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30546
Re: [PATCH] Math expression support for pad editor.
Scratch Pad:
I think this will be easily doable as an additional text box in the dialog,
which is then added to the beginning of the expression for each text box.
The format for the math library is as follows
(a) Initialise x to zero
var x;
(b) Initialise y to three
var y := 3;
(c) Initialise z to the expression
var z := if (max(1,x + y) > 2,w,v);
Global variable support:
I think this is possible but a simpler path might be to use a global
scratch pad, which would be added first to the beginning of the expression
used for the text box.
Currently the expression text ie something like "posx + 1" isn't saved
within the dialog or for the component.
Regards
Russell
On Fri, Sep 1, 2017 at 7:46 AM Michael Geselbracht <mgeselbracht3@xxxxxxxxx>
wrote:
> Hi,
>
> I have tested the patch and I really like this feature. This automatic
> variable assignment will sure come in handy.
> How about adding a kind of scratch pad (a single line should do) to the
> footprint editor so that one can add variables (measurements) given in
> datasheets?
> Like "c1=2.9; e=0.635" in the scratch pad and then in PosX field: "-c1/2 "
> and PosY: "-1.5*e" in order to place the first pad.
>
> - Michael
>
>
> On Thu, Aug 31, 2017 at 3:58 PM, Tomasz Wlostowski <
> tomasz.wlostowski@xxxxxxx> wrote:
>
>> On 31.08.2017 15:27, Russell Oliver wrote:
>> > Hi All.
>> >
>> > As a follow up to my earlier post, attached is a patch that implement
>> > math expressions in the pad editor as well.
>> >
>> > A nifty feature is that the fields can be referenced from each other.
>> > currently the fields are referenced by the following names.
>> > - posx, posy, sizex, sizey, offsetx, offsetx, drillx, drillx.
>>
>> Hi Russell,
>>
>> Didn't have the time to check your patch yet, but I came up with an
>> idea: add global variable support to the math parser, so that if you
>> place a text anywhere in the design assigning to a variable (e.g.
>> var=10), it will be updated in any of the expressions that reference it.
>>
>> Cheers,
>> Tom
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References