kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30433
[RFC] Proof of concept of mathematical expression input for text fields.
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
Attachment:
0001-Proof-of-concept-of-mathematical-expression-input-fo.patch
Description: Binary data
Follow ups