PowerMaster/include/alarmEventRealTimeDock.h

68 lines
1.7 KiB
C++

#ifndef ALARMEVENTREALTIMEDOCK_H
#define ALARMEVENTREALTIMEDOCK_H
#include <QWidget>
#include "alarmEventGlobal.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class alarmEventRealTimeDock;
}
QT_END_NAMESPACE
class AlarmEventDataView;
class QPropertyAnimation;
class AlarmEventRealTimeDock : public QWidget
{
Q_OBJECT
Q_PROPERTY(float alertWidgetBGColorAlpha READ alertWidgetBGColorAlpha WRITE setAlertWidgetBGColorAlpha NOTIFY alertWidgetBGColorAlphaChanged)
public:
struct AlarmDataStatics
{
int allCount = 0; //总数量
int accidentCount = 0; //事故数量
int abnormalCount = 0; //异常数量
int alertCount = 0; //预警数量
int informCount = 0; //告知数量
};
AlarmEventRealTimeDock(QWidget *parent = nullptr);
~AlarmEventRealTimeDock();
void updateGeometry();
signals:
void alertWidgetBGColorAlphaChanged(float value);
public slots:
void onBtnClicked_open();
void onBtnClicked_close();
void onBtnClicked_confirmAll();
void onBtnClicked_checkAll();
void onSIG_receivedNewAlarm(const EventData& event);
private:
void expand();
void collapse();
void startAlarmAlert();
void stopAlarmAlert();
float alertWidgetBGColorAlpha() {return m_alertWidgetBGColorAlpha;}
void setAlertWidgetBGColorAlpha(float value);
void updateAlertWidgetBGColorAlpha();
Ui::alarmEventRealTimeDock* ui;
AlarmEventDataView* m_tableView;
QPropertyAnimation* m_animationExpand;
QPropertyAnimation* m_animationAlert;
bool m_isInAnimationExpand;
bool m_isInAnimationAlert;
float m_alertWidgetBGColorAlpha;
QString m_alertWidgetStyleSheet;
QString m_curState;
AlarmDataStatics m_alarmDataStatics;
};
#endif