implementing UnitsCalculator and disable changes in Sketcher
This commit is contained in:
@@ -120,6 +120,35 @@ double Quantity::getUserPrefered(QString &unitString)const
|
||||
return Base::UnitsApi::schemaPrefUnit(_Unit,unitString).getValue() * _Value;
|
||||
}
|
||||
|
||||
std::string Quantity::getUserString(void)const
|
||||
{
|
||||
std::stringstream sstream;
|
||||
sstream << _Value << _Unit.getString();
|
||||
//TODO: implementing
|
||||
return sstream.str();
|
||||
}
|
||||
|
||||
/// true if it has a number without a unit
|
||||
bool Quantity::isDimensionless(void)const
|
||||
{
|
||||
return _Value != DOUBLE_MIN && _Unit.isEmpty();
|
||||
}
|
||||
// true if it has a number and a valid unit
|
||||
bool Quantity::isQuantity(void)const
|
||||
{
|
||||
return _Value != DOUBLE_MIN && !_Unit.isEmpty();
|
||||
}
|
||||
// true if it has a number with or without a unit
|
||||
bool Quantity::isValid(void)const
|
||||
{
|
||||
return _Value != DOUBLE_MIN ;
|
||||
}
|
||||
|
||||
void Quantity::setInvalid(void)
|
||||
{
|
||||
_Value = DOUBLE_MIN ;
|
||||
}
|
||||
|
||||
// === Parser & Scanner stuff ===============================================
|
||||
|
||||
// include the Scanner and the Parser for the Quantitys
|
||||
|
||||
Reference in New Issue
Block a user