mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 23:13:43 +00:00
PC Application: partial firmware update dialog
This commit is contained in:
parent
8c8749accd
commit
07ba714f1f
134 changed files with 13954 additions and 7 deletions
59
Software/PC_Application/Traces/traceimportdialog.h
Normal file
59
Software/PC_Application/Traces/traceimportdialog.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#ifndef TRACEIMPORTDIALOG_H
|
||||
#define TRACEIMPORTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "tracemodel.h"
|
||||
#include <vector>
|
||||
|
||||
namespace Ui {
|
||||
class TraceImportDialog;
|
||||
}
|
||||
|
||||
class TraceParameterModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class TraceImportDialog;
|
||||
public:
|
||||
TraceParameterModel(std::vector<Trace*> traces, QString prefix, QObject *parent = 0);
|
||||
~TraceParameterModel(){};
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
// adds all enabled traces to the model, deletes other traces
|
||||
void import(TraceModel &model);
|
||||
private:
|
||||
class Parameter {
|
||||
public:
|
||||
bool enabled;
|
||||
QString trace;
|
||||
QString name;
|
||||
QColor color;
|
||||
};
|
||||
std::vector<Parameter> params;
|
||||
std::vector<Trace*> traces;
|
||||
};
|
||||
|
||||
class TraceImportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TraceImportDialog(TraceModel &model, std::vector<Trace*> traces, QString prefix = QString(), QWidget *parent = nullptr);
|
||||
~TraceImportDialog();
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
void on_tableView_doubleClicked(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
Ui::TraceImportDialog *ui;
|
||||
TraceModel &model;
|
||||
TraceParameterModel *tableModel;
|
||||
};
|
||||
|
||||
#endif // TRACEIMPORTDIALOG_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue