Loading...
Searching...
No Matches
AisInstrumentHandler.h
1#ifndef SQUIDSTATLIBRARY_AISINSTRUMENTHANDLER_H
2#define SQUIDSTATLIBRARY_AISINSTRUMENTHANDLER_H
3
4#include <ctime>
5
6#include <QObject>
7
8#include "AisCompRange.h"
9#include "AisDataPoints.h"
10#include "AisErrorCode.h"
11#include "AisSquidstatGlobal.h"
12
13class AisInstrumentHandlerPrivate;
14class AisExperiment;
15
27class SQUIDSTATLIBRARY_EXPORT AisInstrumentHandler final : public QObject {
28 Q_OBJECT
29 AisInstrumentHandlerPrivate* m_data;
30public:
32 explicit AisInstrumentHandler(AisInstrumentHandlerPrivate* privateData);
35
58 AisErrorCode uploadExperimentToChannel(uint8_t channel, std::shared_ptr<AisExperiment> experiment) const;
59
82 AisErrorCode uploadExperimentToChannel(uint8_t channel, const AisExperiment& experiment) const;
83
97 AisErrorCode startUploadedExperiment(uint8_t channel) const;
98
110 AisErrorCode startIdleSampling(uint8_t channel) const;
111
128 AisErrorCode skipExperimentStep(uint8_t channel) const;
129
142 AisErrorCode pauseExperiment(uint8_t channel) const;
143
156 AisErrorCode resumeExperiment(uint8_t channel) const;
157
169 AisErrorCode stopExperiment(uint8_t channel) const;
170
178 double getExperimentUTCStartTime(uint8_t channel) const;
179
192 AisErrorCode setIRComp(uint8_t channel, double uncompensatedResistance, double compensationLevel) const;
193
205 AisErrorCode setCompRange(uint8_t channel, const AisCompRange& compRange) const;
206
217 int8_t setLinkedChannels(std::vector<uint8_t> channels) const;
218
230 int8_t setBipolarLinkedChannels(std::vector<uint8_t> channels) const;
231
232
238 bool hasBipolarMode(uint8_t channel) const;
239
245 std::vector<uint8_t> getLinkedChannels(uint8_t channel) const;
246
262
277
283 bool isChannelBusy(uint8_t channel) const;
284
290 bool isChannelPaused(uint8_t channel) const;
291
296 std::vector<uint8_t> getFreeChannels() const;
297
303
312
326 AisErrorCode startManualExperiment(uint8_t channel) const;
327
338 AisErrorCode setManualModeSamplingInterval(uint8_t channel, double value) const;
339
353 AisErrorCode setManualModeOCP(uint8_t channel) const;
354
366 AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value) const;
367
382 [[deprecated("This has been replaced by setManualModeCurrentRange().")]]
383 AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value, int currentRangeIndex) const;
384
400 AisErrorCode setManualModeCurrentRange(uint8_t channel, int currentRangeIndex) const;
401
413
429 AisErrorCode setManualModeVoltageRange(uint8_t channel, int voltageRangeIndex) const;
430
442
455 AisErrorCode setManualModeConstantCurrent(uint8_t channel, double value) const;
456
465 std::vector<std::pair<double, double>> getManualModeCurrentRangeList(uint8_t channel) const;
466
475 std::vector<std::pair<double, double>> getManualModeVoltageRangeList(uint8_t channel) const;
476
477
490 AisErrorCode setChannelMaximumVoltage(uint8_t channel, double Vmax) const;
491
504 AisErrorCode setChannelMinimumVoltage(uint8_t channel, double Vmin) const;
505
518 AisErrorCode setChannelMaximumCurrent(uint8_t channel, double Imax) const;
519
532 AisErrorCode setChannelMinimumCurrent(uint8_t channel, double Imin) const;
533
545 AisErrorCode setChannelMaximumTemperature(uint8_t channel, double MaxTemperature) const;
546
556 AisErrorCode resetChannelLimits(uint8_t channel) const;
557signals:
558
564
569 void groundFloatStateChanged(bool grounded);
570
577 void experimentNewElementStarting(uint8_t channel, const AisExperimentNode& stepInfo);
578
584 void activeDCDataReady(uint8_t channel, const AisDCData& DCData);
585
593 void idleDCDataReady(uint8_t channel, const AisDCData& DCData);
594
600 void recoveryDCDataReady(uint8_t channel, const AisDCData& DCData);
601
607 void activeACDataReady(uint8_t channel, const AisACData& ACData);
608
614 void recoveryACDataReady(uint8_t channel, const AisACData& ACData);
615
621 void experimentStopped(uint8_t channel, const QString& reason);
622
627 void experimentPaused(uint8_t channel);
628
633 void experimentResumed(uint8_t channel);
634
639 void recoverDataErased(bool successful);
640
647 void deviceError(uint8_t channel, const QString& error);
648
649
650private slots:
651 void onActiveExperimentNodeBeginning(uint8_t channel, const AisExperimentNode&);
652 void onRecoveryExperimentNodeBeginning(uint8_t channel, const AisExperimentNode&);
653 void onDeviceDisconnected();
654
655private:
656 void connectWithOperatorSignals();
657};
658
659#endif //SQUIDSTATLIBRARY_AISINSTRUMENTHANDLER_H
This class has advanced options controlling the device stability including the bandwidth index and th...
Definition AisCompRange.h:17
This class contains the possible error codes returned to the user when working with the API....
Definition AisErrorCode.h:18
this class is used to create custom experiments. A custom experiment contains one or more elements....
Definition AisExperiment.h:22
this class provides control of the device including starting, pausing, resuming and stopping an exper...
Definition AisInstrumentHandler.h:27
std::vector< uint8_t > getLinkedChannels(uint8_t channel) const
get a list of channels linked to the given channel.
AisErrorCode startIdleSampling(uint8_t channel) const
start idle sampling when an experiment is neither uploaded nor running on the specified channel.
int getNumberOfChannels() const
get the number of all the channels on this device.
AisErrorCode pauseExperiment(uint8_t channel) const
pause a running experiment on the channel.
AisErrorCode setManualModeVoltageAutorange(uint8_t channel) const
enable voltage autoranging 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.
double getExperimentUTCStartTime(uint8_t channel) const
get UTC time for the start of the experiment in seconds.
AisErrorCode stopExperiment(uint8_t channel) const
stop a running or a paused experiment on the channel.
std::vector< uint8_t > getFreeChannels() const
get a list of the currently free channels.
void deviceDisconnected()
a signal that is emitted if the device associated with this handler has been disconnected.
AisErrorCode setFanSpeedMaximum() const
Set the fan speed to maximum when an experiment is active. Only available on some devices.
bool hasBipolarMode(uint8_t channel) const
tells whether the given channel is bipolar mode
void activeACDataReady(uint8_t channel, const AisACData &ACData)
a signal that is emitted whenever new AC data for an active experiment are ready.
AisErrorCode resumeExperiment(uint8_t channel) const
resume a paused experiment on the channel.
void deviceError(uint8_t channel, const QString &error)
a signal that is emitted whenever device send any critical error.
void activeDCDataReady(uint8_t channel, const AisDCData &DCData)
a signal that is emitted whenever new DC data for an active experiment are ready.
void groundFloatStateChanged(bool grounded)
a signal that is emitted when the floating ground connection state has changed.
AisErrorCode uploadExperimentToChannel(uint8_t channel, std::shared_ptr< AisExperiment > experiment) const
upload an already created custom experiment to a specific channel on the device.
void recoveryDCDataReady(uint8_t channel, const AisDCData &DCData)
a signal that is emitted whenever new DC recovery data are ready.
int8_t setBipolarLinkedChannels(std::vector< uint8_t > channels) const
connect two channels together in bipolar mode.
AisErrorCode startUploadedExperiment(uint8_t channel) const
start the previously uploaded experiment on the specific channel.
AisErrorCode setChannelMinimumVoltage(uint8_t channel, double Vmin) const
Sets the minimum allowable voltage for a channel. The experiment will stop if the measured voltage fa...
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.
bool isChannelPaused(uint8_t channel) const
tells whether the given channel has a paused experiment or not.
AisErrorCode setFanSpeedVariable() const
Set the fan speed to always adjust automatically based on the internal temperature of the instrument....
bool isChannelBusy(uint8_t channel) const
tells whether the given channel is busy or not.
AisErrorCode resetChannelLimits(uint8_t channel) const
Resets all limits for the specified channel.
AisErrorCode setManualModeOCP(uint8_t channel) const
set open-circuit potential mode.
AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value, int currentRangeIndex) const
set constant voltage for the manual experiment and also set a manual current range.
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.
AisErrorCode startManualExperiment(uint8_t channel) const
start a manual experiment.
void experimentNewElementStarting(uint8_t channel, const AisExperimentNode &stepInfo)
a signal that is emitted whenever a new elemental experiment has started.
void recoverDataErased(bool successful)
a signal that is emitted whenever data erase process is completed.
AisErrorCode setManualModeCurrentRange(uint8_t channel, int currentRangeIndex) const
set the current range for the manual experiment. Once a range is set, autoranging capability is turne...
AisErrorCode setManualModeVoltageRange(uint8_t channel, int voltageRangeIndex) const
set the voltage range for the manual experiment. Once a range is set, autoranging capability is turne...
void experimentPaused(uint8_t channel)
a signal that is emitted whenever an experiment was paused.
void recoveryACDataReady(uint8_t channel, const AisACData &ACData)
a signal that is emitted whenever new AC recovery data are ready.
AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value) const
set constant voltage for the manual experiment.
AisErrorCode skipExperimentStep(uint8_t channel) const
skip the current experiment step and proceed to the next.
AisErrorCode setChannelMinimumCurrent(uint8_t channel, double Imin) const
Sets the minimum allowable current for a channel. The experiment will stop if the measured current fa...
void experimentResumed(uint8_t channel)
a signal that is emitted whenever an experiment was resumed.
int8_t setLinkedChannels(std::vector< uint8_t > channels) const
connect several channels together in parallel mode.
AisErrorCode setChannelMaximumCurrent(uint8_t channel, double Imax) const
Sets the maximum allowable current for a channel. The experiment will stop if the measured current ex...
AisErrorCode eraseRecoverData() const
delete the recover data from device.
AisErrorCode setCompRange(uint8_t channel, const AisCompRange &compRange) const
set a compensation range with stability factor and bandwidth index.
AisErrorCode setChannelMaximumTemperature(uint8_t channel, double MaxTemperature) const
Sets the maximum allowable temperature for a channel. The experiment will stop if the measured temper...
void experimentStopped(uint8_t channel, const QString &reason)
a signal that is emitted whenever an experiment was stopped manually or has completed.
AisErrorCode setChannelMaximumVoltage(uint8_t channel, double Vmax) const
Sets the maximum allowable voltage for a channel. The experiment will stop if the measured voltage ex...
AisErrorCode uploadExperimentToChannel(uint8_t channel, const AisExperiment &experiment) const
upload an already created custom experiment to a specific channel on the device.
AisErrorCode setManualModeCurrentAutorange(uint8_t channel) const
enable current autoranging for the manual experiment.
AisErrorCode setManualModeSamplingInterval(uint8_t channel, double value) const
set an interval for sampling the data.
AisErrorCode setManualModeConstantCurrent(uint8_t channel, double value) const
set constant current for the manual experiment.
AisErrorCode setIRComp(uint8_t channel, double uncompensatedResistance, double compensationLevel) const
set IR compensation.
A structure containing AC data collected from the instrument.
Definition AisDataPoints.h:44
A structure containing DC data collected from the instrument.
Definition AisDataPoints.h:11
A structure containing some information regarding the running element.
Definition AisDataPoints.h:113