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
Conversation
src/Base/UnitsSchemaMeterDecimal.cpp
Outdated
} | ||
else if (unit == Unit::Velocity) { | ||
// metres per second | ||
unitString = QString::fromLatin1("m/sec"); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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".
a40cbba
to
aaeb2bc
Compare
src/Base/UnitsSchemaMeterDecimal.h
Outdated
*/ | ||
|
||
#ifndef BASE_UNITSSCHEMAMETERS_H | ||
#define BASE_UNITSSCHEMAMETERs_H |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
a78a00e
to
2cc6a5a
Compare
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