Commit Graph

1696 Commits

Author SHA1 Message Date
CarlOlson
7a00359fda add generated code chnages, remove unused file and add bison *.output to gitignore 2023-03-26 18:48:59 +02:00
CarlOlson
926c1253af update expression grammar to handle parens around cond 2023-03-26 18:48:59 +02:00
wmayer
07cf291516 Core: support to load old project files containing image planes
See forum: https://forum.freecad.org/viewtopic.php?p=670545#p670545
2023-03-26 13:51:07 +02:00
Chris Hennes
f5742a71ad Merge pull request #9012 from wwmayer/fix_from_string
App: in PropertyPythonObject::fromString only assign a dict to __dict…
2023-03-25 12:32:44 -05:00
Chris Hennes
54ea0108a9 Merge pull request #8974 from chennes/toponamingMappedElement
App/Toponaming: Add MappedElement
2023-03-25 10:56:55 -05:00
Chris Hennes
8b74cd3255 App/Toponaming: Add tests to MappedElement 2023-03-24 10:05:09 -05:00
wmayer
347729090a App: in PropertyPythonObject::fromString only assign a dict to __dict__ attribute 2023-03-24 14:43:38 +01:00
Syres916
2ed96078c5 [App] Urgent Backout commit cb21604
cb21604494 Humble apologies, back to the drawing board and more testing required.
2023-03-23 15:04:38 +00:00
Chris Hennes
a76ad6bbfe App/Toponaming: clang-tidy cleanup of MappedElement 2023-03-23 09:46:33 -05:00
Chris Hennes
39d2be72d4 App/Toponaming: Add MappedElement class 2023-03-23 09:46:32 -05:00
Chris Hennes
c32ee26b8d Merge pull request #8923 from Ondsel-Development/toponaming-p1-4
[Core] Create `ElementMap.h` and tests
2023-03-23 09:40:56 -05:00
Chris Hennes
633eb24f88 Merge pull request #8955 from wwmayer/issue_8556
Move image loading to core
2023-03-22 16:00:43 -05:00
Ajinkya Dahale
43858ce9ba [Core] Create ElementMap and tests
Test is a dummy for now. `ElementMap.h` only contains const values.
2023-03-22 21:53:23 +05:30
luzpaz
eb852691df Fix typos and whitespace 2023-03-22 17:10:38 +01:00
wmayer
788fe1f139 Gui: add function to scale image 2023-03-22 16:24:51 +01:00
wmayer
084f77f8be Core: move image plane to core system 2023-03-22 13:44:00 +01:00
Syres916
cb21604494 [App] Minor improvment to error handling for...
... a rare event, see https://forum.freecad.org/viewtopic.php?t=76947
2023-03-21 16:43:45 +01:00
Chris Hennes
eec8f3667e Merge pull request #8785 from Pesc0/master
Toponaming: Added MappedName class
2023-03-20 13:09:44 -04:00
Pesc0
dce458d1e8 Added all tests and minor fixes 2023-03-19 02:55:24 +01:00
Pesc0
5e5719a435 Fixed tests 2023-03-18 19:44:18 +01:00
Chris Hennes
376c94f72f App/Toponaming: Finish Doxygen comments 2023-03-18 17:59:35 +01:00
Uwe
25031a74ee [App] [skip ci] register PropertyVelocity
- was forgotten once the property was implemented some days ago
2023-03-18 05:45:45 +01:00
Florian Foinant-Willig
a290fe8ae1 Fix missing python addProperty and removeProperty of Document object 2023-03-17 10:34:32 +01:00
Chris Hennes
c02aeafad0 App/Toponaming: Begin adding Doxygen comments 2023-03-17 02:21:29 +01:00
Chris Hennes
cd6c70adcc App/Toponaming: MappedName clang-tidy cleanup 2023-03-17 02:21:29 +01:00
Pesc0
1562179bdc MappedName unit tests almost complete 2023-03-17 01:43:34 +01:00
Pesc0
62246b951a Added initial tests to MappedName 2023-03-17 01:43:34 +01:00
Pesc0
5600c564be Added MappedName class 2023-03-17 01:42:53 +01:00
Chris Hennes
44864bf525 Merge pull request #8776 from chennes/toponamingIndexedName
App: Toponaming indexed name
2023-03-14 19:21:19 -05:00
Chris Hennes
cc9387aa3f App: Clean up IndexedName and add tests
Fixes the matching algorithm when provided a vector of existing names:
The original algorithm was equivalent to a 'startswith' algorithm, when it should
have been testing for exact and complete string equality. This also does some
refactoring to rename and clarify variables and functions, simplifies some
functions by using standard library calls when possible, and addresses various
linter complaints. It also applies our current clang-format to the files.

