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 163 of file pokitproducts.cpp.

164{
165 switch (product) {
167 qCWarning(lc).noquote()
168 << QCoreApplication::translate("PokitProducts", "Pokit Meter has no capacitance support", "toString");
169 return QVariant();
171 return PokitPro::maxValue(static_cast<PokitPro::CapacitanceRange>(range));
172 }
173 qCWarning(lc).noquote() << QCoreApplication::translate("CapacitanceRange",
174 "Unknown PokitProduct value: %1", "maxValue").arg((int)product);
175 return QVariant();
176}
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 140 of file pokitproducts.cpp.

141{
142 switch (product) {
144 qCWarning(lc).noquote()
145 << QCoreApplication::translate("PokitProducts", "Pokit Meter has no capacitance support", "toString");
146 return QString();
148 return PokitPro::toString(static_cast<PokitPro::CapacitanceRange>(range));
149 }
150 qCWarning(lc).noquote() << QCoreApplication::translate("CapacitanceRange",
151 "Unknown PokitProduct value: %1", "toString").arg((int)product);
152 return QString();
153}
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: