LibreVNA/Software/PC_Application/LibreVNA-GUI/VNA/Deembedding/deembeddingoption.h

47 lines
1.3 KiB
C
Raw Normal View History

2022-10-01 23:10:44 +08:00
#ifndef DEEMBEDDINGOPTION_H
#define DEEMBEDDINGOPTION_H
#include "savable.h"
#include "Device/device.h"
#include "Traces/tracemodel.h"
2022-12-13 00:39:17 +08:00
#include "scpi.h"
2022-10-01 23:10:44 +08:00
#include <QWidget>
2022-12-13 00:39:17 +08:00
class DeembeddingOption : public QObject, public Savable, public SCPINode
2022-10-01 23:10:44 +08:00
{
Q_OBJECT
public:
enum class Type {
PortExtension,
TwoThru,
MatchingNetwork,
ImpedanceRenormalization,
// Add new deembedding options here, do not explicitly assign values and keep the Last entry at the last position
Last,
};
static DeembeddingOption *create(Type type);
2022-12-13 00:39:17 +08:00
static QString TypeToString(Type type);
static Type TypeFromString(QString string);
2022-10-01 23:10:44 +08:00
2022-10-14 06:27:22 +08:00
virtual std::set<unsigned int> getAffectedPorts() = 0;
2022-10-01 23:10:44 +08:00
virtual void transformDatapoint(VirtualDevice::VNAMeasurement &p) = 0;
virtual void edit(){}
virtual Type getType() = 0;
public slots:
virtual void measurementCompleted(std::vector<VirtualDevice::VNAMeasurement> m){Q_UNUSED(m)}
signals:
// Deembedding option may selfdestruct if not applicable with current settings. It should emit this signal before deleting itself
void deleted(DeembeddingOption *option);
void triggerMeasurement();
2022-12-13 00:39:17 +08:00
protected:
DeembeddingOption(QString SCPIname)
: SCPINode(SCPIname){}
2022-10-01 23:10:44 +08:00
};
#endif // DEEMBEDDING_H