2024-04-26 13:05:19 +02:00
|
|
|
#ifndef SYSTEM_H
|
|
|
|
#define SYSTEM_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
2024-05-14 12:43:46 +02:00
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <initializer_list>
|
2024-04-26 13:05:19 +02:00
|
|
|
|
|
|
|
class System : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
explicit System(QObject *parent = 0);
|
|
|
|
|
|
|
|
static QString errorMsg;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2024-05-14 12:43:46 +02:00
|
|
|
static const QStringList allowedJsonFiles;
|
2024-04-26 13:05:19 +02:00
|
|
|
|
|
|
|
static bool checkForSDCard();
|
|
|
|
static bool umountSDCard();
|
|
|
|
|
2024-05-14 12:43:46 +02:00
|
|
|
static std::optional<QString> checkForUSBStick(QString const &dirPathUnderMountPath = ".");
|
|
|
|
static QString getUSBMountPath(QString const &dirPathUnderMountPath = ".");
|
|
|
|
|
|
|
|
//static QString getUSBDeviceName();
|
2024-04-26 13:05:19 +02:00
|
|
|
static bool umountUSBStick();
|
|
|
|
|
|
|
|
static bool test_mount(const QString& dev, const QString &mountpoint);
|
|
|
|
static bool test_dir(const QString& dir);
|
|
|
|
|
|
|
|
static quint32 getFreeDiskSpace(const QString& dev);
|
|
|
|
static quint32 getFreeDiskSpaceSDCard();
|
|
|
|
static bool isSDCardWritable();
|
|
|
|
static quint32 getFreeDiskSpaceUSBStick();
|
|
|
|
static bool isUSBStickWritable();
|
|
|
|
|
|
|
|
static quint8 createLogFileBackup(const QString & targzfile, const QString &filelistfile = "");
|
|
|
|
static QString getSDCardMountPath();
|
|
|
|
static QString getSDCardDeviceName();
|
|
|
|
|
|
|
|
static QString getUniqueDeviceId();
|
|
|
|
|
|
|
|
static QString getErrorMessage();
|
|
|
|
|
|
|
|
static QString readStringFromFile(const QString & filename);
|
|
|
|
static int readIntFromFile(const QString & filename);
|
|
|
|
|
|
|
|
static QString getPTU4SerialNumber();
|
|
|
|
static QString getPTU4MACAddress();
|
|
|
|
|
2024-05-14 12:43:46 +02:00
|
|
|
static QStringList getJsonFilesOnUsbStick(QString const &mountPath);
|
2024-04-26 13:05:19 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SYSTEM_H
|