Option to view raw calibration measurements + calkit typos fixed
This commit is contained in:
parent
6893af1386
commit
0837db05ad
@ -621,6 +621,55 @@ std::vector<Trace *> Calibration::getErrorTermTraces()
|
||||
return traces;
|
||||
}
|
||||
|
||||
std::vector<Trace *> Calibration::getMeasurementTraces()
|
||||
{
|
||||
std::vector<Trace*> traces;
|
||||
for(auto m : measurements) {
|
||||
auto info = getMeasurementInfo(m.first);
|
||||
if(info.points > 0) {
|
||||
vector<QString> usedPrefixes;
|
||||
switch(m.first) {
|
||||
case Measurement::Port1Load:
|
||||
case Measurement::Port1Open:
|
||||
case Measurement::Port1Short:
|
||||
usedPrefixes = {"S11"};
|
||||
break;
|
||||
case Measurement::Port2Load:
|
||||
case Measurement::Port2Open:
|
||||
case Measurement::Port2Short:
|
||||
usedPrefixes = {"S22"};
|
||||
break;
|
||||
case Measurement::Through:
|
||||
case Measurement::Line:
|
||||
case Measurement::Isolation:
|
||||
usedPrefixes = {"S11", "S12", "S21", "S22"};
|
||||
break;
|
||||
}
|
||||
for(auto prefix : usedPrefixes) {
|
||||
auto t = new Trace(prefix + " " + info.name);
|
||||
t->setCalibration(true);
|
||||
t->setReflection(prefix == "S11" || prefix == "S22");
|
||||
for(auto p : m.second.datapoints) {
|
||||
Trace::Data d;
|
||||
d.frequency = p.frequency;
|
||||
if(prefix == "S11") {
|
||||
d.S = complex<double>(p.real_S11, p.imag_S11);
|
||||
} else if(prefix == "S12") {
|
||||
d.S = complex<double>(p.real_S12, p.imag_S12);
|
||||
} else if(prefix == "S21") {
|
||||
d.S = complex<double>(p.real_S21, p.imag_S21);
|
||||
} else {
|
||||
d.S = complex<double>(p.real_S22, p.imag_S22);
|
||||
}
|
||||
t->addData(d);
|
||||
}
|
||||
traces.push_back(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
return traces;
|
||||
}
|
||||
|
||||
bool Calibration::openFromFile(QString filename)
|
||||
{
|
||||
if(filename.isEmpty()) {
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
}
|
||||
|
||||
std::vector<Trace*> getErrorTermTraces();
|
||||
std::vector<Trace*> getMeasurementTraces();
|
||||
|
||||
bool openFromFile(QString filename = QString());
|
||||
bool saveToFile(QString filename = QString());
|
||||
|
@ -32,7 +32,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@ -112,7 +112,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>L0 [10<span style=" vertical-align:super;">-12</span>F]:</p></body></html></string>
|
||||
<string><html><head/><body><p>L0 [10<span style=" vertical-align:super;">-12</span>H]:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -122,7 +122,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>L1 [10<span style=" vertical-align:super;">-24</span>F/Hz]:</p></body></html></string>
|
||||
<string><html><head/><body><p>L1 [10<span style=" vertical-align:super;">-24</span>H/Hz]:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -132,7 +132,7 @@
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>L2 [10<span style=" vertical-align:super;">-33</span>F/Hz<span style=" vertical-align:super;">2</span>]:</p></body></html></string>
|
||||
<string><html><head/><body><p>L2 [10<span style=" vertical-align:super;">-33</span>H/Hz<span style=" vertical-align:super;">2</span>]:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -142,7 +142,7 @@
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>L3 [10<span style=" vertical-align:super;">-42</span>F/Hz<span style=" vertical-align:super;">3</span>]:</p></body></html></string>
|
||||
<string><html><head/><body><p>L3 [10<span style=" vertical-align:super;">-42</span>H/Hz<span style=" vertical-align:super;">3</span>]:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -288,7 +288,7 @@
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>C0 [10<sup>-45</sup>F/Hz<sup>3</sup>]:</string>
|
||||
<string><html><head/><body><p>C3 [10<span style=" vertical-align:super;">-45</span>F/Hz<span style=" vertical-align:super;">3</span>]:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -845,17 +845,17 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SIUnitEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>CustomWidgets/siunitedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>TouchstoneImport</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>CustomWidgets/touchstoneimport.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SIUnitEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>CustomWidgets/siunitedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>open_Z0</tabstop>
|
||||
@ -933,10 +933,10 @@
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="ThroughType"/>
|
||||
<buttongroup name="TRL_Rtype"/>
|
||||
<buttongroup name="LoadType"/>
|
||||
<buttongroup name="ThroughType"/>
|
||||
<buttongroup name="ShortType"/>
|
||||
<buttongroup name="OpenType"/>
|
||||
<buttongroup name="LoadType"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -97,7 +97,7 @@ QVariant TraceModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
} else if (index.column() == 1) {
|
||||
if (role == Qt::DecorationRole && !traces[index.row()]->isTouchstone()) {
|
||||
if (role == Qt::DecorationRole && traces[index.row()]->isLive()) {
|
||||
if (traces[index.row()]->isPaused()) {
|
||||
return QIcon(":/icons/pause.svg");
|
||||
} else {
|
||||
|
@ -119,13 +119,6 @@ VNA::VNA(AppWindow *window)
|
||||
StartCalibrationDialog();
|
||||
});
|
||||
|
||||
auto calImport = calMenu->addAction("Import error terms as traces");
|
||||
calImport->setEnabled(false);
|
||||
connect(calImport, &QAction::triggered, [=](){
|
||||
auto import = new TraceImportDialog(traceModel, cal.getErrorTermTraces());
|
||||
import->show();
|
||||
});
|
||||
|
||||
auto calEditKit = calMenu->addAction("Edit Calibration Kit");
|
||||
connect(calEditKit, &QAction::triggered, [=](){
|
||||
cal.getCalibrationKit().edit([=](){
|
||||
@ -134,6 +127,22 @@ VNA::VNA(AppWindow *window)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
calMenu->addSeparator();
|
||||
|
||||
auto calImportTerms = calMenu->addAction("Import error terms as traces");
|
||||
calImportTerms->setEnabled(false);
|
||||
connect(calImportTerms, &QAction::triggered, [=](){
|
||||
auto import = new TraceImportDialog(traceModel, cal.getErrorTermTraces());
|
||||
import->show();
|
||||
});
|
||||
auto calImportMeas = calMenu->addAction("Import measurements as traces");
|
||||
calImportMeas->setEnabled(false);
|
||||
connect(calImportMeas, &QAction::triggered, [=](){
|
||||
auto import = new TraceImportDialog(traceModel, cal.getMeasurementTraces());
|
||||
import->show();
|
||||
});
|
||||
|
||||
portExtension.setCalkit(&cal.getCalibrationKit());
|
||||
|
||||
// Tools menu
|
||||
@ -319,7 +328,8 @@ VNA::VNA(AppWindow *window)
|
||||
cbEnableCal->setCheckState(Qt::CheckState::Unchecked);
|
||||
cbType->blockSignals(false);
|
||||
cbEnableCal->blockSignals(false);
|
||||
calImport->setEnabled(false);
|
||||
calImportTerms->setEnabled(false);
|
||||
calImportMeas->setEnabled(false);
|
||||
saveCal->setEnabled(false);
|
||||
});
|
||||
connect(calDisable, &QAction::triggered, this, &VNA::DisableCalibration);
|
||||
@ -335,7 +345,8 @@ VNA::VNA(AppWindow *window)
|
||||
cbEnableCal->setCheckState(Qt::CheckState::Checked);
|
||||
cbType->blockSignals(false);
|
||||
cbEnableCal->blockSignals(false);
|
||||
calImport->setEnabled(true);
|
||||
calImportTerms->setEnabled(true);
|
||||
calImportMeas->setEnabled(true);
|
||||
saveCal->setEnabled(true);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user