Squidstat API User Manual
Loading...
Searching...
No Matches
AisErrorCode Class Reference

This class contains the possible error codes returned to the user when working with the API. More...

#include <AisErrorCode.h>

Public Types

enum  ErrorCode : uint8_t {
  Unknown = 255 , Success = 0 , ConnectionFailed = 1 , FirmwareNotSupported = 2 ,
  FirmwareFileNotFound = 3 , FirmwareUptodate = 4 , InvalidChannel = 10 , BusyChannel = 11 ,
  DeviceNotFound = 13 , ManualExperimentNotRunning = 51 , ExperimentNotUploaded = 52 , ExperimentIsEmpty = 53 ,
  InvalidParameters = 54 , ChannelNotBusy = 55 , ExperimentUploaded = 56 , DeviceCommunicationFailed = 100 ,
  FailedToSetManualModeCurrentRange = 101 , FailedToSetManualModeConstantVoltage = 102 , FailedToPauseExperiment = 103 , FailedToResumeExperiment = 104 ,
  FailedToStopExperiment = 105 , FailedToUploadExperiment = 106 , ExperimentAlreadyPaused = 107 , ExperimentAlreadyRun = 108 ,
  FailedToSetManualModeVoltageRange = 109 , FailedToSetManualModeConstantCurrent = 110 , FailedToSetManualModeInOCP = 111 , FailedToSetManualModeSamplingInterval = 112 ,
  FailedToSetIRComp = 113 , FailedToSetCompRange = 114 , FailedRequest = 254
}
 

Public Member Functions

 AisErrorCode (ErrorCode error)
 
 AisErrorCode (ErrorCode error, QString message)
 
QString message () const
 a function to get a message explaining the error. More...
 
int value () const
 a function to get the error code. More...
 
 operator ErrorCode () const
 

Detailed Description

This class contains the possible error codes returned to the user when working with the API.

If a function has an AisErrorCode return type, then it needs to be checked for possible failures. The object of this class returned will contain an error code that can be accessed by calling value() member function and an error message that can be accessed by calling

See also
message.

Member Enumeration Documentation

◆ ErrorCode

enum AisErrorCode::ErrorCode : uint8_t
Enumerator
Unknown 

indicates that the command failed for an unknown reason.

Success 

indicates success.

ConnectionFailed 

indicates failure connecting the plugged in device when calling AisDeviceTracker::connectToDeviceOnComPort.

FirmwareNotSupported 

indicates failure connecting the plugged in device when calling AisDeviceTracker::connectToDeviceOnComPort because firmware update require.

InvalidChannel 

indicates that the given channel number is not valid.

BusyChannel 

indicates that the failure was due to the channel being busy.

DeviceNotFound 

indicates that no device was detected to be connected.

ManualExperimentNotRunning 

indicates that the given command applies when there is a manual experiment running on the channel but there is none.

ExperimentNotUploaded 

indicates that the given command applies when an experiment has already been uploaded to the channel but there is none.

ExperimentIsEmpty 

indicates that the given experiment has no elements. It need to contain at least one.

InvalidParameters 

indicates that a given parameter is invalid. For example, it is out of the allowed range.

ChannelNotBusy 

indicates that the given command applies when there is an experiment running or paused on the channel but there is none.

ExperimentUploaded 

indicates that the given command could not be completed because an experiment is already uploaded to the channel.

DeviceCommunicationFailed 

indicates that there was failure in communication with the device.

FailedToSetManualModeCurrentRange 

indicates failure to set manual mode current range due to a possible communication failure with the device.

FailedToSetManualModeConstantVoltage 

indicates failure to set manual mode constant voltage due to a possible communication failure with the device

FailedToPauseExperiment 

indicates that pausing the experiment failed because either there is no active experiment or due to a possible communication failure with the device.

FailedToResumeExperiment 

indicates that resuming the experiment failed because either there is no paused experiment or due to a possible communication failure with the device.

FailedToStopExperiment 

indicates that stopping the experiment failed because either there is no experiment running, the experiment is paused, or due to a possible communication failure with the device.

FailedToUploadExperiment 

indicates failure to communicate with the device to upload the experiment.

ExperimentAlreadyPaused 

indicates that pausing the experiment failed because the experiment is already paused.

ExperimentAlreadyRun 

indicates that resuming the experiment failed because an experiment is already running.

FailedToSetManualModeConstantCurrent 

indicates failure to set manual mode constant current due to a possible communication failure with the device.

FailedToSetManualModeInOCP 

indicates failure of setting manual mode in open circuit mode for possible communication failure with the device.

FailedToSetManualModeSamplingInterval 

indicates failure of setting manual mode sampling interval. possible communication failure with the device.

FailedToSetIRComp 

indicates failure of setting IR Compensation. Possible communication failure with the device.

FailedToSetCompRange 

indicates failure of setting Compensation Range. Possible communication failure with the device.

Member Function Documentation

◆ message()

QString AisErrorCode::message ( ) const

a function to get a message explaining the error.

Returns
a message that explains the error.

◆ value()

int AisErrorCode::value ( ) const

a function to get the error code.

Returns
the error code

The documentation for this class was generated from the following file: