Commit Graph

1267 Commits

Author SHA1 Message Date
WandererFan
db22476450 Merge pull request #9750 from hlorus/gsoc2023_measure
GSoC 2023: Unified Measurement Facility
2024-04-29 12:41:54 -04:00
hlorus
cb0e5b6f9c [Base] Expose type's "getModuleName" method 2024-04-29 09:27:22 -04:00
wmayer
8210e99b0c Base: Fix memory leak in Quantity::parse
If an exception is thrown then the allocated buffer won't be cleaned up. To make this exception-safe the class
StringBufferCleaner is added using the RAII idiom
2024-04-25 14:34:02 +02:00
Chris Hennes
1ec93fdbc2 Update translations
Note: Web and Start omitted
2024-04-24 13:58:21 -05:00
wmayer
6e55cd1c3a Base: Fix possible race condition when restarting the application
When restarting the application (e.g. after installing an addon) the application will be closed and a new instance will be launched. Now it can happen that the old instance is still busy writing the config files to disk while the new instance wants to read them in. At this time it's possible that a config file is in an invalid state so that the new instance will ignore it but then starts with a default configuration.
Later when closing the new instance the config files will be overwritten and destroy the user's original settings.

By using a lock file this race condition will be avoided. It uses a timeout of 1 second that should be enough for the old instance to write the files to disk.
2024-04-18 23:07:58 -05:00
Chris Hennes
6d504a0351 Update translations. 2024-04-17 16:50:38 -05:00
wmayer
0226770b4c Base: handle exceptions in ParameterGrpPy 2024-04-17 21:52:32 +02:00
wmayer
757d564a7c Tests: add more unit tests for ParameterGrp 2024-04-17 21:45:26 +02:00
Chris Hennes
0056038ff4 Toponaming/Base: Add ASCII stream output class (#13209)
* Toponaming/Base: Add ASCII stream output class

* Remove the ref from std::string

* Update based on review comments
2024-04-15 17:58:11 +02:00
wmayer
9fb2931781 Base: fix some linter warnings 2024-04-14 21:22:08 +02:00
wmayer
0b08ea3368 C++: replace deprecated vsprintf and sprintf
With future C++ compilers the methods vsprintf and sprintf are declared as deprecated due to security issues.
They are replaced with the secure counterpart of the fmt library

Fixes the compiler warnings -Wdeprecated-declarations
2024-04-03 10:04:56 +02:00
wmayer
c3f70bfa7f Base: expose a method to copy a parameter group to Python 2024-04-01 14:56:19 +02:00
wmayer
e16ccc33ce Base: expose a method to rename a parameter group to Python 2024-04-01 14:43:23 +02:00
wmayer
a0e901defd Base: Fix linter warnings in ParameterPy 2024-04-01 14:23:41 +02:00
wmayer
1d5de9d356 Base: Fix console logging macros
The notifier string must be a std::string() instead of an empty C string as otherwise the wrong methods are called so
    that all messages are sent to the void.

    This regression was caused by commit dc08aa8e0f
2024-03-31 17:38:26 +02:00
Chris Hennes
af131413c5 Update translations 2024-03-25 18:08:22 -05:00
Anurag Singh
299dab5769 Add Missing API documentation/Update API Documentation for various files. (#13062)
* Added-API-Documentation-for-RectangularTrimmedSurfacePy.xml

* Added-API-Documentation-for-PlateSurfacePy.xml

* Added-API-Documentation-for-ShapeFix.xml

* Added-Back-Missing-Docs

* Add Missing Documentation to BuildPlateSurface

* Elaborate ComplexGeoData Functions

* Elaborate ComplexGeoData Functions

* Elaborates TypePy

* Add Missing Documentation to AreaPy
2024-03-22 15:49:36 +01:00
wmayer
655d5e4fbd Base: enable user site-packages for Py >= 3.11
For more details see: https://forum.freecad.org/viewtopic.php?p=748296#p748296
2024-03-20 19:24:45 +01:00
wmayer
1775991b50 Base: Implement FileInfo::size() 2024-03-11 16:05:30 +01:00
Chris Hennes
da36c0c1f3 Merge pull request #12066 from 3x380V/time_cleanup
Base: Use std::chrono for time manipulation
2024-03-05 15:47:33 -06:00
Yorik van Havre
1e164f24c0 Translations (#12748)
* Updated ts files

* Merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-05 08:54:36 -06:00
Ladislav Michl
1677e3d105 Base: Remove StopWatch
StopWatch is now used on single place only, remove it in favour of TimeElapsed
2024-03-05 12:30:56 +01:00
Ladislav Michl
e4d304f934 Base: Implement TimeElapsed
Some instances of TimeInfo serve the sole purpose of measuring time
duration. Using system time is unfortunate as it returns wall clock,
which is not guaranteed to be monotonic. Replace such a usage with
the new TimeElapsed class based on steady clock.
2024-03-05 12:29:24 +01:00
Ladislav Michl
159fe5c21f Base: Use std::chrono for time handling
Replace platform specific implementations with standard C++ std::chrono.
As time_t is now 64-bit on all supported systems, use it to set the clock.
2024-03-05 12:22:40 +01:00
Ladislav Michl
de1305413e Base: Move currentDateTimeString out of TimeInfo
currentDateTimeString does not have anything in common
with TimeInfo class, move it into Tools.
2024-03-05 12:22:40 +01:00
bdieterm
019adbb846 Base: add missing axis and angle update for Rotation::setEulerAngles 2024-03-04 11:07:21 -06:00
Chris Hennes
b6c8f8d460 Update translations 2024-02-29 17:25:46 -06:00
mos
7e0cd689a5 [Base] remove MemDebug
removed unused Memdebug files
2024-02-26 20:38:46 -06:00
Ladislav Michl
1215301e59 Base: Fix #12061
While rebasing after f539138dd9 ("fix readability-*:") a mistake was
make, causing  exception been thrown for every file opened. While there,
invert file test existence logic, so we return early on failure.

Fixes: 95b37fa806 ("Base: Do not use else before return")
2024-02-26 17:39:33 +01:00
Chris Hennes
7f8d6e2bb1 Update translations (#12557)
* Update translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-24 21:38:37 -06:00
Chris Hennes
5d1c4caba0 Base: Rename ASCIIInputStream to TextInputStream 2024-02-21 07:31:22 +01:00
Chris Hennes
44d86f3296 Base: Add ASCIIInputStream
Based on the modifications to InputStream from the LinkStage3 fork. Needed for correct restoration of StringHasher.
2024-02-19 16:47:28 -06:00
Paddle
48173f2b9d Assembly: Implement special drag mode for revolute. 2024-02-13 08:25:46 +01:00
Adrián Insaurralde Avalos
9c3ab15ecb Base: escape quotes in Quantity::getSafeUserString
fix #12204 and fix #12206
2024-02-12 12:09:30 -06:00
Yorik van Havre
638e398bec Crowdin translations (#12313)
* updated ts files

* merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-12 11:59:08 -06:00
wmayer
b03ed3b42e Base: fix IsNormal() and IsParallel()
Fix the IsNormal() and IsParallel() methods to pass the unit tests
2024-02-12 11:58:45 -06:00
wmayer
100ab2a975 Py3.12: initialize field 'tp_watched' 2024-02-12 11:41:49 -06:00
Adrian Insaurralde Avalos
808e5d9d74 Add Base::Tools::escapeQuotesFromString with corresponding test
To be used to avoid sending unescaped quotes to python console
2024-02-04 16:44:25 -06:00
marioalexis
c2fbee6be4 Base: Add stiffness per unit area unit 2024-01-26 13:44:16 -03:00
Ladislav Michl
f1fdd2e2a9 Base: Replace if else with switch statement 2024-01-21 16:14:12 +01:00
Ladislav Michl
95b37fa806 Base: Do not use else before return 2024-01-21 16:14:12 +01:00
Ladislav Michl
915bfd3dde Base: Use std::recursive_mutex 2024-01-21 16:14:12 +01:00
pre-commit-ci[bot]
dd1db1e23e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-13 09:59:54 -05:00
edi271
6b68344af8 [TD] extend App.Vector API 2024-01-13 09:59:54 -05:00
edi271
14c536b453 [TD] extend Base::Vector3D 2024-01-13 09:59:54 -05:00
edi271
9a9803c9f9 [base] Extend Vector by isParallel function 2024-01-13 09:59:54 -05:00
Catalin MARINCIA
4813b9297b Build: Fix visibility of fields in Reader.h to be compiled with GCC 13 toolchain 2024-01-08 18:32:40 +01:00
sliptonic
88e186f305 Merge pull request #11779 from hasecilu/second_unit
[Base/Units] Change strings' description
2024-01-08 11:10:22 -06:00
Alex Neufeld
8936a4bd1b Fix Rotation constructor error msg 2024-01-05 11:10:10 -06:00
Chris Hennes
1d2186b7d6 Update translations (#11886)
* Update translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-03 09:27:18 -06:00