Dokit
Internal development documentation
Loading...
Searching...
No Matches
loggerstartcommand.h
1// SPDX-FileCopyrightText: 2022-2023 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#include "devicecommand.h"
5
8#include <qtpokit/pokitpro.h>
9
11{
13
14public:
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
20public slots:
21 QStringList processOptions(const QCommandLineParser &parser) override;
22
23protected:
25
26protected slots:
27 void serviceDetailsDiscovered() override;
28
29private:
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 interracts with.
37
38private slots:
39 void settingsWritten();
40
41 friend class TestLoggerStartCommand;
42};
The AbstractPokitService class provides a common base for Pokit services classes.
The DataLoggerService class accesses the Data Logger service of Pokit devices.
@ Start
Start the Data Logger.
@ DcVoltage
Measure DC voltage.
The AbstractCommand class extends AbstractCommand to add a PokitDevice instance.
The LoggerStartCommand class implements the logger CLI command.
QStringList requiredOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names required by this command.
quint8(* minRangeFunc)(const PokitProduct product, const quint32 maxValue)
Pointer to function for converting rangeOptionValue to a Pokit device's range enumerator.
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
QStringList processOptions(const QCommandLineParser &parser) override
Processes the relevant options from the command line parser.
DataLoggerService::Settings settings
Settings for the Pokit device's data logger mode.
quint32 rangeOptionValue
The parsed value of range option.
void settingsWritten()
Invoked when the data logger settings have been written.
void serviceDetailsDiscovered() override
Handles service detail discovery events.
QStringList supportedOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names supported by this command.
LoggerStartCommand(QObject *const parent=nullptr)
Construct a new LoggerStartCommand object with parent.
DataLoggerService * service
Bluetooth service this command interracts with.
Declares the DataLoggerService class.
Declares the PokitMeter namespace.
Declares the PokitPro namespace.
PokitProduct
Pokit products known to, and supported by, the QtPokit library.
Q_OBJECTQ_OBJECT
QObject * parent() const const
Attributes included in the Settings characterstic.