allow different paramaters for male/female standards

This commit is contained in:
Jan Käberich 2021-11-27 23:32:41 +01:00
parent 82891ac766
commit 55ac50ee84
7 changed files with 1416 additions and 678 deletions

View File

@ -122,13 +122,14 @@ bool Calibration::constructErrorTerms(Calibration::Type type)
} }
qDebug() << "Constructing error terms for" << TypeToString(type) << "calibration"; qDebug() << "Constructing error terms for" << TypeToString(type) << "calibration";
bool isTRL = type == Type::TRL; bool isTRL = type == Type::TRL;
double kit_minFreq = kit.minFreq(isTRL); bool uses_male = true;
double kit_maxFreq = kit.maxFreq(isTRL); bool uses_female = true;
if(minFreq < kit_minFreq || maxFreq > kit_maxFreq) { if(kit.checkIfValid(minFreq, maxFreq, isTRL, uses_male, uses_female)) {
// TODO adjust for male/female standards
// Calkit does not support complete calibration range // Calkit does not support complete calibration range
QString msg = QString("The calibration kit does not support the complete span.\n\n") QString msg = QString("The calibration kit does not support the complete span.\n\n")
+ "The measured calibration data covers " + Unit::ToString(minFreq, "Hz", " kMG", 4) + " to " + Unit::ToString(maxFreq, "Hz", " kMG", 4) + "The measured calibration data covers " + Unit::ToString(minFreq, "Hz", " kMG", 4) + " to " + Unit::ToString(maxFreq, "Hz", " kMG", 4)
+ ", however the calibration kit is only valid from " + Unit::ToString(kit_minFreq, "Hz", " kMG", 4) + " to " + Unit::ToString(kit_maxFreq, "Hz", " kMG", 4) + ".\n\n" + ", however the calibration kit does not support the whole frequency range.\n\n"
+ "Please adjust the calibration kit or the span and take the calibration measurements again."; + "Please adjust the calibration kit or the span and take the calibration measurements again.";
InformationBox::ShowError("Unable to perform calibration", msg); InformationBox::ShowError("Unable to perform calibration", msg);
qWarning() << msg; qWarning() << msg;

View File

@ -30,7 +30,8 @@ CalibrationTraceDialog::CalibrationTraceDialog(Calibration *cal, double f_min, d
if(type != Calibration::Type::None) { if(type != Calibration::Type::None) {
auto kit = cal->getCalibrationKit(); auto kit = cal->getCalibrationKit();
auto isTRL = type == Calibration::Type::TRL; auto isTRL = type == Calibration::Type::TRL;
if(kit.minFreq(isTRL) > f_min || kit.maxFreq(isTRL) < f_max) { if(isTRL && (kit.minFreqTRL() > f_min || kit.maxFreqTRL() < f_max)) {
// TODO check SOLT frequency range depending on selected male/female kit
InformationBox::ShowMessage("Warning", "The calibration kit does not completely cover the currently selected span. " InformationBox::ShowMessage("Warning", "The calibration kit does not completely cover the currently selected span. "
"Applying a calibration will not be possible for any measurements taken with these settings."); "Applying a calibration will not be possible for any measurements taken with these settings.");
} }

View File

@ -14,9 +14,12 @@ using json = nlohmann::json;
using namespace std; using namespace std;
Calkit::Calkit() Calkit::Calkit()
: ts_open(nullptr), : ts_open_m(nullptr),
ts_short(nullptr), ts_short_m(nullptr),
ts_load(nullptr), ts_load_m(nullptr),
ts_open_f(nullptr),
ts_short_f(nullptr),
ts_load_f(nullptr),
ts_through(nullptr), ts_through(nullptr),
ts_cached(false) ts_cached(false)
{ {
@ -128,39 +131,39 @@ Calkit Calkit::fromFile(QString filename)
// legacy file format, return to beginning of file // legacy file format, return to beginning of file
file.clear(); file.clear();
file.seekg(0); file.seekg(0);
c.SOLT.Open.useMeasurements = readLine(file).toInt(); c.SOLT.open_m.useMeasurements = readLine(file).toInt();
c.SOLT.Short.useMeasurements = readLine(file).toInt(); c.SOLT.short_m.useMeasurements = readLine(file).toInt();
c.SOLT.Load.useMeasurements = readLine(file).toInt(); c.SOLT.load_m.useMeasurements = readLine(file).toInt();
c.SOLT.Through.useMeasurements = readLine(file).toInt(); c.SOLT.Through.useMeasurements = readLine(file).toInt();
c.SOLT.Open.Z0 = readLine(file).toDouble(); c.SOLT.open_m.Z0 = readLine(file).toDouble();
c.SOLT.Open.delay = readLine(file).toDouble(); c.SOLT.open_m.delay = readLine(file).toDouble();
c.SOLT.Open.loss = readLine(file).toDouble(); c.SOLT.open_m.loss = readLine(file).toDouble();
c.SOLT.Open.C0 = readLine(file).toDouble(); c.SOLT.open_m.C0 = readLine(file).toDouble();
c.SOLT.Open.C1 = readLine(file).toDouble(); c.SOLT.open_m.C1 = readLine(file).toDouble();
c.SOLT.Open.C2 = readLine(file).toDouble(); c.SOLT.open_m.C2 = readLine(file).toDouble();
c.SOLT.Open.C3 = readLine(file).toDouble(); c.SOLT.open_m.C3 = readLine(file).toDouble();
c.SOLT.Short.Z0 = readLine(file).toDouble(); c.SOLT.short_m.Z0 = readLine(file).toDouble();
c.SOLT.Short.delay = readLine(file).toDouble(); c.SOLT.short_m.delay = readLine(file).toDouble();
c.SOLT.Short.loss = readLine(file).toDouble(); c.SOLT.short_m.loss = readLine(file).toDouble();
c.SOLT.Short.L0 = readLine(file).toDouble(); c.SOLT.short_m.L0 = readLine(file).toDouble();
c.SOLT.Short.L1 = readLine(file).toDouble(); c.SOLT.short_m.L1 = readLine(file).toDouble();
c.SOLT.Short.L2 = readLine(file).toDouble(); c.SOLT.short_m.L2 = readLine(file).toDouble();
c.SOLT.Short.L3 = readLine(file).toDouble(); c.SOLT.short_m.L3 = readLine(file).toDouble();
c.SOLT.Load.Z0 = readLine(file).toDouble(); c.SOLT.load_m.Z0 = readLine(file).toDouble();
c.SOLT.Through.Z0 = readLine(file).toDouble(); c.SOLT.Through.Z0 = readLine(file).toDouble();
c.SOLT.Through.delay = readLine(file).toDouble(); c.SOLT.Through.delay = readLine(file).toDouble();
c.SOLT.Through.loss = readLine(file).toDouble(); c.SOLT.Through.loss = readLine(file).toDouble();
if(c.SOLT.Open.useMeasurements) { if(c.SOLT.open_m.useMeasurements) {
c.SOLT.Open.file = readLine(file); c.SOLT.open_m.file = readLine(file);
c.SOLT.Open.Sparam = readLine(file).toInt(); c.SOLT.open_m.Sparam = readLine(file).toInt();
} }
if(c.SOLT.Short.useMeasurements) { if(c.SOLT.short_m.useMeasurements) {
c.SOLT.Short.file = readLine(file); c.SOLT.short_m.file = readLine(file);
c.SOLT.Short.Sparam = readLine(file).toInt(); c.SOLT.short_m.Sparam = readLine(file).toInt();
} }
if(c.SOLT.Load.useMeasurements) { if(c.SOLT.load_m.useMeasurements) {
c.SOLT.Load.file = readLine(file); c.SOLT.load_m.file = readLine(file);
c.SOLT.Load.Sparam = readLine(file).toInt(); c.SOLT.load_m.Sparam = readLine(file).toInt();
} }
if(c.SOLT.Through.useMeasurements) { if(c.SOLT.Through.useMeasurements) {
c.SOLT.Through.file = readLine(file); c.SOLT.Through.file = readLine(file);
@ -173,6 +176,8 @@ Calkit Calkit::fromFile(QString filename)
c.TRL.Line.minFreq = readLine(file).toDouble(); c.TRL.Line.minFreq = readLine(file).toDouble();
c.TRL.Line.maxFreq = readLine(file).toDouble(); c.TRL.Line.maxFreq = readLine(file).toDouble();
c.SOLT.separate_male_female = false;
InformationBox::ShowMessage("Loading calkit file", "The file \"" + filename + "\" is stored in a deprecated" InformationBox::ShowMessage("Loading calkit file", "The file \"" + filename + "\" is stored in a deprecated"
" calibration kit format. Future versions of this application might not support" " calibration kit format. Future versions of this application might not support"
" it anymore. Please save the calibration kit to update to the new format"); " it anymore. Please save the calibration kit to update to the new format");
@ -199,7 +204,7 @@ void Calkit::edit(std::function<void (void)> done)
dialog->show(); dialog->show();
} }
class Calkit::SOLT Calkit::toSOLT(double frequency) class Calkit::SOLT Calkit::toSOLT(double frequency, bool male_standards)
{ {
auto addTransmissionLine = [](complex<double> termination_reflection, double offset_impedance, double offset_delay, double offset_loss, double frequency) -> complex<double> { auto addTransmissionLine = [](complex<double> termination_reflection, double offset_impedance, double offset_delay, double offset_loss, double frequency) -> complex<double> {
// nomenclature and formulas from https://loco.lab.asu.edu/loco-memos/edges_reports/report_20130807.pdf // nomenclature and formulas from https://loco.lab.asu.edu/loco-memos/edges_reports/report_20130807.pdf
@ -221,29 +226,36 @@ class Calkit::SOLT Calkit::toSOLT(double frequency)
return Gamma_i; return Gamma_i;
}; };
auto Load = male_standards ? SOLT.load_m : SOLT.load_f;
auto Short = male_standards ? SOLT.short_m : SOLT.short_f;
auto Open = male_standards ? SOLT.open_m : SOLT.open_f;
auto ts_load = male_standards ? ts_load_m : ts_load_f;
auto ts_short = male_standards ? ts_short_m : ts_short_f;
auto ts_open = male_standards ? ts_open_m : ts_open_f;
fillTouchstoneCache(); fillTouchstoneCache();
class SOLT ref; class SOLT ref;
if(SOLT.Load.useMeasurements) { if(Load.useMeasurements) {
ref.Load = ts_load->interpolate(frequency).S[0]; ref.Load = ts_load->interpolate(frequency).S[0];
} else { } else {
auto imp_load = complex<double>(SOLT.Load.Z0, 0); auto imp_load = complex<double>(Load.Z0, 0);
// Add parallel capacitor to impedance // Add parallel capacitor to impedance
if(SOLT.Load.Cparallel > 0) { if(Load.Cparallel > 0) {
auto imp_C = complex<double>(0, -1.0 / (frequency * 2 * M_PI * SOLT.Load.Cparallel)); auto imp_C = complex<double>(0, -1.0 / (frequency * 2 * M_PI * Load.Cparallel));
imp_load = (imp_load * imp_C) / (imp_load + imp_C); imp_load = (imp_load * imp_C) / (imp_load + imp_C);
} }
// add series inductor to impedance // add series inductor to impedance
auto imp_L = complex<double>(0, frequency * 2 * M_PI * SOLT.Load.Lseries); auto imp_L = complex<double>(0, frequency * 2 * M_PI * Load.Lseries);
imp_load += imp_L; imp_load += imp_L;
ref.Load = (imp_load - complex<double>(50.0)) / (imp_load + complex<double>(50.0)); ref.Load = (imp_load - complex<double>(50.0)) / (imp_load + complex<double>(50.0));
ref.Load = addTransmissionLine(ref.Load, SOLT.Load.Z0, SOLT.Load.delay*1e-12, 0, frequency); ref.Load = addTransmissionLine(ref.Load, Load.Z0, Load.delay*1e-12, 0, frequency);
} }
if(SOLT.Open.useMeasurements) { if(Open.useMeasurements) {
ref.Open = ts_open->interpolate(frequency).S[0]; ref.Open = ts_open->interpolate(frequency).S[0];
} else { } else {
// calculate fringing capacitance for open // calculate fringing capacitance for open
double Cfringing = SOLT.Open.C0 * 1e-15 + SOLT.Open.C1 * 1e-27 * frequency + SOLT.Open.C2 * 1e-36 * pow(frequency, 2) + SOLT.Open.C3 * 1e-45 * pow(frequency, 3); double Cfringing = Open.C0 * 1e-15 + Open.C1 * 1e-27 * frequency + Open.C2 * 1e-36 * pow(frequency, 2) + Open.C3 * 1e-45 * pow(frequency, 3);
// convert to impedance // convert to impedance
if (Cfringing == 0) { if (Cfringing == 0) {
// special case to avoid issues with infinity // special case to avoid issues with infinity
@ -252,18 +264,18 @@ class Calkit::SOLT Calkit::toSOLT(double frequency)
auto imp_open = complex<double>(0, -1.0 / (frequency * 2 * M_PI * Cfringing)); auto imp_open = complex<double>(0, -1.0 / (frequency * 2 * M_PI * Cfringing));
ref.Open = (imp_open - complex<double>(50.0)) / (imp_open + complex<double>(50.0)); ref.Open = (imp_open - complex<double>(50.0)) / (imp_open + complex<double>(50.0));
} }
ref.Open = addTransmissionLine(ref.Open, SOLT.Open.Z0, SOLT.Open.delay*1e-12, SOLT.Open.loss*1e9, frequency); ref.Open = addTransmissionLine(ref.Open, Open.Z0, Open.delay*1e-12, Open.loss*1e9, frequency);
} }
if(SOLT.Short.useMeasurements) { if(Short.useMeasurements) {
ref.Short = ts_short->interpolate(frequency).S[0]; ref.Short = ts_short->interpolate(frequency).S[0];
} else { } else {
// calculate inductance for short // calculate inductance for short
double Lseries = SOLT.Short.L0 * 1e-12 + SOLT.Short.L1 * 1e-24 * frequency + SOLT.Short.L2 * 1e-33 * pow(frequency, 2) + SOLT.Short.L3 * 1e-42 * pow(frequency, 3); double Lseries = Short.L0 * 1e-12 + Short.L1 * 1e-24 * frequency + Short.L2 * 1e-33 * pow(frequency, 2) + Short.L3 * 1e-42 * pow(frequency, 3);
// convert to impedance // convert to impedance
auto imp_short = complex<double>(0, frequency * 2 * M_PI * Lseries); auto imp_short = complex<double>(0, frequency * 2 * M_PI * Lseries);
ref.Short = (imp_short - complex<double>(50.0)) / (imp_short + complex<double>(50.0)); ref.Short = (imp_short - complex<double>(50.0)) / (imp_short + complex<double>(50.0));
ref.Short = addTransmissionLine(ref.Short, SOLT.Short.Z0, SOLT.Short.delay*1e-12, SOLT.Short.loss*1e9, frequency); ref.Short = addTransmissionLine(ref.Short, Short.Z0, Short.delay*1e-12, Short.loss*1e9, frequency);
} }
if(SOLT.Through.useMeasurements) { if(SOLT.Through.useMeasurements) {
@ -300,47 +312,91 @@ class Calkit::TRL Calkit::toTRL(double)
return trl; return trl;
} }
double Calkit::minFreq(bool trl) double Calkit::minFreqTRL()
{ {
if(trl) { return TRL.Line.minFreq;
return TRL.Line.minFreq;
} else {
fillTouchstoneCache();
double min = 0;
array<Touchstone*, 4> ts_list = {ts_open, ts_short, ts_load, ts_through};
// find the highest minimum frequency in all measurement files
for(auto ts : ts_list) {
if(!ts) {
// this calibration standard is defined by coefficients, no minimum frequency
continue;
}
if(ts->minFreq() > min) {
min = ts->minFreq();
}
}
return min;
}
} }
double Calkit::maxFreq(bool trl) double Calkit::maxFreqTRL()
{ {
if(trl) { return TRL.Line.maxFreq;
return TRL.Line.maxFreq; }
double Calkit::minFreqSOLT(bool male_standards)
{
fillTouchstoneCache();
double min = 0;
auto ts_load = male_standards ? ts_load_m : ts_load_f;
auto ts_short = male_standards ? ts_short_m : ts_short_f;
auto ts_open = male_standards ? ts_open_m : ts_open_f;
array<Touchstone*, 4> ts_list = {ts_open, ts_short, ts_load, ts_through};
// find the highest minimum frequency in all measurement files
for(auto ts : ts_list) {
if(!ts) {
// this calibration standard is defined by coefficients, no minimum frequency
continue;
}
if(ts->minFreq() > min) {
min = ts->minFreq();
}
}
return min;
}
double Calkit::maxFreqSOLT(bool male_standards)
{
fillTouchstoneCache();
double max = std::numeric_limits<double>::max();
auto ts_load = male_standards ? ts_load_m : ts_load_f;
auto ts_short = male_standards ? ts_short_m : ts_short_f;
auto ts_open = male_standards ? ts_open_m : ts_open_f;
array<Touchstone*, 4> ts_list = {ts_open, ts_short, ts_load, ts_through};
// find the highest minimum frequency in all measurement files
for(auto ts : ts_list) {
if(!ts) {
// this calibration standard is defined by coefficients, no minimum frequency
continue;
}
if(ts->maxFreq() < max) {
max = ts->maxFreq();
}
}
return max;
}
bool Calkit::checkIfValid(double min_freq, double max_freq, bool isTRL, bool include_male, bool include_female)
{
auto min_supported = std::numeric_limits<double>::min();
auto max_supported = std::numeric_limits<double>::max();
if(isTRL) {
min_supported = TRL.Line.minFreq;
max_supported = TRL.Line.maxFreq;
} else { } else {
fillTouchstoneCache(); if(include_male) {
double max = std::numeric_limits<double>::max(); auto min_male = minFreqSOLT(true);
array<Touchstone*, 4> ts_list = {ts_open, ts_short, ts_load, ts_through}; auto max_male = maxFreqSOLT(true);
// find the highest minimum frequency in all measurement files if(min_male > min_supported) {
for(auto ts : ts_list) { min_supported = min_male;
if(!ts) {
// this calibration standard is defined by coefficients, no minimum frequency
continue;
} }
if(ts->maxFreq() < max) { if(max_male > max_supported) {
max = ts->maxFreq(); max_supported = max_male;
} }
} }
return max; if(include_female) {
auto min_female = minFreqSOLT(false);
auto max_female = maxFreqSOLT(false);
if(min_female > min_supported) {
min_supported = min_female;
}
if(max_female > max_supported) {
max_supported = max_female;
}
}
}
if(min_supported <= min_freq && max_supported >= max_freq) {
return true;
} else {
return false;
} }
} }
@ -351,7 +407,7 @@ bool Calkit::isTRLReflectionShort() const
void Calkit::TransformPathsToRelative(QFileInfo d) void Calkit::TransformPathsToRelative(QFileInfo d)
{ {
vector<QString*> filenames = {&SOLT.Short.file, &SOLT.Open.file, &SOLT.Load.file, &SOLT.Through.file}; vector<QString*> filenames = {&SOLT.short_m.file, &SOLT.open_m.file, &SOLT.load_m.file, &SOLT.short_f.file, &SOLT.open_f.file, &SOLT.load_f.file, &SOLT.Through.file};
for(auto f : filenames) { for(auto f : filenames) {
if(f->isEmpty()) { if(f->isEmpty()) {
continue; continue;
@ -366,7 +422,7 @@ void Calkit::TransformPathsToRelative(QFileInfo d)
void Calkit::TransformPathsToAbsolute(QFileInfo d) void Calkit::TransformPathsToAbsolute(QFileInfo d)
{ {
vector<QString*> filenames = {&SOLT.Short.file, &SOLT.Open.file, &SOLT.Load.file, &SOLT.Through.file}; vector<QString*> filenames = {&SOLT.short_m.file, &SOLT.open_m.file, &SOLT.load_m.file, &SOLT.short_f.file, &SOLT.open_f.file, &SOLT.load_f.file, &SOLT.Through.file};
for(auto f : filenames) { for(auto f : filenames) {
if(f->isEmpty()) { if(f->isEmpty()) {
continue; continue;
@ -382,12 +438,18 @@ void Calkit::TransformPathsToAbsolute(QFileInfo d)
void Calkit::clearTouchstoneCache() void Calkit::clearTouchstoneCache()
{ {
delete ts_open; delete ts_open_m;
ts_open = nullptr; ts_open_m = nullptr;
delete ts_short; delete ts_short_m;
ts_short = nullptr; ts_short_m = nullptr;
delete ts_load; delete ts_load_m;
ts_load = nullptr; ts_load_m = nullptr;
delete ts_open_f;
ts_open_f = nullptr;
delete ts_short_f;
ts_short_f = nullptr;
delete ts_load_f;
ts_load_f = nullptr;
delete ts_through; delete ts_through;
ts_through = nullptr; ts_through = nullptr;
ts_cached = false; ts_cached = false;
@ -398,20 +460,35 @@ void Calkit::fillTouchstoneCache()
if(ts_cached) { if(ts_cached) {
return; return;
} }
if(SOLT.Open.useMeasurements) { if(SOLT.open_m.useMeasurements) {
ts_open = new Touchstone(1); ts_open_m = new Touchstone(1);
*ts_open = Touchstone::fromFile(SOLT.Open.file.toStdString()); *ts_open_m = Touchstone::fromFile(SOLT.open_m.file.toStdString());
ts_open->reduceTo1Port(SOLT.Open.Sparam); ts_open_m->reduceTo1Port(SOLT.open_m.Sparam);
} }
if(SOLT.Short.useMeasurements) { if(SOLT.short_m.useMeasurements) {
ts_short = new Touchstone(1); ts_short_m = new Touchstone(1);
*ts_short = Touchstone::fromFile(SOLT.Short.file.toStdString()); *ts_short_m = Touchstone::fromFile(SOLT.short_m.file.toStdString());
ts_short->reduceTo1Port(SOLT.Short.Sparam); ts_short_m->reduceTo1Port(SOLT.short_m.Sparam);
} }
if(SOLT.Load.useMeasurements) { if(SOLT.load_m.useMeasurements) {
ts_load = new Touchstone(1); ts_load_m = new Touchstone(1);
*ts_load = Touchstone::fromFile(SOLT.Load.file.toStdString()); *ts_load_m = Touchstone::fromFile(SOLT.load_m.file.toStdString());
ts_load->reduceTo1Port(SOLT.Load.Sparam); ts_load_m->reduceTo1Port(SOLT.load_m.Sparam);
}
if(SOLT.open_f.useMeasurements) {
ts_open_f = new Touchstone(1);
*ts_open_f = Touchstone::fromFile(SOLT.open_f.file.toStdString());
ts_open_f->reduceTo1Port(SOLT.open_f.Sparam);
}
if(SOLT.short_f.useMeasurements) {
ts_short_f = new Touchstone(1);
*ts_short_f = Touchstone::fromFile(SOLT.short_f.file.toStdString());
ts_short_f->reduceTo1Port(SOLT.short_f.Sparam);
}
if(SOLT.load_f.useMeasurements) {
ts_load_f = new Touchstone(1);
*ts_load_f = Touchstone::fromFile(SOLT.load_f.file.toStdString());
ts_load_f->reduceTo1Port(SOLT.load_f.Sparam);
} }
if(SOLT.Through.useMeasurements) { if(SOLT.Through.useMeasurements) {
ts_through = new Touchstone(2); ts_through = new Touchstone(2);

View File

@ -41,10 +41,13 @@ public:
void toFile(QString filename); void toFile(QString filename);
static Calkit fromFile(QString filename); static Calkit fromFile(QString filename);
void edit(std::function<void(void)> done = nullptr); void edit(std::function<void(void)> done = nullptr);
SOLT toSOLT(double frequency); SOLT toSOLT(double frequency, bool male_standards = true);
TRL toTRL(double frequency); TRL toTRL(double frequency);
double minFreq(bool trl = false); double minFreqTRL();
double maxFreq(bool trl = false); double maxFreqTRL();
double minFreqSOLT(bool male_standards = true);
double maxFreqSOLT(bool male_standards = true);
bool checkIfValid(double min_freq, double max_freq, bool isTRL, bool include_male, bool include_female);
bool isTRLReflectionShort() const; bool isTRLReflectionShort() const;
private: private:
@ -54,30 +57,34 @@ private:
QString manufacturer, serialnumber, description; QString manufacturer, serialnumber, description;
// SOLT standard definitions // SOLT standard definitions
struct { struct {
struct { using Open = struct {
double Z0, delay, loss, C0, C1, C2, C3; double Z0, delay, loss, C0, C1, C2, C3;
QString file; QString file;
bool useMeasurements; bool useMeasurements;
int Sparam; int Sparam;
} Open; };
struct { Open open_m, open_f;
using Short = struct {
double Z0, delay, loss, L0, L1, L2, L3; double Z0, delay, loss, L0, L1, L2, L3;
QString file; QString file;
bool useMeasurements; bool useMeasurements;
int Sparam; int Sparam;
} Short; };
struct { Short short_m, short_f;
using Load = struct {
double Z0, delay, Cparallel, Lseries; double Z0, delay, Cparallel, Lseries;
QString file; QString file;
bool useMeasurements; bool useMeasurements;
int Sparam; int Sparam;
} Load; };
Load load_m, load_f;
struct { struct {
double Z0, delay, loss; double Z0, delay, loss;
QString file; QString file;
bool useMeasurements; bool useMeasurements;
int Sparam1, Sparam2; int Sparam1, Sparam2;
} Through; } Through;
bool separate_male_female;
} SOLT; } SOLT;
struct { struct {
struct { struct {
@ -92,7 +99,9 @@ private:
} TRL; } TRL;
bool startDialogWithSOLT; bool startDialogWithSOLT;
Touchstone *ts_open, *ts_short, *ts_load, *ts_through; Touchstone *ts_open_m, *ts_short_m, *ts_load_m;
Touchstone *ts_open_f, *ts_short_f, *ts_load_f;
Touchstone *ts_through;
bool ts_cached; bool ts_cached;
using JSONDescription = struct _jsondescr { using JSONDescription = struct _jsondescr {
@ -100,40 +109,67 @@ private:
QString name; QString name;
QVariant def; QVariant def;
}; };
const std::array<JSONDescription, 43> json_descr = {{ const std::array<JSONDescription, 71> json_descr = {{
{&manufacturer, "Manufacturer", ""}, {&manufacturer, "Manufacturer", ""},
{&serialnumber, "Serialnumber", ""}, {&serialnumber, "Serialnumber", ""},
{&description, "Description", ""}, {&description, "Description", ""},
{&SOLT.Open.Z0, "SOLT/Open/Param/Z0", 50.0}, {&SOLT.open_m.Z0, "SOLT/Open/Param/Z0", 50.0},
{&SOLT.Open.delay, "SOLT/Open/Param/Delay", 0.0}, {&SOLT.open_m.delay, "SOLT/Open/Param/Delay", 0.0},
{&SOLT.Open.loss, "SOLT/Open/Param/Loss", 0.0}, {&SOLT.open_m.loss, "SOLT/Open/Param/Loss", 0.0},
{&SOLT.Open.C0, "SOLT/Open/Param/C0", 0.0}, {&SOLT.open_m.C0, "SOLT/Open/Param/C0", 0.0},
{&SOLT.Open.C1, "SOLT/Open/Param/C1", 0.0}, {&SOLT.open_m.C1, "SOLT/Open/Param/C1", 0.0},
{&SOLT.Open.C2, "SOLT/Open/Param/C2", 0.0}, {&SOLT.open_m.C2, "SOLT/Open/Param/C2", 0.0},
{&SOLT.Open.C3, "SOLT/Open/Param/C3", 0.0}, {&SOLT.open_m.C3, "SOLT/Open/Param/C3", 0.0},
{&SOLT.Open.useMeasurements, "SOLT/Open/Measurements/Use", false}, {&SOLT.open_m.useMeasurements, "SOLT/Open/Measurements/Use", false},
{&SOLT.Open.file, "SOLT/Open/Measurements/File", ""}, {&SOLT.open_m.file, "SOLT/Open/Measurements/File", ""},
{&SOLT.Open.Sparam, "SOLT/Open/Measurements/Port", 0}, {&SOLT.open_m.Sparam, "SOLT/Open/Measurements/Port", 0},
{&SOLT.open_f.Z0, "SOLT/Open/Param/Z0_Female", 50.0},
{&SOLT.open_f.delay, "SOLT/Open/Param/Delay_Female", 0.0},
{&SOLT.open_f.loss, "SOLT/Open/Param/Loss_Female", 0.0},
{&SOLT.open_f.C0, "SOLT/Open/Param/C0_Female", 0.0},
{&SOLT.open_f.C1, "SOLT/Open/Param/C1_Female", 0.0},
{&SOLT.open_f.C2, "SOLT/Open/Param/C2_Female", 0.0},
{&SOLT.open_f.C3, "SOLT/Open/Param/C3_Female", 0.0},
{&SOLT.open_f.useMeasurements, "SOLT/Open/Measurements/Use_Female", false},
{&SOLT.open_f.file, "SOLT/Open/Measurements/File_Female", ""},
{&SOLT.open_f.Sparam, "SOLT/Open/Measurements/Port_Female", 0},
{&SOLT.Short.Z0, "SOLT/Short/Param/Z0", 50.0}, {&SOLT.short_m.Z0, "SOLT/Short/Param/Z0", 50.0},
{&SOLT.Short.delay, "SOLT/Short/Param/Delay", 0.0}, {&SOLT.short_m.delay, "SOLT/Short/Param/Delay", 0.0},
{&SOLT.Short.loss, "SOLT/Short/Param/Loss", 0.0}, {&SOLT.short_m.loss, "SOLT/Short/Param/Loss", 0.0},
{&SOLT.Short.L0, "SOLT/Short/Param/L0", 0.0}, {&SOLT.short_m.L0, "SOLT/Short/Param/L0", 0.0},
{&SOLT.Short.L1, "SOLT/Short/Param/L1", 0.0}, {&SOLT.short_m.L1, "SOLT/Short/Param/L1", 0.0},
{&SOLT.Short.L2, "SOLT/Short/Param/L2", 0.0}, {&SOLT.short_m.L2, "SOLT/Short/Param/L2", 0.0},
{&SOLT.Short.L3, "SOLT/Short/Param/L3", 0.0}, {&SOLT.short_m.L3, "SOLT/Short/Param/L3", 0.0},
{&SOLT.Short.useMeasurements, "SOLT/Short/Measurements/Use", false}, {&SOLT.short_m.useMeasurements, "SOLT/Short/Measurements/Use", false},
{&SOLT.Short.file, "SOLT/Short/Measurements/File", ""}, {&SOLT.short_m.file, "SOLT/Short/Measurements/File", ""},
{&SOLT.Short.Sparam, "SOLT/Short/Measurements/Port", 0}, {&SOLT.short_m.Sparam, "SOLT/Short/Measurements/Port", 0},
{&SOLT.short_f.Z0, "SOLT/Short/Param/Z0_Female", 50.0},
{&SOLT.short_f.delay, "SOLT/Short/Param/Delay_Female", 0.0},
{&SOLT.short_f.loss, "SOLT/Short/Param/Loss_Female", 0.0},
{&SOLT.short_f.L0, "SOLT/Short/Param/L0_Female", 0.0},
{&SOLT.short_f.L1, "SOLT/Short/Param/L1_Female", 0.0},
{&SOLT.short_f.L2, "SOLT/Short/Param/L2_Female", 0.0},
{&SOLT.short_f.L3, "SOLT/Short/Param/L3_Female", 0.0},
{&SOLT.short_f.useMeasurements, "SOLT/Short/Measurements/Use_Female", false},
{&SOLT.short_f.file, "SOLT/Short/Measurements/File_Female", ""},
{&SOLT.short_f.Sparam, "SOLT/Short/Measurements/Port_Female", 0},
{&SOLT.Load.Z0, "SOLT/Load/Param/Z0", 50.0}, {&SOLT.load_m.Z0, "SOLT/Load/Param/Z0", 50.0},
{&SOLT.Load.delay, "SOLT/Load/Param/Delay", 0.0}, {&SOLT.load_m.delay, "SOLT/Load/Param/Delay", 0.0},
{&SOLT.Load.Cparallel, "SOLT/Load/Param/C", 0.0}, {&SOLT.load_m.Cparallel, "SOLT/Load/Param/C", 0.0},
{&SOLT.Load.Lseries, "SOLT/Load/Param/L", 0.0}, {&SOLT.load_m.Lseries, "SOLT/Load/Param/L", 0.0},
{&SOLT.Load.useMeasurements, "SOLT/Load/Measurements/Use", false}, {&SOLT.load_m.useMeasurements, "SOLT/Load/Measurements/Use", false},
{&SOLT.Load.file, "SOLT/Load/Measurements/File", ""}, {&SOLT.load_m.file, "SOLT/Load/Measurements/File", ""},
{&SOLT.Load.Sparam, "SOLT/Load/Measurements/Port", 0}, {&SOLT.load_m.Sparam, "SOLT/Load/Measurements/Port", 0},
{&SOLT.load_f.Z0, "SOLT/Load/Param/Z0_Female", 50.0},
{&SOLT.load_f.delay, "SOLT/Load/Param/Delay_Female", 0.0},
{&SOLT.load_f.Cparallel, "SOLT/Load/Param/C_Female", 0.0},
{&SOLT.load_f.Lseries, "SOLT/Load/Param/L_Female", 0.0},
{&SOLT.load_f.useMeasurements, "SOLT/Load/Measurements/Use_Female", false},
{&SOLT.load_f.file, "SOLT/Load/Measurements/File_Female", ""},
{&SOLT.load_f.Sparam, "SOLT/Load/Measurements/Port_Female", 0},
{&SOLT.Through.Z0, "SOLT/Through/Param/Z0", 50.0}, {&SOLT.Through.Z0, "SOLT/Through/Param/Z0", 50.0},
{&SOLT.Through.delay, "SOLT/Through/Param/Delay", 0.0}, {&SOLT.Through.delay, "SOLT/Through/Param/Delay", 0.0},
@ -143,6 +179,8 @@ private:
{&SOLT.Through.Sparam1, "SOLT/Through/Measurements/Port1", 0}, {&SOLT.Through.Sparam1, "SOLT/Through/Measurements/Port1", 0},
{&SOLT.Through.Sparam2, "SOLT/Through/Measurements/Port2", 1}, {&SOLT.Through.Sparam2, "SOLT/Through/Measurements/Port2", 1},
{&SOLT.separate_male_female, "SOLT/SeparateMaleFemale", false},
{&TRL.Through.Z0, "TRL/Through/Z0", 50.0}, {&TRL.Through.Z0, "TRL/Through/Z0", 50.0},
{&TRL.Reflection.isShort, "TRL/Reflect/isShort", false}, {&TRL.Reflection.isShort, "TRL/Reflect/isShort", false},
{&TRL.Line.delay, "TRL/Line/Delay", 74.0}, {&TRL.Line.delay, "TRL/Line/Delay", 74.0},

View File

@ -47,6 +47,29 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
ui->load_parC->setPrefixes("fpnum "); ui->load_parC->setPrefixes("fpnum ");
ui->load_serL->setUnit("H"); ui->load_serL->setUnit("H");
ui->load_serL->setPrefixes("fpnum "); ui->load_serL->setPrefixes("fpnum ");
// Same setup for female standards
ui->OpenType_f->setId(ui->open_coefficients_f, 0);
ui->OpenType_f->setId(ui->open_measurement_f, 1);
ui->ShortType_f->setId(ui->short_coefficients_f, 0);
ui->ShortType_f->setId(ui->short_measurement_f, 1);
ui->LoadType_f->setId(ui->load_coefficients_f, 0);
ui->LoadType_f->setId(ui->load_measurement_f, 1);
ui->open_touchstone_f->setPorts(1);
ui->short_touchstone_f->setPorts(1);
ui->load_touchstone_f->setPorts(1);
ui->short_Z0_f->setUnit("Ω");
ui->open_Z0_f->setUnit("Ω");
ui->load_Z0_f->setUnit("Ω");
ui->load_parC_f->setUnit("F");
ui->load_parC_f->setPrefixes("fpnum ");
ui->load_serL_f->setUnit("H");
ui->load_serL_f->setPrefixes("fpnum ");
ui->through_Z0->setUnit("Ω"); ui->through_Z0->setUnit("Ω");
ui->TRL_through_Z0->setUnit("Ω"); ui->TRL_through_Z0->setUnit("Ω");
@ -59,6 +82,24 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
editKit.clearTouchstoneCache(); editKit.clearTouchstoneCache();
ownKit = editKit; ownKit = editKit;
connect(ui->cbStandardDefinition, qOverload<int>(&QComboBox::currentIndexChanged), [=](int index){
if (index == 0) {
// common definition, hide tab bars, set all to male tab
ui->mf_short->setCurrentIndex(0);
ui->mf_short->tabBar()->hide();
ui->mf_open->setCurrentIndex(0);
ui->mf_open->tabBar()->hide();
ui->mf_load->setCurrentIndex(0);
ui->mf_load->tabBar()->hide();
} else {
// separate definitions for male/female standards
ui->mf_short->tabBar()->show();
ui->mf_open->tabBar()->show();
ui->mf_load->tabBar()->show();
}
});
updateEntries(); updateEntries();
connect(ui->TRL_line_min, &SIUnitEdit::valueChanged, [=](double newval){ connect(ui->TRL_line_min, &SIUnitEdit::valueChanged, [=](double newval){
@ -85,6 +126,15 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
if(ui->load_measurement->isChecked() && !ui->load_touchstone->getStatus()) { if(ui->load_measurement->isChecked() && !ui->load_touchstone->getStatus()) {
ok = false; ok = false;
} }
if(ui->open_measurement_f->isChecked() && !ui->open_touchstone_f->getStatus()) {
ok = false;
}
if(ui->short_measurement_f->isChecked() && !ui->short_touchstone_f->getStatus()) {
ok = false;
}
if(ui->load_measurement_f->isChecked() && !ui->load_touchstone_f->getStatus()) {
ok = false;
}
if(ui->through_measurement->isChecked() && !ui->through_touchstone->getStatus()) { if(ui->through_measurement->isChecked() && !ui->through_touchstone->getStatus()) {
ok = false; ok = false;
} }
@ -95,6 +145,9 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
connect(ui->open_touchstone, &TouchstoneImport::statusChanged, UpdateStatus); connect(ui->open_touchstone, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->short_touchstone, &TouchstoneImport::statusChanged, UpdateStatus); connect(ui->short_touchstone, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->load_touchstone, &TouchstoneImport::statusChanged, UpdateStatus); connect(ui->load_touchstone, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->open_touchstone_f, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->short_touchstone_f, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->load_touchstone_f, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->through_touchstone, &TouchstoneImport::statusChanged, UpdateStatus); connect(ui->through_touchstone, &TouchstoneImport::statusChanged, UpdateStatus);
connect(ui->OpenType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) { connect(ui->OpenType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
@ -106,6 +159,15 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
connect(ui->LoadType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) { connect(ui->LoadType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
UpdateStatus(); UpdateStatus();
}); });
connect(ui->OpenType_f, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
UpdateStatus();
});
connect(ui->ShortType_f, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
UpdateStatus();
});
connect(ui->LoadType_f, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
UpdateStatus();
});
connect(ui->ThroughType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) { connect(ui->ThroughType, qOverload<int>(&QButtonGroup::buttonClicked), [=](int) {
UpdateStatus(); UpdateStatus();
}); });
@ -152,49 +214,83 @@ void CalkitDialog::parseEntries()
ownKit.description = ui->description->toPlainText(); ownKit.description = ui->description->toPlainText();
// type // type
ownKit.SOLT.Open.useMeasurements = ui->open_measurement->isChecked(); ownKit.SOLT.open_m.useMeasurements = ui->open_measurement->isChecked();
ownKit.SOLT.Short.useMeasurements = ui->short_measurement->isChecked(); ownKit.SOLT.short_m.useMeasurements = ui->short_measurement->isChecked();
ownKit.SOLT.Load.useMeasurements = ui->load_measurement->isChecked(); ownKit.SOLT.load_m.useMeasurements = ui->load_measurement->isChecked();
ownKit.SOLT.open_f.useMeasurements = ui->open_measurement_f->isChecked();
ownKit.SOLT.short_f.useMeasurements = ui->short_measurement_f->isChecked();
ownKit.SOLT.load_f.useMeasurements = ui->load_measurement_f->isChecked();
ownKit.SOLT.Through.useMeasurements = ui->through_measurement->isChecked(); ownKit.SOLT.Through.useMeasurements = ui->through_measurement->isChecked();
// coefficients // coefficients
ownKit.SOLT.Open.Z0 = ui->open_Z0->value(); ownKit.SOLT.open_m.Z0 = ui->open_Z0->value();
ownKit.SOLT.Open.delay = ui->open_delay->value(); ownKit.SOLT.open_m.delay = ui->open_delay->value();
ownKit.SOLT.Open.loss = ui->open_loss->value(); ownKit.SOLT.open_m.loss = ui->open_loss->value();
ownKit.SOLT.Open.C0 = ui->open_C0->value(); ownKit.SOLT.open_m.C0 = ui->open_C0->value();
ownKit.SOLT.Open.C1 = ui->open_C1->value(); ownKit.SOLT.open_m.C1 = ui->open_C1->value();
ownKit.SOLT.Open.C2 = ui->open_C2->value(); ownKit.SOLT.open_m.C2 = ui->open_C2->value();
ownKit.SOLT.Open.C3 = ui->open_C3->value(); ownKit.SOLT.open_m.C3 = ui->open_C3->value();
ownKit.SOLT.Short.Z0 = ui->short_Z0->value(); ownKit.SOLT.short_m.Z0 = ui->short_Z0->value();
ownKit.SOLT.Short.delay = ui->short_delay->value(); ownKit.SOLT.short_m.delay = ui->short_delay->value();
ownKit.SOLT.Short.loss = ui->short_loss->value(); ownKit.SOLT.short_m.loss = ui->short_loss->value();
ownKit.SOLT.Short.L0 = ui->short_L0->value(); ownKit.SOLT.short_m.L0 = ui->short_L0->value();
ownKit.SOLT.Short.L1 = ui->short_L1->value(); ownKit.SOLT.short_m.L1 = ui->short_L1->value();
ownKit.SOLT.Short.L2 = ui->short_L2->value(); ownKit.SOLT.short_m.L2 = ui->short_L2->value();
ownKit.SOLT.Short.L3 = ui->short_L3->value(); ownKit.SOLT.short_m.L3 = ui->short_L3->value();
ownKit.SOLT.Load.Z0 = ui->load_Z0->value(); ownKit.SOLT.load_m.Z0 = ui->load_Z0->value();
ownKit.SOLT.Load.delay = ui->load_delay->value(); ownKit.SOLT.load_m.delay = ui->load_delay->value();
ownKit.SOLT.Load.Cparallel = ui->load_parC->value(); ownKit.SOLT.load_m.Cparallel = ui->load_parC->value();
ownKit.SOLT.Load.Lseries = ui->load_serL->value(); ownKit.SOLT.load_m.Lseries = ui->load_serL->value();
ownKit.SOLT.open_f.Z0 = ui->open_Z0_f->value();
ownKit.SOLT.open_f.delay = ui->open_delay_f->value();
ownKit.SOLT.open_f.loss = ui->open_loss_f->value();
ownKit.SOLT.open_f.C0 = ui->open_C0_f->value();
ownKit.SOLT.open_f.C1 = ui->open_C1_f->value();
ownKit.SOLT.open_f.C2 = ui->open_C2_f->value();
ownKit.SOLT.open_f.C3 = ui->open_C3_f->value();
ownKit.SOLT.short_f.Z0 = ui->short_Z0_f->value();
ownKit.SOLT.short_f.delay = ui->short_delay_f->value();
ownKit.SOLT.short_f.loss = ui->short_loss_f->value();
ownKit.SOLT.short_f.L0 = ui->short_L0_f->value();
ownKit.SOLT.short_f.L1 = ui->short_L1_f->value();
ownKit.SOLT.short_f.L2 = ui->short_L2_f->value();
ownKit.SOLT.short_f.L3 = ui->short_L3_f->value();
ownKit.SOLT.load_f.Z0 = ui->load_Z0_f->value();
ownKit.SOLT.load_f.delay = ui->load_delay_f->value();
ownKit.SOLT.load_f.Cparallel = ui->load_parC_f->value();
ownKit.SOLT.load_f.Lseries = ui->load_serL_f->value();
ownKit.SOLT.Through.Z0 = ui->through_Z0->value(); ownKit.SOLT.Through.Z0 = ui->through_Z0->value();
ownKit.SOLT.Through.delay = ui->through_delay->value(); ownKit.SOLT.Through.delay = ui->through_delay->value();
ownKit.SOLT.Through.loss = ui->through_loss->value(); ownKit.SOLT.Through.loss = ui->through_loss->value();
ownKit.SOLT.separate_male_female = ui->cbStandardDefinition->currentIndex() == 1;
// file // file
ownKit.SOLT.Open.file = ui->open_touchstone->getFilename(); ownKit.SOLT.open_m.file = ui->open_touchstone->getFilename();
ownKit.SOLT.Short.file = ui->short_touchstone->getFilename(); ownKit.SOLT.short_m.file = ui->short_touchstone->getFilename();
ownKit.SOLT.Load.file = ui->load_touchstone->getFilename(); ownKit.SOLT.load_m.file = ui->load_touchstone->getFilename();
ownKit.SOLT.Through.file = ui->through_touchstone->getFilename(); ownKit.SOLT.Through.file = ui->through_touchstone->getFilename();
ownKit.SOLT.Open.Sparam = ui->open_touchstone->getPorts()[0]; ownKit.SOLT.open_m.Sparam = ui->open_touchstone->getPorts()[0];
ownKit.SOLT.Short.Sparam = ui->short_touchstone->getPorts()[0]; ownKit.SOLT.short_m.Sparam = ui->short_touchstone->getPorts()[0];
ownKit.SOLT.Load.Sparam = ui->load_touchstone->getPorts()[0]; ownKit.SOLT.load_m.Sparam = ui->load_touchstone->getPorts()[0];
ownKit.SOLT.Through.Sparam1 = ui->through_touchstone->getPorts()[0]; ownKit.SOLT.Through.Sparam1 = ui->through_touchstone->getPorts()[0];
ownKit.SOLT.Through.Sparam2 = ui->through_touchstone->getPorts()[1]; ownKit.SOLT.Through.Sparam2 = ui->through_touchstone->getPorts()[1];
ownKit.SOLT.open_f.file = ui->open_touchstone_f->getFilename();
ownKit.SOLT.short_f.file = ui->short_touchstone_f->getFilename();
ownKit.SOLT.load_f.file = ui->load_touchstone_f->getFilename();
ownKit.SOLT.open_f.Sparam = ui->open_touchstone_f->getPorts()[0];
ownKit.SOLT.short_f.Sparam = ui->short_touchstone_f->getPorts()[0];
ownKit.SOLT.load_f.Sparam = ui->load_touchstone_f->getPorts()[0];
// TRL // TRL
ownKit.TRL.Through.Z0 = ui->TRL_through_Z0->value(); ownKit.TRL.Through.Z0 = ui->TRL_through_Z0->value();
ownKit.TRL.Reflection.isShort = ui->TRL_R_short->isChecked(); ownKit.TRL.Reflection.isShort = ui->TRL_R_short->isChecked();
@ -212,70 +308,124 @@ void CalkitDialog::updateEntries()
ui->description->setPlainText(ownKit.description); ui->description->setPlainText(ownKit.description);
// Coefficients // Coefficients
ui->open_Z0->setValueQuiet(ownKit.SOLT.Open.Z0); ui->open_Z0->setValueQuiet(ownKit.SOLT.open_m.Z0);
ui->open_delay->setValueQuiet(ownKit.SOLT.Open.delay); ui->open_delay->setValueQuiet(ownKit.SOLT.open_m.delay);
ui->open_loss->setValueQuiet(ownKit.SOLT.Open.loss); ui->open_loss->setValueQuiet(ownKit.SOLT.open_m.loss);
ui->open_C0->setValueQuiet(ownKit.SOLT.Open.C0); ui->open_C0->setValueQuiet(ownKit.SOLT.open_m.C0);
ui->open_C1->setValueQuiet(ownKit.SOLT.Open.C1); ui->open_C1->setValueQuiet(ownKit.SOLT.open_m.C1);
ui->open_C2->setValueQuiet(ownKit.SOLT.Open.C2); ui->open_C2->setValueQuiet(ownKit.SOLT.open_m.C2);
ui->open_C3->setValueQuiet(ownKit.SOLT.Open.C3); ui->open_C3->setValueQuiet(ownKit.SOLT.open_m.C3);
ui->short_Z0->setValueQuiet(ownKit.SOLT.Short.Z0); ui->short_Z0->setValueQuiet(ownKit.SOLT.short_m.Z0);
ui->short_delay->setValueQuiet(ownKit.SOLT.Short.delay); ui->short_delay->setValueQuiet(ownKit.SOLT.short_m.delay);
ui->short_loss->setValueQuiet(ownKit.SOLT.Short.loss); ui->short_loss->setValueQuiet(ownKit.SOLT.short_m.loss);
ui->short_L0->setValueQuiet(ownKit.SOLT.Short.L0); ui->short_L0->setValueQuiet(ownKit.SOLT.short_m.L0);
ui->short_L1->setValueQuiet(ownKit.SOLT.Short.L1); ui->short_L1->setValueQuiet(ownKit.SOLT.short_m.L1);
ui->short_L2->setValueQuiet(ownKit.SOLT.Short.L2); ui->short_L2->setValueQuiet(ownKit.SOLT.short_m.L2);
ui->short_L3->setValueQuiet(ownKit.SOLT.Short.L3); ui->short_L3->setValueQuiet(ownKit.SOLT.short_m.L3);
ui->load_Z0->setValueQuiet(ownKit.SOLT.Load.Z0); ui->load_Z0->setValueQuiet(ownKit.SOLT.load_m.Z0);
ui->load_delay->setValueQuiet(ownKit.SOLT.Load.delay); ui->load_delay->setValueQuiet(ownKit.SOLT.load_m.delay);
ui->load_parC->setValueQuiet(ownKit.SOLT.Load.Cparallel); ui->load_parC->setValueQuiet(ownKit.SOLT.load_m.Cparallel);
ui->load_serL->setValueQuiet(ownKit.SOLT.Load.Lseries); ui->load_serL->setValueQuiet(ownKit.SOLT.load_m.Lseries);
ui->open_Z0_f->setValueQuiet(ownKit.SOLT.open_f.Z0);
ui->open_delay_f->setValueQuiet(ownKit.SOLT.open_f.delay);
ui->open_loss_f->setValueQuiet(ownKit.SOLT.open_f.loss);
ui->open_C0_f->setValueQuiet(ownKit.SOLT.open_f.C0);
ui->open_C1_f->setValueQuiet(ownKit.SOLT.open_f.C1);
ui->open_C2_f->setValueQuiet(ownKit.SOLT.open_f.C2);
ui->open_C3_f->setValueQuiet(ownKit.SOLT.open_f.C3);
ui->short_Z0_f->setValueQuiet(ownKit.SOLT.short_f.Z0);
ui->short_delay_f->setValueQuiet(ownKit.SOLT.short_f.delay);
ui->short_loss_f->setValueQuiet(ownKit.SOLT.short_f.loss);
ui->short_L0_f->setValueQuiet(ownKit.SOLT.short_f.L0);
ui->short_L1_f->setValueQuiet(ownKit.SOLT.short_f.L1);
ui->short_L2_f->setValueQuiet(ownKit.SOLT.short_f.L2);
ui->short_L3_f->setValueQuiet(ownKit.SOLT.short_f.L3);
ui->load_Z0_f->setValueQuiet(ownKit.SOLT.load_f.Z0);
ui->load_delay_f->setValueQuiet(ownKit.SOLT.load_f.delay);
ui->load_parC_f->setValueQuiet(ownKit.SOLT.load_f.Cparallel);
ui->load_serL_f->setValueQuiet(ownKit.SOLT.load_f.Lseries);
ui->through_Z0->setValueQuiet(ownKit.SOLT.Through.Z0); ui->through_Z0->setValueQuiet(ownKit.SOLT.Through.Z0);
ui->through_delay->setValueQuiet(ownKit.SOLT.Through.delay); ui->through_delay->setValueQuiet(ownKit.SOLT.Through.delay);
ui->through_loss->setValueQuiet(ownKit.SOLT.Through.loss); ui->through_loss->setValueQuiet(ownKit.SOLT.Through.loss);
// Measurements // Measurements
ui->open_touchstone->setFile(ownKit.SOLT.Open.file); ui->open_touchstone->setFile(ownKit.SOLT.open_m.file);
ui->open_touchstone->selectPort(0, ownKit.SOLT.Open.Sparam); ui->open_touchstone->selectPort(0, ownKit.SOLT.open_m.Sparam);
ui->short_touchstone->setFile(ownKit.SOLT.Short.file); ui->short_touchstone->setFile(ownKit.SOLT.short_m.file);
ui->short_touchstone->selectPort(0, ownKit.SOLT.Short.Sparam); ui->short_touchstone->selectPort(0, ownKit.SOLT.short_m.Sparam);
ui->load_touchstone->setFile(ownKit.SOLT.Load.file); ui->load_touchstone->setFile(ownKit.SOLT.load_m.file);
ui->load_touchstone->selectPort(0, ownKit.SOLT.Load.Sparam); ui->load_touchstone->selectPort(0, ownKit.SOLT.load_m.Sparam);
ui->open_touchstone_f->setFile(ownKit.SOLT.open_f.file);
ui->open_touchstone_f->selectPort(0, ownKit.SOLT.open_f.Sparam);
ui->short_touchstone_f->setFile(ownKit.SOLT.short_f.file);
ui->short_touchstone_f->selectPort(0, ownKit.SOLT.short_f.Sparam);
ui->load_touchstone_f->setFile(ownKit.SOLT.load_f.file);
ui->load_touchstone_f->selectPort(0, ownKit.SOLT.load_f.Sparam);
ui->through_touchstone->setFile(ownKit.SOLT.Through.file); ui->through_touchstone->setFile(ownKit.SOLT.Through.file);
ui->through_touchstone->selectPort(0, ownKit.SOLT.Through.Sparam1); ui->through_touchstone->selectPort(0, ownKit.SOLT.Through.Sparam1);
ui->through_touchstone->selectPort(1, ownKit.SOLT.Through.Sparam2); ui->through_touchstone->selectPort(1, ownKit.SOLT.Through.Sparam2);
// Type // Type
if (ownKit.SOLT.Open.useMeasurements) { if (ownKit.SOLT.open_m.useMeasurements) {
ui->open_measurement->click(); ui->open_measurement->click();
} else { } else {
ui->open_coefficients->click(); ui->open_coefficients->click();
} }
if (ownKit.SOLT.Short.useMeasurements) { if (ownKit.SOLT.short_m.useMeasurements) {
ui->short_measurement->click(); ui->short_measurement->click();
} else { } else {
ui->short_coefficients->click(); ui->short_coefficients->click();
} }
if (ownKit.SOLT.Load.useMeasurements) { if (ownKit.SOLT.load_m.useMeasurements) {
ui->load_measurement->click(); ui->load_measurement->click();
} else { } else {
ui->load_coefficients->click(); ui->load_coefficients->click();
} }
if (ownKit.SOLT.open_f.useMeasurements) {
ui->open_measurement_f->click();
} else {
ui->open_coefficients_f->click();
}
if (ownKit.SOLT.short_f.useMeasurements) {
ui->short_measurement_f->click();
} else {
ui->short_coefficients_f->click();
}
if (ownKit.SOLT.load_f.useMeasurements) {
ui->load_measurement_f->click();
} else {
ui->load_coefficients_f->click();
}
if (ownKit.SOLT.Through.useMeasurements) { if (ownKit.SOLT.Through.useMeasurements) {
ui->through_measurement->click(); ui->through_measurement->click();
} else { } else {
ui->through_coefficients->click(); ui->through_coefficients->click();
} }
if (ownKit.SOLT.separate_male_female) {
ui->cbStandardDefinition->setCurrentIndex(1);
} else {
ui->cbStandardDefinition->setCurrentIndex(0);
}
// TRL // TRL
ui->TRL_through_Z0->setValueQuiet(ownKit.TRL.Through.Z0); ui->TRL_through_Z0->setValueQuiet(ownKit.TRL.Through.Z0);
if(ownKit.TRL.Reflection.isShort) { if(ownKit.TRL.Reflection.isShort) {

View File

@ -20,7 +20,7 @@ public:
explicit CalkitDialog(Calkit &c, QWidget *parent = nullptr); explicit CalkitDialog(Calkit &c, QWidget *parent = nullptr);
~CalkitDialog(); ~CalkitDialog();
private: private:
void parseEntries(); void parseEntries();
void updateEntries(); void updateEntries();
Ui::CalkitDialog *ui; Ui::CalkitDialog *ui;

File diff suppressed because it is too large Load Diff