Dokit
dev
v0.6.0
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.2
v0.1.1
v0.1.0
User docs
Internal
Coverage
Internal development documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
loggerstartcommand.h
1
// SPDX-FileCopyrightText: 2022-2026 Paul Colby <git@colby.id.au>
2
// SPDX-License-Identifier: LGPL-3.0-or-later
3
4
#include "devicecommand.h"
5
6
#include <
qtpokit/dataloggerservice.h
>
7
#include <
qtpokit/pokitmeter.h
>
8
#include <
qtpokit/pokitpro.h
>
9
10
class
LoggerStartCommand
:
public
DeviceCommand
11
{
12
Q_OBJECT
13
14
public
:
15
explicit
LoggerStartCommand
(
QObject
*
const
parent
=
nullptr
);
16
17
QStringList
requiredOptions
(
const
QCommandLineParser
&parser)
const override
;
18
QStringList
supportedOptions
(
const
QCommandLineParser
&parser)
const override
;
19
20
public
slots:
21
QStringList
processOptions
(
const
QCommandLineParser
&parser)
override
;
22
23
protected
:
24
AbstractPokitService
*
getService
()
override
;
25
26
protected
slots:
27
void
serviceDetailsDiscovered
()
override
;
28
29
private
:
30
quint8 (*
minRangeFunc
)(
const
PokitProduct
product,
const
quint32 maxValue) {
nullptr
};
31
quint32
rangeOptionValue
{ 0 };
///< The parsed value of range option.
32
DataLoggerService
*
service
{
nullptr
};
///< Bluetooth service this command interacts with.
33
DataLoggerService::Settings
settings
{
///< Settings for the Pokit device's data logger mode.
34
DataLoggerService::Command::Start
, 0,
DataLoggerService::Mode::DcVoltage
,
35
+
PokitMeter::VoltageRange::AutoRange
, 60'000, 0
36
};
37
38
private
slots:
39
void
settingsWritten
();
40
41
QTPOKIT_BEFRIEND_TEST
(
LoggerStartCommand
)
42
};
AbstractPokitService
The AbstractPokitService class provides a common base for Pokit services classes.
Definition
abstractpokitservice.h:27
DataLoggerService
The DataLoggerService class accesses the Data Logger service of Pokit devices.
Definition
dataloggerservice.h:23
DataLoggerService::Command::Start
@ Start
Start the Data Logger.
Definition
dataloggerservice.h:44
DataLoggerService::Mode::DcVoltage
@ DcVoltage
Measure DC voltage.
Definition
dataloggerservice.h:52
DeviceCommand::DeviceCommand
DeviceCommand(QObject *const parent=nullptr)
Construct a new DeviceCommand object with parent.
Definition
devicecommand.cpp:21
LoggerStartCommand
The LoggerStartCommand class implements the logger CLI command.
Definition
loggerstartcommand.h:11
LoggerStartCommand::requiredOptions
QStringList requiredOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names required by this command.
Definition
loggerstartcommand.cpp:31
LoggerStartCommand::getService
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
Definition
loggerstartcommand.cpp:138
LoggerStartCommand::processOptions
QStringList processOptions(const QCommandLineParser &parser) override
Processes the relevant options from the command line parser.
Definition
loggerstartcommand.cpp:53
LoggerStartCommand::settings
DataLoggerService::Settings settings
Settings for the Pokit device's data logger mode.
Definition
loggerstartcommand.h:33
LoggerStartCommand::rangeOptionValue
quint32 rangeOptionValue
The parsed value of range option.
Definition
loggerstartcommand.h:31
LoggerStartCommand::minRangeFunc
quint8(*) minRangeFunc(const PokitProduct product, const quint32 maxValue)
Pointer to function for converting rangeOptionValue to a Pokit device's range enumerator.
Definition
loggerstartcommand.h:30
LoggerStartCommand::settingsWritten
void settingsWritten()
Invoked when the data logger settings have been written.
Definition
loggerstartcommand.cpp:181
LoggerStartCommand::serviceDetailsDiscovered
void serviceDetailsDiscovered() override
Handles service detail discovery events.
Definition
loggerstartcommand.cpp:154
LoggerStartCommand::supportedOptions
QStringList supportedOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names supported by this command.
Definition
loggerstartcommand.cpp:38
LoggerStartCommand::LoggerStartCommand
LoggerStartCommand(QObject *const parent=nullptr)
Construct a new LoggerStartCommand object with parent.
Definition
loggerstartcommand.cpp:26
LoggerStartCommand::service
DataLoggerService * service
Bluetooth service this command interacts with.
Definition
loggerstartcommand.h:32
dataloggerservice.h
Declares the DataLoggerService class.
PokitMeter::VoltageRange::AutoRange
@ AutoRange
Auto-range.
Definition
pokitmeter.h:54
pokitmeter.h
Declares the PokitMeter namespace.
pokitpro.h
Declares the PokitPro namespace.
PokitProduct
PokitProduct
Pokit products known to, and supported by, the QtPokit library.
Definition
pokitproducts.h:21
QCommandLineParser
QObject::QObject
QObject(QObject *parent)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QStringList
QTPOKIT_BEFRIEND_TEST
#define QTPOKIT_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
Definition
qtpokit_global.h:118
DataLoggerService::Settings
Attributes included in the Settings characteristic.
Definition
dataloggerservice.h:66
dokit
dokit
src
cli
loggerstartcommand.h
Generated by
1.18.0