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