This class is used track device connections to the computer. It can establish connection with plugged-in devices. It also provides instrument handlers specific to each connected device which can provide control of the specific device like starting experiments.
More...
#include <AisDeviceTracker.h>
|
void | newDeviceConnected (const QString &deviceName) |
| a signal to be emitted whenever a new connection has been successfully established with a device. More...
|
|
void | deviceDisconnected (const QString &deviceName) |
| a signal to be emitted whenever a device has been disconnected. More...
|
|
void | firmwareUpdateNotification (const QString &message) |
|
This class is used track device connections to the computer. It can establish connection with plugged-in devices. It also provides instrument handlers specific to each connected device which can provide control of the specific device like starting experiments.
◆ connectAllPluggedInDevices()
int AisDeviceTracker::connectAllPluggedInDevices |
( |
| ) |
|
connect all devices physically plugged to the computer.
This will automatically detect all the communication ports that have devices plugged in and establish a connection with each.
- Returns
- the number of new devices that have successfully established a connection with the computer. If a device has already been connected before calling this function, it will not be counted in the return value.
- Note
- emits newDeviceConnected() signal with the device name for each successful connection.
◆ connectToDeviceOnComPort()
AisErrorCode AisDeviceTracker::connectToDeviceOnComPort |
( |
const QString & |
comPort | ) |
|
establish a connection with a device connected on a USB port.
- Parameters
-
comPort | the communication port to connect through. |
- Returns
- AisErrorCode::Success if a connection was established with the device through the given communication port. If not successful, possible returned errors are:
- Note
- emits newDeviceConnected() signal with the device name if establishing the connection was successful.
-
You need to specify the communication port specific to your computer. For example, on PC, you may find your port number through the 'device manager'. An example would be "COM15".
◆ deviceDisconnected
void AisDeviceTracker::deviceDisconnected |
( |
const QString & |
deviceName | ) |
|
|
signal |
a signal to be emitted whenever a device has been disconnected.
- Parameters
-
deviceName | the name of the newly disconnected device. |
◆ getConnectedDevices()
const std::list< QString > AisDeviceTracker::getConnectedDevices |
( |
| ) |
const |
get a list of all the connected devices.
- Returns
- a list of all the connected devices.
◆ getInstrumentHandler()
const AisInstrumentHandler & AisDeviceTracker::getInstrumentHandler |
( |
const QString & |
deviceName | ) |
const |
◆ newDeviceConnected
void AisDeviceTracker::newDeviceConnected |
( |
const QString & |
deviceName | ) |
|
|
signal |
a signal to be emitted whenever a new connection has been successfully established with a device.
- Parameters
-
deviceName | the name of the newly connected device. |
- Note
- this signal will be emitted for each newly connected device whenever either connectToDeviceOnComPort() or connectAllPluggedInDevices() successfully established connections.
◆ saveLogToFile()
void AisDeviceTracker::saveLogToFile |
( |
bool |
save | ) |
|
Allow to collect device error message in file for debugging purpose.
- Note
- by default it will be true.
- Parameters
-
save | When set to 'false,' it will not write logs to the file. When set to 'true,' it will begin writing device error logs to the file. |
- See also
- setLogFilePath
◆ setLogFilePath()
void AisDeviceTracker::setLogFilePath |
( |
const QString & |
path | ) |
|
This will help to change the log file directory.
- Note
- by default it will be Document/Admiral Instrument/API
- Parameters
-
path | Set the path value at which you want to save the log file. |
- Note
- If you set 'false' for 'saveLogToFile,' it will not generate the log file. It is recommended to set it to 'true' or leave the permission as the default setting.
- See also
- saveLogToFile
◆ updateFirmwareOnAllAvailableDevices()
int AisDeviceTracker::updateFirmwareOnAllAvailableDevices |
( |
| ) |
|
request firmware update for all available devices.
This will automatically detect devices not currently in use and update firmware if necessary.
- Returns
- the number of devices that have successfully requested for firmware update. If a device has already been updated firmware before calling this function, it will not be counted in the return value. If any error is generated while requesting firmware update, it will not be counted in the return value.
- Note
- emits firmwareUpdateNotification() signal will provide notification regarding firmware update of all devices.
-
You can update firmware when you reset the device physically through reset button.
- See also
- updateFirmwareOnComPort
◆ updateFirmwareOnComPort()
AisErrorCode AisDeviceTracker::updateFirmwareOnComPort |
( |
const QString & |
comport | ) |
const |
update firmware on connected device at USB port.
- Parameters
-
comPort | the communication port to connect through. |
- Returns
- AisErrorCode::Success if firmware update successfully initiated through the given communication port. If not successful, possible returned errors are:
- Note
- emits firmwareUpdateNotification() signal to provide firmware update progress.
-
You need to specify the communication port specific to your computer. For example, on PC, you may find your port number through the 'device manager'. An example would be "COM15".
The documentation for this class was generated from the following file: