Skip to content

Commit

Permalink
Misc GUI fixes
Browse files Browse the repository at this point in the history
* Added ccoupled_shunt_resonators.h to Makefile.am as suggested by
ra3xdh

* ccoupled_shunt_resonators.cpp, qw_coupled_ring_filter.cpp: Double
format lengths converted to string using num2str()

* lc_filter.cpp: The last component of a LCL filter (even order only)
was not connected

* qf_filter.cpp: It was the 'dBS11' and 'dBS21' variables were renamed
so as to be in line with the other filter implementations

*qucsfilter.cpp: As suggested by ra3xdh, the behaviour of the labels in
the quarter wave side coupled resonator bandpass filter was fixed.
Moreover, it was added an icon for the RFEDD based filters (which was
missing before).

On the other hand, the logic of the microstrip panel was fixed in order
to avoid the undefined behaviour described by ra3xdh at the Github
thread.

Last but not least, QucsFilter::calculateFilter() was modified so as to
avoid redundant error messages when even order Chebyshev filters are
selected. In addition to this, the error message was changed, so far it
said "Even order Chebyshev can't be realized with passive filters."
Actually, it is possible to implement passive filters of even order
having RS != RL
  • Loading branch information
andresmmera committed Jul 1, 2017
1 parent 56952ce commit 341bec7
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 46 deletions.
1 change: 1 addition & 0 deletions qucs/qucs-filter/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ noinst_HEADERS = \
qf_cauer.h \
quarterwave_filter.h \
qw_coupled_ring_filter.h \
ccoupled_shunt_resonators.h \
qf_matrix.h \
line_filter.h \
filter.h \
Expand Down
185 changes: 185 additions & 0 deletions qucs/qucs-filter/bitmaps/RFEDD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions qucs/qucs-filter/ccoupled_shunt_resonators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int x = 90;//Index for drawing the schematic
QString *wirestr= new QString("<0 -30 60 -30 "" 0 0 0 "">\n");
QString *s = new QString("<Qucs Schematic " PACKAGE_VERSION ">\n");
*s += "<Components>\n";
*s += QString("<Pac P1 1 0 0 0 -26 0 1 \"1\" 1 \"%1 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(Filter->Impedance);
*s += QString("<Pac P1 1 0 0 -92 -31 0 1 \"1\" 1 \"%1 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(Filter->Impedance);
*s += QString("<GND * 1 0 30 0 0 0 0>\n");

for(int i = 0; i < N; i++)//Component calculation
Expand All @@ -70,7 +70,7 @@ QString *s = new QString("<Qucs Schematic " PACKAGE_VERSION ">\n");
{
J[i]= sqrt(pi*delta/(4*g[i]))/Z0;
C[i] = J[i]/(w0*sqrt(1-Z0*Z0*J[i]*J[i]));
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n").arg(x).arg(C[i]);
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n").arg(x).arg(num2str(C[i]));
x+=60;
continue;
}
Expand All @@ -81,10 +81,10 @@ QString *s = new QString("<Qucs Schematic " PACKAGE_VERSION ">\n");
l[i-1] = (Z0*w0*deltaC[i-1]/(2*pi))*lambda0;
if (l[i-1] < 0) l[i-1] += lambda0/4;
*wirestr += QString("<%1 -30 %2 -30 "" 0 0 0 "">\n").arg(x-30).arg(x+30);
*s += QString("<TLIN Line1 1 %1 0 -26 20 0 1 \"%2\" 1 \"%3\" 1 \"0 dB\" 0 \"26.85\" 0>\n").arg(x).arg(Filter->Impedance).arg(l[i-1]);
*s += QString("<TLIN Line1 1 %1 0 -41 46 0 1 \"%2\" 1 \"%3\" 1 \"0 dB\" 0 \"26.85\" 0>\n").arg(x).arg(Filter->Impedance).arg(num2str(l[i-1]));
*s += QString("<GND * 1 %1 30 0 0 0 0>\n").arg(x);
x += 60;
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n").arg(x).arg(C[i]);
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n").arg(x).arg(num2str(C[i]));
x += 60;
}

Expand All @@ -97,10 +97,10 @@ if (l[N-1] < 0) l[N-1] +=lambda0/4;

//Wiring
*wirestr += QString("<%1 -30 %2 -30 "" 0 0 0 "">\n").arg(x-30).arg(x+30);
*s += QString("<TLIN Line1 1 %1 0 -26 20 0 1 \"%2\" 1 \"%3\" 1 \"0 dB\" 0 \"26.85\" 0>\n").arg(x).arg(Filter->Impedance).arg(l[N-1]);
*s += QString("<TLIN Line1 1 %1 0 -41 46 0 1 \"%2\" 1 \"%3\" 1 \"0 dB\" 0 \"26.85\" 0>\n").arg(x).arg(Filter->Impedance).arg(num2str(l[N-1]));
*s += QString("<GND * 1 %1 30 0 0 0 0>\n").arg(x);
x += 60;
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n ").arg(x).arg(C[N]);
*s += QString("<C C1 1 %1 -30 -26 17 0 0 \"%2\" 1 \"\" 0 \"neutral\" 0>\n ").arg(x).arg(num2str(C[N]));
x += 60;
*wirestr += QString("<%1 -30 %2 -30 "" 0 0 0 "">\n").arg(x-30).arg(x+30);
*s += QString("<Pac P2 1 %1 0 18 -26 0 1 \"2\" 1 \"%2 Ohm\" 1 \"0 dBm\" 0 \"1 GHz\" 0>\n").arg(x+30).arg(Filter->Impedance);
Expand Down
3 changes: 3 additions & 0 deletions qucs/qucs-filter/lc_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ QString* LC_Filter::createSchematic(tFilter *Filter, bool piType)
}
else {
if(Filter->Order & 1)
{
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x+30).arg(x+70);
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x+170).arg(x+210);
}
else
*s += QString("<%1 240 %2 240 \"\" 0 0 0>\n").arg(x+110).arg(x+210);
}
Expand Down
4 changes: 2 additions & 2 deletions qucs/qucs-filter/qf_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ std::string qf_filter::to_qucs (void) {
<< num2str(Value).c_str() << "Hz\" 1 \"" << num2str(Value2).c_str()
<< "Hz\" 1 \"200\" 1 \"no\" 0 \"1\" 0 \"2\" 0>\n"
<< "<Eqn Eqn1 1 260 " << yc+10
<< " -28 15 0 0 \"dBS21=dB(S[2,1])\" 1 "
<< "\"dBS11=dB(S[1,1])\" 1 \"yes\" 0>\n"
<< " -28 15 0 0 \"S21_dB=dB(S[2,1])\" 1 "
<< "\"S11_dB=dB(S[1,1])\" 1 \"yes\" 0>\n"
<< "</Components>\n";

res << "<Wires>\n";
Expand Down
Loading

0 comments on commit 341bec7

Please sign in to comment.