Commit Graph

57 Commits

Author SHA1 Message Date
wmayer
020bf1789a Base: expose enum NumberFormat to Python 2022-08-15 11:12:53 +02:00
wmayer
c955372ecf cppcoreguidelines-pro-type-union-access
According to https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md using union for type-punning is undefined behaviour.
 Replace it with std::memcpy
2022-06-24 14:29:50 +02:00
wmayer
cbc0bfc24d Base: cosmetic changes 2022-05-12 17:49:55 +02:00
wmayer
882e34f2ce Base: modernize C++11
* use nullptr
2022-03-23 16:57:25 +01:00
wmayer
e4435cdcba Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
2022-03-06 23:49:30 +01:00
Uwe
f20840442f [Base] Quantity, Rotation, Stream: remove unused includes 2022-03-01 11:27:54 +01:00
wmayer
4d87039635 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01:00
wmayer
88ded38ca1 Base: only handle Base::ParserError exceptions for quantity expressions 2022-01-22 01:15:12 +01:00
wmayer
fb84f715fa Base: extend Python wrapper to allow to create a quantity with Units.Quantity(1, 'm') and add a unit test 2022-01-21 14:57:49 +01:00
luz paz
142c2c2c4d Base: remove Py2 code 2021-04-26 09:23:58 +02:00
wmayer
7f01c558df Py: fix memory leak 2021-04-12 00:06:00 +02:00
luz paz
d5f6c096b8 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
c165edd52c Base: [skip ci] implement method Quantity.toStr() to control string representation 2020-02-29 22:51:55 +01:00
wmayer
9c154f705c Base: [skip ci] improve repr() for quantity
https://forum.freecadweb.org/viewtopic.php?f=10&t=43718
https://forum.freecadweb.org/viewtopic.php?f=10&t=43431&p=369556#p369575
2020-02-29 00:20:21 +01:00
wmayer
1c8d0d1d84 Base: [skip ci] support of __round__ of QuantityPy 2020-02-16 21:50:06 +01:00
luz.paz
6f11ed298a src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
Zheng, Lei
71c54272a0 Fix various Py::Object leak 2019-10-08 17:53:20 +02:00
Zheng, Lei
6b6c0a503c App: fix QuantityPy __add__ and __sub__ 2019-09-28 15:32:12 +02:00
Zheng, Lei
783947ecd4 Base: improve base python object number protocol 2019-09-28 15:30:23 +02:00
wmayer
a6a9c15c4c disable commit e3793e6c 2019-02-19 22:28:46 +01:00
wmayer
e3793e6c88 use format options when using repr() on a quantity 2019-02-19 13:46:22 +01:00
wmayer
1081403d21 Expose some standard units and quantities to Python 2019-02-12 15:12:19 +01:00
wmayer
83f61b4372 implement true divide handler of the number protocol for Quantity 2018-10-27 15:27:27 +02:00
wmayer
189a729027 extend QuantityFormat to set denominator independent of user settings 2018-09-17 12:38:46 +02:00
wmayer
9ec4d83682 missing call to clear error indicator 2018-06-04 17:48:10 +02:00
wmayer
1cbc20b0b1 fix conversion factors for psi and ksi 2018-03-31 15:43:16 +02:00
wmayer
8c7bb0cd55 fix warning 2017-11-14 21:47:56 +01:00
wmayer
533a78026a add method toFormat to get number format from character 2017-08-20 18:50:13 +02:00
wmayer
a51b2f6ce7 fix Py3 issue 2017-07-25 01:07:09 +02:00
wmayer
e20975c2ef add attribute to control format of a quantity via Python 2017-07-24 22:47:10 +02:00
Yorik van Havre
2becb8a0e8 py3: Base: files I-R ported to python3
PyObjectBase.cpp and PyObjectBase.h not included
issue 0000995
2017-05-18 16:00:05 +02:00
wmayer
9fe82bfbb9 fixes #0002460: Use keyword 'explicit' for Quantity constructor 2016-11-05 23:21:42 +01:00
wmayer
f408f3180b fix -Wextra in FreeCADBase 2016-09-21 15:02:02 +02:00
wmayer
948bd3f646 + fixes #0002554: Py Quantity Constructor Angles 2016-05-14 19:30:43 +02:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
Sebastian Hoogen
f2367c6c19 bugfix in unit parser
partly revert to 810fadab23
and change python string handling to "et" method
2014-10-05 14:44:04 -03:00
Sebastian Hoogen
6ad50db01b fixes #1744 Use unicode in Unit system 2014-09-20 08:58:06 +02:00
wmayer
a1da4bb4fb + fixes #0001619: Python script generating 3D model works in V0.13, error in V0.14 2014-07-27 14:08:31 +02:00
wmayer
8aec46fbaf + support comparison with double in quantity number protocol 2014-07-14 17:17:41 +02:00
wmayer
75e5d5f3ac + Fix broken unit tests 2014-02-25 15:24:10 +01:00
wmayer
3ce05cd4ff + fixes #0001410: Base::Quantity::getValueAs does not properly check the dimension 2014-02-14 17:14:39 +01:00
wmayer
a3056b9d32 + fixes #0001409: implement FreeCAD.Units.Quantity().__float__() 2014-02-14 14:50:01 +01:00
wmayer
98bab1ebbe + extend number protocol 2014-02-14 12:46:30 +01:00
jriegel
d5d9ea9c30 Add unti support to Sketcher 2013-12-15 22:47:47 +01:00
jriegel
9efcb3969a fix user preferred 2013-12-10 23:32:25 +01:00
jriegel
401cb13035 Switching Quantity parser to UTF8 2013-12-09 23:50:52 +01:00
jriegel
cfa7045408 Some fixes in unit system 2013-12-08 19:48:13 +01:00
jriegel
75216d9d8c some fixes in quantity 2013-12-06 23:26:42 +01:00
jriegel
272e60671b some fixes and comparison interface for Unit and Quantity python objects 2013-12-06 00:06:58 +01:00
jriegel
eb5cc8ed6c Implement the three major unit system schemas 2013-12-05 18:16:31 +01:00