This change gives a better name to the parameter type that is used to
store numeric values. Before it was called length, but it can store
other quantities as well so the name is no longer fitting.
If possible we should prefer using our own classess instead of ones
coming from frameworks. This changes Style Parameters to use Base::Color
class instead of QColor. Calculations are still done using QColor but
the data is always exposed as Base::Color.
* [Core] Add Boolean Functions to expressions (AND, OR, BOOL, NOT)
* [Core] Add `if` function to expressions to overcome ternary operator limitations
* [Core] Update expressions grammar to recognize relational operations as arguments
* [Core] The `if` function has been removed as no consensus was reached regarding its convenience or necessity. Its inclusion was considered potentially confusing or redundant.
* [Core] Make boolean cast based on Confusion threshold.
* Tests: Add tests for 'Standard' backup policy
* [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>
Input hints in various DrawSketchHandler were implemented independently
using declarative mechanism with searching over lookup table. This
results in a lot of duplicated code, this commit will create generic
mechanisms that can be used to replace them.
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.
The basic tests now run on Windows correctly without needing to manually
copy any files -- the executables are output in the same location as the
necessary DLLs. However, tests that require *.pyd files (all code in the
Mod subdirectory, basically) still do not work on Windows as the test
executables cannot find those files. This is a work in progress.
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.
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")
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
* Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,anull,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,groupe,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,matc,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,re-use,re-used,re-using,rin,ro,rougly,sectionin,seperator,sergent,serie,shs,sinc,siz,som,stpo,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uupper,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./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,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`
* [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>
* Add unit tests for large digit count in unique names
* Updated to use arbitrary-precision unsigneds
Passes the new unit tests, all diagnostics, and resolves Issue 19881
* Place UnlimitedUnsigned at top level and add unit tests
* [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>