UpdatePTUDevCtrl/update_dc_event.h
Gerhard Hoffmann e82742a609 Add helper class update_dc_event to dend customer messages from the worker-thread
to the gui-thread. The gui-thread will then perform bl_rebootDC, bl_startBL,
bl_checkBL(), bl_isUp() and bl_stopBL().
2023-09-09 14:27:50 +02:00

41 lines
1.2 KiB
C++

#ifndef UPDATE_DC_EVENT_H_INCLUDED
#define UPDATE_DC_EVENT_H_INCLUDED
#include <QEvent>
#include <QDateTime>
class UpdateDcEvent : public QEvent {
public:
enum UpdateStep { NONE, DC_REBOOT, BL_START, BL_CHECK, BL_CHECK_AFTER_STOP, BL_IS_UP, BL_IS_DOWN, BL_STOP};
private:
QObject const *m_sender;
UpdateStep m_updateStep;
int m_count;
QDateTime m_sendDateTime;
public:
explicit UpdateDcEvent(QObject const *sender, UpdateStep updateStep,
int count,
QDateTime const &sendDateTime = QDateTime::currentDateTime());
virtual ~UpdateDcEvent();
static QEvent::Type type();
QObject const *sender() { return m_sender; }
QObject const *sender() const { return m_sender; }
void setUpdateStep(UpdateStep updateStep) { m_updateStep = updateStep; }
UpdateStep updateStep() { return m_updateStep; }
UpdateStep updateStep() const { return m_updateStep; }
int count() const { return m_count; }
void setCount(int count) { m_count = count; }
QDateTime &sendDateTime() { return m_sendDateTime; }
QDateTime const &sendDateTime() const { return m_sendDateTime; }
private:
static QEvent::Type customEventType;
};
#endif // PROGRESS_EVENT_H_INCLUDED