![]() |
this class provides control of the device including starting, pausing, resuming and stopping an experiment on a channel as well as reading the data and other controls of the device. More...
#include <AisInstrumentHandler.h>
#include <AisInstrumentHandler.h>
Signals | |
void | deviceDisconnected () |
a signal that is emitted if the device associated with this handler has been disconnected. | |
void | groundFloatStateChanged (bool grounded) |
a signal that is emitted when the floating ground connection state has changed. | |
void | experimentNewElementStarting (uint8_t channel, const AisExperimentNode &stepInfo) |
a signal that is emitted whenever a new elemental experiment has started. | |
void | activeDCDataReady (uint8_t channel, const AisDCData &DCData) |
a signal that is emitted whenever new DC data for an active experiment are ready. | |
void | idleDCDataReady (uint8_t channel, const AisDCData &DCData) |
a signal that is emitted whenever new DC data are ready when the device is in an idle state. | |
void | recoveryDCDataReady (uint8_t channel, const AisDCData &DCData) |
a signal that is emitted whenever new DC recovery data are ready. | |
void | activeACDataReady (uint8_t channel, const AisACData &ACData) |
a signal that is emitted whenever new AC data for an active experiment are ready. | |
void | recoveryACDataReady (uint8_t channel, const AisACData &ACData) |
a signal that is emitted whenever new AC recovery data are ready. | |
void | experimentStopped (uint8_t channel, const QString &reason) |
a signal that is emitted whenever an experiment was stopped manually or has completed. | |
void | experimentPaused (uint8_t channel) |
a signal that is emitted whenever an experiment was paused. | |
void | experimentResumed (uint8_t channel) |
a signal that is emitted whenever an experiment was resumed. | |
void | recoverDataErased (bool successful) |
a signal that is emitted whenever data erase process is completed. | |
void | deviceError (uint8_t channel, const QString &error) |
a signal that is emitted whenever device send any critical error. | |
Public Member Functions | |
AisErrorCode | uploadExperimentToChannel (uint8_t channel, std::shared_ptr< AisExperiment > experiment) const |
upload an already created custom experiment to a specific channel on the device. | |
AisErrorCode | uploadExperimentToChannel (uint8_t channel, const AisExperiment &experiment) const |
upload an already created custom experiment to a specific channel on the device. | |
AisErrorCode | startUploadedExperiment (uint8_t channel) const |
start the previously uploaded experiment on the specific channel. | |
AisErrorCode | startIdleSampling (uint8_t channel) const |
start idle sampling when an experiment is neither uploaded nor running on the specified channel. | |
AisErrorCode | skipExperimentStep (uint8_t channel) const |
skip the current experiment step and proceed to the next. | |
AisErrorCode | pauseExperiment (uint8_t channel) const |
pause a running experiment on the channel. | |
AisErrorCode | resumeExperiment (uint8_t channel) const |
resume a paused experiment on the channel. | |
AisErrorCode | stopExperiment (uint8_t channel) const |
stop a running or a paused experiment on the channel. | |
double | getExperimentUTCStartTime (uint8_t channel) const |
get UTC time for the start of the experiment in seconds. | |
AisErrorCode | setIRComp (uint8_t channel, double uncompensatedResistance, double compensationLevel) const |
set IR compensation. | |
AisErrorCode | setCompRange (uint8_t channel, const AisCompRange &compRange) const |
set a compensation range with stability factor and bandwidth index. | |
int8_t | setLinkedChannels (std::vector< uint8_t > channels) const |
connect several channels together in parallel mode. | |
int8_t | setBipolarLinkedChannels (std::vector< uint8_t > channels) const |
connect two channels together in bipolar mode. | |
bool | hasBipolarMode (uint8_t channel) const |
tells whether the given channel is bipolar mode | |
std::vector< uint8_t > | getLinkedChannels (uint8_t channel) const |
get a list of channels linked to the given channel. | |
AisErrorCode | setFanSpeedMaximum () const |
Set the fan speed to maximum when an experiment is active. Only available on some devices. | |
AisErrorCode | setFanSpeedVariable () const |
Set the fan speed to always adjust automatically based on the internal temperature of the instrument. Only available on some devices. | |
bool | isChannelBusy (uint8_t channel) const |
tells whether the given channel is busy or not. | |
bool | isChannelPaused (uint8_t channel) const |
tells whether the given channel has a paused experiment or not. | |
std::vector< uint8_t > | getFreeChannels () const |
get a list of the currently free channels. | |
int | getNumberOfChannels () const |
get the number of all the channels on this device. | |
AisErrorCode | eraseRecoverData () const |
delete the recover data from device. | |
AisErrorCode | startManualExperiment (uint8_t channel) const |
start a manual experiment. | |
AisErrorCode | setManualModeSamplingInterval (uint8_t channel, double value) const |
set an interval for sampling the data. | |
AisErrorCode | setManualModeOCP (uint8_t channel) const |
set open-circuit potential mode. | |
AisErrorCode | setManualModeConstantVoltage (uint8_t channel, double value) const |
set constant voltage for the manual experiment. | |
AisErrorCode | setManualModeConstantVoltage (uint8_t channel, double value, int currentRangeIndex) const |
set constant voltage for the manual experiment and also set a manual current range. | |
AisErrorCode | setManualModeCurrentRange (uint8_t channel, int currentRangeIndex) const |
set the current range for the manual experiment. Once a range is set, autoranging capability is turned off. That means that during potentiostatic control, the current range may range up if necessary, but it will not drop below the user-set range. During galvanostatic control, the lowest current range that contains the designated setpoint will be chosen, provided it is not lower than the user-set range. | |
AisErrorCode | setManualModeCurrentAutorange (uint8_t channel) const |
enable current autoranging for the manual experiment. | |
AisErrorCode | setManualModeVoltageRange (uint8_t channel, int voltageRangeIndex) const |
set the voltage range for the manual experiment. Once a range is set, autoranging capability is turned off. That means that during galvanostatic control, the voltage range may range up if necessary, but it will not drop below the user-set range. During potentiostatic control, the lowest voltage range that contains the designated setpoint will be chosen, provided it is not lower than the user-set range. | |
AisErrorCode | setManualModeVoltageAutorange (uint8_t channel) const |
enable voltage autoranging for the manual experiment. | |
AisErrorCode | setManualModeConstantCurrent (uint8_t channel, double value) const |
set constant current for the manual experiment. | |
std::vector< std::pair< double, double > > | getManualModeCurrentRangeList (uint8_t channel) const |
get a list of the applicable current ranges to the given channel specific to your device. | |
std::vector< std::pair< double, double > > | getManualModeVoltageRangeList (uint8_t channel) const |
get a list of the applicable voltage ranges to the given channel specific to your device. | |
AisErrorCode | setChannelMaximumVoltage (uint8_t channel, double Vmax) const |
Sets the maximum allowable voltage for a channel. The experiment will stop if the measured voltage exceeds this limit. | |
AisErrorCode | setChannelMinimumVoltage (uint8_t channel, double Vmin) const |
Sets the minimum allowable voltage for a channel. The experiment will stop if the measured voltage falls below this limit. | |
AisErrorCode | setChannelMaximumCurrent (uint8_t channel, double Imax) const |
Sets the maximum allowable current for a channel. The experiment will stop if the measured current exceeds this limit. | |
AisErrorCode | setChannelMinimumCurrent (uint8_t channel, double Imin) const |
Sets the minimum allowable current for a channel. The experiment will stop if the measured current falls below this limit. | |
AisErrorCode | setChannelMaximumTemperature (uint8_t channel, double MaxTemperature) const |
Sets the maximum allowable temperature for a channel. The experiment will stop if the measured temperature exceeds this limit. | |
AisErrorCode | resetChannelLimits (uint8_t channel) const |
Resets all limits for the specified channel. | |
|
signal |
channel | the channel number from which the AC data arrived. |
ACData | the AC data that just arrived. |
|
signal |
channel | the channel number from which the DC data arrived. |
DCData | the DC data that just arrived. |
|
signal |
channel | the channel number at which error rise. |
error | information about error message. |
AisErrorCode AisInstrumentHandler::eraseRecoverData | ( | ) | const |
|
signal |
channel | the channel number on which the experiment was started. |
stepInfo | information regarding the current step. |
|
signal |
channel | the channel on which the experiment was paused. |
|
signal |
channel | the channel on which the experiment was resumed. |
|
signal |
channel | the channel on which the experiment has stopped. |
reason | the reason why the experiment has stopped. |
double AisInstrumentHandler::getExperimentUTCStartTime | ( | uint8_t | channel | ) | const |
This will give the time in seconds between the origin of UTC time and the start of the experiment aka Unix Epoch.
channel | the channel for which to get the start time of the experiment. |
std::vector< uint8_t > AisInstrumentHandler::getFreeChannels | ( | ) | const |
std::vector< uint8_t > AisInstrumentHandler::getLinkedChannels | ( | uint8_t | channel | ) | const |
channel | a valid channel number to find which other channels are linked to it. |
std::vector< std::pair< double, double > > AisInstrumentHandler::getManualModeCurrentRangeList | ( | uint8_t | channel | ) | const |
The list is indexed, with each index containing a range with minimum and maximum current for the range. You can pass the index of the desired current range to setManualModeConstantVoltage or setManualModeConstantCurrent.
channel | a valid channel number for which to check the current range. |
std::vector< std::pair< double, double > > AisInstrumentHandler::getManualModeVoltageRangeList | ( | uint8_t | channel | ) | const |
The list is indexed, with each index containing a range with minimum and maximum voltage for the range. You can pass the index of the desired current range to setManualModeConstantVoltage or setManualModeConstantCurrent.
channel | a valid channel number for which to check the current range. |
int AisInstrumentHandler::getNumberOfChannels | ( | ) | const |
|
signal |
grounded | true if there is a connection to ground and false if the ground has disconnected. |
bool AisInstrumentHandler::hasBipolarMode | ( | uint8_t | channel | ) | const |
channel | the channel number to check if it is bipolar mode |
|
signal |
A manual experiment displays real time values. These values are displayed even if the channel does not have an experiment running on it.
channel | the channel number from which the DC data arrived. |
DCData | the DC data that just arrived. |
bool AisInstrumentHandler::isChannelBusy | ( | uint8_t | channel | ) | const |
channel | the channel number to check if it is busy or not. |
bool AisInstrumentHandler::isChannelPaused | ( | uint8_t | channel | ) | const |
channel | the channel number to check if it has a paused experiment. |
AisErrorCode AisInstrumentHandler::pauseExperiment | ( | uint8_t | channel | ) | const |
channel | the channel number to pause the experiment on. |
This will return AisErrorCode::Success only if there is currently a running experiment on a valid channel on a connected device.
|
signal |
successful | is true on erased correctly, and false on data is not erased. |
|
signal |
channel | the channel number from which the AC data are recovered from. |
ACData | the AC data that just arrived. |
|
signal |
channel | the channel number from which the DC data are recovered from. |
DCData | the DC data that just arrived. |
AisErrorCode AisInstrumentHandler::resetChannelLimits | ( | uint8_t | channel | ) | const |
This function removes all configured voltage, current, and temperature limits for a specific channel, restoring it to its default state.
channel | The channel number for which the limits are to be reset. |
AisErrorCode AisInstrumentHandler::resumeExperiment | ( | uint8_t | channel | ) | const |
channel | the channel number to resume the experiment on. |
This will return AisErrorCode::Success only if there is currently a paused experiment on a valid channel on a connected device.
int8_t AisInstrumentHandler::setBipolarLinkedChannels | ( | std::vector< uint8_t > | channels | ) | const |
You may combine two channels to expand the voltage range to include negative voltages. Note that this is only applicable to the cycler model. For 4 channel Cycler models, you can combine channels 1 and 2 or channels 3 and 4. You cannot use any other channel combinations.
channels | a list of two channels to be oprate in bipolar mode. |
AisErrorCode AisInstrumentHandler::setChannelMaximumCurrent | ( | uint8_t | channel, |
double | Imax ) const |
Sets the maximum allowable current for a channel. The experiment will stop if the measured current exceeds this limit.
channel | The channel number for which the current limit is to be set. |
Imax | The maximum allowable current in amperes. |
AisErrorCode AisInstrumentHandler::setChannelMaximumTemperature | ( | uint8_t | channel, |
double | MaxTemperature ) const |
Sets the maximum allowable temperature for a channel. The experiment will stop if the measured temperature exceeds this limit.
channel | The channel number for which the temperature limit is to be set. |
MaxTemperature | The maximum allowable temperature in degrees Celsius. |
AisErrorCode AisInstrumentHandler::setChannelMaximumVoltage | ( | uint8_t | channel, |
double | Vmax ) const |
Sets the maximum allowable voltage for a channel. The experiment will stop if the measured voltage exceeds this limit.
channel | The channel number for which the voltage limit is to be set. |
Vmax | The maximum allowable voltage in volts. |
AisErrorCode AisInstrumentHandler::setChannelMinimumCurrent | ( | uint8_t | channel, |
double | Imin ) const |
Sets the minimum allowable current for a channel. The experiment will stop if the measured current falls below this limit.
channel | The channel number for which the current limit is to be set. |
Imin | The minimum allowable current in amperes. |
AisErrorCode AisInstrumentHandler::setChannelMinimumVoltage | ( | uint8_t | channel, |
double | Vmin ) const |
Sets the minimum allowable voltage for a channel. The experiment will stop if the measured voltage falls below this limit.
channel | The channel number for which the voltage limit is to be set. |
Vmin | The minimum allowable voltage in volts. |
AisErrorCode AisInstrumentHandler::setCompRange | ( | uint8_t | channel, |
const AisCompRange & | compRange ) const |
channel | the channel for which to set the compensation range. |
compRange | an object of type compRange that is initialized with a stability factor (0-10) and a bandwidth index (0-10). |
AisErrorCode AisInstrumentHandler::setFanSpeedMaximum | ( | ) | const |
Set the fan speed to maximum when an experiment is active. Only available on some devices.
Model-specific fan behavior:
AisErrorCode::Success | |
AisErrorCode::DeviceNotFound | |
AisErrorCode::FeatureNotSupported | |
AisErrorCode::DeviceCommunicationFailed |
AisErrorCode AisInstrumentHandler::setFanSpeedVariable | ( | ) | const |
Set the fan speed to always adjust automatically based on the internal temperature of the instrument. Only available on some devices.
Model-specific fan behavior:
AisErrorCode::Success | |
AisErrorCode::DeviceNotFound | |
AisErrorCode::FeatureNotSupported | |
AisErrorCode::DeviceCommunicationFailed |
AisErrorCode AisInstrumentHandler::setIRComp | ( | uint8_t | channel, |
double | uncompensatedResistance, | ||
double | compensationLevel ) const |
channel | the channel for which to set the IR compensation. |
uncompensatedResistance | the value of the uncompensated resistance in Ohms. |
compensationLevel | the compensation percentage (0%-100%). This is unit-less. |
int8_t AisInstrumentHandler::setLinkedChannels | ( | std::vector< uint8_t > | channels | ) | const |
You may connect a list of channels so you can get a higher combined output current of all channels. Note that this is only applicable to the cycler model.
channels | a list of channels to be linked. |
AisErrorCode AisInstrumentHandler::setManualModeConstantCurrent | ( | uint8_t | channel, |
double | value ) const |
channel | a valid channel number to set a constant voltage for. |
value | the value to set the constant current in Amps. |
AisErrorCode AisInstrumentHandler::setManualModeConstantVoltage | ( | uint8_t | channel, |
double | value ) const |
channel | a valid channel number to set a constant voltage for. |
value | the value to set the constant voltage in volts. |
AisErrorCode AisInstrumentHandler::setManualModeConstantVoltage | ( | uint8_t | channel, |
double | value, | ||
int | currentRangeIndex ) const |
channel | a valid channel number to set a constant voltage for. |
value | the value to set the constant voltage in volts. |
currentRangeIndex | the index of the desired current range. |
AisErrorCode AisInstrumentHandler::setManualModeCurrentAutorange | ( | uint8_t | channel | ) | const |
channel | a valid channel number to enable current autoranging for. |
AisErrorCode AisInstrumentHandler::setManualModeCurrentRange | ( | uint8_t | channel, |
int | currentRangeIndex ) const |
channel | a valid channel number to set the current range for. |
currentRangeIndex | the index of the desired current range. |
AisErrorCode AisInstrumentHandler::setManualModeOCP | ( | uint8_t | channel | ) | const |
To apply the set potential or current, leave the open circuit potential mode off. This operation is reversed automatically when calling either setManualModeConstantVoltage() or setManualModeConstantCurrent()
channel | a valid channel number to set open circuit mode on. |
AisErrorCode AisInstrumentHandler::setManualModeSamplingInterval | ( | uint8_t | channel, |
double | value ) const |
channel | the channel to set the sampling interval for. |
value | the value for the sampling interval in seconds. |
AisErrorCode AisInstrumentHandler::setManualModeVoltageAutorange | ( | uint8_t | channel | ) | const |
channel | a valid channel number to enable voltage autoranging for. |
AisErrorCode AisInstrumentHandler::setManualModeVoltageRange | ( | uint8_t | channel, |
int | voltageRangeIndex ) const |
channel | a valid channel number to set the voltage range for. |
voltageRangeIndex | the index of the desired voltage range. |
AisErrorCode AisInstrumentHandler::skipExperimentStep | ( | uint8_t | channel | ) | const |
When running an element that has several steps like going from CC to CV, then skipping the step goes to the next step within the element. When having several elements in the custom experiment and the current element has one step or we are at the last step within the element, then skipping the step results in going to the next element. If this is the final step of the final element, the experiment will stop.
channel | a valid channel number with an experiment to skip the step. |
AisErrorCode AisInstrumentHandler::startIdleSampling | ( | uint8_t | channel | ) | const |
channel | the channel number to start collecting idle data on. |
AisErrorCode AisInstrumentHandler::startManualExperiment | ( | uint8_t | channel | ) | const |
With manual experiments, users can turn on any connected channel and toggle between open circuit mode and voltage or current setpoints that can be changed in real-time and run for indefinite periods.
channel | a valid channel number to run the manual experiment on. |
AisErrorCode AisInstrumentHandler::startUploadedExperiment | ( | uint8_t | channel | ) | const |
channel | the channel number to start the experiment on. |
AisErrorCode AisInstrumentHandler::stopExperiment | ( | uint8_t | channel | ) | const |
channel | the channel number to stop the experiment on. |
This will only return AisErrorCode::Success if there is currently a running or a paused experiment on a valid channel on a connected device.
AisErrorCode AisInstrumentHandler::uploadExperimentToChannel | ( | uint8_t | channel, |
const AisExperiment & | experiment ) const |
Any running experiment is run on a specific device on a specific channel. This function uploads an experiment to a channel so that you may start, pause, resume and stop the experiment. All of these four control functionalities and others require a channel number to control the experiment. Therefore, if we have several channels, we need to keep track of which experiment is on which channel.
channel | the channel number to upload the experiment to. |
experiment | the custom experiment to be uploaded to the channel. |
This returns AisErrorCode::Success only when given a valid channel number that is not busy on a connected device.
AisErrorCode AisInstrumentHandler::uploadExperimentToChannel | ( | uint8_t | channel, |
std::shared_ptr< AisExperiment > | experiment ) const |
Any running experiment is run on a specific device on a specific channel. This function uploads an experiment to a channel so that you may start, pause, resume and stop the experiment. All of these four control functionalities and others require a channel number to control the experiment. Therefore, if we have several channels, we need to keep track of which experiment is on which channel.
channel | the channel number to upload the experiment to. |
experiment | the custom experiment to be uploaded to the channel. |
This returns AisErrorCode::Success only when given a valid channel number that is not busy on a connected device.