Squidstat API User Manual
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
24class SQUIDSTATLIBRARY_EXPORT AisInstrumentHandler final : public QObject {
25 Q_OBJECT
26 AisInstrumentHandlerPrivate* m_data;
27public:
29 explicit AisInstrumentHandler(AisInstrumentHandlerPrivate* privateData);
32
55 AisErrorCode uploadExperimentToChannel(uint8_t channel, std::shared_ptr<AisExperiment> experiment) const;
56
79 AisErrorCode uploadExperimentToChannel(uint8_t channel, const AisExperiment& experiment) const;
80
94 AisErrorCode startUploadedExperiment(uint8_t channel) const;
95
107 AisErrorCode startIdleSampling(uint8_t channel) const;
108
125 AisErrorCode skipExperimentStep(uint8_t channel) const;
126
139 AisErrorCode pauseExperiment(uint8_t channel) const;
140
153 AisErrorCode resumeExperiment(uint8_t channel) const;
154
166 AisErrorCode stopExperiment(uint8_t channel) const;
167
175 double getExperimentUTCStartTime(uint8_t channel) const;
176
189 AisErrorCode setIRComp(uint8_t channel, double uncompensatedResistance, double compensationLevel) const;
190
202 AisErrorCode setCompRange(uint8_t channel, const AisCompRange& compRange) const;
203
214 int8_t setLinkedChannels(std::vector<uint8_t> channels) const;
215
227 int8_t setBipolarLinkedChannels(std::vector<uint8_t> channels) const;
228
229
235 bool hasBipolarMode(uint8_t channel) const;
236
242 std::vector<uint8_t> getLinkedChannels(uint8_t channel) const;
243
249 bool isChannelBusy(uint8_t channel) const;
250
256 bool isChannelPaused(uint8_t channel) const;
257
262 std::vector<uint8_t> getFreeChannels() const;
263
269
278
292 AisErrorCode startManualExperiment(uint8_t channel) const;
293
304 AisErrorCode setManualModeSamplingInterval(uint8_t channel, double value) const;
305
319 AisErrorCode setManualModeOCP(uint8_t channel) const;
320
332 AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value) const;
333
348 [[deprecated("This has been replaced by setManualModeCurrentRange().")]]
349 AisErrorCode setManualModeConstantVoltage(uint8_t channel, double value, int currentRangeIndex) const;
350
366 AisErrorCode setManualModeCurrentRange(uint8_t channel, int currentRangeIndex) const;
367
379
395 AisErrorCode setManualModeVoltageRange(uint8_t channel, int voltageRangeIndex) const;
396
408
421 AisErrorCode setManualModeConstantCurrent(uint8_t channel, double value) const;
422
431 std::vector<std::pair<double, double>> getManualModeCurrentRangeList(uint8_t channel) const;
432
441 std::vector<std::pair<double, double>> getManualModeVoltageRangeList(uint8_t channel) const;
442
443
444signals:
445
451
456 void groundFloatStateChanged(bool grounded);
457
464 void experimentNewElementStarting(uint8_t channel, const AisExperimentNode& stepInfo);
465
471 void activeDCDataReady(uint8_t channel, const AisDCData& DCData);
472
480 void idleDCDataReady(uint8_t channel, const AisDCData& DCData);
481
487 void recoveryDCDataReady(uint8_t channel, const AisDCData& DCData);
488
494 void activeACDataReady(uint8_t channel, const AisACData& ACData);
495
501 void recoveryACDataReady(uint8_t channel, const AisACData& ACData);
502
507 void experimentStopped(uint8_t channel);
508
513 void experimentPaused(uint8_t channel);
514
519 void experimentResumed(uint8_t channel);
520
525 void recoverDataErased(bool successful);
526
533 void deviceError(uint8_t channel, const QString& error);
534
535
536private slots:
537 void onActiveExperimentNodeBeginning(uint8_t channel, const AisExperimentNode&);
538 void onRecoveryExperimentNodeBeginning(uint8_t channel, const AisExperimentNode&);
539 void onDeviceDisconnected();
540
541private:
542 void connectWithOperatorSignals();
543};
544
545#endif //SQUIDSTATLIBRARY_AISINSTRUMENTHANDLER_H
This class has advanced options controlling the device stability including the bandwidth index and th...
Definition: AisCompRange.h:15
This class contains the possible error codes returned to the user when working with the API.
Definition: AisErrorCode.h:15
this class is used to create custom experiments. A custom experiment contains one or more elements....
Definition: AisExperiment.h:19
this class provides control of the device including starting, pausing, resuming and stopping an exper...
Definition: AisInstrumentHandler.h:24
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.
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 experimentStopped(uint8_t channel)
a signal that is emitted whenever an experiment was stopped manually or has completed.
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.
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.
bool isChannelBusy(uint8_t channel) const
tells whether the given channel is busy or not.
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.
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 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 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 information.
Definition: AisDataPoints.h:40
a structure containing DC data information.
Definition: AisDataPoints.h:9
a structure containing some information regarding the running element.
Definition: AisDataPoints.h:109