← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] Proof of concept of mathematical expression input for text fields.

 

You might consider muparser.

David


On 8/27/2017 11:03 AM, 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].

I think this provides a template for other numerical input fields within Kicad.

[1] http://www.partow.net/programming/exprtk/index.html

Kind Regards
Russell


_______________________________________________
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