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