Dokit
Internal development documentation
Loading...
Searching...
No Matches
pokitpro.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022-2025 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*!
5 * \file
6 * Declares the PokitPro namespace.
7 */
8
9#ifndef QTPOKIT_POKITPRO_H
10#define QTPOKIT_POKITPRO_H
11
12#include "qtpokit_global.h"
13
15
16/// Encapsulates details specific to Pokit Pro devices.
17namespace PokitPro {
18
19 /// Values supported by the Pokit Pro's `Range` attributes in `Capacitance` mode.
20 enum class CapacitanceRange : quint8 {
21 _100nF = 0, ///< Up 100nF.
22 _10uF = 1, ///< Up 10μF.
23 _1mF = 2, ///< Up 1mF.
24 AutoRange = 255 ///< Auto-range.
25 };
27 QTPOKIT_EXPORT quint32 maxValue(const CapacitanceRange &range);
28
29
30 /// Values supported by the Pokit Pro's `Range` attributes in `*Current` modes.
31 enum class CurrentRange : quint8 {
32 _500uA = 0, ///< Up to 5µA.
33 _2mA = 1, ///< Up to 2mA.
34 _10mA = 2, ///< Up to 10mA.
35 _125mA = 3, ///< Up to 125mA.
36 _300mA = 4, ///< Up to 300mA.
37 _3A = 5, ///< Up to 3A.
38 _10A = 6, ///< Up to 10A.
39 AutoRange = 255 ///< Auto-range.
40 };
42 QTPOKIT_EXPORT quint32 maxValue(const CurrentRange &range);
43
44 /// Values supported by the Pokit Pro's `Range` attributes in `Resistance` mode.
45 enum class ResistanceRange : quint8 {
46 _30 = 0, ///< Up to 30Ω.
47 _75 = 1, ///< Up to 75Ω.
48 _400 = 2, ///< Up to 400Ω.
49 _5K = 3, ///< Up to 5KΩ.
50 _10K = 4, ///< Up to 10KΩ.
51 _15K = 5, ///< Up to 15KΩ.
52 _40K = 6, ///< Up to 40KΩ.
53 _500K = 7, ///< Up to 500KΩ.
54 _700K = 8, ///< Up to 700KΩ.
55 _1M = 9, ///< Up to 1MΩ.
56 _3M = 10, ///< Up to 3MΩ.
57 AutoRange = 255 ///< Auto-range.
58 };
60 QTPOKIT_EXPORT quint32 maxValue(const ResistanceRange &range);
61
62 /// Values supported by the Pokit Pro's `Range` attributes in `*Voltage` modes.
63 enum class VoltageRange : quint8 {
64 _250mV = 0, ///< Up to 250mV.
65 _2V = 1, ///< Up to 2V.
66 _10V = 2, ///< Up to 10V.
67 _30V = 3, ///< Up to 30V.
68 _60V = 4, ///< Up to 60V.
69 _125V = 5, ///< Up to 125V.
70 _400V = 6, ///< Up to 400V.
71 _600V = 7, ///< Up to 600V.
72 AutoRange = 255 ///< Auto-range.
73 };
75 QTPOKIT_EXPORT quint32 maxValue(const VoltageRange &range);
76
77}
78
79/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
80constexpr quint8 operator+(PokitPro::CapacitanceRange range) noexcept { return static_cast<quint8>(range); }
81
82/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
83constexpr quint8 operator+(PokitPro::CurrentRange range) noexcept { return static_cast<quint8>(range); }
84
85/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
86constexpr quint8 operator+(PokitPro::ResistanceRange range) noexcept { return static_cast<quint8>(range); }
87
88/// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
89constexpr quint8 operator+(PokitPro::VoltageRange range) noexcept { return static_cast<quint8>(range); }
90
92
93#endif // QTPOKIT_POKITPRO_H
Encapsulates convenience functions for working with capacitance ranges.
Encapsulates convenience functions for working with current ranges.
Encapsulates details specific to Pokit Pro devices.
Definition pokitpro.h:17
QTPOKIT_EXPORT QString toString(const CapacitanceRange &range)
Returns range as a user-friendly string.
Definition pokitpro.cpp:35
VoltageRange
Values supported by the Pokit Pro's Range attributes in *Voltage modes.
Definition pokitpro.h:63
@ _250mV
Up to 250mV.
Definition pokitpro.h:64
@ _400V
Up to 400V.
Definition pokitpro.h:70
@ _600V
Up to 600V.
Definition pokitpro.h:71
@ _125V
Up to 125V.
Definition pokitpro.h:69
CurrentRange
Values supported by the Pokit Pro's Range attributes in *Current modes.
Definition pokitpro.h:31
@ _500uA
Up to 5µA.
Definition pokitpro.h:32
@ _10mA
Up to 10mA.
Definition pokitpro.h:34
@ _300mA
Up to 300mA.
Definition pokitpro.h:36
@ _125mA
Up to 125mA.
Definition pokitpro.h:35
ResistanceRange
Values supported by the Pokit Pro's Range attributes in Resistance mode.
Definition pokitpro.h:45
@ _500K
Up to 500KΩ.
Definition pokitpro.h:53
@ _700K
Up to 700KΩ.
Definition pokitpro.h:54
CapacitanceRange
Values supported by the Pokit Pro's Range attributes in Capacitance mode.
Definition pokitpro.h:20
QTPOKIT_EXPORT quint32 maxValue(const CapacitanceRange &range)
Returns the maximum value for range in nanofarads, or 0 if range is not a known value for Pokit Pro d...
Definition pokitpro.cpp:49
Encapsulates convenience functions for working with resistance ranges.
Encapsulates convenience functions for working with voltage ranges.
constexpr quint8 operator+(PokitPro::CapacitanceRange range) noexcept
Returns range as a quint8 as a convenience for assigning to services' settings.range members.
Definition pokitpro.h:80
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).