Commit Graph

76 Commits

Author SHA1 Message Date
wmayer
44f42a8e2c LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
wmayer
51585ac4a1 Coverity: Not restoring ostream format 2020-07-20 17:34:29 +02:00
wmayer
6dc9a89d97 Coverity: Empty virtual destructor 2020-07-20 17:34:27 +02:00
wmayer
aa3fde2dae Coverity: Big parameter passed by value 2020-07-20 17:34:25 +02:00
wmayer
6e00846cdd PVS: V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing. 2020-07-18 10:59:28 +02:00
wmayer
53a4cb9919 PVS: V501 There are identical sub-expressions to the left and to the right 2020-07-18 10:59:27 +02:00
wmayer
89ddab33f6 Expression: move handling of invalid quantities (NaN) from FunctionExpression to DlgExpressionInput 2020-06-07 18:00:35 +02:00
wmayer
45c2e5cb21 App: [skip ci] throw an exception if the expression gives NaN 2020-06-06 13:04:01 +02:00
Zheng, Lei
3beb1bff21 App: improve FunctionExpression forward compatibility
Remove runtime check when constructing FunctionExpression, in order to
support future built-in function. Exception will be thrown when
evaluating the expression to inform user about the error.
2020-06-03 22:18:39 +02:00
wmayer
300e887480 Handle clang 10 warnings:
+ fix -Wtautological-bitwise-compare
+ fix -Wimplicit-int-float-conversion
+ fix -Wmisleading-indentation
+ fix -Wrange-loop-construct
+ suppress -Wdeprecated-copy of 3rd party libs
2020-05-25 15:34:43 +02:00
wmayer
338bf2ca3a App: [skip ci] reduce number of digits by 1 to display a NumberExpression
See also: https://forum.freecadweb.org/viewtopic.php?f=3&t=44057
2020-03-11 10:31:28 +01:00
Zheng, Lei
d5a4996d25 App: fix Expression _moveCells()
The problem is caused by not refreshing ObjectIdentifier internal cache
after change.
2019-12-31 15:23:03 +01:00
luz.paz
4f308dc03c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
wmayer
fd741e4338 check returned value of PyUnicode_AsUTF8() before passing to a std::string to avoid possible segfaults 2019-12-09 12:23:58 +01:00
Zheng, Lei
13fd54a42f App: fix pyObjectToAny() in Python3 2019-12-09 00:37:34 +00:00
luz.paz
379d041664 Fix typos and some trailing whitespace
Found via:  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2019-12-03 12:22:59 +01:00
Zheng, Lei
71c54272a0 Fix various Py::Object leak 2019-10-08 17:53:20 +02:00
Zheng, Lei
44354b808b App: add Expression built-in function mscale/minvert/create
mscale(matrix,vector|tuple) for scaling matrix

minvert(matrix|placement|rotation) for inverting matrix, placement or
rotation

create(type,arg...) for creating Python object of given type (currently
only support 'matrix', 'placement', 'rotation', 'vector'
2019-10-07 17:24:30 +02:00
Zheng, Lei
a1417c5ffa App: extend Expression syntax
* Support sub-object reference syntax using the following syntax,
    Part.<<Box.>>.Placement
  or, with sub-object label referencing
    Part.<<$Cube.>>.Placement

* Extend indexing support, including range based indexing, e.g.
    A1[B2+1][C3][D4:-1]

* Add new constants, None, True, true, False, false.
2019-09-28 15:31:24 +02:00
Zheng, Lei
22fede14d8 App: add list/tuple() function to Expression
For easy creation of Python list/tuple using expression. Range
expression can now be expanded into list or tuple.
2019-09-28 15:30:55 +02:00
Zheng, Lei
ea7eee8061 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
Zheng, Lei
d141975701 App: use Python number protocol in Expression
This adds support to do mul/div with matrix and vector, as well as
Python formated string with operator %.
2019-09-28 15:30:34 +02:00
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
wmayer
3e6ae0d027 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-private-field
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:51:51 +02:00
Zheng, Lei
ce30645b39 Fix typos pathes -> paths 2019-08-17 15:32:49 +02:00
Zheng, Lei
e0799e2bb3 Expression: fix python object evaluation 2019-08-17 15:32:48 +02:00
Zheng, Lei
93e60caa35 PropertyExpressionEngine: convert to link type property
PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
2019-08-17 14:52:09 +02:00
Yorik van Havre
057c79c11c Doxygen tweaks 2019-07-17 18:01:56 -03:00
wmayer
85270f5cd3 Fix a couple of clang compiler warnings:
-Wunused-variable
-Winconsistent-missing-override
-Wdelete-non-virtual-dtor
-Wunused-private-field
-Wformat
2019-06-23 15:19:12 +02:00
luz.paz
c985f9ee79 Misc typos and whitespace fixes
Found via `codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*`
2019-03-31 11:42:36 +02:00
wmayer
183cd16263 Fix precision of NumberExpression when writing to a string (reverts a3af2902ef)
See also: https://forum.freecadweb.org/viewtopic.php?f=3&t=34392
2019-02-23 14:34:14 +01:00
luz.paz
6e64b4f75d Misc. typos 2018-05-19 12:06:34 -04:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
Eivind Kvedalen
ae7bef9978 Expressions: Fixed issue #3432; aggregate functions sometimes ignore some of their arguments.
Also updated regression tests in Spreadsheet module.
2018-04-21 22:33:54 +02:00
Eivind Kvedalen
0574ac37ed Spreadsheet/Expressions: Fixed issue #3363. 2018-03-25 11:53:35 +02:00
wmayer
7480544967 fix typo 2018-03-11 18:34:18 +01:00
luz.paz
bbfbb0e7d3 Misc. comment typos 2018-01-14 12:11:35 -02:00
Unknown
a8ecffb652 Misc. typo fixes
Various workbenches
2017-12-23 14:30:30 +01:00
wmayer
532d9b230b fix coverity issue 2017-11-18 16:30:27 +01:00
Eivind Kvedalen
2e96d9bf95 Fixed issue #2877: Added hypot() and catet() functions to expression framework. 2017-07-20 18:57:31 +02:00
Eivind Kvedalen
72dd6dfd9a Expressions: Fixed issue #3128; mod(x;y) should support arbitrary units for both arguments. 2017-07-13 12:20:31 +02:00
wmayer
1673ab801e use specialized exception classes 2017-04-28 18:49:11 +02:00
Eivind Kvedalen
338ca55622 Spreadsheet: Fixed issue #2894: Unit strings could be used as aliases. 2017-03-07 13:45:53 -03:00
Kunda
3017173c9a source typo fixes pt6 2017-03-07 13:43:46 -03:00
wmayer
33e0bc3a46 fix various warnings 2017-02-02 20:42:56 +01:00
Eivind Kvedalen
4750bd40dd Expressions: Generalized FunctionExpression::simplify(...) function. 2017-02-02 10:27:29 +01:00
Eivind Kvedalen
0d6f777099 Expressions: Fixed issue #2879. 2017-02-02 10:27:29 +01:00
wmayer
efe14610b7 fix & suppress warnings of generated code 2016-12-30 13:31:31 +01:00
Eivind Kvedalen
25c56b7864 Spreadsheet: Fix for issue #2646: Spreadsheet-Sum-Function does not work with units
This fix also fixes the other aggregates.
2016-12-15 17:27:18 +01:00
Eivind Kvedalen
de27adbefa Spreadsheet: Fix for issue #2647, stddev does not work with arrays. 2016-12-15 17:27:18 +01:00