#ifndef SPRINKLERDEVICE_H
#define SPRINKLERDEVICE_H

#include "GlobalDefine.h"
#include "NetworkDevice.h"
#include <QTimer>

typedef enum eSprinklerState
{
    SPRINKLER_OFF_STATE = 0,
    SPRINKLER_ON_STATE,
    SPRINKLER_UNKNOWN_STATE
}SprinklerState;

class CSprinklerMgr;

class CSprinklerDevice:  public QObject, public CNetworkDevice
{
    Q_OBJECT
public:
    CSprinklerDevice(int Address, CAbstractNetworkCommIF *NetworkInterface, CSprinklerMgr *SprinklerMgr);
    virtual ~CSprinklerDevice();

    virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);

    SprinklerState GetSprinklerState();
    unsigned short mFlowMeter;


    CSprinklerMgr *mSprinklerMgr;
    QTimer *mSprinklerStatusTimer;
    SprinklerState mSprinklerState;

public slots:
    void StatusTimerExpired();

};

#endif // SPRINKLERDEVICE_H
