2020-08-31 04:03:41 +08:00
|
|
|
#ifndef TRACEMODEL_H
|
|
|
|
#define TRACEMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include "trace.h"
|
|
|
|
#include <vector>
|
|
|
|
#include "Device/device.h"
|
|
|
|
|
|
|
|
class TraceModel : public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
TraceModel(QObject *parent = 0);
|
|
|
|
|
|
|
|
void addTrace(Trace *t);
|
|
|
|
void removeTrace(unsigned int index);
|
|
|
|
Trace *trace(unsigned int index);
|
|
|
|
void toggleVisibility(unsigned int index);
|
|
|
|
void togglePause(unsigned int index);
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
std::vector<Trace*> getTraces();
|
2020-09-16 05:22:08 +08:00
|
|
|
|
|
|
|
bool PortExcitationRequired(int port);
|
2020-09-18 01:54:03 +08:00
|
|
|
|
2020-08-31 04:03:41 +08:00
|
|
|
signals:
|
2020-09-18 01:54:03 +08:00
|
|
|
void SpanChanged(double fmin, double fmax);
|
2020-08-31 04:03:41 +08:00
|
|
|
void traceAdded(Trace *t);
|
|
|
|
void traceRemoved(Trace *t);
|
2020-09-16 05:22:08 +08:00
|
|
|
void requiredExcitation(bool excitePort1, bool excitePort2);
|
2020-08-31 04:03:41 +08:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void clearVNAData();
|
|
|
|
void addVNAData(Protocol::Datapoint d);
|
2020-09-17 21:51:20 +08:00
|
|
|
void addSAData(Protocol::SpectrumAnalyzerResult d);
|
2020-08-31 04:03:41 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<Trace*> traces;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRACEMODEL_H
|