Dokit
Internal development documentation
|
The LoggerStopCommand class implements the logger stop
CLI command.
More...
Public Member Functions | |
LoggerStopCommand (QObject *const parent=nullptr) | |
Construct a new LoggerStopCommand object with parent. | |
Public Member Functions inherited from DeviceCommand | |
DeviceCommand (QObject *const parent=nullptr) | |
Construct a new DeviceCommand object with parent. | |
Public Member Functions inherited from AbstractCommand | |
AbstractCommand (QObject *const parent=nullptr) | |
Constructs a new command with parent. | |
virtual QStringList | requiredOptions (const QCommandLineParser &parser) const |
Returns a list of CLI option names required by this command. | |
virtual QStringList | supportedOptions (const QCommandLineParser &parser) const |
Returns a list of CLI option names supported by this command. | |
Public Member Functions inherited from QObject | |
virtual const QMetaObject * | metaObject () const const |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
Q_CLASSINFO (Name, Value) | |
Q_INTERFACES (...) | |
Q_PROPERTY (...) | |
Q_ENUMS (...) | |
Q_FLAGS (...) | |
Q_ENUM (...) | |
Q_FLAG (...) | |
Q_ENUM_NS (...) | |
Q_FLAG_NS (...) | |
Q_OBJECT Q_OBJECT | |
Q_GADGET Q_GADGET | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_SIGNALS Q_SIGNALS | |
Q_SIGNAL Q_SIGNAL | |
Q_SLOTS Q_SLOTS | |
Q_SLOT Q_SLOT | |
Q_EMIT Q_EMIT | |
Q_INVOKABLE Q_INVOKABLE | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Protected Slots | |
void | serviceDetailsDiscovered () override |
Handles service detail discovery events. | |
Protected Slots inherited from DeviceCommand | |
virtual void | controllerError (const QLowEnergyController::Error error) |
Handles controller error events. | |
virtual void | deviceDisconnected () |
Handles devics disconnection events. | |
virtual void | serviceError (const QLowEnergyService::ServiceError error) |
Handles service error events. | |
virtual void | serviceDetailsDiscovered () |
Handles service detail discovery events. | |
Protected Slots inherited from AbstractCommand | |
virtual void | deviceDiscovered (const QBluetoothDeviceInfo &info)=0 |
Handles PokitDiscoveryAgent::pokitDeviceDiscovered signal. | |
virtual void | deviceDiscoveryFinished ()=0 |
Handles PokitDiscoveryAgent::deviceDiscoveryFinished signal. | |
Protected Member Functions | |
AbstractPokitService * | getService () override |
Returns a Pokit service object for the derived command class. | |
Protected Member Functions inherited from DeviceCommand | |
void | disconnect (int exitCode=EXIT_SUCCESS) |
Disconnects the underlying Pokit device, and sets exitCode to be return to the OS once the disconnection has taken place. | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Private Slots | |
void | settingsWritten () |
Invoked when the data logger settings have been written. | |
Private Attributes | |
DataLoggerService * | service { nullptr } |
Bluetooth service this command interracts with. | |
Friends | |
class | TestLoggerStopCommand |
Additional Inherited Members | |
Public Types inherited from AbstractCommand | |
enum class | OutputFormat { Csv , Json , Text } |
Supported output formats. More... | |
Public Slots inherited from DeviceCommand | |
bool | start () override |
Begins scanning for the Pokit device. | |
Public Slots inherited from AbstractCommand | |
virtual QStringList | processOptions (const QCommandLineParser &parser) |
Processes the relevant options from the command line parser. | |
virtual bool | start ()=0 |
Begins the functionality of this command, and returns true if begun successfully, false otherwise. | |
Static Public Member Functions inherited from AbstractCommand | |
static QString | escapeCsvField (const QString &field) |
Returns an RFC 4180 compliant version of field. | |
template<typename R > | |
static quint32 | parseNumber (const QString &value, const QString &unit, const quint32 sensibleMinimum=0) |
Returns value as an integer multiple of the ratio R. | |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Static Protected Member Functions inherited from DeviceCommand | |
template<typename T > | |
static T | minRange (const quint32 maxValue) |
static quint8 | minCapacitanceRange (const PokitProduct product, const quint32 maxValue) |
Returns the product's lowest capacitance range that can measure at least up to maxValue (nF), or AutoRange if no such range is available. | |
static quint8 | minCurrentRange (const PokitProduct product, const quint32 maxValue) |
Returns the product's lowest current range that can measure at least up to maxValue (µA), or AutoRange if no such range is available. | |
static quint8 | minResistanceRange (const PokitProduct product, const quint32 maxValue) |
Returns the product's lowest resistance range that can measure at least up to maxValue (Ω), or AutoRange if no such range is available. | |
static quint8 | minVoltageRange (const PokitProduct product, const quint32 maxValue) |
t Returns the product's lowest voltage range that can measure at least up to maxValue (mV), or AutoRange if no such range is available. | |
Static Protected Member Functions inherited from AbstractCommand | |
static | Q_LOGGING_CATEGORY (lc, "dokit.cli.command", QtInfoMsg) |
Logging category for UI commands. | |
Protected Attributes inherited from DeviceCommand | |
PokitDevice * | device { nullptr } |
Pokit Bluetooth device (if any) this command inerracts with. | |
int | exitCodeOnDisconnect { EXIT_FAILURE } |
Exit code to return on device disconnection. | |
Protected Attributes inherited from AbstractCommand | |
QString | deviceToScanFor |
Device (if any) that were passed to processOptions(). | |
PokitDiscoveryAgent * | discoveryAgent |
Agent for Pokit device descovery. | |
OutputFormat | format { OutputFormat::Text } |
Selected output format. | |
Properties inherited from QObject | |
objectName | |
The LoggerStopCommand class implements the logger stop
CLI command.
Definition at line 8 of file loggerstopcommand.h.
|
explicit |
Construct a new LoggerStopCommand object with parent.
Definition at line 22 of file loggerstopcommand.cpp.
|
overrideprotectedvirtual |
Returns a Pokit service object for the derived command class.
This override returns a pointer to a DataLoggerService object.
Implements DeviceCommand.
Definition at line 32 of file loggerstopcommand.cpp.
References QObject::connect(), PokitDevice::dataLogger(), DeviceCommand::device, service, DataLoggerService::settingsWritten(), and settingsWritten().
|
overrideprotectedslot |
Handles service detail discovery events.
This override stops the device's logger.
Definition at line 49 of file loggerstopcommand.cpp.
References service, DeviceCommand::serviceDetailsDiscovered(), DataLoggerService::stopLogger(), and QObject::tr().
|
privateslot |
Invoked when the data logger settings have been written.
Definition at line 59 of file loggerstopcommand.cpp.
References AbstractCommand::Csv, DeviceCommand::device, DeviceCommand::disconnect(), AbstractCommand::format, AbstractCommand::Json, AbstractCommand::Text, and QObject::tr().
Referenced by getService().
|
friend |
Definition at line 27 of file loggerstopcommand.h.
|
private |
Bluetooth service this command interracts with.
Definition at line 22 of file loggerstopcommand.h.
Referenced by getService(), and serviceDetailsDiscovered().