Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-25 Thread Michael Geselbracht
That was quick. Thank you Orson for taking care of this feature. I often use math expressions in entry fields not only in Kicad and I am glad that this is an official feature now. - Michael On Fri, Nov 24, 2017 at 10:12 PM, Maciej Suminski wrote: > Great, I have just

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-24 Thread Maciej Suminski
Great, I have just pushed the patches to the master branch. Michael, thank you very much. Footprint creation will be a pleasure now. Cheers, Orson On 11/24/2017 05:27 PM, Wayne Stambaugh wrote: > I'm fine with merging it if it meets with your approval. I plan > announcing the freeze on Sunday

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-24 Thread Wayne Stambaugh
I'm fine with merging it if it meets with your approval. I plan announcing the freeze on Sunday so use your best judgment. Cheers, Wayne On 11/24/2017 11:18 AM, Maciej Sumiński wrote: > I patched NumericEvaluator to use the system locale to pick the right > decimal separator character. I have

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-24 Thread Maciej Sumiński
I patched NumericEvaluator to use the system locale to pick the right decimal separator character. I have tested it on Windows and Linux, no issues found. In my opinion it is ready to be merged and could be a nice bonus for v5. Sincerely, I love this feature, so I might be a bit biased. Cheers,

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-24 Thread Maciej Sumiński
Thank you Michael, I have just updated the files and pushed to my branch. I am about to test the code on Windows and check for decimal separator character issues. Cheers, Orson On 11/24/2017 09:04 AM, Michael Geselbracht wrote: > Hi, > I have added some comments and examples to the code. The

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Michael Geselbracht
Hi Russell, the class can handle variables in two ways: NumericEvaluator eval; 1. Assignment within expressions: eval.process("x=1; y=5"); 2. Assignment from c++ code: eval.setVar("posx", -3.4); So it would be up to the dialog to add a variable to an eval object within a "focus lost" or "value

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Michael Geselbracht
Hello Jean-Pierre, I need to remember that one. But you are right of course. I will add some comments and examples. - Michael On Thu, Nov 23, 2017 at 8:54 PM, jp charras wrote: > Le 23/11/2017 à 20:45, Michael Geselbracht a écrit : > > Hi, > > I have replaced the

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Russell Oliver
Hi All, Just a query for Michael: can your parser be modified to include references to dialog variables, ie while writing an expression for y axis position, using the label posx or something would refer to the value currently within that text box? Kind Regards Russell On 24 Nov 2017 06:54, "jp

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread jp charras
Le 23/11/2017 à 20:45, Michael Geselbracht a écrit : > Hi, > I have replaced the useless file info comments by a GPLv3 header  in order to > make my "libeval" code > license-wise compatible to the Kicad project. > >  - Michael > > Thanks Michael, Could you add a bit of comments? Currently

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Maciej Sumiński
Just to be clear, these patches are not critical for the feature freeze. If I manage to get them merged before the freeze is announced - cool, otherwise we will have a reward for our dedicated nightly build testers in v6. Regards, Orson On 11/23/2017 04:28 PM, Maciej Sumiński wrote: > Ok, that

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Maciej Sumiński
Ok, that is good news. Would you share the files licensed under GPLv3? I think I can handle the rest of potential problems. Regards, Orson On 11/23/2017 04:03 PM, Michael Geselbracht wrote: > Hi, > these files were written by me. The comment blocks at the top are generated > by Eclipse ("let" is

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Wayne Stambaugh
Michael, All source code in kicad must have a license statement and that license must be compatible with the GPL3+. This is mandatory to minimize the possibility of legal repercussions. Cheers, Wayne On 11/23/2017 10:03 AM, Michael Geselbracht wrote: > Hi, > these files were written by me.

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Michael Geselbracht
Hi, these files were written by me. The comment blocks at the top are generated by Eclipse ("let" is my login name). I am afraid that the coding style is about the opposite of the rules for Kicad. But if you can use the code feel free to do so. The current implementation has some issues: 1. The

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-11-23 Thread Maciej Sumiński
We still do not have the feature freeze, so there is still a chance to shove it to the master branch. I feel a bit uneasy about exprtk (over 1 MB header file), but Michael's parser approach seems like a good solution to me. We can extend it later as the lemon format is not very complex. I took

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-08-31 Thread Russell Oliver
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 :=

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-08-31 Thread Michael Geselbracht
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"

Re: [Kicad-developers] [PATCH] Math expression support for pad editor.

2017-08-31 Thread Tomasz Wlostowski
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