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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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