Merge branch 'master' of github.com:jankae/VNA2

This commit is contained in:
Jan Käberich 2020-10-27 22:08:05 +01:00
commit fcab7f499d
8 changed files with 26 additions and 26 deletions

View File

@ -176,8 +176,8 @@ Calkit::SOLT Calkit::toSOLT(double frequency)
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));
} }
// transform the delay into a phase shift for the given frequency // transform the delay into a phase shift for the given frequency
double open_phaseshift = -2 * M_PI * frequency * open_delay * 1e-12; double open_phaseshift = -2 * M_PI * frequency * 2 * open_delay * 1e-12;
double open_att_db = open_loss * 1e9 * 4.3429 * open_delay * 1e-12 / open_Z0 * sqrt(frequency / 1e9); double open_att_db = open_loss * 1e9 * 4.3429 * 2 * open_delay * 1e-12 / open_Z0 * sqrt(frequency / 1e9);
double open_att = pow(10.0, -open_att_db / 10.0); double open_att = pow(10.0, -open_att_db / 10.0);
auto open_correction = polar<double>(open_att, open_phaseshift); auto open_correction = polar<double>(open_att, open_phaseshift);
ref.Open *= open_correction; ref.Open *= open_correction;
@ -192,8 +192,8 @@ Calkit::SOLT Calkit::toSOLT(double frequency)
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));
// transform the delay into a phase shift for the given frequency // transform the delay into a phase shift for the given frequency
double short_phaseshift = -2 * M_PI * frequency * short_delay * 1e-12; double short_phaseshift = -2 * M_PI * frequency * 2 * short_delay * 1e-12;
double short_att_db = short_loss * 1e9 * 4.3429 * short_delay * 1e-12 / short_Z0 * sqrt(frequency / 1e9);; double short_att_db = short_loss * 1e9 * 4.3429 * 2 * short_delay * 1e-12 / short_Z0 * sqrt(frequency / 1e9);;
double short_att = pow(10.0, -short_att_db / 10.0); double short_att = pow(10.0, -short_att_db / 10.0);
auto short_correction = polar<double>(short_att, short_phaseshift); auto short_correction = polar<double>(short_att, short_phaseshift);
ref.Short *= short_correction; ref.Short *= short_correction;

View File

@ -128,7 +128,7 @@ void TileWidget::on_bSmithchart_clicked()
setContent(new TraceSmithChart(model)); setContent(new TraceSmithChart(model));
} }
void TileWidget::on_bBodeplot_clicked() void TileWidget::on_bXYplot_clicked()
{ {
setContent(new TraceXYPlot(model)); setContent(new TraceXYPlot(model));
} }

View File

@ -28,7 +28,7 @@ public slots:
private slots: private slots:
void on_bSmithchart_clicked(); void on_bSmithchart_clicked();
void on_bBodeplot_clicked(); void on_bXYplot_clicked();
void traceDeleted(TracePlot *t); void traceDeleted(TracePlot *t);
private: private:

View File

@ -79,7 +79,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="bBodeplot"> <widget class="QPushButton" name="bXYplot">
<property name="text"> <property name="text">
<string>XY-plot</string> <string>XY-plot</string>
</property> </property>

View File

@ -55,13 +55,13 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window)
tPort2->fromLivedata(Trace::LivedataType::Overwrite, Trace::LiveParameter::Port2); tPort2->fromLivedata(Trace::LivedataType::Overwrite, Trace::LiveParameter::Port2);
traceModel.addTrace(tPort2); traceModel.addTrace(tPort2);
auto tracebode = new TraceXYPlot(traceModel); auto traceXY = new TraceXYPlot(traceModel);
tracebode->enableTrace(tPort1, true); traceXY->enableTrace(tPort1, true);
tracebode->enableTrace(tPort2, true); traceXY->enableTrace(tPort2, true);
tracebode->setYAxis(0, TraceXYPlot::YAxisType::Magnitude, false, false, -120,0,10); traceXY->setYAxis(0, TraceXYPlot::YAxisType::Magnitude, false, false, -120,0,10);
tracebode->setYAxis(1, TraceXYPlot::YAxisType::Disabled, false, true, 0,0,1); traceXY->setYAxis(1, TraceXYPlot::YAxisType::Disabled, false, true, 0,0,1);
central->setPlot(tracebode); central->setPlot(traceXY);
// Create menu entries and connections // Create menu entries and connections
// Sweep toolbar // Sweep toolbar

View File

@ -1,5 +1,5 @@
#include "xyplotaxisdialog.h" #include "xyplotaxisdialog.h"
#include "ui_bodeplotaxisdialog.h" #include "ui_xyplotaxisdialog.h"
#include <QStandardItemModel> #include <QStandardItemModel>
using namespace std; using namespace std;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BodeplotAxisDialog</class> <class>XYplotAxisDialog</class>
<widget class="QDialog" name="BodeplotAxisDialog"> <widget class="QDialog" name="XYplotAxisDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -32,7 +32,7 @@
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
<widget class="QWidget" name=""> <widget class="QWidget" name="layoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -510,7 +510,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>BodeplotAxisDialog</receiver> <receiver>XYplotAxisDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -526,7 +526,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>BodeplotAxisDialog</receiver> <receiver>XYplotAxisDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -541,7 +541,7 @@
</connection> </connection>
</connections> </connections>
<buttongroups> <buttongroups>
<buttongroup name="Y1group"/>
<buttongroup name="Y2group"/> <buttongroup name="Y2group"/>
<buttongroup name="Y1group"/>
</buttongroups> </buttongroups>
</ui> </ui>

View File

@ -70,10 +70,10 @@ VNA::VNA(AppWindow *window)
auto tracesmith2 = new TraceSmithChart(traceModel); auto tracesmith2 = new TraceSmithChart(traceModel);
tracesmith2->enableTrace(tS22, true); tracesmith2->enableTrace(tS22, true);
auto tracebode1 = new TraceXYPlot(traceModel); auto traceXY1 = new TraceXYPlot(traceModel);
tracebode1->enableTrace(tS12, true); traceXY1->enableTrace(tS12, true);
auto tracebode2 = new TraceXYPlot(traceModel); auto traceXY2 = new TraceXYPlot(traceModel);
tracebode2->enableTrace(tS21, true); traceXY2->enableTrace(tS21, true);
connect(&traceModel, &TraceModel::requiredExcitation, this, &VNA::ExcitationRequired); connect(&traceModel, &TraceModel::requiredExcitation, this, &VNA::ExcitationRequired);
@ -81,8 +81,8 @@ VNA::VNA(AppWindow *window)
central->Child1()->splitHorizontally(); central->Child1()->splitHorizontally();
central->Child2()->splitHorizontally(); central->Child2()->splitHorizontally();
central->Child1()->Child1()->setPlot(tracesmith1); central->Child1()->Child1()->setPlot(tracesmith1);
central->Child1()->Child2()->setPlot(tracebode1); central->Child1()->Child2()->setPlot(traceXY1);
central->Child2()->Child1()->setPlot(tracebode2); central->Child2()->Child1()->setPlot(traceXY2);
central->Child2()->Child2()->setPlot(tracesmith2); central->Child2()->Child2()->setPlot(tracesmith2);
// Create menu entries and connections // Create menu entries and connections