| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef BIOSWORKER_H
- #define BIOSWORKER_H
- #include <QObject>
- #include <QSerialPort>
- #include <QRegularExpression>
- #include <QHash>
- #include <QVector>
- #include <QSet>
- struct DimmRecord
- {
- QString sn;
- int socket = -1;
- int channel = -1;
- int dimm = -1;
- int rank = -1;
- int bit = -1;
- };
- class BiosWorker : public QObject
- {
- Q_OBJECT
- public:
- explicit BiosWorker(QObject *parent = nullptr);
- ~BiosWorker();
- void setPortName(const QString &name);
- signals:
- void signalPID();
- public slots:
- void openSerial();
- void sendNextCommand();
- void onTestFilePath(const QString &path);
- private slots:
- void OnReadyRead();
- private:
- void init();
- void parseDimmInfo(const QString &line);
- void parseEnhancedWarningLine(const QString &line);
- void saveSnapshot();
- void exportXlsx();
- private:
- QSerialPort *m_port = nullptr;
- QString m_portName;
- QByteArray biosBuffer;
- QStringList commands;
- int commandIndex = 0;
- QString m_path;
- QRegularExpression dimmRegex;
- QRegularExpression numberRegex;
- QHash<QString,QString> dimmHash;
- QVector<DimmRecord> warningRecords;
- DimmRecord currentWarning;
- bool parsingWarning = false;
- QSet<QString> recordSet;
- };
- #endif
|