2020-08-31 04:03:41 +08:00
|
|
|
#ifndef TRACEEDITDIALOG_H
|
|
|
|
#define TRACEEDITDIALOG_H
|
|
|
|
|
|
|
|
#include "trace.h"
|
2021-10-21 19:00:34 +08:00
|
|
|
|
|
|
|
#include <QDialog>
|
2021-02-23 04:50:28 +08:00
|
|
|
#include <QAbstractTableModel>
|
2020-08-31 04:03:41 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TraceEditDialog;
|
|
|
|
}
|
|
|
|
|
2021-02-23 04:50:28 +08:00
|
|
|
class MathModel : public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MathModel(Trace &t, QObject *parent = 0);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ColIndexStatus = 0,
|
|
|
|
ColIndexDescription = 1,
|
|
|
|
ColIndexDomain = 2,
|
|
|
|
ColIndexLast,
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
|
|
|
|
void addOperation(TraceMath *math);
|
2021-04-25 21:46:34 +08:00
|
|
|
void addOperations(std::vector<TraceMath*> maths);
|
2021-02-23 04:50:28 +08:00
|
|
|
void deleteRow(unsigned int row);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Trace &t;
|
|
|
|
};
|
|
|
|
|
2020-08-31 04:03:41 +08:00
|
|
|
class TraceEditDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TraceEditDialog(Trace &t, QWidget *parent = nullptr);
|
|
|
|
~TraceEditDialog();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_buttonBox_accepted();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::TraceEditDialog *ui;
|
|
|
|
Trace &trace;
|
2020-09-17 21:51:20 +08:00
|
|
|
bool VNAtrace;
|
2020-08-31 04:03:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRACEEDITDIALOG_H
|