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

48 lines
1.3 KiB
C
Raw Permalink Normal View History

2022-10-01 23:10:44 +08:00
#ifndef DEEMBEDDINGOPTION_H
#define DEEMBEDDINGOPTION_H
#include "savable.h"
2023-01-16 07:25:29 +08:00
#include "Device/devicedriver.h"
2022-10-01 23:10:44 +08:00
#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:
2022-12-15 07:00:15 +08:00
virtual ~DeembeddingOption(){}
2022-10-01 23:10:44 +08:00
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;
2023-01-16 07:25:29 +08:00
virtual void transformDatapoint(DeviceDriver::VNAMeasurement &p) = 0;
2022-10-01 23:10:44 +08:00
virtual void edit(){}
virtual Type getType() = 0;
public slots:
2023-01-16 07:25:29 +08:00
virtual void measurementCompleted(std::vector<DeviceDriver::VNAMeasurement> m){Q_UNUSED(m)}
2022-10-01 23:10:44 +08:00
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