2024-12-16 08:38:04 +00:00
|
|
|
#ifndef SENSORLOGS_H
|
|
|
|
#define SENSORLOGS_H
|
|
|
|
|
|
|
|
#include <QJsonObject>
|
2025-01-07 22:13:48 +00:00
|
|
|
#include <QString>
|
2024-12-16 08:38:04 +00:00
|
|
|
|
|
|
|
class SensorLogs
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SensorLogs() = default;
|
|
|
|
SensorLogs(const QString &logError, const QString &logManual, const QString &logHugeError)
|
2025-01-07 22:13:48 +00:00
|
|
|
: logError(logError)
|
|
|
|
, logManual(logManual)
|
|
|
|
, logHugeError(logHugeError)
|
|
|
|
{}
|
2024-12-16 08:38:04 +00:00
|
|
|
|
|
|
|
QString getLogError() const { return logError; }
|
|
|
|
void setLogError(const QString &value) { logError = value; }
|
|
|
|
|
|
|
|
QString getLogManual() const { return logManual; }
|
|
|
|
void setLogManual(const QString &value) { logManual = value; }
|
|
|
|
|
|
|
|
QString getLogHugeError() const { return logHugeError; }
|
|
|
|
void setLogHugeError(const QString &value) { logHugeError = value; }
|
|
|
|
|
|
|
|
int getAlarmSleepage() const { return AlarmSleepage; }
|
|
|
|
void setAlarmSleepage(const int &value) { AlarmSleepage = value; }
|
|
|
|
|
2025-01-07 22:13:48 +00:00
|
|
|
void SensorLogsParse(QJsonObject &sensorData)
|
|
|
|
{
|
2024-12-16 08:38:04 +00:00
|
|
|
logError = sensorData["LOG_ERROR"].toString();
|
|
|
|
logManual = sensorData["LOG_MANUAL"].toString();
|
|
|
|
logHugeError = sensorData["LOG_HUGE_ERROR"].toString();
|
|
|
|
AlarmSleepage = sensorData["ALARM_SLIPPAGE"].toInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int AlarmSleepage;
|
|
|
|
QString logError;
|
|
|
|
QString logManual;
|
|
|
|
QString logHugeError;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SENSORLOGS_H
|