41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
|
#ifndef SENSORLOGS_H
|
||
|
#define SENSORLOGS_H
|
||
|
|
||
|
#include <QString>
|
||
|
#include <QJsonObject>
|
||
|
|
||
|
class SensorLogs
|
||
|
{
|
||
|
public:
|
||
|
SensorLogs() = default;
|
||
|
SensorLogs(const QString &logError, const QString &logManual, const QString &logHugeError)
|
||
|
: logError(logError), logManual(logManual), logHugeError(logHugeError) {}
|
||
|
|
||
|
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; }
|
||
|
|
||
|
void SensorLogsParse(QJsonObject &sensorData) {
|
||
|
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
|