QAlphaCloud  0.0.1
Qt bindings for Alpha Cloud
Classes | Enumerations | Functions
QAlphaCloud Namespace Reference

Utility namespace. More...

Classes

class  ApiRequest
 API request job. More...
 
class  Configuration
 API configuration. More...
 
class  Connector
 API Connection. More...
 
class  LastPowerData
 Live Power Data. More...
 
class  OneDateEnergy
 Cumulative daily energy information. More...
 
class  OneDayPowerModel
 Historic power data for a day. More...
 
class  StorageSystemsModel
 Storage Systems Model. More...
 

Enumerations

enum class  RequestStatus { NoRequest = 0 , Loading , Finished , Error }
 Request status. More...
 
enum class  ErrorCode {
  UnknownError = -1 , NoError = 0 , JsonParseError = 1001 , UnexpectedJsonDataError = 1002 ,
  EmptyJsonObjectError = 1002 , ParameterError = 6001 , SnNotBoundToUser = 6002 , CheckCodeError = 6004 ,
  AppIdNotBoundToSn = 6005 , TimestampError = 6006 , SignVerificationError = 6007 , SetFailed = 6008 ,
  WhitelistVerificationFailed = 6009 , SignEmpty = 6010 , TimestampEmpty = 6011 , AppIdEmpty = 6012 ,
  DataDoesNotExist = 6016 , InvalidDate = 6026 , OperationFailed = 6029 , SystemSnDoesNotExist = 6038 ,
  SystemOffline = 6042 , VerificationCode = 6046 , TooManyRequests = 6053
}
 Error codes. More...
 
enum class  SystemStatus { UnknownStatus = -1 , Normal , Fault }
 System status. More...
 

Functions

QString errorText (ErrorCode code, const QVariant &details=QVariant())
 Human-readable error text. More...
 

Detailed Description

Utility namespace.

Enumeration Type Documentation

◆ ErrorCode

Error codes.

This can either be

  • NoError
  • A value from QNetworkReply::Error (not documented here).
  • Errors specific to this library (in the 1xxx range).
  • Errors from the API (in the 6xxx range).
Enumerator
NoError 

API returns 200.

JsonParseError 

Failed to parse JSON received.

UnexpectedJsonDataError 

Valid JSON received but it was not an Object (perhaps null, or an Array).

EmptyJsonObjectError 

Valid JSON object was received but it was empty.

ParameterError 

"Parameter error"

SnNotBoundToUser 

"The SN is not bound to the user"

CheckCodeError 

"CheckCode error"

AppIdNotBoundToSn 

"This appId is not bound to the SN"

TimestampError 

"Timestamp error"

SignVerificationError 

"Sign verification error"

SetFailed 

"Set failed"

WhitelistVerificationFailed 

"Whitelist verification failed"

SignEmpty 

"Sign is empty"

TimestampEmpty 

"timestamp is empty"

AppIdEmpty 

"AppId is empty"

DataDoesNotExist 

"Data does not exist or has been deleted"

InvalidDate 

Date is invalid, documented as "internal error". Also returned when requesting historic data for a future date.

OperationFailed 

"Operation failed"

SystemSnDoesNotExist 

"system sn does not exist"

SystemOffline 

"system offline"

VerificationCode 

"Verification code error"

TooManyRequests 

"The request was too fast, please try again later"

◆ RequestStatus

Request status.

Enumerator
NoRequest 

No request has been issued.

Loading 

The request is being loaded from the server.

Finished 

The request has finished successfully.

Error 

The request failed with an error.

◆ SystemStatus

System status.

Corresponds to the emsStatus field on the /getEssList endpoint.

Note
No values are officially documented, this enumeration is incomplete.
Enumerator
UnknownStatus 

Unknown status.

Normal 

The system is performing normally.

Fault 

There is a system fault.

Function Documentation

◆ errorText()

QALPHACLOUD_EXPORT QString QAlphaCloud::errorText ( ErrorCode  code,
const QVariant &  details = QVariant() 
)

Human-readable error text.

Parameters
codeThe error code
detailsDetails about the error, for example a QString with the JSON parser error message, or a QJsonValue whose type is printed when a different one was expected, etc.
Returns
A human-readable error description