QAlphaCloud
0.0.1
Qt bindings for Alpha Cloud
|
Storage Systems Model. More...
#include <storagesystemsmodel.h>
Inherits QAbstractListModel.
Public Types | |
enum class | Roles { SerialNumber = Qt::UserRole , Status , InverterModel , InverterPower , BatteryModel , BatteryGrossCapacity , BatteryRemainingCapacity , BatteryUsableCapacity , PhotovoltaicPower , RawJson } |
The model roles. More... | |
Public Slots | |
bool | reload () |
(Re)load data More... | |
Signals | |
void | countChanged () |
Public Member Functions | |
StorageSystemsModel (QObject *parent=nullptr) | |
Creates a StorageSystemsModel instance. More... | |
StorageSystemsModel (QAlphaCloud::Connector *connector, QObject *parent=nullptr) | |
Creates a StorageSystemsModel intsance. More... | |
Q_REQUIRED_RESULT QAlphaCloud::Connector * | connector () const |
void | setConnector (QAlphaCloud::Connector *connector) |
Q_SIGNAL void | connectorChanged (QAlphaCloud::Connector *connector) |
Q_REQUIRED_RESULT bool | cached () const |
void | setCached (bool cached) |
Q_SIGNAL void | cachedChanged (bool cached) |
QAlphaCloud::RequestStatus | status () const |
Q_SIGNAL void | statusChanged (QAlphaCloud::RequestStatus status) |
QString | primarySerialNumber () const |
Q_SIGNAL void | primarySerialNumberChanged (const QString &primarySerialNumber) |
QAlphaCloud::ErrorCode | error () const |
Q_SIGNAL void | errorChanged (QAlphaCloud::ErrorCode error) |
QString | errorString () const |
Q_SIGNAL void | errorStringChanged (const QString &errorString) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QHash< int, QByteArray > | roleNames () const override |
Properties | |
QAlphaCloud::Connector * | connector |
The connector to use. | |
bool | cached |
Cache the data on disk. More... | |
int | count |
The number of items in the model. | |
QString | primarySerialNumber |
The first serial number in the model. More... | |
QAlphaCloud::RequestStatus | status |
The current request status. More... | |
QAlphaCloud::ErrorCode | error |
The error, if any. More... | |
QString | errorString |
The error string, if any. More... | |
Storage Systems Model.
List all storage systems associated with the user.
Wraps the /getEssList
API endpoint.
|
strong |
The model roles.
Enumerator | |
---|---|
SerialNumber | System serial number (QString). |
Status | Status of the energy management system (QAlphaCloud::SystemStatus). |
InverterModel | Interver model (QString). |
InverterPower | Gross power of the inverter system in W (int). |
BatteryModel | Battery model (QString). |
BatteryGrossCapacity | Gross battery capacity in Wh. Typically there's a capacity buffer that cannot be used (int). |
BatteryRemainingCapacity | Remaining battery capacity in Wh (int). |
BatteryUsableCapacity | Usable battery capacity in per-cent % (qreal). |
PhotovoltaicPower | Gross power provided by the photovoltaic system in W (int). |
RawJson | Returns the raw JSON data for this system. Useful for extracting properties that aren't provided through the model (QJsonObject). |
|
explicit |
Creates a StorageSystemsModel instance.
parent | The owner |
|
explicit |
Creates a StorageSystemsModel intsance.
connector | The connector |
parent | The owner |
|
slot |
(Re)load data
|
readwrite |
Cache the data on disk.
Whether to cache the storage systems data on disk since it is unlikely to change often. Default is true.
|
read |
The error, if any.
There can still be valid data in the model from a previous successful request.
|
read |
The error string, if any.
|
read |
The first serial number in the model.
This is provided for convenience, so one does not need to deal with QAbstractListModel API for serving the common case of having a single storage system.
|
read |
The current request status.
The model may contain cached data before a request is sent and even if status is NoRequest.