Commit Graph

35 Commits

Author SHA1 Message Date
bofdahof
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
2025-04-27 00:45:54 +02:00
Benjamin Bræstrup Sayoc
dda05369c4 Base: remove unneeded includes 2025-02-18 11:07:57 -06:00
Ladislav Michl
4d6ed9d531 Base: UnitsSchema: return std::string 2024-12-23 17:48:42 +01:00
hasecilu
af6477205b [Base/Units] Change strings' description
Affect strings presented to the user on the combobox to select unit system.

- The symbol to represent angles on "degree" unit is '°'
- Change imperial velocity to "ft/s" to enforce the use of 's' symnbol as second
2023-12-19 16:35:22 -06:00
wmayer
08b10cd287 fix cppcoreguidelines-*
* cppcoreguidelines-init-variables
* cppcoreguidelines-c-copy-assignment-signature
* cppcoreguidelines-macro-usage
* cppcoreguidelines-non-private-member-variables-in-classes
* cppcoreguidelines-pro-type-member-init
* cppcoreguidelines-slicing
* cppcoreguidelines-special-member-functions
* cppcoreguidelines-virtual-class-destructor
2023-11-16 01:22:09 +01:00
pre-commit-ci[bot]
6a66034ce2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-11-16 00:24:09 +01:00
wandererfan
7194c29a81 [Units]Add Meters-only schema (#7395)
- use correct unit for velocity

- typo in include guard
2023-11-16 00:24:09 +01:00
wmayer
e85c383bff Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
2bc90e6090 Base: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wandererfan
7745a5aca0 [Units]Allow querying schema for unit of measure 2022-11-19 16:49:46 +01:00
wmayer
9381a8b2fb Base: make isMultiUnitLength() and isMultiUnitAngle() const 2022-09-01 17:07:30 +02:00
wandererfan
16ff6dfbbb [Base]identify schemas which use multiple units
- allow querying a schema to determine if it uses multiple
  units for length (ex ft/in) or angles (ex DMS).
2022-08-31 16:31:27 -04:00
berniev
8aff4a7503 Base: Modernise ctors dtors defs etc 2022-08-02 12:37:46 +02:00
Uwe
9ec0bcdcf2 [Base] Units and Uui: remove unused includes 2022-02-24 11:08:56 +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
luz paz
d5f6c096b8 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
Bernd Hahnebach
7852957623 Base: add new unit schema for mm and N for use in FEM 2020-08-07 19:19:44 +02: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
wmayer
4bcb43ebd2 Base: [skip ci] make UnitSystem an enum class 2019-12-21 10:10:19 +01:00
wandererfan
00e6e376c9 Add ImperialCivil Units Schema
- units for civil engineering - ft, ft2, ft3, mph,
  and angles as degrees/minutes/seconds
2018-12-06 08:57:17 -03:00
wmayer
892e78d445 extend Python api of units:
+ get list of all available schemas
+ get currently set schema
+ translate a quantity to a given schema
2017-08-13 16:55:00 +02:00
Itai Nahshon
29ff650f65 Spelling 2017-07-18 17:41:51 +02:00
Itai Nahshon
a91c5bbae7 Add UnitsSchemaMmMin - izes are only in mm, speed in mm/munute. 2017-07-18 17:41:36 +02:00
wmayer
f39b89a54d add class QuantityFormat to control user string of Quantity
do some code refactoration to reduce duplicate code
2016-08-06 19:06:29 +02:00
wmayer
6176756b28 use const reference in schemaTranslate to avoid tmp. copy 2016-08-05 10:33:41 +02:00
wmayer
5cb8873794 improve whitespaces, fix typos 2016-08-05 10:00:12 +02:00
Yorik van Havre
ad92a2df25 Added new units schema: US building (feet + inches + fraction) 2016-05-26 20:37:53 -03:00
Yorik van Havre
ee9452a8ee Added new units schema: Building Euro (everything in centimeters, areas/volumes in meters) 2016-05-25 19:10:48 -03:00
wmayer
2d4110b0f3 + Better support of clang, fix issues discovered by clang 2014-05-05 18:25:59 +02:00
jriegel
aa5a2e1b3f New Unit-Schema ImperialDecimal 2014-04-15 18:25:00 +02:00
jriegel
eb5cc8ed6c Implement the three major unit system schemas 2013-12-05 18:16:31 +01:00
jriegel
87c4741fac new userString methode 2013-12-03 19:03:12 +01:00
jriegel
3a3afa0783 Switching the UnitsApi to the new Quantity system 2013-12-03 19:03:08 +01:00
jriegel
44c07da571 integrate Quantities into PropertyView and activate preferences again 2013-09-25 21:59:24 +02:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00