Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Units]Add Meters-only schema (#7395) #11365

Merged
merged 3 commits into from Nov 15, 2023
Merged

Conversation

WandererFan
Copy link
Contributor

This PR implements a solution for #7395.

Additional forum discussion:
https://forum.freecad.org/viewtopic.php?t=71365
https://forum.freecad.org/viewtopic.php?t=59635

@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Nov 12, 2023
@luzpaz luzpaz added the Units Issue related to units of measurement label Nov 13, 2023
}
else if (unit == Unit::Velocity) {
// metres per second
unitString = QString::fromLatin1("m/sec");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sec" is not a valid SI unit. It must be "s" (https://en.wikipedia.org/wiki/Second). In case the faulty string is used in an expression an error is raised: App.Units.parseQuantity("2m/sec")

Traceback (most recent call last):
File "", line 1, in
ValueError: invalid unit expression

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit string changed to "m/s".

*/

#ifndef BASE_UNITSSCHEMAMETERS_H
#define BASE_UNITSSCHEMAMETERs_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo. The #define is different to the #ifndef

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

- use correct unit for velocity

- typo in include guard
@wwmayer wwmayer merged commit 6a66034 into FreeCAD:main Nov 15, 2023
7 checks passed
@WandererFan WandererFan deleted the metreSchema branch March 7, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Units Issue related to units of measurement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants