Loading...
Searching...
No Matches
AisDeviceTracker.h
1#ifndef SQUIDSTATLIBRARY_AISDEVICETRACKER_H
2#define SQUIDSTATLIBRARY_AISDEVICETRACKER_H
3
4#include "AisErrorCode.h"
5#include "AisSquidstatGlobal.h"
6#include <QObject>
7#include <memory>
8
9class AisDeviceTrackerPrivate;
11
19class SQUIDSTATLIBRARY_EXPORT AisDeviceTracker final : public QObject
20{
21 Q_OBJECT
22public:
23 ~AisDeviceTracker() override;
24
30
40 AisErrorCode connectToDevice(const QString& deviceName);
41
54 AisErrorCode connectToDeviceOnComPort(const QString &comPort);
55
67 const AisInstrumentHandler &getInstrumentHandler(const QString &deviceName) const;
68
73 const std::list<QString> getConnectedDevices() const;
74
84
96 AisErrorCode updateFirmwareOnComPort(const QString& comport) const;
97
110
117 void saveLogToFile(bool save);
118
126 void setLogFilePath(const QString& path);
127
134
135
136signals:
142 void newDeviceConnected(const QString &deviceName);
143
148 void deviceDisconnected(const QString& deviceName);
149
155 void firmwareUpdateNotification(const QString& message);
156
163 void firmwareUpdateFinished(const QString& deviceName, bool success);
164
165private:
168 void operator=(const AisDeviceTracker &);
169
170
171 AisDeviceTrackerPrivate* m_data = nullptr;
172};
173
174#endif
This class is used track device connections to the computer. It also provides instrument handlers spe...
Definition AisDeviceTracker.h:20
void deviceDisconnected(const QString &deviceName)
a signal to be emitted whenever a device has been disconnected.
void firmwareUpdateNotification(const QString &message)
a signal which is emitted regularaly during a firmware update, providing information about the progre...
AisErrorCode connectToDeviceOnComPort(const QString &comPort)
establish a connection with a device connected on a USB port.
const AisInstrumentHandler & getInstrumentHandler(const QString &deviceName) const
get an instrument handler to control a specific device.
void saveLogToFile(bool save)
Allow to collect device error message in file for debugging purpose.
AisErrorCode updateFirmwareOnComPort(const QString &comport) const
update firmware on connected device at USB port.
void setLogFilePath(const QString &path)
This will help to change the log file directory.
void purgeStaleDevices()
Calling this function will remove all disconnected devices from memory. Any pointers and references t...
int updateFirmwareOnAllAvailableDevices()
request firmware update for all available devices.
int connectAllPluggedInDevices()
connect all devices physically plugged to the computer.
AisErrorCode connectToDevice(const QString &deviceName)
Establish a connection with a device connected on a USB port via its name.
const std::list< QString > getConnectedDevices() const
get a list of all the connected devices.
static AisDeviceTracker * Instance()
get the instance of the device tracker.
void firmwareUpdateFinished(const QString &deviceName, bool success)
Emitted when a device finishes the firmware update process.
void newDeviceConnected(const QString &deviceName)
a signal to be emitted whenever a new connection has been successfully established with a device.
This class contains the possible error codes returned to the user when working with the API....
Definition AisErrorCode.h:18
this class provides control of the device including starting, pausing, resuming and stopping an exper...
Definition AisInstrumentHandler.h:27