2024-12-28 17:15:48 +00:00
|
|
|
#ifndef ALARMWIDGET_H
|
|
|
|
#define ALARMWIDGET_H
|
|
|
|
|
2025-01-07 22:13:48 +00:00
|
|
|
#include "sensorservice.h"
|
|
|
|
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QHBoxLayout>
|
2024-12-28 17:15:48 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QVBoxLayout>
|
2025-01-07 22:13:48 +00:00
|
|
|
#include <QWidget>
|
2024-12-28 17:15:48 +00:00
|
|
|
|
|
|
|
class AlarmWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2025-01-07 22:13:48 +00:00
|
|
|
explicit AlarmWidget(QMap<QString, QMap<QString, QPair<QString, QString>>> &translate,
|
|
|
|
const QString &sensorId = "",
|
|
|
|
const QString &group = "",
|
|
|
|
const QString &date = "",
|
|
|
|
const QString &time = "",
|
|
|
|
const QString &timeEnd = "",
|
|
|
|
SensorService *sensorService = nullptr,
|
|
|
|
QWidget *parent = nullptr);
|
2024-12-28 17:15:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QLabel *createLabel(const QString &text, int minSize = 100, int maxSize = 250);
|
|
|
|
|
2025-01-07 22:13:48 +00:00
|
|
|
signals:
|
|
|
|
void dialogClosedFromWidget(QString groupWithSensor, QDateTime start, QDateTime end);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onInfoButtonClicked();
|
|
|
|
void onDialogClosed();
|
|
|
|
|
2024-12-28 17:15:48 +00:00
|
|
|
private:
|
2025-01-07 22:13:48 +00:00
|
|
|
QMap<QString, QMap<QString, QPair<QString, QString>>> _translate;
|
|
|
|
const QString _timeEnd;
|
|
|
|
const QString _sensorId;
|
|
|
|
SensorService *_sensorService;
|
2024-12-28 17:15:48 +00:00
|
|
|
QLabel *groupLabel;
|
|
|
|
QLabel *sensorLabel;
|
|
|
|
QLabel *dateLabel;
|
|
|
|
QLabel *timeLabel;
|
|
|
|
QPushButton *infoButton;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ALARMWIDGET_H
|