Line data Source code
1 : // SPDX-FileCopyrightText: 2022 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 : 8 392 : class LoggerStartCommand : public DeviceCommand 9 : { 10 : public: 11 : explicit LoggerStartCommand(QObject * const parent); 12 : 13 : QStringList requiredOptions(const QCommandLineParser &parser) const override; 14 : QStringList supportedOptions(const QCommandLineParser &parser) const override; 15 : 16 : public slots: 17 : QStringList processOptions(const QCommandLineParser &parser) override; 18 : 19 : protected: 20 : AbstractPokitService * getService() override; 21 : 22 : protected slots: 23 : void serviceDetailsDiscovered() override; 24 : 25 : private: 26 : DataLoggerService * service; ///< Bluetooth service this command interracts with. 27 : DataLoggerService::Settings settings; ///< Settings for the Pokit device's data logger mode. 28 : 29 : static DataLoggerService::Range lowestRange(const DataLoggerService::Mode mode, 30 : const quint32 desiredMax); 31 : static DataLoggerService::CurrentRange lowestCurrentRange(const quint32 desiredMax); 32 : static DataLoggerService::VoltageRange lowestVoltageRange(const quint32 desiredMax); 33 : 34 : private slots: 35 : void settingsWritten(); 36 : 37 : friend class TestLoggerStartCommand; 38 : };