kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30446
Re: [RFC] Proof of concept of mathematical expression input for text fields.
On 27.08.2017 17:03, Russell Oliver wrote:
> Hi all,
>
> Attached is a patch that allows for the use of a mathematical expression
> when editing the value field of components in Eeschema.
>
> If editing the value field and the entered string begins with an equals
> sign "=" as you would when entering a formula into an Excel spreadsheet
> cell, it is compiled and parsed when the Enter button is pressed while
> the text entry is in focus.
>
> A valid expression is returned as a double value which is then printed
> with a format to remove trailing zeroes. An invalid expression will not
> change the text value.
>
> The expression parser is simple wrap of the C++ Mathematical Expression
> Toolkit Library (ExprTk) written Arash Partow and is under the MIT
> licence [1].
>
Hi Russell,
Looks great, I wanted to have such a feature for parametric mechanical
design.
Have a look at the WX_UNIT_BINDER class - it's used in more recent
dialogs for inputting coordinates/sizes. Perhaps the math parser could
become a standard part of it?
Cheers,
Tom
Follow ups
References