From 523946447a96a1a53e1c9c7d8a81f56bed9be982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Wed, 22 Jan 2025 19:07:28 +0100 Subject: [PATCH] Force correct file ending when exporting touchstone files --- .../LibreVNA-GUI/Traces/tracetouchstoneexport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/tracetouchstoneexport.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/tracetouchstoneexport.cpp index ccea02b..3e604bb 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/tracetouchstoneexport.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/tracetouchstoneexport.cpp @@ -42,9 +42,10 @@ bool TraceTouchstoneExport::setPortNum(int ports) void TraceTouchstoneExport::on_buttonBox_accepted() { - auto filename = QFileDialog::getSaveFileName(this, "Select file for exporting traces", "", "Touchstone files (*.s1p *.s2p *.s3p *.s4p)", nullptr, Preferences::QFileDialogOptions()); + auto ports = ui->sbPorts->value(); + QString extension = ".s"+QString::number(ports)+"p"; + auto filename = QFileDialog::getSaveFileName(this, "Select file for exporting traces", "", "Touchstone files (*"+extension+")", nullptr, Preferences::QFileDialogOptions()); if(filename.length() > 0) { - auto ports = ui->sbPorts->value(); auto t = Touchstone(ports); t.setReferenceImpedance(ui->selector->getReferenceImpedance()); // add trace points to touchstone