Expressions/formulas

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
eivindkvedalen
Posts: 600
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions/formulas

Postby eivindkvedalen » Fri Sep 25, 2015 6:14 am

quick61 wrote:Thanks rockn, I was just about to make a post about that my own self. I first noticed it a couple of days ago, but senes everything seemed to be working OK, I figured it was some nonconsequential oversight in the config files or some such. But with it still showing up, I was going to mention it. Lucky i saw this post first. :)

Mark
This file has been moved into the Gui directory, but some relics of it is still left. This can safely be removed from the make system. I think this is actually true for the whole Spreadsheet/Resources directory.

Eivind
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Expressions/formulas

Postby pablogil » Fri Sep 25, 2015 3:19 pm

I was finally able to compile on OSX using a fresh install folder...
I got hundreds of warnings (full compile log: https://www.dropbox.com/s/1v3edydsn2m5o ... g.txt?dl=0)
But it compiled successfully and I have it working with the new expressions system: it's so cool, I like it and it's so useful for engineers as me that love to parametrize everything =)
THANK YOU!!

Anyway, I prefer ickby GUI, it's cleaner... (would it be "themable" with Qt?)
Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
eivindkvedalen
Posts: 600
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions/formulas

Postby eivindkvedalen » Sat Sep 26, 2015 1:27 pm

pablogil wrote:I was finally able to compile on OSX using a fresh install folder...
I got hundreds of warnings (full compile log: https://www.dropbox.com/s/1v3edydsn2m5o ... g.txt?dl=0)
But it compiled successfully and I have it working with the new expressions system: it's so cool, I like it and it's so useful for engineers as me that love to parametrize everything =)
THANK YOU!!
Thanks :)

I see that clang gives other warnings than gcc. Some of them are salomemesh, that we just accept as warnings for the time being, but there are also lots of lots of warnings coming from overloading the setValue function. I'll install clang so I can test some more myself.

Eivind
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Expressions/formulas

Postby pablogil » Sun Sep 27, 2015 11:02 am

I'm sorry to tell you that it's not working properly in OSX:
the Expressions popup goes below the normal "numeric dimmension" popup window so it's not possible to edit it because once you move the original popup you can never go again into the expressions popup...
expressions_1.png
expressions_1.png (36.53 KiB) Viewed 1453 times
expressions_2.png
expressions_2.png (49.62 KiB) Viewed 1453 times
expressions_3.png
expressions_3.png (63.11 KiB) Viewed 1453 times
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
eivindkvedalen
Posts: 600
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions/formulas

Postby eivindkvedalen » Mon Sep 28, 2015 8:37 pm

Hi,

A set of small fixes available for merging/cherry-picking eb3b170..2b0b147 available at https://github.com/eivindkv/free-cad-co ... ions_fixes (forced update since last time).

2b0b147 PartDesign: bugfix, invoke ui->spinOccurrences->apply().
f48227c PartDesign: Replaced QuantitySpinBox by SpinBox for "occurrences" input field.
6b32d81 SpinBox: Added expression binding functionality.
393fa09 QuantitySpinBox: Moved getIcon() and some data members to ExpressionBinding class.
ca9c7a9 QunatitySpinBox: Removed unused code.
1838ac9 Removed PropertyExpressionEngine::getPaths() method.
82d88e2 Added various options to silence warnings when compiling salomemesh with clang.
6f3d7ab Spreadsheet: Fixed too liberal decoding of cell addresses.
eb3b170 QuantitySpinBox: Fixed layout when expression icon is not shown (issue #2272).

eb3b170 is suggested fix from me, not sure what status is in that issue now.

82d88e2 silences most warnings when compiling with clang. However, clang generates TONS of -Woverloaded-virtual warnings. These are mostly in the Property system, and I'm not really sure what to do about them. According to http://www.stroustrup.com/bs_faq2.html#overloadderived one can use 'using' to import functions into the class scope to avoid this warnings, but this is a huge job to do.

Eivind
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: Expressions/formulas

Postby wmayer » Wed Sep 30, 2015 2:38 pm

Merged.
eb3b170 is suggested fix from me, not sure what status is in that issue now.
This could be ignored because ickby's changes solved this issue already.

When going through this thread again the remaining issues are:
* a more comfortable completion
* a faster way to define a variable in a cell
* the OSX behaviour mentioned above [fixed]
User avatar
PrzemoF
Posts: 2660
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Expressions/formulas

Postby PrzemoF » Wed Sep 30, 2015 5:34 pm

I just played for the first time with the expressions and I'm really impressed!

Should I report bugs/crashes or it's too early for it?
triplus
Posts: 8854
Joined: Mon Dec 12, 2011 4:45 pm

Re: Expressions/formulas

Postby triplus » Wed Sep 30, 2015 6:34 pm

PrzemoF wrote:I just played for the first time with the expressions and I'm really impressed!

Should I report bugs/crashes or it's too early for it?
Yes you should report. Here or on issue tracker or i am guessing after the merge new thread for discussing about expression support in FreeCAD will make sense.
triplus
Posts: 8854
Joined: Mon Dec 12, 2011 4:45 pm

Re: Expressions/formulas

Postby triplus » Fri Oct 02, 2015 4:30 pm

I could be wrong but i think this might be (in master) expressions merge related issue ( issue #0002286):
Step1.png
Step1.png (10.89 KiB) Viewed 1268 times
User decides to change 2 constraints (100 -> 120 and 10 -> 12). This is the expected result:
Step2.png
Step2.png (10.42 KiB) Viewed 1268 times
Instead this is produced:
Step3.png
Step3.png (10.69 KiB) Viewed 1268 times
To get expected result user has to input -120 and -12 values instead. Note that this is a bit random and sometimes (different set of constraints used) everything works as expected.
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: Expressions/formulas

Postby wmayer » Fri Oct 02, 2015 5:28 pm

I see that clang gives other warnings than gcc. Some of them are salomemesh, that we just accept as warnings for the time being, but there are also lots of lots of warnings coming from overloading the setValue function. I'll install clang so I can test some more myself.
The vast majority of these warnings are created because of this in the Property base class:

Code: Select all

    /// Set value of property
    virtual void setValue(const App::ObjectIdentifier & path, const boost::any & value);

    /// Get value of property
    virtual const boost::any getValue(const App::ObjectIdentifier & path) const;
So, most of the warnings can be easily fixed by renaming the methods to setPathValue/getPathValue

EDIT:
git commit e4768c1