34 lines
1016 B
C++
34 lines
1016 B
C++
#ifndef ENERGYJSONHANDLER_H
|
|
#define ENERGYJSONHANDLER_H
|
|
|
|
#include <QObject>
|
|
#include "jsonrpc/jsonhandler.h"
|
|
|
|
class EnergyManager;
|
|
|
|
class EnergyJsonHandler : public JsonHandler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit EnergyJsonHandler(EnergyManager *energyManager, QObject *parent = nullptr);
|
|
|
|
QString name() const override;
|
|
|
|
Q_INVOKABLE JsonReply* GetRootMeter(const QVariantMap ¶ms);
|
|
Q_INVOKABLE JsonReply* SetRootMeter(const QVariantMap ¶ms);
|
|
Q_INVOKABLE JsonReply* GetPowerBalance(const QVariantMap ¶ms);
|
|
Q_INVOKABLE JsonReply* GetPowerBalanceLogs(const QVariantMap ¶ms);
|
|
Q_INVOKABLE JsonReply* GetThingPowerLogs(const QVariantMap ¶ms);
|
|
|
|
signals:
|
|
void RootMeterChanged(const QVariantMap ¶ms);
|
|
void PowerBalanceChanged(const QVariantMap ¶ms);
|
|
void PowerBalanceLogEntryAdded(const QVariantMap ¶ms);
|
|
void ThingPowerLogEntryAdded(const QVariantMap ¶ms);
|
|
|
|
private:
|
|
EnergyManager *m_energyManager = nullptr;
|
|
};
|
|
|
|
#endif // ENERGYJSONHANDLER_H
|