Dokit
Internal development documentation
Loading...
Searching...
No Matches
CapacitanceRange Namespace Reference

Encapsulates convenience functions for working with capacitance ranges. More...

Functions

QString toString (const PokitProduct product, const quint8 range)
 Returns product's capacitance range as a human-friendly string.
 
QVariant maxValue (const PokitProduct product, const quint8 range)
 Returns the maximum value for product's range in (integer) nanofarads, or the string "Auto".
 

Detailed Description

Encapsulates convenience functions for working with capacitance ranges.

Function Documentation

◆ maxValue()

QTPOKIT_EXPORT QVariant CapacitanceRange::maxValue ( const PokitProduct product,
const quint8 range )

Returns the maximum value for product's range in (integer) nanofarads, or the string "Auto".

If range is not a known valid value, then an null QVariant is returned.

Note
Since Pokit Meters do not support capacitance measurement, product should not be PokitProduct::PokitMeter.
See also
PokitPro::maxValue(const PokitPro::CapacitanceRange &range)

Definition at line 157 of file pokitproducts.cpp.

158{
159 switch (product) {
161 qCWarning(lc).noquote()
162 << QCoreApplication::translate("PokitProducts", "Pokit Meter has no capacitance support", "toString");
163 return QVariant();
165 return PokitPro::maxValue(static_cast<PokitPro::CapacitanceRange>(range));
166 }
167 qCWarning(lc).noquote() << QCoreApplication::translate("CapacitanceRange",
168 "Unknown PokitProduct value: %1", "maxValue").arg((int)product);
169 return QVariant();
170}
QTPOKIT_EXPORT QVariant maxValue(const CapacitanceRange &range)
Returns the maximum value for range in (integer) nanofarads, or the string "Auto".
Definition pokitpro.cpp:40
CapacitanceRange
Values supported by the Pokit Pro's Range attributes in Capacitance mode.
Definition pokitpro.h:22
@ PokitPro
Pokit Pro.
@ PokitMeter
Pokit Meter.
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const

References QString::arg(), PokitPro::maxValue(), PokitMeter, PokitPro, and QCoreApplication::translate().

Referenced by MultimeterService::maxValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

QTPOKIT_EXPORT QString CapacitanceRange::toString ( const PokitProduct product,
const quint8 range )

Returns product's capacitance range as a human-friendly string.

Note
Since Pokit Meters do not support capacitance measurement, product should not be PokitProduct::PokitMeter.
See also
PokitPro::toString(const PokitPro::CapacitanceRange &range)

Definition at line 134 of file pokitproducts.cpp.

135{
136 switch (product) {
138 qCWarning(lc).noquote()
139 << QCoreApplication::translate("PokitProducts", "Pokit Meter has no capacitance support", "toString");
140 return QString();
142 return PokitPro::toString(static_cast<PokitPro::CapacitanceRange>(range));
143 }
144 qCWarning(lc).noquote() << QCoreApplication::translate("CapacitanceRange",
145 "Unknown PokitProduct value: %1", "toString").arg((int)product);
146 return QString();
147}
QTPOKIT_EXPORT QString toString(const CapacitanceRange &range)
Returns range as a user-friendly string.
Definition pokitpro.cpp:25

References QString::arg(), PokitMeter, PokitPro, PokitPro::toString(), and QCoreApplication::translate().

Referenced by MultimeterService::toString().

Here is the call graph for this function:
Here is the caller graph for this function: