Squidstat API User Manual
Loading...
Searching...
No Matches
AisErrorCode.h
1
2#ifndef AIS_ERROR_CODE_H
3#define AIS_ERROR_CODE_H
4
5#include "AisSquidstatGlobal.h"
6#include <qstring.h>
7
15class SQUIDSTATLIBRARY_EXPORT AisErrorCode {
16
17public:
18 enum ErrorCode : uint8_t {
19 Unknown = 255,
20 Success = 0,
21 ConnectionFailed = 1,
22 FirmwareNotSupported = 2,
23 FirmwareFileNotFound = 3,
24 FirmwareUptodate = 4,
25
26 InvalidChannel = 10,
27 BusyChannel = 11,
28 DeviceNotFound = 13,
30 ManualExperimentNotRunning = 51,
31 ExperimentNotUploaded = 52,
32 ExperimentIsEmpty = 53,
33 InvalidParameters = 54,
34 ChannelNotBusy = 55,
35 ExperimentUploaded = 56,
37 DeviceCommunicationFailed = 100,
39 FailedToSetManualModeCurrentRange = 101,
40 FailedToSetManualModeConstantVoltage = 102,
41 FailedToPauseExperiment = 103,
42 FailedToResumeExperiment = 104,
43 FailedToStopExperiment = 105,
44 FailedToUploadExperiment = 106,
45 ExperimentAlreadyPaused = 107,
46 ExperimentAlreadyRun = 108,
47 FailedToSetManualModeVoltageRange = 109, /* !< indicates failure to set manual mode voltage range due to a possible communication failure with the device.*/
48 FailedToSetManualModeConstantCurrent = 110,
49 FailedToSetManualModeInOCP = 111,
50 FailedToSetManualModeSamplingInterval = 112,
51 FailedToSetIRComp = 113,
52 FailedToSetCompRange = 114,
54 FailedRequest = 254 /* !< indicates a failed request to the device. */
55 };
56
58 AisErrorCode(ErrorCode error);
59 AisErrorCode(ErrorCode error, QString message);
60
65 QString message() const;
66
71 int value() const;
72
73 operator ErrorCode() const;
74
75private:
76 ErrorCode code;
77 QString errorMessage;
78};
79
80#endif // ! AIS_ERROR_CODE_H
This class contains the possible error codes returned to the user when working with the API.
Definition: AisErrorCode.h:15
QString message() const
a function to get a message explaining the error.
ErrorCode
Definition: AisErrorCode.h:18
int value() const
a function to get the error code.