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

Encapsulates details specific to Pokit Meter devices. More...

Enumerations

enum class  CurrentRange : quint8 {
  _10mA = 0 , _30mA = 1 , _150mA = 2 , _300mA = 3 ,
  _2A = 4 , AutoRange = 255
}
 Values supported by the Pokit Meter's Range attributes in *Current modes. More...
 
enum class  ResistanceRange : quint8 {
  _160 = 0 , _330 = 1 , _890 = 2 , _1K5 = 3 ,
  _10K = 4 , _100K = 5 , _470K = 6 , _1M = 7 ,
  AutoRange = 255
}
 Values supported by the Pokit Meter's Range attributes in Resistance mode. More...
 
enum class  VoltageRange : quint8 {
  _300mV = 0 , _2V = 1 , _6V = 2 , _12V = 3 ,
  _30V = 4 , _60V = 5 , AutoRange = 255
}
 Values supported by the Pokit Meter's Range attributes in *Voltage modes. More...
 

Functions

QTPOKIT_EXPORT QString toString (const CurrentRange &range)
 Returns range as a user-friendly string.
 
QTPOKIT_EXPORT quint32 maxValue (const CurrentRange &range)
 Returns the maximum value for range in microamps, or 0 if range is not a known value for Pokit Meter devices.
 
QTPOKIT_EXPORT QString toString (const ResistanceRange &range)
 Returns range as a user-friendly string.
 
QTPOKIT_EXPORT quint32 maxValue (const ResistanceRange &range)
 Returns the maximum value for range in ohms, or 0 if range is not a known value for Pokit Meter devices.
 
QTPOKIT_EXPORT QString toString (const VoltageRange &range)
 Returns range as a user-friendly string.
 
QTPOKIT_EXPORT quint32 maxValue (const VoltageRange &range)
 Returns the maximum value for range in millivolts, or 0 if range is not a known value for Pokit Meter devices.
 
static Q_LOGGING_CATEGORY (lc, "dokit.pokit.products.meter", QtInfoMsg)
 Logging category for this file.
 

Detailed Description

Encapsulates details specific to Pokit Meter devices.

Enumeration Type Documentation

◆ CurrentRange

enum class PokitMeter::CurrentRange : quint8
strong

Values supported by the Pokit Meter's Range attributes in *Current modes.

Enumerator
_10mA 

Up to 10mA.

_30mA 

Up to 30mA.

_150mA 

Up to 150mA.

_300mA 

Up to 300mA.

_2A 

Up to 2A.

AutoRange 255 

Auto-range.

Definition at line 20 of file pokitmeter.h.

20 : quint8 {
21 _10mA = 0, ///< Up to 10mA.
22 _30mA = 1, ///< Up to 30mA.
23 _150mA = 2, ///< Up to 150mA.
24 _300mA = 3, ///< Up to 300mA.
25 _2A = 4, ///< Up to 2A.
26 AutoRange = 255 ///< Auto-range.
27 };

◆ ResistanceRange

enum class PokitMeter::ResistanceRange : quint8
strong

Values supported by the Pokit Meter's Range attributes in Resistance mode.

Enumerator
_160 

Up to 160Ω.

_330 

Up to 330Ω.

_890 

Up to 890Ω.

_1K5 

Up to 1.5KΩ.

_10K 

Up to 10KΩ.

_100K 

Up to 100KΩ.

_470K 

Up to 470KΩ.

_1M 

Up to 1MΩ.

AutoRange 255 

Auto-range.

Definition at line 32 of file pokitmeter.h.

32 : quint8 {
33 _160 = 0, ///< Up to 160Ω.
34 _330 = 1, ///< Up to 330Ω.
35 _890 = 2, ///< Up to 890Ω.
36 _1K5 = 3, ///< Up to 1.5KΩ.
37 _10K = 4, ///< Up to 10KΩ.
38 _100K = 5, ///< Up to 100KΩ.
39 _470K = 6, ///< Up to 470KΩ.
40 _1M = 7, ///< Up to 1MΩ.
41 AutoRange = 255 ///< Auto-range.
42 };

◆ VoltageRange

enum class PokitMeter::VoltageRange : quint8
strong

Values supported by the Pokit Meter's Range attributes in *Voltage modes.

Enumerator
_300mV 

Up to 300mV.

_2V 

Up to 2V.

_6V 

Up to 6V.

_12V 

Up to 12V.

_30V 

Up to 30V.

_60V 

Up to 60V DC (42V AC).

AutoRange 255 

Auto-range.

Definition at line 47 of file pokitmeter.h.

47 : quint8 {
48 _300mV = 0, ///< Up to 300mV.
49 _2V = 1, ///< Up to 2V.
50 _6V = 2, ///< Up to 6V.
51 _12V = 3, ///< Up to 12V.
52 _30V = 4, ///< Up to 30V.
53 _60V = 5, ///< Up to 60V DC (42V AC).
54 AutoRange = 255 ///< Auto-range.
55 };

Function Documentation

◆ maxValue() [1/3]

quint32 PokitMeter::maxValue ( const CurrentRange & range)

Returns the maximum value for range in microamps, or 0 if range is not a known value for Pokit Meter devices.

Definition at line 44 of file pokitmeter.cpp.

