LibreVNA/Software/PC_Application/VNA/Deembedding/twothru.h

49 lines
1.3 KiB
C
Raw Normal View History

#ifndef TWOTHRU_H
#define TWOTHRU_H
#include "deembeddingoption.h"
#include "Tools/parameters.h"
2021-10-21 19:00:34 +08:00
#include <complex>
#include <QMessageBox>
namespace Ui {
class TwoThruDialog;
}
class TwoThru : public DeembeddingOption
{
public:
TwoThru();
virtual void transformDatapoint(VNAData& p) override;
virtual void edit() override;
virtual Type getType() override {return DeembeddingOption::Type::TwoThru;}
nlohmann::json toJSON() override;
void fromJSON(nlohmann::json j) override;
private slots:
void startMeasurement();
2021-02-11 23:59:59 +08:00
void updateGUI();
void measurementCompleted(std::vector<VNAData> m) override;
private:
using Point = struct {
double freq;
Tparam inverseP1, inverseP2;
};
2021-02-11 23:59:59 +08:00
static std::vector<VNAData> interpolateEvenFrequencySteps(std::vector<VNAData> input);
static std::vector<Point> calculateErrorBoxes(std::vector<VNAData> data_2xthru);
static std::vector<Point> calculateErrorBoxes(std::vector<VNAData> data_2xthru, std::vector<VNAData> data_fix_dut_fix, double z0);
2021-02-11 23:59:59 +08:00
std::vector<VNAData> measurements2xthru;
std::vector<VNAData> measurementsDUT;
2021-02-11 23:59:59 +08:00
double Z0;
std::vector<Point> points;
2021-02-11 23:59:59 +08:00
bool measuring2xthru;
bool measuringDUT;
Ui::TwoThruDialog *ui;
};
#endif // TWOTHRU_H