swift
Loading...
Searching...
No Matches
swift::misc::physical_quantities::CSpeedUnit Class Referencefinal

Specialized class for speed units (m/s, ft/s, NM/h). More...

#include <units.h>

Inheritance diagram for swift::misc::physical_quantities::CSpeedUnit:
[legend]

Public Types

using base_type = CMeasurementUnit
 Base type.
Public Types inherited from swift::misc::mixin::Index< CSpeedUnit >
enum  ColumnIndex
 Base class enums. More...

Public Member Functions

 CSpeedUnit ()
 Default constructor, required for Qt Metasystem.
 CSpeedUnit (std::nullptr_t)
 Null constructor.
void unmarshallFromDbus (const QDBusArgument &argument)
 Unmarshall without begin/endStructure, for when composed within another object.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit
 CMeasurementUnit (const Data &&)=delete
 Constructor saves the address of its argument, so forbid rvalues.
QString convertToQString (bool i18n=false) const
 Cast as QString.
void marshallToDbus (QDBusArgument &argument) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &)
 Unmarshall without begin/endStructure, for when composed within another object.
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &)
 Unmarshal a value from a QDataStream.
QString getName (bool i18n=false) const
 Name such as "meter".
QString getSymbol (bool i18n=false) const
 Unit name such as "m".
bool endsStringWithNameOrSymbol (const QString &candidate, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
 Does a string end with name or symbol? E.g. 3meter, 3m, 3deg.
double roundValue (double value, int digits=-1) const
 Rounded value.
double roundToEpsilon (double value) const
 Rounded to the nearest CMeasurementUnit::getEpsilon.
virtual QString makeRoundedQString (double value, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
 Rounded string utility method, virtual so units can have specialized formatting.
virtual QString makeRoundedQStringWithUnit (double value, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
 Value rounded with unit, e.g. "5.00m", "30kHz".
double getEpsilon () const
 Threshold for comparions.
int getDisplayDigits () const
 Display digits.
double convertFrom (double value, const CMeasurementUnit &unit) const
 Convert from other unit to this unit.
bool isEpsilon (double value) const
 Is given value <= epsilon?
bool isNull () const
 Is unit null?
Public Member Functions inherited from swift::misc::mixin::String< CMeasurementUnit >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.
Public Member Functions inherited from swift::misc::mixin::Icon< CMeasurementUnit >
CIcons::CIcons::StandardIconUnknown16 toIcon () const
 As icon, not implemented by all classes.
Public Member Functions inherited from swift::misc::mixin::MetaType< CSpeedUnit >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::Index< CSpeedUnit >
CPropertyIndexList apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
 Update by variant map.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CSpeedUnit &compareValue) const
 Compare for index.
bool equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const
 Is given variant equal to value of property index?

Static Public Member Functions

static CSpeedUnit defaultUnit ()
 Default unit.
static CSpeedUnit nullUnit ()
 Null unit.
static CSpeedUnit m_s ()
 Meter/second m/s.
static CSpeedUnit kts ()
 Knots.
static CSpeedUnit NM_h ()
 Nautical miles per hour NM/h (same as kts).
static CSpeedUnit ft_s ()
 Feet/second ft/s.
static CSpeedUnit ft_min ()
 Feet/min ft/min.
static CSpeedUnit km_h ()
 Kilometer/hour km/h.
static const QList< CSpeedUnit > & allUnits ()
 All units.
Static Public Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit
template<class U>
static U unitFromSymbol (const QString &symbol, bool strict=true)
 Unit from symbol.
template<class U>
static const QStringList & allSymbols ()
 All symbols.
template<class U>
static const QStringList & allSymbolsLowerCase ()
 All symbols case insensitive.
template<class U>
static bool hasCaseSensitiveSymbols ()
 Are symbols case sensitive?
template<class U>
static bool isValidUnitSymbol (const QString &symbol)
 Valid unit symbol?
template<class U>
static bool isValidUnitSymbol (const QString &symbol, Qt::CaseSensitivity caseSensitivity)
 Valid unit symbol?
template<class U>
static bool containsValidUnitSymbol (const QString &candidate, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
 Contains valid unit symbol?
template<class U>
static bool endWithValidUnitSymbol (const QString &candidate, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
 Ends with valid unit symbol?
static CMeasurementUnit None ()
 Dimensionless unit.
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CSpeedUnit >
static void registerMetadata ()
 Register metadata.

Additional Inherited Members

Protected Types inherited from swift::misc::physical_quantities::CMeasurementUnit
using ConverterFunction = double (*)(double)
 Pointer to function for converting between units.
Protected Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit
 CMeasurementUnit (const Data &data)
 Constructor.
 ~CMeasurementUnit ()=default
 Destructor.
 CMeasurementUnit (const CMeasurementUnit &)=default
 Copy constructor.
CMeasurementUnit & operator= (const CMeasurementUnit &)=default
 Copy assignment operator.
Static Protected Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit
template<int N>
static constexpr QLatin1String constQLatin1 (const char(&str)[N])
 Constant-initialize QLatin1String without using strlen.

Detailed Description

Specialized class for speed units (m/s, ft/s, NM/h).

Definition at line 758 of file units.h.

Member Typedef Documentation

◆ base_type

Base type.

Definition at line 787 of file units.h.

Constructor & Destructor Documentation

◆ CSpeedUnit() [1/2]

swift::misc::physical_quantities::CSpeedUnit::CSpeedUnit ( )
inline

Default constructor, required for Qt Metasystem.

Definition at line 792 of file units.h.

◆ CSpeedUnit() [2/2]

swift::misc::physical_quantities::CSpeedUnit::CSpeedUnit ( std::nullptr_t )
inline

Null constructor.

Definition at line 795 of file units.h.

Member Function Documentation

◆ allUnits()

const QList< CSpeedUnit > & swift::misc::physical_quantities::CSpeedUnit::allUnits ( )
inlinestatic

All units.

Definition at line 861 of file units.h.

◆ defaultUnit()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::defaultUnit ( )
inlinestatic

Default unit.

Definition at line 798 of file units.h.

◆ ft_min()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::ft_min ( )
inlinestatic

Feet/min ft/min.

Definition at line 843 of file units.h.

◆ ft_s()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::ft_s ( )
inlinestatic

Feet/second ft/s.

Definition at line 834 of file units.h.

◆ km_h()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::km_h ( )
inlinestatic

Kilometer/hour km/h.

Definition at line 852 of file units.h.

◆ kts()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::kts ( )
inlinestatic

Knots.

Definition at line 817 of file units.h.

◆ m_s()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::m_s ( )
inlinestatic

Meter/second m/s.

Definition at line 808 of file units.h.

◆ NM_h()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::NM_h ( )
inlinestatic

Nautical miles per hour NM/h (same as kts).

Definition at line 825 of file units.h.

◆ nullUnit()

CSpeedUnit swift::misc::physical_quantities::CSpeedUnit::nullUnit ( )
inlinestatic

Null unit.

Definition at line 801 of file units.h.

◆ unmarshalFromDataStream()

void swift::misc::physical_quantities::CSpeedUnit::unmarshalFromDataStream ( QDataStream & stream)
inline

Unmarshal a value from a QDataStream.

Definition at line 878 of file units.h.

◆ unmarshallFromDbus()

void swift::misc::physical_quantities::CSpeedUnit::unmarshallFromDbus ( const QDBusArgument & argument)
inline

Unmarshall without begin/endStructure, for when composed within another object.

Definition at line 870 of file units.h.


The documentation for this class was generated from the following file: