Skip to content

Commit

Permalink
Switch to SCH only if matching dialog opened from DPL
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Oct 18, 2023
1 parent 4f46054 commit f9fddd2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions qucs/qucs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,6 +3027,8 @@ void QucsApp::slotSymbolEdit()
// -----------------------------------------------------------
void QucsApp::slotPowerMatching()
{
QWidget *w = DocumentTab->currentWidget(); // remember from which Tab the tuner was started
if (isTextDocument(w)) return;
if(!view->focusElement) return;
if(view->focusElement->Type != isMarker) return;
Marker *pm = (Marker*)view->focusElement;
Expand All @@ -3043,14 +3045,19 @@ void QucsApp::slotPowerMatching()
Dia->setFrequency(pm->powFreq());
Dia->setTwoPortMatch(false); // will also cause the corresponding impedance LineEdit to be updated

slotToPage();
Schematic *sch = dynamic_cast<Schematic*>(w);
if (sch->SimOpenDpl || sch->DocName.endsWith(".dpl")) {
slotToPage();
}
if(Dia->exec() != QDialog::Accepted)
return;
}

// -----------------------------------------------------------
void QucsApp::slot2PortMatching()
{
QWidget *w = DocumentTab->currentWidget(); // remember from which Tab the tuner was started
if (isTextDocument(w)) return;
if(!view->focusElement) return;
if(view->focusElement->Type != isMarker) return;
Marker *pm = (Marker*)view->focusElement;
Expand Down Expand Up @@ -3126,7 +3133,10 @@ void QucsApp::slot2PortMatching()
Dia->setS21LineEdits(S21real, S21imag);
Dia->setS22LineEdits(S22real, S22imag);

slotToPage();
Schematic *sch = dynamic_cast<Schematic*>(w);
if (sch->SimOpenDpl || sch->DocName.endsWith(".dpl")) {
slotToPage();
}
if(Dia->exec() != QDialog::Accepted)
return;
}
Expand Down

0 comments on commit f9fddd2

Please sign in to comment.