63 lines
1.3 KiB
C++
63 lines
1.3 KiB
C++
#ifndef DEVICECONFIGVIEW_H
|
|
#define DEVICECONFIGVIEW_H
|
|
|
|
#include <QWidget>
|
|
#include <QHash>
|
|
#include "MeasureAnalysisView.h"
|
|
|
|
class QTableView;
|
|
class QStandardItemModel;
|
|
class QPushButton;
|
|
|
|
|
|
class DeviceConfigView : public MeasureAnalysisView
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DeviceConfigView(QWidget *parent = nullptr);
|
|
~DeviceConfigView();
|
|
|
|
|
|
bool loadJson(const QString &filePath);
|
|
|
|
|
|
bool saveJson(const QString &filePath);
|
|
|
|
|
|
QStandardItemModel* getModel() const;
|
|
|
|
|
|
void showColumnControlDialog();
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
void setColumnMapping(const QHash<QString, QString> &mapping);
|
|
|
|
virtual void InitViewWorkspace(const QString& project_name) override final;
|
|
virtual void SetAnalyzeDataFilename(const QMap<QString, QVariant>& data_files_set);
|
|
|
|
QList<int> getCheckedRows() const;
|
|
|
|
signals:
|
|
|
|
void dataChanged();
|
|
|
|
private slots:
|
|
void onActionButtonClicked();
|
|
|
|
private:
|
|
void initTableView();
|
|
void setupActionColumnButtons();
|
|
bool parseJsonImpl(const QByteArray &data);
|
|
QList<int> selectTargetChannels(int currentChannel) const;
|
|
|
|
QTableView *m_tableView;
|
|
QStandardItemModel *m_model;
|
|
QHash<QString, QString> m_columnToJsonKey; // 列头 -> JSON键名
|
|
QHash<QString, int> m_jsonKeyToColumn; // 反向映射,用于快速查找列索引
|
|
};
|
|
|
|
#endif // DEVICECONFIGVIEW_H
|