diff --git a/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.cpp b/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.cpp index da8ace55..cab81dbe 100644 --- a/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.cpp +++ b/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.cpp @@ -88,6 +88,22 @@ void TraceSetSelector::setPorts(unsigned int newPorts) emit selectionChanged(); } +void TraceSetSelector::setDefaultTraces() +{ + auto traces = model->getTraces(); + for(unsigned int i=1;i<=ports;i++) { + for(unsigned int j=1;j<=ports;j++) { + QString defaultTraceName = "S"+QString::number(i)+QString::number(j); + for(auto t : traces) { + if(t->name() == defaultTraceName) { + setTrace(i, j, t); + break; + } + } + } + } +} + bool TraceSetSelector::setTrace(unsigned int destPort, unsigned int srcPort, Trace *t) { if(destPort < 1 || destPort > ports || srcPort < 1 || srcPort > ports) { diff --git a/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.h b/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.h index 6b4857d6..33a4b3a6 100644 --- a/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.h +++ b/Software/PC_Application/LibreVNA-GUI/CustomWidgets/tracesetselector.h @@ -20,6 +20,7 @@ class TraceSetSelector : public QWidget unsigned int getPorts() const; void setPorts(unsigned int newPorts); + void setDefaultTraces(); bool setTrace(unsigned int destPort, unsigned int srcPort, Trace *t); Trace *getTrace(unsigned int destPort, unsigned int srcPort); diff --git a/Software/PC_Application/LibreVNA-GUI/Tools/mixedmodeconversion.cpp b/Software/PC_Application/LibreVNA-GUI/Tools/mixedmodeconversion.cpp index a07f26eb..1c1d211b 100644 --- a/Software/PC_Application/LibreVNA-GUI/Tools/mixedmodeconversion.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Tools/mixedmodeconversion.cpp @@ -19,6 +19,7 @@ MixedModeConversion::MixedModeConversion(TraceModel &m, QWidget *parent) : }); connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &QDialog::reject); selectionChanged(); + ui->selector->setDefaultTraces(); } MixedModeConversion::~MixedModeConversion()