Bugfixes TDR
This commit is contained in:
parent
8d382e8b9c
commit
5ddc3d6794
@ -136,6 +136,7 @@ FORMS += \
|
|||||||
Traces/Math/medianfilterdialog.ui \
|
Traces/Math/medianfilterdialog.ui \
|
||||||
Traces/Math/newtracemathdialog.ui \
|
Traces/Math/newtracemathdialog.ui \
|
||||||
Traces/Math/tdrdialog.ui \
|
Traces/Math/tdrdialog.ui \
|
||||||
|
Traces/Math/tdrexplanationwidget.ui \
|
||||||
Traces/Math/tracematheditdialog.ui \
|
Traces/Math/tracematheditdialog.ui \
|
||||||
Traces/markerwidget.ui \
|
Traces/markerwidget.ui \
|
||||||
Traces/smithchartdialog.ui \
|
Traces/smithchartdialog.ui \
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "ui_tdrdialog.h"
|
#include "ui_tdrdialog.h"
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include "ui_tdrexplanationwidget.h"
|
||||||
using namespace Math;
|
using namespace Math;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -85,6 +86,9 @@ void TDR::edit()
|
|||||||
ui->DCmanual->setChecked(true);
|
ui->DCmanual->setChecked(true);
|
||||||
}
|
}
|
||||||
ui->computeStepResponse->setChecked(stepResponse);
|
ui->computeStepResponse->setChecked(stepResponse);
|
||||||
|
if(mode == Mode::Bandpass) {
|
||||||
|
ui->mode->setCurrentIndex(1);
|
||||||
|
}
|
||||||
|
|
||||||
ui->manualMag->setUnit("dBm");
|
ui->manualMag->setUnit("dBm");
|
||||||
ui->manualMag->setPrecision(3);
|
ui->manualMag->setPrecision(3);
|
||||||
@ -108,7 +112,10 @@ void TDR::edit()
|
|||||||
|
|
||||||
QWidget *TDR::createExplanationWidget()
|
QWidget *TDR::createExplanationWidget()
|
||||||
{
|
{
|
||||||
return new QLabel("Test");
|
auto w = new QWidget();
|
||||||
|
auto ui = new Ui::TDRExplanationWidget;
|
||||||
|
ui->setupUi(w);
|
||||||
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
nlohmann::json TDR::toJSON()
|
nlohmann::json TDR::toJSON()
|
||||||
@ -151,10 +158,10 @@ void TDR::fromJSON(nlohmann::json j)
|
|||||||
|
|
||||||
void TDR::inputSamplesChanged(unsigned int begin, unsigned int end)
|
void TDR::inputSamplesChanged(unsigned int begin, unsigned int end)
|
||||||
{
|
{
|
||||||
Q_UNUSED(begin);
|
Q_UNUSED(end);
|
||||||
if(input->rData().size() >= 2) {
|
if(input->rData().size() >= 2) {
|
||||||
// TDR is computationally expensive, only update at the end of sweep
|
// TDR is computationally expensive, only update at the end of sweep -> check if this is the first changed data in the next sweep
|
||||||
if(end != input->rData().size()) {
|
if(begin != 0) {
|
||||||
// not the end, do nothing
|
// not the end, do nothing
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
44
Software/PC_Application/Traces/Math/tdrexplanationwidget.ui
Normal file
44
Software/PC_Application/Traces/Math/tdrexplanationwidget.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TDRExplanationWidget</class>
|
||||||
|
<widget class="QWidget" name="TDRExplanationWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>364</width>
|
||||||
|
<height>412</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="widget">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-weight:600;">TDR (IDFT)</span></p><p>This operation performs an inverse DFT on the frequency data, resulting in time domain data.</p><p>Two modes are available:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Bandpass: The center frequency is used as the DC bin for the IDFT. In this mode, any span can be used as the input, but in the time domain no step response is available.</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Lowpass: The start frequency is used as the DC bin. If a step response should also be calculated, the start frequency should be as low as possible.</li></ul><p><br/></p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -130,6 +130,7 @@ void Trace::fillFromTouchstone(Touchstone &t, unsigned int parameter, QString fi
|
|||||||
}
|
}
|
||||||
touchstone = true;
|
touchstone = true;
|
||||||
emit typeChanged(this);
|
emit typeChanged(this);
|
||||||
|
emit outputSamplesChanged(0, data.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Trace::fromLivedata(Trace::LivedataType type, LiveParameter param)
|
void Trace::fromLivedata(Trace::LivedataType type, LiveParameter param)
|
||||||
@ -283,6 +284,9 @@ void Trace::fromJSON(nlohmann::json j)
|
|||||||
}
|
}
|
||||||
qDebug() << "Creating math operation of type:" << operation;
|
qDebug() << "Creating math operation of type:" << operation;
|
||||||
auto op = TraceMath::createMath(type);
|
auto op = TraceMath::createMath(type);
|
||||||
|
if(jm.contains("settings")) {
|
||||||
|
op->fromJSON(jm["settings"]);
|
||||||
|
}
|
||||||
MathInfo info;
|
MathInfo info;
|
||||||
info.enabled = jm.value("enabled", true);
|
info.enabled = jm.value("enabled", true);
|
||||||
info.math = op;
|
info.math = op;
|
||||||
@ -492,7 +496,7 @@ double Trace::minX()
|
|||||||
if(lastMath->numSamples() > 0) {
|
if(lastMath->numSamples() > 0) {
|
||||||
return lastMath->rData().front().x;
|
return lastMath->rData().front().x;
|
||||||
} else {
|
} else {
|
||||||
return numeric_limits<double>::quiet_NaN();
|
return numeric_limits<double>::max();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,7 +505,7 @@ double Trace::maxX()
|
|||||||
if(lastMath->numSamples() > 0) {
|
if(lastMath->numSamples() > 0) {
|
||||||
return lastMath->rData().back().x;
|
return lastMath->rData().back().x;
|
||||||
} else {
|
} else {
|
||||||
return numeric_limits<double>::quiet_NaN();
|
return numeric_limits<double>::lowest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,12 @@ Trace *TraceMarker::trace()
|
|||||||
|
|
||||||
QString TraceMarker::readableData()
|
QString TraceMarker::readableData()
|
||||||
{
|
{
|
||||||
|
if(!parentTrace) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if(position < parentTrace->minX() || position > parentTrace->maxX()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if(isTimeDomain()) {
|
if(isTimeDomain()) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Type::Manual: {
|
case Type::Manual: {
|
||||||
|
Loading…
Reference in New Issue
Block a user