70 case DEG:
return _fdValue;
72 case GRAD:
return _fdValue / 0.9;
96 static const QRegExp __qRegExp(
"^\\s*(-?\\d+(\\.\\d+)?)\\s*([^\\d\\s]*)?\\s*$" );
98 if( _pbOK ) *_pbOK =
false;
99 if( !__qRegExp.exactMatch( _rqString ) )
return 0.0;
101 double __fdValue = __qRegExp.cap(1).toDouble( &__bOK );
102 if( !__bOK )
return 0.0;
103 QString __qsUnit = __qRegExp.cap(3);
107 case RAD: __fdValue = __fdValue * 180.0 /
QVCT::PI;
break;
108 case GRAD: __fdValue = __fdValue * 0.9;
break;
111 if( _pbOK ) *_pbOK =
true;
[UI] Container for the application's settings
CUnitBearing::EUnit getUnitBearing()
[Unit] Returns the bearing format/unit
int getPrecisionBearing()
[Precision] Returns the bearing decimal precision
Container class for supported machine-friendly format/unit codes.
QMap< CUnitBearing::EUnit, QString > qMapCodes
Container class for supported human-readable format/unit symbols.
QMap< CUnitBearing::EUnit, QString > qMapSymbols
static QString toCode(EUnit _eUnit)
Returns the machine-friendly code corresponding to the given format/unit ID.
@ UNDEFINED
undefined format/unit
static const QMap< EUnit, QString > & symbols()
Returns the list of supported human-readable format/unit symbols.
static double toValue(double _fdValue, EUnit _eUnit)
Returns the converted value, using the specified format/unit.
static const CUnitBearingSymbols oUnitBearingSymbols
Container for supported human-readable format/unit symbols.
static const CUnitBearingCodes oUnitBearingCodes
Container for supported machine-friendly format/unit codes.
static double fromString(const QString &_rqString, EUnit _eUnit=UNDEFINED, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
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 EUnit fromCode(const QString &_rqsCode)
Returns the format/unit ID corresponding to the given machine-friendly code.
static EUnit fromSymbol(const QString &_rqsSymbol)
Returns the format/unit ID corresponding to the given human-readable symbol.
static QString toSymbol(EUnit _eUnit)
Returns the human-readable symbol corresponding to the given format/unit ID.
static const QMap< EUnit, QString > & codes()
Returns the list of supported machine-friendly format/unit codes.
static CSettings * useSettings()
static constexpr double PI