45{
46 switch (range) {
47 case CurrentRange::_10mA: return 10'000;
48 case CurrentRange::_30mA: return 30'000;
49 case CurrentRange::_150mA: return 150'000;
50 case CurrentRange::_300mA: return 300'000;
51 case CurrentRange::_2A: return 2'000'000;
52 case CurrentRange::AutoRange: return 2'000'000;
53 default:
54 qCWarning(lc).noquote() << Private::tr("Unknown CurrentRange value: %1").arg((int)range);
55 return 0;
56 }
57}

References _10mA, _150mA, _2A, _300mA, _30mA, and AutoRange.

Referenced by CurrentRange::maxValue(), ResistanceRange::maxValue(), and VoltageRange::maxValue().

Here is the caller graph for this function:

◆ maxValue() [2/3]

quint32 PokitMeter::maxValue ( const ResistanceRange & range)

Returns the maximum value for range in ohms, or 0 if range is not a known value for Pokit Meter devices.

Definition at line 79 of file pokitmeter.cpp.

80{
81 switch (range) {
82 case ResistanceRange::_160: return 160;
83 case ResistanceRange::_330: return 330;
84 case ResistanceRange::_890: return 890;
85 case ResistanceRange::_1K5: return 1'500;
86 case ResistanceRange::_10K: return 10'000;
87 case ResistanceRange::_100K: return 100'000;
88 case ResistanceRange::_470K: return 470'000;
89 case ResistanceRange::_1M: return 1'000'000;
90 case ResistanceRange::AutoRange: return 1'000'000;
91 default:
92 qCWarning(lc).noquote() << Private::tr("Unknown ResistanceRange value: %1").arg((int)range);
93 return 0;
94 }
95}

References _100K, _10K, _160, _1K5, _1M, _330, _470K, _890, and AutoRange.

◆ maxValue() [3/3]

quint32 PokitMeter::maxValue ( const VoltageRange & range)

Returns the maximum value for range in millivolts, or 0 if range is not a known value for Pokit Meter devices.

Definition at line 115 of file pokitmeter.cpp.

116{
117 switch (range) {
118 case VoltageRange::_300mV: return 300;
119 case VoltageRange::_2V: return 2'000;
120 case VoltageRange::_6V: return 6'000;
121 case VoltageRange::_12V: return 12'000;
122 case VoltageRange::_30V: return 30'000;
123 case VoltageRange::_60V: return 60'000;
124 case VoltageRange::AutoRange: return 60'000;
125 default:
126 qCWarning(lc).noquote() << Private::tr("Unknown VoltageRange value: %1").arg((int)range);
127 return 0;
128 }
129}
@ _60V
Up to 60V DC (42V AC).
Definition pokitmeter.h:53

References _12V, _2V, _300mV, _30V, _60V, _6V, and AutoRange.

◆ toString() [1/3]

QString PokitMeter::toString ( const CurrentRange & range)

Returns range as a user-friendly string.

Definition at line 28 of file pokitmeter.cpp.

29{
30 switch (range) {
31 case CurrentRange::_10mA: return Private::tr("Up to 10mA");
32 case CurrentRange::_30mA: return Private::tr("Up to 30mA");
33 case CurrentRange::_150mA: return Private::tr("Up to 150mA");
34 case CurrentRange::_300mA: return Private::tr("Up to 300mA");
35 case CurrentRange::_2A: return Private::tr("Up to 2A");
36 case CurrentRange::AutoRange: return Private::tr("Auto-range");
37 default: return QString();
38 }
39}

References _10mA, _150mA, _2A, _300mA, _30mA, and AutoRange.

Referenced by CurrentRange::toString(), ResistanceRange::toString(), and VoltageRange::toString().

Here is the caller graph for this function:

◆ toString() [2/3]

QString PokitMeter::toString ( const ResistanceRange & range)

Returns range as a user-friendly string.

Definition at line 60 of file pokitmeter.cpp.

61{
62 switch (range) {
63 case ResistanceRange::_160: return Private::tr("Up to 160Ω");
64 case ResistanceRange::_330: return Private::tr("Up to 330Ω");
65 case ResistanceRange::_890: return Private::tr("Up to 890Ω");
66 case ResistanceRange::_1K5: return Private::tr("Up to 1.5KΩ");
67 case ResistanceRange::_10K: return Private::tr("Up to 10KΩ");
68 case ResistanceRange::_100K: return Private::tr("Up to 100KΩ");
69 case ResistanceRange::_470K: return Private::tr("Up to 470KΩ");
70 case ResistanceRange::_1M: return Private::tr("Up to 1MΩ");
71 case ResistanceRange::AutoRange: return Private::tr("Auto-range");
72 default: return QString();
73 }
74}

References _100K, _10K, _160, _1K5, _1M, _330, _470K, _890, and AutoRange.

◆ toString() [3/3]

QString PokitMeter::toString ( const VoltageRange & range)

Returns range as a user-friendly string.

Definition at line 98 of file pokitmeter.cpp.

99{
100 switch (range) {
101 case VoltageRange::_300mV: return Private::tr("Up to 300mV");
102 case VoltageRange::_2V: return Private::tr("Up to 2V");
103 case VoltageRange::_6V: return Private::tr("Up to 6V");
104 case VoltageRange::_12V: return Private::tr("Up to 12V");
105 case VoltageRange::_30V: return Private::tr("Up to 30V");
106 case VoltageRange::_60V: return Private::tr("Up to 60V");
107 case VoltageRange::AutoRange: return Private::tr("Auto-range");
108 default: return QString();
109 }
110}

References _12V, _2V, _300mV, _30V, _60V, _6V, and AutoRange.