This class aims to implement Design Token idea into FreeCAD themes. It
allows themes to use generic variables with generic values so we could
use one qss theme and change the style based on values from preference
packs.
This commit fixes how origin (coordinate system) indicator looks. Before
it showed as disc, and now it shows as point which is more approperiate
given the context.
If the Python profiler is activated then transporting the dict as
exception object is broken where InteractiveInterpreter::runCode()
fails to restore it.
To fix the problem use Exception::setPyException() instead inside
the macto PY_CATCH and the generated wrapper code.
This also improves exception handling in command line mode.
Refactor Units making it constexpr, immutable, with repetition reduced.
Separate data from code.
Constexpr constructed units allow constructing predefined Quantities
from predefined unit types.
Dimensionless quantities have all exponents equal to zero.
Such quantities are simply numbers. The associated unit is
the unit one, symbol 1, although this is rarely explicitly
written.
See chapter 2.3.3 Dimensions of quantities, The International
System of Units, 9th edition.
Quantity is often queried for Unit just to see if it has a dimension.
Ask Quantity directly using isDimensionless() method and modify that
method not to care about Quantity value validity; no user was ever
asking for value validity.
Schema translation previously returned factor 0 and unit string
of input quantity if there was no translation match. Restore
that behaviour as well as returned factor and unit string of
imperial schemas.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
Introduce a new `ProgressIndicator` base class
(`ProgressIndicator.h`/`.cpp`) with a singleton-managed, no-op default
implementation matching OCCT’s `Message_ProgressIndicator` interface.
Update `CMakeLists.txt` to include the new sources.
Quantity parser is unable to deal with exponents written in
supersript, so change it back to ^n.
The micro prefix is expected to be U+00B5, not U+03BC, so change
it back as well. Note, that \x escape sequence reads till the
whitespace or the end of string, thus microFarad becomes
"\xC2\xB5""F
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
* Base: Fixed segfault on destructing cached string
Xerces default memory manager is deleted before destructing static local
variable and segfault.
---------
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
The new unit schema management is using U+2032 and U+2033 characters
for feet and inches while parser is expecting only ' and ", while
U+2032 and U+2033 are used for arcminute and arcsecond.
While this is not an ideal solution and parser should deal with both,
revert back to ASCII for now.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
Fix the transcription error which occured while moving into
single structure. Default schema now uses milimeters again.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
Return schemas name and description vectors sorted by number, so
index can be used later to select particular schema.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
Fixes: Maintaining schemas is difficult and error-prone
- Facilitate easy schemas add, remove, change, etc.
- Remove 14 files containing approx 2,190 lines of if/else code and data
- Place data in one file (UnitsSchemasData.h) using a normalized structure (including special functions)
- Isolate and simplify data operations (code)
- Remove schemas enum to keep data independent of code
- Separate responsibilities: Specifications, data, schemas, schema
- Add schema data 'isDefault'
- Add schema data name
- Prefer algorithms to raw loops
- Add schemas unit tests
- Tweak quantity unit tests