Co-authored-by: Ajinkya Dahale <AjinkyaDahale@users.noreply.github.com>
2023-03-14 13:08:23 -05:00
wmayer
54009f14ee App: fixes #7833: Python2/3 FIXME code in App/FreeCADInit.py to be reviewed
The workaround was needed for Py2 on Windows. Since with Py3 it works as expected the workaround can be removed
2023-03-13 14:07:59 +01:00
Chris Hennes
f0fe65e769 App: Add IndexedName class
Ported from development/toponaming.
2023-03-12 11:03:52 -05:00
Abdullah Tahiri
eb7bf5d977 Gui: Remove old signal for critical messages in favour of Notification Area
===========================================================================

The former system of autoclosing messageboxes is removed in favour of the Notification Area.
2023-03-12 06:06:29 +01:00
Daniel-Khodabakhsh
827af464e3 Add various matrix related expression functions (#8603)
Adds a few new Expression functions with the goal to:

- Simplify Placement, Rotation, Vector and Matrix object creation.
- Add new matrix functions for rotation and translation.
2023-03-11 20:13:23 -06:00
wmayer
d0a23a1cd2 App: add CC 3.0 licenses 2023-03-09 12:44:14 +01:00
berniev
0a5e59adae an example of using constexpr array for data
simplifies code and removes the need for a class.
2023-03-07 23:22:44 +01:00
Abdullah Tahiri
c604d1741d Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
Abdullah Tahiri
2dac347526 App: DocumentObject - New full label member function
====================================================

Before this commit there is a function getFullName(), which
produces a string in the form document#objectname. For "document"
the real name of the document is taken, whereas for objectname it
is the initial name (Sketch, Sketch001), not the label.

The new function fo this commit, getFullLabel(), provides a string
documentlabel#documentobjectlabel, that are
probably easier to identify for end users.
2023-03-07 16:13:23 +01:00
wmayer
d03f287cf4 App: using fmtlib causes a linking failure together with boost's graphviz classes
To fix this failure a workaround is move the graphviz handling from Document.cpp to a separate source file
See also: https://github.com/FreeCAD/FreeCAD/pull/8350
2023-03-04 19:08:11 +01:00
Chris Hennes
19c7942b90 App: Minor loop cleanup in Property.h
As discussed in PR #8683
2023-02-27 23:07:27 +01:00
Uwe
4f324add9f [App] attempt to fix compiler warnings in Property.h
- "conversion from 'size_t' to 'int', possible loss of data" in for loops by modernizing the for loops
- fix warning about uninitialized variable
2023-02-27 02:20:01 +01:00
Uwe
a000dcf60a [App] sort units in FreeCADInit.py 2023-02-27 00:12:06 +01:00
Uwe
de8988049d [App] [skip ci] some comment fixes
- also a sorting fix
2023-02-26 23:19:19 +01:00
Uwe
35338171f1 [App] register all available unit properties
- was missing in #6717
2023-02-26 19:12:25 +01:00
Uwe
33f336ddd9 [App] sort properties
- to keep better the overview
2023-02-26 18:07:41 +01:00
M G Berberich
6832743262 add cbrt (cube root) to expressions (#8629)
This adds a function cbrt(arg) to the freecad-expressions that computes
the cube root of arg. Instead of arg^(1/3) this handles the units of the
argument, so that one can compute units from p.e. ml to mm.
  cbrt(27 ml) → 30 mm
instead of
  (27 ml)^(1/3) → 30
2023-02-26 17:49:58 +01:00
Uwe
2a098b1471 [Core] add missing velocity property
- fixes compilation because declared in header but no code
- also sort the properties to keep the overview
2023-02-26 16:38:02 +01:00
Oliver Oxtoby
9d5ab79a4c [App] [Base] Add missing Property classes for all Units (#6717)
- Add missing Property classes for all Units
- Add missing units to unit calculator, as well as some missing string representations
- also change units used for dynamic viscosity to the customary Pa*s
2023-02-26 15:28:28 +01:00
wmayer
1483e28ffd App: fix several Lint warnings:
* ignore bugprone-easily-swappable-parameters
* handle bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions
* handle readability-uppercase-literal-suffix
* handle readability-braces-around-statements
2023-02-26 13:30:44 +01:00
wmayer
f091ca1d37 App: fix some Lint issues:
* readability-identifier-length
* cppcoreguidelines-pro-type-member-init
2023-02-26 13:30:44 +01:00