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

Specialized class for pressure (psi, hPa, bar). More...

#include <units.h>

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

Public Types

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

Public Member Functions

 CPressureUnit ()
 Default constructor, required for Qt Metasystem.
 CPressureUnit (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< CPressureUnit >
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< CPressureUnit >
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 CPressureUnit &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 CPressureUnit defaultUnit ()
 Default unit.
static CPressureUnit nullUnit ()
 Null unit.
static CPressureUnit Pa ()
 Pascal.
static CPressureUnit hPa ()
 Hectopascal.
static CPressureUnit psi ()
 Pounds per square inch.
static CPressureUnit bar ()
 Bar.
static CPressureUnit mbar ()
 Millibar, actually the same as hPa.
static CPressureUnit inHg ()
 Inch of mercury at 0°C.
static CPressureUnit mmHg ()
 Millimeter of mercury.
static const QList< CPressureUnit > & 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< CPressureUnit >
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 pressure (psi, hPa, bar).

Definition at line 528 of file units.h.

Member Typedef Documentation

◆ base_type

Base type.

Definition at line 554 of file units.h.

Constructor & Destructor Documentation

◆ CPressureUnit() [1/2]

swift::misc::physical_quantities::CPressureUnit::CPressureUnit ( )
inline

Default constructor, required for Qt Metasystem.

Definition at line 559 of file units.h.

◆ CPressureUnit() [2/2]

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

Null constructor.

Definition at line 562 of file units.h.

Member Function Documentation

◆ allUnits()

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

All units.

Definition at line 636 of file units.h.

◆ bar()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::bar ( )
inlinestatic

Bar.

Definition at line 601 of file units.h.

◆ defaultUnit()

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

Default unit.

Definition at line 565 of file units.h.

◆ hPa()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::hPa ( )
inlinestatic

Hectopascal.

Definition at line 583 of file units.h.

◆ inHg()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::inHg ( )
inlinestatic

Inch of mercury at 0°C.

Definition at line 618 of file units.h.

◆ mbar()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::mbar ( )
inlinestatic

Millibar, actually the same as hPa.

Definition at line 609 of file units.h.

◆ mmHg()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::mmHg ( )
inlinestatic

Millimeter of mercury.

Definition at line 627 of file units.h.

◆ nullUnit()

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

Null unit.

Definition at line 568 of file units.h.

◆ Pa()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::Pa ( )
inlinestatic

Pascal.

Definition at line 575 of file units.h.

◆ psi()

CPressureUnit swift::misc::physical_quantities::CPressureUnit::psi ( )
inlinestatic

Pounds per square inch.

Definition at line 592 of file units.h.

◆ unmarshalFromDataStream()

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

Unmarshal a value from a QDataStream.

Definition at line 654 of file units.h.

◆ unmarshallFromDbus()

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

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

Definition at line 646 of file units.h.


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