#ifndef ZTALARMGENERATOR_H
#define ZTALARMGENERATOR_H
#include <QObject>

#include "ModbusZTMaster.h"
#include "ModbusRepository.h"
#include "ZTInfo.h"
#include <QTimer>

class CZTAlarmGeneratorPage;
class CZTAlarms;

class CZTAlarmGenerator : public QObject
{
    Q_OBJECT

public:
    explicit CZTAlarmGenerator(QObject *parent = 0);
    ~CZTAlarmGenerator();
    int UpdateActiveAlarms(CZTAlarms *ActiveAlarms);
    int ClearAllAlarms();
    int ConnectToSEIRequest();
    int DisconnectFromSEIRequest();

    CModbusZTMaster *mModbusZTEmulator;
    CModbusRepository mZTModbusRepo;
    CZTInfo mZTInfo;
    QString mIPAddress;

    CZTAlarmGeneratorPage *mAlarmGeneratorPageHandle;

private:
    bool mWatchdogValue;
    bool mReadModbus;
    QTimer *mModbusUpdateTimer;

public slots:
    void ModbusMasterConnected(CModbusZTMaster *ModbusZTMaster);
    void ModbusMasterDisconnected(CModbusZTMaster *);
    void ModbusMasterRepositoryUpdated();
    void UpdateModbusTimerExpired();

};

#endif // ZTALARMGENERATOR_H
