LCOV - code coverage report
Current view: top level - include/qtpokit - pokitmeter.h (source / functions) Coverage Total Hit
Project: Dokit Lines: 100.0 % 3 3
Version: Functions: 100.0 % 3 3

            Line data    Source code
       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 PokitMeter namespace.
       7              :  */
       8              : 
       9              : #ifndef QTPOKIT_POKITMETER_H
      10              : #define QTPOKIT_POKITMETER_H
      11              : 
      12              : #include "qtpokit_global.h"
      13              : 
      14              : QTPOKIT_BEGIN_NAMESPACE
      15              : 
      16              : /// Encapsulates details specific to Pokit Meter devices.
      17              : namespace PokitMeter {
      18              : 
      19              :     /// Values supported by the Pokit Meter's `Range` attributes in `*Current` modes.
      20              :     enum class CurrentRange : 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              :     };
      28              :     QTPOKIT_EXPORT QString toString(const CurrentRange &range);
      29              :     QTPOKIT_EXPORT quint32 maxValue(const CurrentRange &range);
      30              : 
      31              :     /// Values supported by the Pokit Meter's `Range` attributes in `Resistance` mode.
      32              :     enum class ResistanceRange : 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              :     };
      43              :     QTPOKIT_EXPORT QString toString(const ResistanceRange &range);
      44              :     QTPOKIT_EXPORT quint32 maxValue(const ResistanceRange &range);
      45              : 
      46              :     /// Values supported by the Pokit Meter's `Range` attributes in `*Voltage` modes.
      47              :     enum class VoltageRange : 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              :     };
      56              :     QTPOKIT_EXPORT QString toString(const VoltageRange &range);
      57              :     QTPOKIT_EXPORT quint32 maxValue(const VoltageRange &range);
      58              : 
      59              : }
      60              : 
      61              : /// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
      62         1585 : constexpr quint8 operator+(PokitMeter::CurrentRange range) noexcept { return static_cast<quint8>(range); }
      63              : 
      64              : /// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
      65          705 : constexpr quint8 operator+(PokitMeter::ResistanceRange range) noexcept { return static_cast<quint8>(range); }
      66              : 
      67              : /// Returns \a range as a `quint8` as a convenience for assigning to services' `settings.range` members.
      68         8536 : constexpr quint8 operator+(PokitMeter::VoltageRange range) noexcept { return static_cast<quint8>(range); }
      69              : 
      70              : QTPOKIT_END_NAMESPACE
      71              : 
      72              : #endif // QTPOKIT_POKITMETER_H
        

Generated by: LCOV version 2.2-1