From ce50ddc702f82577a92104d5a3c270757837f4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sun, 5 Mar 2023 23:26:49 +0100 Subject: [PATCH] make reference impedance editable for math traces --- .../PC_Application/LibreVNA-GUI/Traces/traceeditdialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/traceeditdialog.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/traceeditdialog.cpp index a5cc70c..5d9d90f 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/traceeditdialog.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/traceeditdialog.cpp @@ -36,6 +36,7 @@ TraceEditDialog::TraceEditDialog(Trace &t, QWidget *parent) : if(live) { ui->stack->setCurrentIndex(0); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); + ui->impedance->setEnabled(false); } }); connect(ui->bFile, &QPushButton::clicked, [&](bool file) { @@ -48,6 +49,7 @@ TraceEditDialog::TraceEditDialog(Trace &t, QWidget *parent) : // attempt to parse as touchstone ui->stack->setCurrentIndex(1); ui->touchstoneImport->setFile(t.getFilename()); + ui->impedance->setEnabled(false); } } }); @@ -55,6 +57,7 @@ TraceEditDialog::TraceEditDialog(Trace &t, QWidget *parent) : if(math) { ui->stack->setCurrentIndex(3); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(t.mathFormularValid()); + ui->impedance->setEnabled(true); } }); @@ -336,6 +339,7 @@ void TraceEditDialog::okClicked() { trace.setName(ui->name->text()); trace.setVelocityFactor(ui->vFactor->value()); + trace.setReferenceImpedance(ui->impedance->value()); if(trace.getSource() != Trace::Source::Calibration) { // only apply changes if it is not a calibration trace if (ui->bFile->isChecked()) {