| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- /**
- * @file device_log_dialog.h
- * @brief 设备日志对话框 - 显示设备加载历史和状态信息
- */
- #ifndef DEVICE_LOG_DIALOG_H
- #define DEVICE_LOG_DIALOG_H
- #include <QDialog>
- #include <QString>
- #include "soft_bus_core/soft_bus_core.h"
- class QLabel;
- class QTextEdit;
- class QPushButton;
- class QVBoxLayout;
- class QHBoxLayout;
- class DeviceBusCore;
- /**
- * @brief 设备日志对话框 - 显示设备加载历史和状态信息
- */
- class DeviceLogDialog : public QDialog
- {
- Q_OBJECT
- public:
- explicit DeviceLogDialog(QWidget* parent = nullptr);
- ~DeviceLogDialog();
- /**
- * @brief 设置设备信息并显示日志
- * @param deviceInfo 设备信息
- * @param busCore 设备总线核心(用于查询历史数据)
- */
- void setDeviceInfo(const DeviceInfo& deviceInfo, DeviceBusCore* busCore = nullptr);
- private slots:
- void onRefresh();
- void onClose();
- private:
- /**
- * @brief 更新日志内容
- */
- void updateLog();
- /**
- * @brief 获取设备加载历史文本
- */
- QString getDeviceHistoryText() const;
- private:
- DeviceInfo m_deviceInfo;
- DeviceBusCore* m_busCore;
-
- QLabel* m_deviceNameLabel;
- QLabel* m_deviceInfoLabel;
- QTextEdit* m_logTextEdit;
- QPushButton* m_refreshButton;
- QPushButton* m_closeButton;
-
- QVBoxLayout* m_mainLayout;
- QHBoxLayout* m_buttonLayout;
- };
- #endif // DEVICE_LOG_DIALOG_H
|