55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef CMODBUSSEIMGR_H
|
|
#define CMODBUSSEIMGR_H
|
|
|
|
|
|
#include <QObject>
|
|
#include "ModbusBackend.h"
|
|
#include <QTimer>
|
|
#include <QElapsedTimer>
|
|
#include <QHostAddress>
|
|
|
|
|
|
|
|
|
|
class CModbusSEIMgr : public CModbusBackend
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CModbusSEIMgr(CModbusRepository *SEIRepo,CModbusRepository *CCRepo, QHostAddress ServerIP, int ModbusPort, int DevID);
|
|
~CModbusSEIMgr();
|
|
|
|
int ConnectToSlave(QHostAddress SlaveIP, int SlavePort);
|
|
int DisconnectFromSlave();
|
|
int ReadModbusRegisters();
|
|
int StartSEICommunication();
|
|
int SEISettingsChanged(QHostAddress ServerIP, int ModbusPort, int DevID);
|
|
|
|
|
|
virtual void RegistersDatabaseUpdated(quint16 StartAddress, quint16 Length);
|
|
virtual void ModbusResponseException(quint8 ExceptionCode, quint8 FctCode);
|
|
|
|
QTimer *mConnectionTimer;
|
|
// QTimer *mSEIWatchdogTimer;
|
|
QTimer *mSEIModbusUpdateTimer;
|
|
|
|
private:
|
|
int mModbusPort;
|
|
QHostAddress mSEIIPAddress;
|
|
CModbusRepository *mCCRepoHandle;
|
|
bool mZTWatchdog;
|
|
|
|
signals:
|
|
void ModbusMasterConnected(qint32 LocalIP, qint32 RemoteIP);
|
|
void ModbusMasterDisconnected();
|
|
void ModbusMasterRepositoryUpdated();
|
|
|
|
public slots:
|
|
void SocketConnected();
|
|
void SocketDisconnected();
|
|
void ConnectionTimerExpired();
|
|
void SEIModbusUpdateTimerExpired();
|
|
void ZTTKUpdated();
|
|
};
|
|
|
|
#endif // CMODBUSSEIMGR_H
|