70 case M_S:
return _fdValue;
71 case KM_H:
return _fdValue * 3.6;
72 case MI_H:
return _fdValue * 2.23693629205;
73 case KT:
return _fdValue * 1.94384449244;
98 static const QRegExp __qRegExp(
"^\\s*(-?\\d+(\\.\\d+)?)\\s*([^\\d\\s]*)?\\s*$" );
100 if( _pbOK ) *_pbOK =
false;
101 if( !__qRegExp.exactMatch( _rqString ) )
return 0.0;
103 double __fdValue = __qRegExp.cap(1).toDouble( &__bOK );
104 if( !__bOK )
return 0.0;
105 QString __qsUnit = __qRegExp.cap(3);
109 case KM_H: __fdValue = __fdValue / 3.6;
break;
110 case MI_H: __fdValue = __fdValue / 2.23693629205;
break;
111 case KT: __fdValue = __fdValue / 1.94384449244;
break;
114 if( _pbOK ) *_pbOK =
true;
[UI] Container for the application's settings
int getPrecisionSpeed()
[Precision] Returns the speed decimal precision
CUnitSpeed::EUnit getUnitSpeed()
[Unit] Returns the speed format/unit
Container class for supported machine-friendly format/unit codes.
QMap< CUnitSpeed::EUnit, QString > qMapCodes
Container class for supported human-readable format/unit symbols.
QMap< CUnitSpeed::EUnit, QString > qMapSymbols
static const QMap< EUnit, QString > & symbols()
Returns the list of supported human-readable format/unit symbols.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static double fromString(const QString &_rqString, EUnit _eUnit, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static QString toCode(EUnit _eUnit)
Returns the machine-friendly code corresponding to the given format/unit ID.
static double toValue(double _fdValue, EUnit _eUnit)
Returns the converted value, using the specified format/unit.
static QString toSymbol(EUnit _eUnit)
Returns the human-readable symbol corresponding to the given format/unit ID.
static const CUnitSpeedCodes oUnitSpeedCodes
Container for supported machine-friendly format/unit codes.
static EUnit fromSymbol(const QString &_rqsSymbol)
Returns the format/unit ID corresponding to the given human-readable symbol.
static EUnit fromCode(const QString &_rqsCode)
Returns the format/unit ID corresponding to the given machine-friendly code.
static const CUnitSpeedSymbols oUnitSpeedSymbols
Container for supported human-readable format/unit symbols.
@ UNDEFINED
undefined format/unit
@ KM_H
kilometers per hour [km/h]
@ MI_H
statute miles per hour [mi/h]
@ KT
nautical miles per hour (knots) [kt]
@ M_S
meters per second [m/s]
static const QMap< EUnit, QString > & codes()
Returns the list of supported machine-friendly format/unit codes.
static CSettings * useSettings()