FemaLocalSoftware/sensordialog.h

60 lines
1.4 KiB
C
Raw Permalink Normal View History

2024-12-16 08:38:04 +00:00
#ifndef SENSORDIALOG_H
#define SENSORDIALOG_H
#include "httpclient.h"
#include "sensorlogs.h"
2025-01-07 22:13:48 +00:00
#include "sensorwidget.h"
2024-12-16 08:38:04 +00:00
#include <QDialog>
namespace Ui {
class SensorDialog;
}
class SensorDialog : public QDialog
{
Q_OBJECT
public:
2025-01-07 22:13:48 +00:00
explicit SensorDialog(QWidget *parent = nullptr,
SensorWidget *sensor = nullptr,
HttpClient *httpClient = nullptr);
2024-12-16 08:38:04 +00:00
~SensorDialog();
2025-01-07 22:13:48 +00:00
enum DialogResult { NoSave = 0, SaveSuccess, SaveError };
2024-12-16 08:38:04 +00:00
signals:
void resultReady(SensorDialog::DialogResult result);
protected:
void closeEvent(QCloseEvent *event) override;
private:
bool isSavingSuccess = false;
HttpClient *_httpClient;
SensorWidget *sensorWidget;
SensorLogs sensorLogs;
Sensor sensorC;
SensorLogs sensorLogsC;
private:
void onSaveButtonClicked();
2025-01-07 22:13:48 +00:00
void onIsAlarmChanged(const QString &value);
void onIsBooledChanged(const QString &value);
void onIsVisibleChanged(const QString &value);
void onNameChanged(const QString &value);
void onUnitNameChanged(const QString &value);
void onAlarmLowChanged(const QString &value);
void onAlarmUpChanged(const QString &value);
void onAlarmCooldownChanged(const QString &value);
2024-12-16 08:38:04 +00:00
void onLogErrorChanged();
void onLogManualChanged();
2025-01-07 22:13:48 +00:00
void onAlarmSleepageChanged(const QString &value);
2024-12-16 08:38:04 +00:00
void onLogHugeErrorChanged();
private:
Ui::SensorDialog *ui;
};
#endif // SENSORDIALOG_H