Dokit
Internal development documentation
Loading...
Searching...
No Matches
pokitmeter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*!
5 * \file
6 * Declares the PokitMeter namespace.
7 */
8
9#ifndef QTPOKIT_POKITMETER_H
10#define QTPOKIT_POKITMETER_H
11
12#include "qtpokit_global.h"
13
14#include <QVariant>
15
17
18/// Encapsulates details specific to Pokit Meter devices.
19namespace PokitMeter {
20
21 /// Values supported by the Pokit Meter's `Range` attributes in `*Current` modes.
22 enum class CurrentRange : quint8 {
23 _10mA = 0, ///< Up to 10mA.
24 _30mA = 1, ///< Up to 30mA.
25 _150mA = 2, ///< Up to 150mA.
26 _300mA = 3, ///< Up to 300mA.
27 _2A = 4, ///< Up to 2A.
28 AutoRange = 255 ///< Auto-range.
29 };
32
33 /// Values supported by the Pokit Meter's `Range` attributes in `Resistance` mode.
34 enum class ResistanceRange : quint8 {
35 _160 = 0, ///< Up to 160Ω.
36 _330 = 1, ///< Up to 330Ω.
37 _890 = 2, ///< Up to 890Ω.
38 _1K5 = 3, ///< Up to 1.5KΩ.
39 _10K = 4, ///< Up to 10KΩ.
40 _100K = 5, ///< Up to 100KΩ.
41 _470K = 6, ///< Up to 470KΩ.
42 _1M = 7, ///< Up to 1MΩ.
43 AutoRange = 255 ///< Auto-range.
44 };
47
48 /// Values supported by the Pokit Meter's `Range` attributes in `*Voltage` modes.
49 enum class VoltageRange : quint8 {
50 _300mV = 0, ///< Up to 300mV.
51 _2V = 1, ///< Up to 2V.
52 _6V = 2, ///< Up to 6V.
53 _12V = 3, ///< Up to 12V.
54 _30V = 4, ///< Up to 30V.
55 _60V = 5, ///< Up to 60V DC (42V AC).
56 AutoRange = 255 ///< Auto-range.
57 };
60
61}
62
63/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
64constexpr quint8 operator+(PokitMeter::CurrentRange range) noexcept { return static_cast<quint8>(range); }
65
66/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
67constexpr quint8 operator+(PokitMeter::ResistanceRange range) noexcept { return static_cast<quint8>(range); }
68
69/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
70constexpr quint8 operator+(PokitMeter::VoltageRange range) noexcept { return static_cast<quint8>(range); }
71
73
74#endif // QTPOKIT_POKITMETER_H
Encapsulates convenience functions for working with current ranges.
Encapsulates details specific to Pokit Meter devices.
Definition pokitmeter.h:19
CurrentRange
Values supported by the Pokit Meter's Range attributes in *Current modes.
Definition pokitmeter.h:22
QTPOKIT_EXPORT QString toString(const CurrentRange &range)
Returns range as a user-friendly string.
QTPOKIT_EXPORT QVariant maxValue(const CurrentRange &range)
Returns the maximum value for range in (integer) microamps, or the string "Auto".
ResistanceRange
Values supported by the Pokit Meter's Range attributes in Resistance mode.
Definition pokitmeter.h:34
VoltageRange
Values supported by the Pokit Meter's Range attributes in *Voltage modes.
Definition pokitmeter.h:49
@ _60V
Up to 60V DC (42V AC).
Encapsulates convenience functions for working with resistance ranges.
Encapsulates convenience functions for working with voltage ranges.
constexpr quint8 operator+(PokitMeter::CurrentRange range) noexcept
Returns range as a quint8 as a convenience for assigning to services' settings.range members.
Definition pokitmeter.h:64
Global QtPokit library macros.
#define QTPOKIT_BEGIN_NAMESPACE
Macro for starting the QtPokit library's top-most namespace (if one is defined).
#define QTPOKIT_EXPORT
QtPokit library export/import macro.
#define QTPOKIT_END_NAMESPACE
Macro for ending the QtPokit library's top-most namespace (if one is defined).