QAlphaCloud
0.0.1
Qt bindings for Alpha Cloud
|
Historic power data for a day. More...
#include <onedaypowermodel.h>
Inherits QAbstractListModel.
Public Types | |
enum class | Roles { PhotovoltaicEnergy = Qt::UserRole , CurrentLoad , GridFeed , GridCharge , BatterySoc , UploadTime , RawJson } |
The model roles. More... | |
Public Slots | |
bool | reload () |
(Re)load data More... | |
bool | forceReload () |
Force a reload. More... | |
void | reset () |
Reset object. More... | |
Signals | |
void | countChanged () |
Public Member Functions | |
OneDayPowerModel (QObject *parent=nullptr) | |
Creates a OneDateEnergy instance. More... | |
OneDayPowerModel (Connector *connector, const QString &serialNumber, const QDate &date, QObject *parent=nullptr) | |
Creates a OneDateEnergy intsance. More... | |
Q_REQUIRED_RESULT Connector * | connector () const |
void | setConnector (Connector *connector) |
Q_SIGNAL void | connectorChanged (Connector *connector) |
Q_REQUIRED_RESULT QString | serialNumber () const |
void | setSerialNumber (const QString &serialNumber) |
Q_SIGNAL void | serialNumberChanged (const QString &serialNumber) |
Q_REQUIRED_RESULT QDate | date () const |
void | setDate (const QDate &date) |
void | resetDate () |
Q_SIGNAL void | dateChanged (const QDate &date) |
Q_REQUIRED_RESULT bool | cached () const |
void | setCached (bool cached) |
Q_SIGNAL void | cachedChanged (bool cached) |
Q_REQUIRED_RESULT QDateTime | fromDateTime () const |
Q_SIGNAL void | fromDateTimeChanged (const QDateTime &fromDateTime) |
Q_REQUIRED_RESULT QDateTime | toDateTime () const |
Q_SIGNAL void | toDateTimeChanged (const QDateTime &toDateTime) |
Q_REQUIRED_RESULT int | peakPhotovoltaic () const |
Q_SIGNAL void | peakPhotovoltaicChanged (int peakPhotovoltaicChanged) |
Q_REQUIRED_RESULT int | peakLoad () const |
Q_SIGNAL void | peakLoadChanged (int peakLoad) |
Q_REQUIRED_RESULT int | peakGridFeed () const |
Q_SIGNAL void | peakGridFeedChanged (int peakGridFeed) |
Q_REQUIRED_RESULT int | peakGridCharge () const |
Q_SIGNAL void | peakGridChargeChanged (int peakGridCharge) |
QAlphaCloud::RequestStatus | status () const |
Q_SIGNAL void | statusChanged (QAlphaCloud::RequestStatus status) |
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. | |
QString | serialNumber |
The serial number. More... | |
QDate | date |
The date. More... | |
bool | cached |
Cache data. More... | |
QDateTime | fromDateTime |
The earliest date in the model. More... | |
QDateTime | toDateTime |
The latest date in the model. More... | |
int | peakPhotovoltaic |
Peak photovoltaic production in W. More... | |
int | peakLoad |
Peak load in W. More... | |
int | peakGridFeed |
Peak grid feed in W. More... | |
int | peakGridCharge |
Peak grid charge in W. More... | |
int | count |
The number of items in the model. | |
QAlphaCloud::RequestStatus | status |
The current request status. | |
QAlphaCloud::ErrorCode | error |
The error, if any. More... | |
QString | errorString |
The error string, if any. More... | |
Historic power data for a day.
Provides historic power data for a given day.
Wraps the /getOneDayPower
API endpoint.
|
strong |
The model roles.
|
explicit |
Creates a OneDateEnergy instance.
parent | The owner |
QAlphaCloud::OneDayPowerModel::OneDayPowerModel | ( | Connector * | connector, |
const QString & | serialNumber, | ||
const QDate & | date, | ||
QObject * | parent = nullptr |
||
) |
Creates a OneDateEnergy intsance.
connector | The connector |
serialNumber | The serial number of the storage system whose data should be queried |
date | The date for which to query the data |
parent | The owner |
|
slot |
Force a reload.
Reloads the data, ignoring the cache.
|
slot |
(Re)load data
In QML, this is done automatically on component completion if the active property (not documented here) is true, which is the default.
|
slot |
Reset object.
This clears all data and resets the object back to its initial state.
|
readwrite |
Cache data.
Whether to cache the returned data, default is true.
This allows for quicker navigation between dates when they have been loaded once and reduces network traffic.
Data from the current day is never cached as data is collected throughout the day.
|
readwrite |
The date.
The date for which to query the data.
|
read |
The error, if any.
There can still be valid data in this object from a previous successful request.
|
read |
The error string, if any.
|
read |
The earliest date in the model.
Useful for determining the range of the X axis on a plot.
|
read |
Peak grid charge in W.
Useful for determining the range of the Y axis on a plot.
|
read |
Peak grid feed in W.
Useful for determining the range of the Y axis on a plot.
|
read |
Peak load in W.
Useful for determining the range of the Y axis on a plot.
|
read |
Peak photovoltaic production in W.
Useful for determining the range of the Y axis on a plot.
|
readwrite |
The serial number.
The serial number of the storage system whose data should be queried.
|
read |
The latest date in the model.
Useful for determining the range of the X axis on a plot.