Expressions/formulas

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

Re: Expressions/formulas

Post by eivindkvedalen »

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
User avatar
pablogil
Posts: 879
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Expressions/formulas

Post by pablogil »

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: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions/formulas

Post by eivindkvedalen »

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
User avatar
pablogil
Posts: 879
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Expressions/formulas

Post by pablogil »

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 2769 times
expressions_2.png
expressions_2.png (49.62 KiB) Viewed 2769 times
expressions_3.png
expressions_3.png (63.11 KiB) Viewed 2769 times
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions/formulas

Post by eivindkvedalen »

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
Founder
Posts: 20113
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Expressions/formulas

Post by wmayer »

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
Veteran
Posts: 3515
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Expressions/formulas

Post by PrzemoF »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Expressions/formulas

Post by triplus »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Expressions/formulas

Post by triplus »

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 2584 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 2584 times
Instead this is produced:
Step3.png
Step3.png (10.69 KiB) Viewed 2584 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
Founder
Posts: 20113
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Expressions/formulas

Post by wmayer »

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
Post Reply