Skip to content

Commit 5239464

Browse files
committed
Force correct file ending when exporting touchstone files
1 parent ab9605c commit 5239464

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Software/PC_Application/LibreVNA-GUI/Traces/tracetouchstoneexport.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ bool TraceTouchstoneExport::setPortNum(int ports)
4242

4343
void TraceTouchstoneExport::on_buttonBox_accepted()
4444
{
45-
auto filename = QFileDialog::getSaveFileName(this, "Select file for exporting traces", "", "Touchstone files (*.s1p *.s2p *.s3p *.s4p)", nullptr, Preferences::QFileDialogOptions());
45+
auto ports = ui->sbPorts->value();
46+
QString extension = ".s"+QString::number(ports)+"p";
47+
auto filename = QFileDialog::getSaveFileName(this, "Select file for exporting traces", "", "Touchstone files (*"+extension+")", nullptr, Preferences::QFileDialogOptions());
4648
if(filename.length() > 0) {
47-
auto ports = ui->sbPorts->value();
4849
auto t = Touchstone(ports);
4950
t.setReferenceImpedance(ui->selector->getReferenceImpedance());
5051
// add trace points to touchstone

0 commit comments

Comments
 (0)