From 1819f91f4aeab32e23b5ac4fa908a26742abf90c Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 21 Feb 2022 23:12:02 +0100 Subject: [PATCH 01/45] Detect dark theme and load special icons --- qucs/bitmaps/dark/ac_current.png | Bin 0 -> 262 bytes qucs/bitmaps/dark/ac_voltage.png | Bin 0 -> 301 bytes qucs/bitmaps/dark/am_mod.png | Bin 0 -> 471 bytes qucs/bitmaps/dark/amplifier.png | Bin 0 -> 256 bytes qucs/bitmaps/dark/and.png | Bin 0 -> 258 bytes qucs/bitmaps/dark/andor4x3.png | Bin 0 -> 480 bytes qucs/bitmaps/dark/andor4x4.png | Bin 0 -> 492 bytes qucs/main.h | 2 ++ qucs/misc.cpp | 12 ++++++++++++ qucs/misc.h | 1 + qucs/qucs.cpp | 22 ++++++++++++++++++++-- qucs/qucs.qrc | 16 +++++++++++----- 12 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 qucs/bitmaps/dark/ac_current.png create mode 100644 qucs/bitmaps/dark/ac_voltage.png create mode 100644 qucs/bitmaps/dark/am_mod.png create mode 100644 qucs/bitmaps/dark/amplifier.png create mode 100644 qucs/bitmaps/dark/and.png create mode 100644 qucs/bitmaps/dark/andor4x3.png create mode 100644 qucs/bitmaps/dark/andor4x4.png diff --git a/qucs/bitmaps/dark/ac_current.png b/qucs/bitmaps/dark/ac_current.png new file mode 100644 index 0000000000000000000000000000000000000000..ecfd629f7d82418bcaf95e9e174275aea7c5b5be GIT binary patch literal 262 zcmV+h0r~!kP)w&qfmYl?!)1Vl>ws3|5P`3ZEZO#&-Vg!p zuh-Tg13hu;x36|@A|M4~;r9GTNc_`)Rs~B45Pm7pH87okgnL;Ta=B@lY3ooUVhYlz zUDAqc5^Xk1hEZ?adIPhTsS`@Q+;is8IKBjqBe3;ia<68{t-9X(0M<>^A(S8OAOHXW M07*qoM6N<$g8wOL+W-In literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ac_voltage.png b/qucs/bitmaps/dark/ac_voltage.png new file mode 100644 index 0000000000000000000000000000000000000000..61453bf07989ca6f3732d84a19a334100b7eea54 GIT binary patch literal 301 zcmV+|0n+}7P)2`%mE%$X z$>QYzlmrz;<4j}NgEet&U2+R*!V!S(Z+jJUka0(s97fUvcoVyN00DTv+W)Bj99b=~ z8Zdj4d76&vJpdsGET7+JrE~*4zh>GwkFI|KE~d&M^OqS}00000NkvXXu0mjfrX+YH literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/am_mod.png b/qucs/bitmaps/dark/am_mod.png new file mode 100644 index 0000000000000000000000000000000000000000..0e0796bd1afe85dea1fba5cd8cbd23a5243c5d39 GIT binary patch literal 471 zcmV;|0Vw{7P)IxIFXn@^m3-iZnoR8fb5Ce`;%MD{=DV$U3FKm(WwIRIucHp_6y;dH>PS+h=PXlNMQ z+1cp>HDCVo=g&f5Xe8lt1fd|uCXdqr+qZB3#m2_Q$jQmc^#1+(|J>Z%pBx+sOrU5Lz0~fu=$cub|k4FA{30c8~_rhN>NOX1CR?EYE(v)xB;w}P?Uhw zP&Ew@lQ1I`{==*46%QB(rbUG8P`ZZzdMFKV2M|-i(JTZ;yJo}|A^_dL6fnE6Uqt`_ N002ovPDHLkV1g?-D*Tc%0T}H zHULZRYem5h0a)THH--URJ=={i0Nafe0MiW!fZ+xVfVx2g$htuV$hh$XI9lF*yj*~g zBX`#~`aIu+zG>^GdTDq_8+Hf}xQdv`wJr9QHwBhU(f&|s?UzY02$RZ zfUIg5096eEFjS`in5x47Y}FxvsZ(*q6x_!woA*cIUw{ugkG&!7ddkuO0000;P7e=k);#B@vK}IRb5BUYzbDA`33DITj+T14OL? zxZ1Cng`IPgwYI<8e|n#-2t%D z;1``RCjUMq*;0@qo}~zjo(HO)h$KIjlriEONLgGmrvWqv789$;-Xr{68h0`Fcm z0Grgiq$A}!(YfB420#=T1)2^(0@}c%?{hKf&NH!d`unx3Dy5Y(}th?6Xq!r6PjW~BmI@+8iZNZ zqA|P+w0|=mkk5GZdb>b_JKX|RDf}(B3?wj3CK< zV`v3xTL4$+Uwr^M9^(TelcLWKX#gehTyER8%f9dK4xyG&v}Pld3B)_k2N=Kbig^PK Wb;q+xQZD%b0000 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/andor4x4.png b/qucs/bitmaps/dark/andor4x4.png new file mode 100644 index 0000000000000000000000000000000000000000..d2b4b3d9d5b776eec2c2262d99536d3efa70b103 GIT binary patch literal 492 zcmVf41;YLp*NOcESBNc5!eRozB)Lr{7Hb`NaCMj$>IE>?*zVeUD5LN+OjOr_N)`I zK|LewiEXlT(U~rR%rSEG^9019bv(Mx#gNUD(7Ak#0O|*UT|2KPt&u)l0jkt2rCalQ% zkP=38^k#rg!i?&!u|p{y)d7#PrD=#XKN`mp%%h=208sk#BC4vFGx^xOHQZi^{SE&+ z@S~(eL(Pha5fvTCSm06T;5!?~(>kC=XM?Sx10zgv$8k05>N&n+et4FrA$kvFR2&&b iCh?pFS@4m4kJ4|W*~GJWL+HT(0000 #include +#include + + +bool misc::isDarkTheme() +{ + QLabel *lbl = new QLabel("check dark"); + int text_hsv = lbl->palette().color(QPalette::WindowText).value(); + int bg_hsv = lbl->palette().color(QPalette::Background).value(); + bool is_dark_theme = text_hsv > bg_hsv; + return is_dark_theme; +} + // ######################################################################### QString misc::complexRect(double real, double imag, int Precision) { diff --git a/qucs/misc.h b/qucs/misc.h index abd0bd65..3cfecde8 100644 --- a/qucs/misc.h +++ b/qucs/misc.h @@ -77,6 +77,7 @@ namespace misc { p->setIcon(icon); p->setIconSize(pixmap.rect().size()); } + bool isDarkTheme(); } /*! handle the application version string diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index 2fb42c8f..c9a7f47d 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -134,6 +134,8 @@ QucsApp::QucsApp() { setWindowTitle(QUCS_NAME " " PACKAGE_VERSION); + QucsSettings.hasDarkTheme = misc::isDarkTheme(); + QucsFileFilter = tr("Schematic") + " (*.sch);;" + tr("Data Display") + " (*.dpl);;" + @@ -727,7 +729,15 @@ void QucsApp::slotSetCompView (int index) if (Infos) { /// \todo warning: expression result unused, can we rewrite this? (void) *((*it)->info) (Name, File, false); - QListWidgetItem *icon = new QListWidgetItem(QPixmap(":/bitmaps/" + QString (File) + ".png"), Name); + QString icon_path; + if (QucsSettings.hasDarkTheme) { + icon_path = ":/bitmaps/dark/" + QString (File) + ".png"; + if (!QFile::exists(icon_path)) + icon_path = ":/bitmaps/" + QString (File) + ".png"; + } else { + icon_path = ":/bitmaps/" + QString (File) + ".png"; + } + QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(Name); iconCompInfo = iconCompInfoStruct{catIdx, compIdx}; v.setValue(iconCompInfo); @@ -783,7 +793,15 @@ void QucsApp::slotSearchComponent(const QString &searchText) if((Name.indexOf(searchText, 0, Qt::CaseInsensitive)) != -1) { //match - QListWidgetItem *icon = new QListWidgetItem(QPixmap(":/bitmaps/" + QString (File) + ".png"), Name); + QString icon_path; + if (QucsSettings.hasDarkTheme) { + icon_path = ":/bitmaps/dark/" + QString (File) + ".png"; + if (!QFile::exists(icon_path)) + icon_path = ":/bitmaps/" + QString (File) + ".png"; + } else { + icon_path = ":/bitmaps/" + QString (File) + ".png"; + } + QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(it + ": " + Name); // add component category and module indexes to the icon iconCompInfo = iconCompInfoStruct{catIdx, compIdx}; diff --git a/qucs/qucs.qrc b/qucs/qucs.qrc index 6b5ce8bc..13eeb50d 100644 --- a/qucs/qucs.qrc +++ b/qucs/qucs.qrc @@ -297,10 +297,10 @@ bitmaps/APBV.png bitmaps/APBPCV.png bitmaps/DivV.png - bitmaps/Icouple.png - bitmaps/core.png - bitmaps/SDTF.png - bitmaps/XAPWL.png + bitmaps/Icouple.png + bitmaps/core.png + bitmaps/SDTF.png + bitmaps/XAPWL.png bitmaps/sp_include.png bitmaps/xspicegeneric.png bitmaps/xsp_cmlib.png @@ -308,6 +308,12 @@ bitmaps/spicegeneric.png bitmaps/spicelibcomp.png bitmaps/xyce_script.png - + bitmaps/dark/ac_current.png + bitmaps/dark/ac_voltage.png + bitmaps/dark/am_mod.png + bitmaps/dark/amplifier.png + bitmaps/dark/and.png + bitmaps/dark/andor4x3.png + bitmaps/dark/andor4x4.png From 9d85e072612371918250b009fff17a770e41c10c Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 22 Feb 2022 21:47:38 +0100 Subject: [PATCH 02/45] Recognize dark theme and use icons from bitmaps/dark --- qucs/bitmaps/dark/EKV26nMOS.png | Bin 0 -> 259 bytes qucs/bitmaps/dark/EKV26pMOS.png | Bin 0 -> 265 bytes qucs/bitmaps/dark/ac.png | Bin 0 -> 514 bytes qucs/bitmaps/dark/ac_current.png | Bin 262 -> 262 bytes qucs/bitmaps/dark/ac_voltage.png | Bin 301 -> 289 bytes qucs/bitmaps/dark/am_mod.png | Bin 471 -> 407 bytes qucs/bitmaps/dark/amplifier.png | Bin 256 -> 257 bytes qucs/bitmaps/dark/and.png | Bin 258 -> 249 bytes qucs/bitmaps/dark/andor4x2.png | Bin 0 -> 302 bytes qucs/bitmaps/dark/andor4x3.png | Bin 480 -> 318 bytes qucs/bitmaps/dark/andor4x4.png | Bin 492 -> 318 bytes qucs/bitmaps/dark/arrow.png | Bin 0 -> 208 bytes qucs/bitmaps/dark/attenuator.png | Bin 0 -> 236 bytes qucs/bitmaps/dark/biast.png | Bin 0 -> 285 bytes qucs/bitmaps/dark/binarytogrey4bit.png | Bin 0 -> 368 bytes qucs/bitmaps/dark/bondwire.png | Bin 0 -> 216 bytes qucs/bitmaps/dark/buffer.png | Bin 0 -> 237 bytes qucs/bitmaps/dark/capacitor.png | Bin 0 -> 184 bytes qucs/bitmaps/dark/cccs.png | Bin 0 -> 242 bytes qucs/bitmaps/dark/ccvs.png | Bin 0 -> 261 bytes qucs/bitmaps/dark/circulator.png | Bin 0 -> 324 bytes qucs/bitmaps/dark/coaxial.png | Bin 0 -> 208 bytes qucs/bitmaps/dark/comp_1bit.png | Bin 0 -> 324 bytes qucs/bitmaps/dark/comp_2bit.png | Bin 0 -> 382 bytes qucs/bitmaps/dark/comp_4bit.png | Bin 0 -> 371 bytes qucs/bitmaps/dark/coplanar.png | Bin 0 -> 269 bytes qucs/bitmaps/dark/coupler.png | Bin 0 -> 274 bytes qucs/bitmaps/dark/cpwgap.png | Bin 0 -> 296 bytes qucs/bitmaps/dark/cpwopen.png | Bin 0 -> 309 bytes qucs/bitmaps/dark/cpwshort.png | Bin 0 -> 313 bytes qucs/bitmaps/dark/cpwstep.png | Bin 0 -> 297 bytes qucs/bitmaps/dark/ctline.png | Bin 0 -> 235 bytes qucs/bitmaps/dark/curve.png | Bin 0 -> 289 bytes qucs/bitmaps/dark/dc.png | Bin 0 -> 388 bytes qucs/bitmaps/dark/dc_current.png | Bin 0 -> 241 bytes qucs/bitmaps/dark/dc_voltage.png | Bin 0 -> 227 bytes qucs/bitmaps/dark/dcblock.png | Bin 0 -> 243 bytes qucs/bitmaps/dark/dcfeed.png | Bin 0 -> 224 bytes qucs/bitmaps/dark/dff_SR.png | Bin 0 -> 313 bytes qucs/bitmaps/dark/diac.png | Bin 0 -> 229 bytes qucs/bitmaps/dark/digi.png | Bin 0 -> 447 bytes qucs/bitmaps/dark/diode.png | Bin 0 -> 215 bytes qucs/bitmaps/dark/dmosfet.png | Bin 0 -> 246 bytes qucs/bitmaps/dark/dmosfet_sub.png | Bin 0 -> 243 bytes qucs/bitmaps/dark/dmux2to4.png | Bin 0 -> 395 bytes qucs/bitmaps/dark/dmux3to8.png | Bin 0 -> 421 bytes qucs/bitmaps/dark/dmux4to16.png | Bin 0 -> 398 bytes qucs/bitmaps/dark/ecvs.png | Bin 0 -> 291 bytes qucs/bitmaps/dark/edd.png | Bin 0 -> 308 bytes qucs/bitmaps/dark/ellipse.png | Bin 0 -> 224 bytes qucs/bitmaps/dark/ellipsearc.png | Bin 0 -> 197 bytes qucs/bitmaps/dark/equation.png | Bin 0 -> 217 bytes qucs/bitmaps/dark/fa1b.png | Bin 0 -> 310 bytes qucs/bitmaps/dark/fa2b.png | Bin 0 -> 392 bytes qucs/bitmaps/dark/gatedDlatch.png | Bin 0 -> 315 bytes qucs/bitmaps/dark/gear.png | Bin 0 -> 1279 bytes qucs/bitmaps/dark/gnd.png | Bin 0 -> 188 bytes qucs/bitmaps/dark/greytobinary4bit.png | Bin 0 -> 366 bytes qucs/bitmaps/dark/ground.png | Bin 0 -> 183 bytes qucs/bitmaps/dark/gyrator.png | Bin 0 -> 229 bytes qucs/bitmaps/dark/ha1b.png | Bin 0 -> 309 bytes qucs/bitmaps/dark/hb.png | Bin 0 -> 415 bytes qucs/bitmaps/dark/hpribin4bit.png | Bin 0 -> 381 bytes qucs/bitmaps/dark/hybrid.png | Bin 0 -> 308 bytes qucs/bitmaps/dark/iexp.png | Bin 0 -> 296 bytes qucs/bitmaps/dark/inductor.png | Bin 0 -> 193 bytes qucs/bitmaps/dark/inverter.png | Bin 0 -> 248 bytes qucs/bitmaps/dark/iprobe.png | Bin 0 -> 295 bytes qucs/bitmaps/dark/ipulse.png | Bin 0 -> 254 bytes qucs/bitmaps/dark/irect.png | Bin 0 -> 248 bytes qucs/bitmaps/dark/isolator.png | Bin 0 -> 245 bytes qucs/bitmaps/dark/jkff_SR.png | Bin 0 -> 339 bytes qucs/bitmaps/dark/jkflipflop.png | Bin 0 -> 311 bytes qucs/bitmaps/dark/line.png | Bin 0 -> 209 bytes qucs/bitmaps/dark/log_amp.png | Bin 0 -> 296 bytes qucs/bitmaps/dark/marker.png | Bin 0 -> 292 bytes qucs/bitmaps/dark/mirror.png | Bin 0 -> 496 bytes qucs/bitmaps/dark/mirrory.png | Bin 0 -> 464 bytes qucs/bitmaps/dark/mscorner.png | Bin 0 -> 213 bytes qucs/bitmaps/dark/mscoupled.png | Bin 0 -> 240 bytes qucs/bitmaps/dark/mscross.png | Bin 0 -> 258 bytes qucs/bitmaps/dark/msgap.png | Bin 0 -> 212 bytes qucs/bitmaps/dark/msline.png | Bin 0 -> 207 bytes qucs/bitmaps/dark/msmbend.png | Bin 0 -> 236 bytes qucs/bitmaps/dark/msopen.png | Bin 0 -> 188 bytes qucs/bitmaps/dark/msrstub.png | Bin 0 -> 283 bytes qucs/bitmaps/dark/msstep.png | Bin 0 -> 225 bytes qucs/bitmaps/dark/mstee.png | Bin 0 -> 242 bytes qucs/bitmaps/dark/msvia.png | Bin 0 -> 215 bytes qucs/bitmaps/dark/mutual.png | Bin 0 -> 255 bytes qucs/bitmaps/dark/mutual2.png | Bin 0 -> 318 bytes qucs/bitmaps/dark/mux2to1.png | Bin 0 -> 348 bytes qucs/bitmaps/dark/mux4to1.png | Bin 0 -> 363 bytes qucs/bitmaps/dark/mux8to1.png | Bin 0 -> 363 bytes qucs/bitmaps/dark/nand.png | Bin 0 -> 252 bytes qucs/bitmaps/dark/nfet.png | Bin 0 -> 226 bytes qucs/bitmaps/dark/nigbt.png | Bin 0 -> 256 bytes qucs/bitmaps/dark/nmosfet.png | Bin 0 -> 254 bytes qucs/bitmaps/dark/nmosfet_sub.png | Bin 0 -> 259 bytes qucs/bitmaps/dark/nodename.png | Bin 0 -> 252 bytes qucs/bitmaps/dark/noise_current.png | Bin 0 -> 284 bytes qucs/bitmaps/dark/noise_ii.png | Bin 0 -> 359 bytes qucs/bitmaps/dark/noise_iv.png | Bin 0 -> 365 bytes qucs/bitmaps/dark/noise_volt.png | Bin 0 -> 281 bytes qucs/bitmaps/dark/noise_vv.png | Bin 0 -> 332 bytes qucs/bitmaps/dark/nor.png | Bin 0 -> 257 bytes qucs/bitmaps/dark/npn.png | Bin 0 -> 251 bytes qucs/bitmaps/dark/npn_therm.png | Bin 0 -> 264 bytes qucs/bitmaps/dark/npnsub.png | Bin 0 -> 265 bytes qucs/bitmaps/dark/npnsub_therm.png | Bin 0 -> 285 bytes qucs/bitmaps/dark/opamp.png | Bin 0 -> 289 bytes qucs/bitmaps/dark/or.png | Bin 0 -> 243 bytes qucs/bitmaps/dark/pfet.png | Bin 0 -> 225 bytes qucs/bitmaps/dark/pm_mod.png | Bin 0 -> 320 bytes qucs/bitmaps/dark/pmosfet.png | Bin 0 -> 254 bytes qucs/bitmaps/dark/pmosfet_sub.png | Bin 0 -> 265 bytes qucs/bitmaps/dark/pnp.png | Bin 0 -> 248 bytes qucs/bitmaps/dark/polar.png | Bin 0 -> 329 bytes qucs/bitmaps/dark/polarsmith.png | Bin 0 -> 378 bytes qucs/bitmaps/dark/port.png | Bin 0 -> 185 bytes qucs/bitmaps/dark/potentiometer.png | Bin 0 -> 262 bytes qucs/bitmaps/dark/pshifter.png | Bin 0 -> 267 bytes qucs/bitmaps/dark/rect.png | Bin 0 -> 279 bytes qucs/bitmaps/dark/rect3d.png | Bin 0 -> 236 bytes qucs/bitmaps/dark/rectangle.png | Bin 0 -> 144 bytes qucs/bitmaps/dark/rectline.png | Bin 0 -> 235 bytes qucs/bitmaps/dark/relais.png | Bin 0 -> 268 bytes qucs/bitmaps/dark/resistor.png | Bin 0 -> 194 bytes qucs/bitmaps/dark/resistor_us.png | Bin 0 -> 198 bytes qucs/bitmaps/dark/rfedd.png | Bin 0 -> 278 bytes qucs/bitmaps/dark/rlcg.png | Bin 0 -> 276 bytes qucs/bitmaps/dark/rotate_ccw.png | Bin 0 -> 493 bytes qucs/bitmaps/dark/rsflipflop.png | Bin 0 -> 289 bytes qucs/bitmaps/dark/smith.png | Bin 0 -> 365 bytes qucs/bitmaps/dark/smithpolar.png | Bin 0 -> 369 bytes qucs/bitmaps/dark/source.png | Bin 0 -> 278 bytes qucs/bitmaps/dark/spfile1.png | Bin 0 -> 237 bytes qucs/bitmaps/dark/spfile2.png | Bin 0 -> 278 bytes qucs/bitmaps/dark/spfile3.png | Bin 0 -> 295 bytes qucs/bitmaps/dark/subcircuit.png | Bin 0 -> 240 bytes qucs/bitmaps/dark/subport.png | Bin 0 -> 186 bytes qucs/bitmaps/dark/substrate.png | Bin 0 -> 284 bytes qucs/bitmaps/dark/sweep.png | Bin 0 -> 502 bytes qucs/bitmaps/dark/switch.png | Bin 0 -> 201 bytes qucs/bitmaps/dark/symtrans.png | Bin 0 -> 327 bytes qucs/bitmaps/dark/tabular.png | Bin 0 -> 346 bytes qucs/bitmaps/dark/text.png | Bin 0 -> 608 bytes qucs/bitmaps/dark/tff_SR.png | Bin 0 -> 324 bytes qucs/bitmaps/dark/thyristor.png | Bin 0 -> 245 bytes qucs/bitmaps/dark/timing.png | Bin 0 -> 276 bytes qucs/bitmaps/dark/tline.png | Bin 0 -> 203 bytes qucs/bitmaps/dark/tline_4port.png | Bin 0 -> 222 bytes qucs/bitmaps/dark/tran.png | Bin 0 -> 393 bytes qucs/bitmaps/dark/transformer.png | Bin 0 -> 268 bytes qucs/bitmaps/dark/triac.png | Bin 0 -> 265 bytes qucs/bitmaps/dark/truth.png | Bin 0 -> 291 bytes qucs/bitmaps/dark/tunneldiode.png | Bin 0 -> 227 bytes qucs/bitmaps/dark/twistedpair.png | Bin 0 -> 237 bytes qucs/bitmaps/dark/vccs.png | Bin 0 -> 245 bytes qucs/bitmaps/dark/vcresistor.png | Bin 0 -> 243 bytes qucs/bitmaps/dark/vcvs.png | Bin 0 -> 266 bytes qucs/bitmaps/dark/vexp.png | Bin 0 -> 298 bytes qucs/bitmaps/dark/vfile.png | Bin 0 -> 330 bytes qucs/bitmaps/dark/vhdlfile.png | Bin 0 -> 233 bytes qucs/bitmaps/dark/vprobe.png | Bin 0 -> 282 bytes qucs/bitmaps/dark/vpulse.png | Bin 0 -> 286 bytes qucs/bitmaps/dark/vrect.png | Bin 0 -> 293 bytes qucs/bitmaps/dark/wire.png | Bin 0 -> 203 bytes qucs/bitmaps/dark/xnor.png | Bin 0 -> 262 bytes qucs/bitmaps/dark/xor.png | Bin 0 -> 271 bytes qucs/bitmaps/dark/ysmith.png | Bin 0 -> 361 bytes qucs/misc.cpp | 12 ++ qucs/misc.h | 4 + qucs/qucs.cpp | 18 +-- qucs/qucs.qrc | 164 +++++++++++++++++++++++++ qucs/qucs_init.cpp | 18 +-- 176 files changed, 191 insertions(+), 25 deletions(-) create mode 100644 qucs/bitmaps/dark/EKV26nMOS.png create mode 100644 qucs/bitmaps/dark/EKV26pMOS.png create mode 100644 qucs/bitmaps/dark/ac.png create mode 100644 qucs/bitmaps/dark/andor4x2.png create mode 100644 qucs/bitmaps/dark/arrow.png create mode 100644 qucs/bitmaps/dark/attenuator.png create mode 100644 qucs/bitmaps/dark/biast.png create mode 100644 qucs/bitmaps/dark/binarytogrey4bit.png create mode 100644 qucs/bitmaps/dark/bondwire.png create mode 100644 qucs/bitmaps/dark/buffer.png create mode 100644 qucs/bitmaps/dark/capacitor.png create mode 100644 qucs/bitmaps/dark/cccs.png create mode 100644 qucs/bitmaps/dark/ccvs.png create mode 100644 qucs/bitmaps/dark/circulator.png create mode 100644 qucs/bitmaps/dark/coaxial.png create mode 100644 qucs/bitmaps/dark/comp_1bit.png create mode 100644 qucs/bitmaps/dark/comp_2bit.png create mode 100644 qucs/bitmaps/dark/comp_4bit.png create mode 100644 qucs/bitmaps/dark/coplanar.png create mode 100644 qucs/bitmaps/dark/coupler.png create mode 100644 qucs/bitmaps/dark/cpwgap.png create mode 100644 qucs/bitmaps/dark/cpwopen.png create mode 100644 qucs/bitmaps/dark/cpwshort.png create mode 100644 qucs/bitmaps/dark/cpwstep.png create mode 100644 qucs/bitmaps/dark/ctline.png create mode 100644 qucs/bitmaps/dark/curve.png create mode 100644 qucs/bitmaps/dark/dc.png create mode 100644 qucs/bitmaps/dark/dc_current.png create mode 100644 qucs/bitmaps/dark/dc_voltage.png create mode 100644 qucs/bitmaps/dark/dcblock.png create mode 100644 qucs/bitmaps/dark/dcfeed.png create mode 100644 qucs/bitmaps/dark/dff_SR.png create mode 100644 qucs/bitmaps/dark/diac.png create mode 100644 qucs/bitmaps/dark/digi.png create mode 100644 qucs/bitmaps/dark/diode.png create mode 100644 qucs/bitmaps/dark/dmosfet.png create mode 100644 qucs/bitmaps/dark/dmosfet_sub.png create mode 100644 qucs/bitmaps/dark/dmux2to4.png create mode 100644 qucs/bitmaps/dark/dmux3to8.png create mode 100644 qucs/bitmaps/dark/dmux4to16.png create mode 100644 qucs/bitmaps/dark/ecvs.png create mode 100644 qucs/bitmaps/dark/edd.png create mode 100644 qucs/bitmaps/dark/ellipse.png create mode 100644 qucs/bitmaps/dark/ellipsearc.png create mode 100644 qucs/bitmaps/dark/equation.png create mode 100644 qucs/bitmaps/dark/fa1b.png create mode 100644 qucs/bitmaps/dark/fa2b.png create mode 100644 qucs/bitmaps/dark/gatedDlatch.png create mode 100644 qucs/bitmaps/dark/gear.png create mode 100644 qucs/bitmaps/dark/gnd.png create mode 100644 qucs/bitmaps/dark/greytobinary4bit.png create mode 100644 qucs/bitmaps/dark/ground.png create mode 100644 qucs/bitmaps/dark/gyrator.png create mode 100644 qucs/bitmaps/dark/ha1b.png create mode 100644 qucs/bitmaps/dark/hb.png create mode 100644 qucs/bitmaps/dark/hpribin4bit.png create mode 100644 qucs/bitmaps/dark/hybrid.png create mode 100644 qucs/bitmaps/dark/iexp.png create mode 100644 qucs/bitmaps/dark/inductor.png create mode 100644 qucs/bitmaps/dark/inverter.png create mode 100644 qucs/bitmaps/dark/iprobe.png create mode 100644 qucs/bitmaps/dark/ipulse.png create mode 100644 qucs/bitmaps/dark/irect.png create mode 100644 qucs/bitmaps/dark/isolator.png create mode 100644 qucs/bitmaps/dark/jkff_SR.png create mode 100644 qucs/bitmaps/dark/jkflipflop.png create mode 100644 qucs/bitmaps/dark/line.png create mode 100644 qucs/bitmaps/dark/log_amp.png create mode 100644 qucs/bitmaps/dark/marker.png create mode 100644 qucs/bitmaps/dark/mirror.png create mode 100644 qucs/bitmaps/dark/mirrory.png create mode 100644 qucs/bitmaps/dark/mscorner.png create mode 100644 qucs/bitmaps/dark/mscoupled.png create mode 100644 qucs/bitmaps/dark/mscross.png create mode 100644 qucs/bitmaps/dark/msgap.png create mode 100644 qucs/bitmaps/dark/msline.png create mode 100644 qucs/bitmaps/dark/msmbend.png create mode 100644 qucs/bitmaps/dark/msopen.png create mode 100644 qucs/bitmaps/dark/msrstub.png create mode 100644 qucs/bitmaps/dark/msstep.png create mode 100644 qucs/bitmaps/dark/mstee.png create mode 100644 qucs/bitmaps/dark/msvia.png create mode 100644 qucs/bitmaps/dark/mutual.png create mode 100644 qucs/bitmaps/dark/mutual2.png create mode 100644 qucs/bitmaps/dark/mux2to1.png create mode 100644 qucs/bitmaps/dark/mux4to1.png create mode 100644 qucs/bitmaps/dark/mux8to1.png create mode 100644 qucs/bitmaps/dark/nand.png create mode 100644 qucs/bitmaps/dark/nfet.png create mode 100644 qucs/bitmaps/dark/nigbt.png create mode 100644 qucs/bitmaps/dark/nmosfet.png create mode 100644 qucs/bitmaps/dark/nmosfet_sub.png create mode 100644 qucs/bitmaps/dark/nodename.png create mode 100644 qucs/bitmaps/dark/noise_current.png create mode 100644 qucs/bitmaps/dark/noise_ii.png create mode 100644 qucs/bitmaps/dark/noise_iv.png create mode 100644 qucs/bitmaps/dark/noise_volt.png create mode 100644 qucs/bitmaps/dark/noise_vv.png create mode 100644 qucs/bitmaps/dark/nor.png create mode 100644 qucs/bitmaps/dark/npn.png create mode 100644 qucs/bitmaps/dark/npn_therm.png create mode 100644 qucs/bitmaps/dark/npnsub.png create mode 100644 qucs/bitmaps/dark/npnsub_therm.png create mode 100644 qucs/bitmaps/dark/opamp.png create mode 100644 qucs/bitmaps/dark/or.png create mode 100644 qucs/bitmaps/dark/pfet.png create mode 100644 qucs/bitmaps/dark/pm_mod.png create mode 100644 qucs/bitmaps/dark/pmosfet.png create mode 100644 qucs/bitmaps/dark/pmosfet_sub.png create mode 100644 qucs/bitmaps/dark/pnp.png create mode 100644 qucs/bitmaps/dark/polar.png create mode 100644 qucs/bitmaps/dark/polarsmith.png create mode 100644 qucs/bitmaps/dark/port.png create mode 100644 qucs/bitmaps/dark/potentiometer.png create mode 100644 qucs/bitmaps/dark/pshifter.png create mode 100644 qucs/bitmaps/dark/rect.png create mode 100644 qucs/bitmaps/dark/rect3d.png create mode 100644 qucs/bitmaps/dark/rectangle.png create mode 100644 qucs/bitmaps/dark/rectline.png create mode 100644 qucs/bitmaps/dark/relais.png create mode 100644 qucs/bitmaps/dark/resistor.png create mode 100644 qucs/bitmaps/dark/resistor_us.png create mode 100644 qucs/bitmaps/dark/rfedd.png create mode 100644 qucs/bitmaps/dark/rlcg.png create mode 100644 qucs/bitmaps/dark/rotate_ccw.png create mode 100644 qucs/bitmaps/dark/rsflipflop.png create mode 100644 qucs/bitmaps/dark/smith.png create mode 100644 qucs/bitmaps/dark/smithpolar.png create mode 100644 qucs/bitmaps/dark/source.png create mode 100644 qucs/bitmaps/dark/spfile1.png create mode 100644 qucs/bitmaps/dark/spfile2.png create mode 100644 qucs/bitmaps/dark/spfile3.png create mode 100644 qucs/bitmaps/dark/subcircuit.png create mode 100644 qucs/bitmaps/dark/subport.png create mode 100644 qucs/bitmaps/dark/substrate.png create mode 100644 qucs/bitmaps/dark/sweep.png create mode 100644 qucs/bitmaps/dark/switch.png create mode 100644 qucs/bitmaps/dark/symtrans.png create mode 100644 qucs/bitmaps/dark/tabular.png create mode 100644 qucs/bitmaps/dark/text.png create mode 100644 qucs/bitmaps/dark/tff_SR.png create mode 100644 qucs/bitmaps/dark/thyristor.png create mode 100644 qucs/bitmaps/dark/timing.png create mode 100644 qucs/bitmaps/dark/tline.png create mode 100644 qucs/bitmaps/dark/tline_4port.png create mode 100644 qucs/bitmaps/dark/tran.png create mode 100644 qucs/bitmaps/dark/transformer.png create mode 100644 qucs/bitmaps/dark/triac.png create mode 100644 qucs/bitmaps/dark/truth.png create mode 100644 qucs/bitmaps/dark/tunneldiode.png create mode 100644 qucs/bitmaps/dark/twistedpair.png create mode 100644 qucs/bitmaps/dark/vccs.png create mode 100644 qucs/bitmaps/dark/vcresistor.png create mode 100644 qucs/bitmaps/dark/vcvs.png create mode 100644 qucs/bitmaps/dark/vexp.png create mode 100644 qucs/bitmaps/dark/vfile.png create mode 100644 qucs/bitmaps/dark/vhdlfile.png create mode 100644 qucs/bitmaps/dark/vprobe.png create mode 100644 qucs/bitmaps/dark/vpulse.png create mode 100644 qucs/bitmaps/dark/vrect.png create mode 100644 qucs/bitmaps/dark/wire.png create mode 100644 qucs/bitmaps/dark/xnor.png create mode 100644 qucs/bitmaps/dark/xor.png create mode 100644 qucs/bitmaps/dark/ysmith.png diff --git a/qucs/bitmaps/dark/EKV26nMOS.png b/qucs/bitmaps/dark/EKV26nMOS.png new file mode 100644 index 0000000000000000000000000000000000000000..466bb9725010c3932698b1c344920c903a403918 GIT binary patch literal 259 zcmV+e0sQ`nP)V&N$2%vLkyF@=;5D2NM~RuHYBn@W^)u`IDo*S z=Av~0VCFlRqdYmW<{yka|Zv$`_nV%!uKf{jRyPb?wUsemPur!BCwL7f2I3Lh@jk1kf#L_`vE-WfF%?TPz9y{um&`A3tA3%wx(+hrvdO(YQ^5>fM@bG z%mD!Xhg&T`ApSLW0DZ+4=BB$c$BA%zw_U7dy!blAE{)2RsmEA{GS9|*NuzZ5yRn-b-UfQhL<-G zK-cv`5~1b>g8{QFYsKTw0I)d(v2C06`~9WwMu5p=a)e7`7{*815@F43Hq+_3EXyum z&!?MAIuiheLF^rc!QfZ~;dx#=j^n2!9ABRs0K^|b{1U|#MX@wZyXB3@T#}@VFbr7` z1YfGE9su+y)ZGzqZUFotilZrZnH*9YuF+`JGEMU>ZHaOLjK|}%TCMhiQKB#|MHEHn z&1Um;VWfa?gn*4k<2h>!=K}D3{~pY*cmRNSsMqV)WJU?3%?Dpc>HTU5`QghNE=nnp z%vu;*CqMvvXQF!qfQ|rxv+@bwLrBVm>rL(r)`*n6EK|bmc_t+!_c;J z17r=9=viSeqHRHT-iG@!6zTMOJ?1#h{5;^7cI9NkhiS*=u5hT05S>nkr2?P{7K)C| zT>(fNubBXR;XX`78XEzMG8X9;@(*a61}cCmfzlKB0h-){Fuo4FNdN!<07*qoM6N<$ Ef&fY9TmS$7 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ac_current.png b/qucs/bitmaps/dark/ac_current.png index ecfd629f7d82418bcaf95e9e174275aea7c5b5be..e6fd1d130dc340ab87ae0f0304091f22417147c5 100644 GIT binary patch delta 225 zcmV<703QE_0)_&REq~Dsz#s@jbrkm>%290jATdS?az<@pznU74<5?iau=$Bd{1QTW z1t1OgW)6;;a2p_UXmHYi4CI_kN(s_{HXmt#Oc7cunW+S7BGP+XbyE$r;uab%11wwz zv?7NHd}U{=RZQ?pIQdADp*2*@JoTNf$0P! z+{?<4%T3EnTZbAEQ;EW@g;B^fvp#ldo@FD b)%D&7COp(3S+qMe00000NkvXXu0mjfV~$^S delta 225 zcmV<703QE_0)_&REq_4{z#s?&^;!P^;InKwkQgHcS)(?wr>4eb84JW1Ha`)GUqUFa z0HopG%)wC;ZUaOP4Ne-6ft+(mDM1?0<|7S|DMD){GnGJ1M0#(lZmNM++(N@;fQ9RT zR^$+YuZ%3&_L|-h0qw8X)*%BuaqG9Qc5fme1!Cd${6|Rq(^`O51xpAJekss3Fr9#e zds!KBxoMec>rf+N3eu=u(u!*mZ8l4WQE%LO1GAQ?6H2|@bLP-Ez66dVu=QecuV%=t by59Q$)=ktQlppON00000NkvXXu0mjfiTGma diff --git a/qucs/bitmaps/dark/ac_voltage.png b/qucs/bitmaps/dark/ac_voltage.png index 61453bf07989ca6f3732d84a19a334100b7eea54..f19c2db3e6ba4f943736fe0a2bf3e205beb0d251 100644 GIT binary patch delta 261 zcmV+g0s8)}0-*wsB!B2hL_t(oN9~tE4#gk{MD0<$|DimJ|FbYLgvtzPyJ=TVq{DN7 z+Fs@5>&oQsrS!i*N+bO6NS=iV1Bi3kl+u?CrU^vGdk zO+Ykps0ToR`KWeF>;|mfWRa%RdLKZ_0p|1ju9RVb@7K&b=h5{aU#-U>0O$jf00000 LNkvXXu0mjfm>7FO delta 274 zcmV+t0qy>w0<8j&B!BctL_t(oN9~uv5yT(}MYWS{!%nuu?Zh_HiMt%!aTp>W(BzVw zG9&psKM<3gZoYCPe@m(T1VS3_hkNoUgd2dIizX+H5J0W9l~O_)p@+`^EY2(kpya)= zkp^83VC{`90G82q0Z{FE5^pn_0D596*=%j*h#6qEQ_on!0Dq`B8aGUe-ZEBEOFZNN z7u4##6<`!c?lphS4j@UlI>2`%mE%$X$>QYzlmrz;<4j}NgEet&U2+R*!V!S(Z+jJU zka0(s97fUvcoVyN00DTv+W)Bj99b=~8Zdj4d76&vJpdsGET7+JrE~*4zh>GwkFI|K YE~d&M^OqS}01E&B07*qoM6N<$f+Nv&tN;K2 diff --git a/qucs/bitmaps/dark/am_mod.png b/qucs/bitmaps/dark/am_mod.png index 0e0796bd1afe85dea1fba5cd8cbd23a5243c5d39..ca305a61a48b3813d410fab1f302c18316ad339a 100644 GIT binary patch delta 380 zcmV-?0fYY61D6AkB!6B>L_t(oN9~t84uU`shJhOGXzXZBynzi@;RYOlJ8=iEU}8m< zkXX?vEkQ@KX4vfP4(Pgxk%k0@nQtEdtcHQ-D|8uu41)0DKCNBztB|}>VT<09f#WK`E znB+Hm6)&vaQGrRJej9*uz&WeH|F0Q$ akK6zsF%&Q)|8M310000U3F zKm(WwIRIucHp_6y;dH>PS+h=PXlNMQ+1cp>HDCVo=g&f5Xe8lt1fd|uCXdqr+qZB3 z#m2_Q$jQmc^#1+(|J>Z%pBx+*0)YaMB!9?BL_t(oN9~qT4umiWMD0!F{)fVwxUvZwZQ`adL+XeAG&T|5 zjFi%r$xoY{e|Z6(?SQK8RwE)(2KqO!0a$WhD++c9z!F!vF%019*=~dZ*lwf%m~KD- z3^!l^)D0Ry)(t8^#*H7q(en1= zky6?+`Dv5$FE7Be9Z=QXYD7fJK>r3d088#`MZpdMSmG)-h5=kX+l?>)+l>?e(+voK z;RXzVx`wJr9QHwBhU(f&|s?UzY02$RZfUIg5096eEFjS`in5x47Y}FxvsZ(*q6x_!w eoA*cIUw{ugkG&!7ddkuO000004El}YC+Th!IczXuFqTmyvNReV4)-el0A2z zQ!I$ndq-r!B{r8rG XTe_qn!p3mE00000NkvXXu0mjfRj^+I delta 230 zcmV}opY15w!hnddS9Qd2t%D;1``RCjUMq*;0@qo}~zjo(HO)h$KIjlriEO gNLgGmrvWqv789Nklszs^6H0`~ zrlDs<$EM-xMwA^i9^rNm>!}12T&AF!;!^6951J07*qoM6N<$g7$8I ADF6Tf literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/andor4x3.png b/qucs/bitmaps/dark/andor4x3.png index a26c4f9e7909ac462bb5a3ff83bfc389bf492360..a1866ae9ac07402ac5e0a3126e38deeae4cbe6e7 100644 GIT binary patch delta 291 zcmV+;0o?xJ1HJ-~B!2}-L_t(oN6l725(6O!>psQ*Kgy?UXAjO$Hee9T*rSCt1`@bF z#;^B&TmP+`x7IF{_j9N(wUXqAo}5{n7Xwi}7oa5eOusY)U*47p>>J31EiYpI2q2CO>1{d?S!%k%YESZ5|sGBOz+-c`l}4fd;l>} pHjbl1X1ffJQyc;715BJ{YG3vC7(bx~?1%sW002ovPDHLkV1n@mf3g4o delta 454 zcmV;%0XhD@0^kFXB!8z#L_t(oN4-|T5yCJGgRS~w8OCB6ex0HNbO}guanCVwtdu~X zZDPx^Ecg0K&jmc|x}w*o-!01m?_Mce(dVlgi%Yei!0CcZ(qDbAE zfnMc`RnY{;06X*=s7{vd-}1Mrp(gnh267Nd($fQ_0o!YK<~!qg(CjeqNbKCHDe!uY zs@C%_E&Q7g7$+?idLZR&IEL)3_XMljbbx{Ytm9P$AHDRpW;CwDEl3w0DOsV9d8Pv} zqWhpN+L{(LVt z#tGH`L(_(z{1fIW5)+zYL?iu`psQ*Kgy?UXAjO$Hee9T*rSCt1`@bF z#;^B&TmP+`x7IF{_j9N(wUXqAo}5{n7Xwi}7oa5eOusY)U*47p>>J31EiYpI2q2CO>1{d?S!%k%YESZ5|sGBOz+-c`l}4fd;l>} pHjbl1X1ffJQyc;715BJ{YG3vC7(bx~?1%sW002ovPDHLkV1oXtf4%?! delta 466 zcmV;@0WJQ%0_+2jB!9C>L_t(oN3~bW6~ZtKgKZe0H6mf_YB*aqyrIykQUNr2u+ z;-6y4;rycS1ip1$(em`#vMkW{tP`+7JtOUjZL)LGnJ$6MF>>_t1jM0rJi5-skj<0O zxqOWP>IZ>cJFh0Kkv?1js?>A5SK0LdN(k6*$gq9d0|KMh{(rLwkllllxNZsPyV8NO z?$!uIl`B-Ypb|Vqph|k3s18QhK9)It1GbVm_@)7xbQtdMpiryvw!3YP%&s2HBoXD&K*9Ld123# zr{O3Kk+zhZ(9)|ij)9Uw9kA#A@+Pdv`j8Svbo6F`PQr}puCYTY9@PPlvZZN=G(Q^0 z63nBaMF3Fx^CGIMmoxd;yfxfji2V)!JMg2VL_^Jrh)WR_9mrVVQRm=08^_Z+phjnd zt)c@XOmW9?HS6j*zGHrPmZu?l4`fsv8Ac}YoCR6%k$sQSZ=>17vv@=3!2kdN07*qo IM6N<$f*IH3W&i*H diff --git a/qucs/bitmaps/dark/arrow.png b/qucs/bitmaps/dark/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..aeb9c4a72437c636bbc60169d40655368674c7e9 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ>7Fi*ArbCxuQ+lw81T4U{HC$< z|H2{>RqllzxwlMaHXWJz;8Cr6j&A$p2zj!$aLmCAD1?8 z)L1ES&FAVkagTe~ HDWM4fA|_Ex literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/attenuator.png b/qucs/bitmaps/dark/attenuator.png new file mode 100644 index 0000000000000000000000000000000000000000..ddc5630ce6a5cf8707105d884e1e6c71433b5740 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ&7LlfArbCx!*cl=6gaNVKJu5} z)!cCHoh?5bXF5y&&D4Eh8)xIJ{mk3=v9_WD*O|2pO0(9-Ffp7=>*lgx+Id7QX{ps+ z77dlw0|Kl;%(G@sPh@dAAap{CWzEChtu9Zxrmc%gn%io7kMo86om%%E9lyWpOqmid z@*XH%m4D~8=xU~&!E3Kw-QQ-g)XBFoov$?Rkj+o=HR~Bt^^Y? k9q-Ki@+mce4Y7^P?$%%Bw}zZ^20EX?)78&qol`;+09T}1c>n+a literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/biast.png b/qucs/bitmaps/dark/biast.png new file mode 100644 index 0000000000000000000000000000000000000000..2fb23b4b4a73520217a3e0c837080ab5ab54392f GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJC!Q{jArbCxr`PfwR^T}LRqgS= z_9FAb#V4aZx|RB_0Bx9R(@}3*R$vLhioOcRs z_d7c%me<#{&jgm}ZeyufaU#OqVb6n)kzSKk>Sqa9G|&ES(_wMC zXU2T(39Ggou4bv=t5*0_({`s`@j`UZ&J)@bJ|6PP2sH532(9Evjh+5eLRtsOLe_(B%|0N=b) z7-FTIApn#O4HPDqn8TPQ0FXpuh5l|aw*-LFPg&qeIT(m5V}SQjI*|t`B|_d;uN_>h z%M7flALCUG+=f4II}DDHR6T1;?j8yNYaaLk-e0{Bhow|!<^nwg=7Ivx*5I^Q`>yOT zVD;Q;j|2c&{4ijRVv3sDDXIyp1(+i=38MwQeJK%YGu$gCDL*B`Y5>zBtOhVG!YI{| zeW}YRaur)n!ZppxZx>i|z#5~GQ_~jyrwDhoAUp}9G)MNO2GMo~yxXu^gy}()xs1>O z7%RHKyA7)un0_YQrGekNj-@t8|8OE!^Y(;W;3cYBSD%Qg3V3bP0l+XkK(|S^& literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/buffer.png b/qucs/bitmaps/dark/buffer.png new file mode 100644 index 0000000000000000000000000000000000000000..bf504080443f06da48942d50bac30eafc0f98dff GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJEuJopArbCxr(NW2P~dS%6yE(m zpj3FNnuJ}$7mtluAC4ahdH?mn21ASZi;?y^4Nnhjmq~cGc$$=wR31xJAVXG?WDd&_ z7KPoHnBL4aUB;l);xvPKfxv$jhnN|U4hT4K{g{}s%i#pu>#NhErYF=Xe4o4Xcl))p zy`>qsE|*fz%ql;=jxVEKXtk=w*L#~eP4zNlFI?+k)24D)Dp@0YQfn+HR*L3_5 z=bNZ&S0Z8)mWV>S`nV9|YPoi(JfJ{K-UA@Tyb5$JISJAN;FQCCKN_Iad#M#_3e=R5 z6jK4ni%9>e?+id)fz*g>z?Kix0b+kY@c<{yXExN5T~LxYb@bMAAP12SptFwRt+(Ot s-UFl8cP)PUJ)i|JZ9)Su1+*1-0FaZ~9WoVHL;wH)07*qoM6N<$f;LBB{{R30 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ccvs.png b/qucs/bitmaps/dark/ccvs.png new file mode 100644 index 0000000000000000000000000000000000000000..abafa1054eadf00ca5cb4d2f2018ebe6d3d7bcc5 GIT binary patch literal 261 zcmV+g0s8)lP)6g3fSN677iEV7HMj*pTk~8%Yj!}(lnXT6;LYhv za}|KtaxQ?a-SF?;1K##6tsj05%mQHTd3H!&Ja-lN!t1L8V7mh+GAGR)^BT5s00000 LNkvXXu0mjfbct;J literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/circulator.png b/qucs/bitmaps/dark/circulator.png new file mode 100644 index 0000000000000000000000000000000000000000..a444a08aefc4485e6aa60f5266611a45b7d52188 GIT binary patch literal 324 zcmV-K0lWT*P)H^ya618y&n$^80#2~n77{pp!21=ko&WgMo+rhs1k9E+9o!SoTbuFUW$Pc{dN+x zMyy}Mz|06)vDG!h93{f&-+>jb#5?sJh=A06L^uBpz*9ED08)L}0)|TF>!)qQ(@=wu z=OzCG-ne7Fi*ArbCxrv&mfDDXHxRD1WY zeU`anno%=Ls^3lu%HJ3fE#B5 zgRgX_34k&IfM#n1$n9Vs_reTt)VTIOY39oeP}JVQTtg`aG-~Ok8Zb*&rUtUYy9a>Y z@JFX&V1rYNnRwgN(g4OR_y?Y!)&|B=d>WW&c@WgQR>&4(_sA0lqM1{B3XpffkAc}J zK7)a6gUF&^(#p~xvI5P{wJ8cdp%Ux@p^8un;BB|RWnh~IW_9$GhWamyaCH#5MR?XA z;yo{l&@+m)*D0$6mogxY@MR5HnR?G301pHAW5BEKh@Ja|BywrSR{bu>TpIDc9KaX5 Wh14pv2I}qr0000|-43wY9PyH$WWYQ%yrD@AiTvQV?VZhyv>oLpC`Lxy!@7_*-t+mMcLqpym0($Tc zFwM2roDz^q5TU5e1ob%T=e}hHG;407SNY^=1te<}SbJzo0Z&@Fs7Gw(tEmTejrSh} zdchxEib0LtGMssUF$@2o>$9~%anCqea!l%8D?Ke^cjSoz5)cK46^No(mmdd8)|gNZ z=yGB(ej+rUEij0H1Y|Hd@zJ-df8Fwp%1*BHHX%)jJYccTk}yp;tAgx)Tc=-2fh>WK zdLT-6ZI`s0lM$#340P)se(%gT$KZs3dHq)$07*qoM6N<$f_TfF&Hw-a literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/comp_4bit.png b/qucs/bitmaps/dark/comp_4bit.png new file mode 100644 index 0000000000000000000000000000000000000000..965f6005beb7f9ffd6e10aade41fa8bfadb8e1ba GIT binary patch literal 371 zcmV-(0gV2MP)5lX+5iqx7H51ez=hjh`>C# z0!(YQJzWA)2_m$*XM*!Q8t1XF0yAsAN3ZhaX$2%}6nOSfNdZe*xv53W^Ofs?s`37V zz}fK6Q;I>2Y8!eUV9bO6(Dl*#ptxn6EIB51Z;ejN*e9~1fCNOrVFgxEJhvYQO4gWA z4$SSuV0mGv4O|%rJGnLTCMHEC57Y0pJ4l_E_n7<-ps5 zRJxfQ9{)1Kdh1#Kqrn zK4Ay|DbL({ZQZEa@GgYryB}b@^MJ=G=s%Q-4x|Yl=@8q{8bSonY$i|UbO+b~Ih!3Y T<;<~h00000NkvXXu0mjf50P(U literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/coupler.png b/qucs/bitmaps/dark/coupler.png new file mode 100644 index 0000000000000000000000000000000000000000..e58ee9e205952eb052b39abc9adec270f626ac6e GIT binary patch literal 274 zcmV+t0qy>YP)gSDL@+z#hK@TWx83ga0$>EkK$e&Nc|h0@;>m_8QV@>lE$ntnntEzo1g!fkV3eP?@#Lfmr_-M uRv0~zp8K!51<`w{rE-etWw0l@Dj!tbt2&wzF_}UlaZ@))?h>lXq7qQHDT?H}$ zYs)K!+JYG*n2hOx86;d2W|L?LFkt3rvca!KxeAOVa|L!yI1-rm>b24};Ybp-wK8Mi z7DT*Z1({SLL_lubQwW)wunD#PNdg);uhUfdC~(f+aX!G&9If6oVFl;=i>TQ?11tX+~O*pE0YcgB~kTCLOo}PqS>h+X>g9uSVR*HmDDgjM;(}a=C*Hnpk z;{Q+RdH^vJ(rfuU-bAss;K}C5xA5tgrG(o8bpG$ITTb8&tje=6^gFhS00000NkvXX Hu0mjf)y0T4 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/cpwshort.png b/qucs/bitmaps/dark/cpwshort.png new file mode 100644 index 0000000000000000000000000000000000000000..54b9d8e97f586435cbeab80562a8b91f795d11c8 GIT binary patch literal 313 zcmV-90mlA`P)6VF*VNs+Y5^FbV-X zfM%n$AAz6%Y;O^VA_xeecZnw+3A&STe|y_b1CQpb>QRUzgeorIuUb!ckFZ`vj*2}8 z82c?b;sm`5kl?jvB8YT=NDyAfI#}3>|9281PFVYqc0hv&5x2X*_Sy?(`u_nDN?FH< zeRr#F-JqXgHdvT}Y(aZpHv>!$nW@(cCcOPdIT5x1eS&w-O$T@b9g(vz&Ejk*00000 LNkvXXu0mjf)Te)V literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/cpwstep.png b/qucs/bitmaps/dark/cpwstep.png new file mode 100644 index 0000000000000000000000000000000000000000..9420b27e04ed97a51dae900ae8af2b56f910d3c6 GIT binary patch literal 297 zcmV+^0oMMBP)56AH>r&?IF$x=sSxUgVZ9)$Svj;|wX5Qp$jo~kqt6j|hhbe%@P2sFPT`ahpT%jlc zM&4Z7+>R0?1YoK|-q&Kh0gmq3j|F`yqJ&KKDQ8Fv{eH%HiH)R1FqVA}5v?}mE-Nrn z{*MBs3PvV}Z^JaRHF+6pm?Gd5SP)ELW)FQ1oFUl2?7n6Nm_tc{8H;WyfX1%%_x0`r v9=9MkhMo}rODP<~(RM(9*0E~cKONu&IypTqEQr?t00000NkvXXu0mjfWeRu~ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ctline.png b/qucs/bitmaps/dark/ctline.png new file mode 100644 index 0000000000000000000000000000000000000000..5f8ab099f5fed5060e45c274726c2dafa6235f77 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJO`a}}ArbCxr+V`>DDb#ERQvX? zeU*9Os+EeqKRq~71I;FR%sd`&T%yO_eAR>#;y(fK_QSQ#Zbi2TATdsKn+c^_)88|mFcr{(a{omk zQ~)d3;{Z5dQ2}f9QXjD9Q8SkUSjq9Wg|SWA*O7j{GPYEK2*{;?G|3~UXAF(M)dO5I zsdK{EttId%RNjaxaqPHazK)d;PPswx%Xg%k5&DGqU!Riez1vn5c naOPGN28g=6T!9zh=M*>rJ!B`$+PW;U00000NkvXXu0mjfF_d;A literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/dc.png b/qucs/bitmaps/dark/dc.png new file mode 100644 index 0000000000000000000000000000000000000000..755aa1a8574dd7386e31707ff8422d053adc3e2f GIT binary patch literal 388 zcmV-~0ek+5P)5dr5P)sfQwQFGp;8m6Q^ZD|f|)gWq72FFlrdt8gcKxr0Vd|Q=^f&bF)k4SLn;{w z3B%d<-9MZyeDQ_#GYeon@H`&K^ZaJABH}n^K@fBdZeAdO>$*lfLdF$E!934v>6i@w zjYE(qidYzijow)SFvO~-wE!S=1lgUM6S@%f$ZlYNtSTJ@P%C_eO=mc0g@?%ylJW%J zuWMxpzoqpQ0F@(1nF3H%&b{Q7t$xG<6+o6{3FrJ>QuYFeea!}trs-7(@wSu)1Xz2( z#JraSAS2-Zsc#Bj(_SrIea;hBTnX5#YZBsB$?!yqnRq3E8-3HhVW4cIE)HNFJ9-LAa>FwwvvK{n5k00000NkvXXu0mjfpzmOq literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/dc_voltage.png b/qucs/bitmaps/dark/dc_voltage.png new file mode 100644 index 0000000000000000000000000000000000000000..dddae1af5d51b15b2e4762295ba883001a412119 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJRh}-6ArbCxr(NVdpupi$DDqwY zRAA0e1H)cTnHvGZzoK>C_XS65{Lno3SCjEv`2yju(XEjkm5S}mx z014#R9I(+|1VDpD$wu=CfK=xpDKr8g!D&KY3(8F* zW@gf4Y6?2NaQ5Zd?q1?ntU@nhkDsyG!=6@^Y-Qw|%A$K%yEpW?*yY(q^UkQ*9$d$- z)V4-}ePYUu(DxJ9x+?^oe<3xw;j7Uv295@YtMv{$gx$^;KHYWY_==#2mdKI;Vst0Nt`#2><{9 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/dff_SR.png b/qucs/bitmaps/dark/dff_SR.png new file mode 100644 index 0000000000000000000000000000000000000000..8d6cbb776d1d0c5b180bac9c79acc7c4bcfaeb4c GIT binary patch literal 313 zcmV-90mlA`P)jp)d>lt5+tBXATqUL`o4=mtC%#f{_SmxP1L*B zSeq}}c6#T$!pFr^dxFoFr0+Q3p|!uzf=3d5-;#5(6V5tz{m@Z z)PNnmHtw`Z_?IqVI^Z5=gbL65eCn&%1C9#JgFziCE<=9-JqT?~JUJ;s<;RohV4u8kNPWwF!&2x*(v74 zyTK{o<7C}RmIZ-H^9?l{86N5>a0j)E^m7F?v3RfsH5Rbi)Hfv-UY9%3&zb9ac5gPz dET%8dnC9-BqgcC0+zjY$22WQ%mvv4FO#p@yTfzVU literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/digi.png b/qucs/bitmaps/dark/digi.png new file mode 100644 index 0000000000000000000000000000000000000000..ca8dc28ed943bb2adc6604ec5ca282bb13dca1a7 GIT binary patch literal 447 zcmV;w0YLtVP)5dr5Xa3{W$cudZk-VuZ^4uSWvSA~$(*zuy7fVr88em_K+GMgw0D-zIvb44M<4@8 z2$0Xd|NZU`I}i(B!NUH9Lsq|?G z0E3fF1H`>fMTmmMXP)OG%d)^0;7Z4tguvt<5cKII3~aAp`^M&K+9ak`fJ(^*jE=Ct z0SQo=h?1uONpz?HNnSZb5t4$+BPY_J#>C>7Vavzxy^DZOJrxg5-~vcoUDsbx6z!B? z1M`#u8U#SV1sptqum@7hyQ+;=ZvraH7jW?INWm|ReYo;Gm;lQ?250A-e`BHT;r@pE z*(%s!HNg5_JK~6$AViOCX%y_>B4m!eUwK=qn%IJX$F>FR`e<~4w^wGUoJ#cSYEW|( z=p+LAh;|a_v&dLm+5_~j7#GA3dz&2V$Tgofq9jS=?_F=hIKa2bTM3|msa=h8z}$xu pgTO5#?pk}6lh7()C2-dS{sEX_l`zuBnhpQ}002ovPDHLkV1k=x%3A;c literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/diode.png b/qucs/bitmaps/dark/diode.png new file mode 100644 index 0000000000000000000000000000000000000000..5e918931a81918527ea33fa24a4ee9e2b8d2bb4b GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJd7dtgArbCxr+D)&*x2ixbrJ-o6Q9x#gYy%7B4Mfr0563tzcSu444AL2t?^9?mraW#FnHcq-u{C(SBh1C(6sgNqUge%0&4fy1(xQ1JDJn{gT`Q;Q}B~ zmgExW2EfcYr3CMX0V5@lGXbznfnFkafRf-B0KGYia620%*zYv=3oR3)&! z;ctMEv$RlUa2FjH92 zapyt>Urv=WMxNpYYAJjZSYsHjNL?x6isH*ywk(@R{J?DHS?Bb%8@{3c9(|0?3)+>42RP#FX^$t_r r!!j!xbsApsEr`DQB>l_o{SO&;xZG9b*U&2h`hvmJ)z4*}Q$iB}d=6YR literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/dmux2to4.png b/qucs/bitmaps/dark/dmux2to4.png new file mode 100644 index 0000000000000000000000000000000000000000..87d0cf05960a4156f4ccc0f99c355c939da9b393 GIT binary patch literal 395 zcmV;60d)R}P)S$p*Zg+i{0o-|Yr)&dd1~ec81m}8;l>p2NFA{br zLan1*XIA=$x1LaH!g9fSZh=b|@qz4gBDQUk5+a4f?J(}2WXTa(>t?k#hH z0mjg%n=;qP{09S3u+=~n0CUCfxu7CEJJ)MO=@PKBpaRGO2t}xiXS!GhNXUS-Auj4E z_$Vu>M#LD1&VrGXPH{o?WrbNcEkd@tYA>)Ib=V1Q3GjTtFs?9P4wP^)dsPIh(1K0L_3HWPspZk1-0suJ9sZ zha!|Zjwjm{TEMObdcz+b$q6PB62r)>1QN5zhw*&3c4jHab=%=th7k+Eu)EhfvX$69 zGQohwP-dE9_l)~r24=<{1KL@(EK74B>pYu?B=zhh^xqP8fi;R(K`k-B)Z7B*O~MNU zC_-_PnPMyxCIi@pFYx$)meitS%JLHiqFs<>Vo3v0U8CSB21F3i;_&nlfzWn%KWszX z59mmjWor(w49qf`v9Y89M)5lMY#md(z$!zw?r1B3rrXe>SFdL#xCS7*z z)h`QVHqOs3h(>W%@e!aU5k^j#a~c5SJbO3&-7xEL_ntcmcO7T#{|?{-93x9Rd*Za` P00000NkvXXu0mjf6f(5^ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/dmux4to16.png b/qucs/bitmaps/dark/dmux4to16.png new file mode 100644 index 0000000000000000000000000000000000000000..080c579f2369dfca28a68be5faa59dffad9acda8 GIT binary patch literal 398 zcmV;90df9`P)aaLtRC9`W?-glF(8da!&2%4QR7iZ*r~@LVSKkx6|90_{SpJ(EXV+|I^l@{OhSn^ zlXM<1l>u3XXhiG#*qAb!E-RrN&|)_`3czB3-~abC s^oC1C9{z7wF<#LzLr^hR(fK)m7mYY)JG+-oeEZXShj z13+?7bI=F@lu~NWIiwM~_zJ+1%ya-S?~Sc#(CGly-na$8GTJTxs693DHlqok8;{Jm zH7*e|0C%UJu~Y+Kajpbb2o(Sol}w~{T#^XDy9s?p^<4shjcH#j0r;7|8puggSP3wk zu>S*q+uS;aJ!dIeX?;{L)fi#`IN$atrXbuXYTt;a1R~>h1#|}hepQS5;s!2CPt#Go p2OyMy<@0-b6F$FY+6Rra?+f7o$stmcieLZ$002ovPDHLkV1oZ9Z<7E3 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/edd.png b/qucs/bitmaps/dark/edd.png new file mode 100644 index 0000000000000000000000000000000000000000..dc2fa01b8cb09e5706ed0930ba6f04475a79c5c3 GIT binary patch literal 308 zcmV-40n7f0P)rf2>Qj1dMXf9o&(ji z(r45X#G_gKKU(W-zo+wLj@!mgas)$y~5NsV*;`o;*Jni+4uAcyb$g^+&$@$ zkd0i@mKm}_eFw;DKr^rVlCOE`ir@G@SIMdyazl~3={T>>7k2mTXTGU^Rv=?aLSqoUtzLQ|QCdGe%?<14?*1U$fk4#(a8;-wQ$~}>xq+x&J zdaH#+R@V1J4$T$F(w`u3y`nVOsMI<0?W%1(pZHc`pYWxuj4|6>uXj8_9q8;pPdX*Tu?aE9_TIxPgg&ebxsLQ0H(!FEC2ui literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/equation.png b/qucs/bitmaps/dark/equation.png new file mode 100644 index 0000000000000000000000000000000000000000..ce38914dfdba48daa0c3acfacec2ec31ee4e0a44 GIT binary patch literal 217 zcmV;~04D#5P)NklqnrR`k3_nog*tF=bNP~KEQrO}^&wLBxK zyk~s>CPfq~o*=jj=9kz|ugI);s^drzeTuLYrC`aVh$2X%p?pB(5IBNT;SD?(P)QKfeIoYQc`4%9FFuV?7hi*>SuZYTZB+n TLgLNX00000NkvXXu0mjfTYy_X literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/fa1b.png b/qucs/bitmaps/dark/fa1b.png new file mode 100644 index 0000000000000000000000000000000000000000..03d21a00665a6ba20a8dfc721d3d4abc01b718c4 GIT binary patch literal 310 zcmV-60m=S}P)0J7Vr0d~m9Z^^SR(i%fuGn9fB zxWw$I7Cx;ASpm!1(Aq7NPp4)2AlhB99r!;7m{#k#LQTTnd7yVLU>?^{fRKCVf#m|w ziRdROXyp)D$94n48G0HrB8CJo1k9dWe@+?T8GGCm%m8OF-Z!CbFoQJQPQqG)bC zr?iAT=Du4SrnCG(?3bV2)S}!<-Hw5b2xol(&C41en$cBG7_sq`2&;;pr7&$o(i8ME zV!L`H@4v)xtH5eTjFs6MOi@{c*(yN>4rQ2e!idnYO1u<=81Q^Qaz8lT4J)T*cgIu} zuwa$%&jnyvF|$=K$JqU7H=J29ij9?^*Rr*LnBCB0;0^#1limmJP64&ziptrV=T-r` mII@#PzlRx!2CU3OVgCUAs#Q6ygoYdd0000pkA`p5*!>rmVTuMS|U*Kuq}#kU>C4N z$jRROOTgv8HV0h4;!zv+fZ6V#+K~AZBElI5mS@38#K&g=<3MW!Z N002ovPDHLkV1h$Ogr5Ka literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/gear.png b/qucs/bitmaps/dark/gear.png new file mode 100644 index 0000000000000000000000000000000000000000..df1f676138faedcd32da2f13d7dc57b106629d96 GIT binary patch literal 1279 zcmV8tXVucpD_p-I^w$t71Zg;!e-F83EOu~lELgOTx*_rv~`ObOI zd(Lq9A4l_-&8fNBIcdvBTet_yTaL8O@B*J&_x@VPqY$};kK^y(yPvroZU};aa5N0X zqNW&QvcIGh;5eN5p#v>P4i#`73ts=+dUMsgRcVjY1GCu--YkIUdGNG>@n7Hp#^A2- zq4|quv>rR0$0`6fe%i<+QOfWp-t4eAz?nD*ykNjZS%RoYFcH*bG8xYtJ|}+rxf4IO zx8u^EmvX#3aMPY9R%9=NXcm!5r%+t%hf-q4!tye@PGg`y00ja8O}N)L2(x5{YEv;D z7zdk6;^7+Pf%i4-GxSU(6R?;1@WP8r(cRqx?OzSk(YR3tcexjtnG6JyLzG2=i*UGX zC@b~jU2F`no*ufqe&Ew*a>YQh{`2TV{mi; znQSIjQ&VGD>-3p+Ca4z3dc-1WFN*NEi;zkt3EYG;XWPgxbm)=#Tt1{TX)Jl^S@d4J zi9l~Z7A<-beZzg&`SH%Y%rP@6mF>r^zIy6nX zDkk0pQIb$m^%O3h{{;ir@4{bMj2$&QMA|#^u+KMd+s58_b2U^&hSh2{fFnae#6nS| z;z?RM15TH~Ut9(g1wS-4hRUUtxN@NrPOk-X~vz4n?<)Gu*1P1R7q1@-g zOd^RS{RT(+!JR(co)VcT$*PRbi&wCG?Q6KudY)XN7D(^_YO|5R3#fyFS?^84p{w6oLz=2a2U-*b z9+w;E&izDS2gZV<2qi+1>gwvEoZXJMoM2^T<+yXV-!Q#Grq3p)XK294o40OdI%v&1 zZ$qN)Gm`^US%xghSl}%*D^_4CPQxb4BQ_B&u+)5CwRt~HCyt+FrDQ{0p77`dZU=77)z;Pu^8xdU pH{Zg&pY3IOy6M?;K_|}l-hWGL)(q3r$*2GT002ovPDHLkV1iuTXT<;j literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/gnd.png b/qucs/bitmaps/dark/gnd.png new file mode 100644 index 0000000000000000000000000000000000000000..36b2826967a2adc5ddeb6e4e9edfd454be4c14f9 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJW=|K#kO=p;QxEboC~~lD6#1>+ z6}02CV^R%cwu##7=mZJZ*)ef%i)s}acrSp_0XCl_|5TpZJU#HSyQ+|diD`!7s{2+v z3szmL)_<}eYE^&# iz`Dg1-}&AcePHx=(NR2in{6@BISihzelF{r5}E*Aghb*1 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/greytobinary4bit.png b/qucs/bitmaps/dark/greytobinary4bit.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c81179917a1612d0f164ff79afde7dd4eeaeb5 GIT binary patch literal 366 zcmV-!0g?WRP)AmmP+RE>(wTGBAdOc7 z(_YP|3qUfVf#Qz2y|kSMFk(VF#k&@42>?#U!B|0Ls<3AXfXtz#5sQ&h4U7b;RnHOw ztIGE(>r(|s!SBbzsUogrsJc@SBeH&7NPac2)gqH$20-t gojwUL>hJJWuJ7-(nqhM%rPhGiEkTw^?f|>_d z$iqc3v@)mT&vd=4IL>GmivG6_;;$pT6q4z(qOs z@`YDM6Q-+(n*fcpXv|!mFw^cr*4@M221gEDx&1->eWO^}+3)MVH@GCCSa9$5tU~t={Pch^guKts|@O&CcpqFs3w8>4iU(Zm_h&rovJ_v+*7KZ@1se7 zs(-$8g|PR4dimk*xZ3`Yc4`=0Fh4(BvDbRp#Iy3iR|-TE5K?kD4=e&pfu+Dwz#5G% zbLP~kSIY28mhl4QbmAfQtH)hZu@pwUpl4V;0t_xHXgoHhv>X0h0dH4FeBWB_@E+)q zh!BVzNfc-JP8b1?+#MHz|5hNn&Zr;Egebtwc6SM8g6i0BTv$~wRN8+p00000NkvXX Hu0mjfAT)zI literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/hb.png b/qucs/bitmaps/dark/hb.png new file mode 100644 index 0000000000000000000000000000000000000000..4b30be2dc287e90ce5727afa62f3eca4924dce05 GIT binary patch literal 415 zcmV;Q0bu@#P)5d$kjr${J+dlzxm)!4KITz3E| z5;5ny@BX{PND=swf#Zu6U{&D%C{Wk6@;MP**NH641_|p01W1y^iz1X<(=;N_^KUW! z3;>fukgBRgQ4~6^699}~VAF+{#azSxwz66FX?0DdtpH$j2FK|9m7Mj#aGkFW`bJ9m zp_Dpu2p-f60QC+y-vM9=wLU3h3~-i!>f<^#=fcrJl%}cR zQ!_Yz(a^3?n}w|9@2YNvWAJqZ)77-~g8nZDPxcEVt!m{90>=^=#&Tt+n9(%O89|0OaDC z#I#q783N!CAztIJ=EwCpgDQA z-Nisut!KAOG++&q9$@Y;iZsxZC^Iclcj;l&^NQwm0VV$s;YtQP+f~~z>jPOM$^zhZ zDIf5HN_}kA042-3s&CW4h!8E0cpK3!4QQ=9JPmt%ATy+Jjq3xe5@Ve7x8aWDT1=CH bzX9+BCT&VN(_2cA00000NkvXXu0mjfI}4u< literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/hybrid.png b/qucs/bitmaps/dark/hybrid.png new file mode 100644 index 0000000000000000000000000000000000000000..ce0481ebbf70cb6976a7723033b5eb054f2f0cab GIT binary patch literal 308 zcmV-40n7f0P)V=8=WmR{;o((l+5FY4|53_#7zx`6FC=hwo`FaK zNQh`A(*V8q(OL`J2`}V`uMI%aMQb~+v&!U_07-9l4h n#cKHj(d<0fM(Qd!g>B_ z04P`*fTGom{1jmBYOD5IX_jO_0-z0vh}EYFwF5v(y!i+bD5cb#^Up{7#*or+E6mdgc!81BbOKZXREWO0LemLw1!$N!p~G|F zFa>C`b&~D@^G{sElXkZP2rMO(w*)5_55WVE*SoP6ka9Bsu?BXIQrzOh$^R_Eh$ uLj=4b@eo-AmI5IKF1?tntC^?9J!`(t&IB-J5#MtF0000F07WVjkK7Ww)?J&WB;A{}wgX2D!Lc ncKbtD4_)kM^JriJp$AMGvON{E^7}1-Zes9s^>bP0l+XkK)O|;$ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/inverter.png b/qucs/bitmaps/dark/inverter.png new file mode 100644 index 0000000000000000000000000000000000000000..6ded4b6f2ffb3e3c9582cf6507a06de016235f11 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ{hlt4ArbCxrzP?=C~&lXRxAAP ze9>1&Yu4;27MH?KQ;a1 zP6~6JYll7Osf%6hz<~6%Mi0CU} zlYkiLO&B$0#d8g0kdQ<|1|lR>IL$yEuw9Ox(L)S~uqD>MOEusHQzA8PZw^$1y(03u zq!mu9fnJusS~HD6PsF1jbFOWm&d^$h!wIOcwOL)mz~~34rZe1zQE{(r-Hiz8am1uc zU^{)Ro12dzw8y<7v~75e{|1 t9sy+Ru2V4*Fk{Sle@rs6Lt;!P@BqP7X)Yb@ev$wH002ovPDHLkV1h>mdG!DQ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ipulse.png b/qucs/bitmaps/dark/ipulse.png new file mode 100644 index 0000000000000000000000000000000000000000..22b8530e44d6d4b3aa801bbb84fe7bc8f7761711 GIT binary patch literal 254 zcmVM6EW0dvaAow*Vuj zCbt-pfKp1$IZH95#h(^n;(UXjQ5r_T=^#q~6tKq|VID%j6Sr!*AB&z_P47|(P(9JO zB%l?XeRtOGDFRU=r2d;kCd07*qoM6N<$ Ef+kvHIRF3v literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/irect.png b/qucs/bitmaps/dark/irect.png new file mode 100644 index 0000000000000000000000000000000000000000..45bc71e780ab3f99fdd0381fe413a1d8a06bad5d GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWND7ebg z#W5tJ_3dTU_CN&bmMRoks3;$v@00`YVb#-Av;8P9A?@ t>~`gLEms}$JGKy?kKrb*olAEz)a>nf{qy35??6{Gc)I$ztaD0e0swKTVe0?@ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/isolator.png b/qucs/bitmaps/dark/isolator.png new file mode 100644 index 0000000000000000000000000000000000000000..f44e2f9d93c54e077bc6f208ed9d127632d4e259 GIT binary patch literal 245 zcmV+H7mEzfOku2U>^f;&d5QK0IcDS9f)Wq(m?9EkV51De7(J(e{lB| zF|v4=j0%t{k;W|mu2X&1J?gP4P+HYm)9vHJ4u@wT2hj__>Vn#yL2|*20;F>U51ojp$!ETM_n~yAGit0Tz^=dsts%i5HuMsl00000NkvXXu0mjf-GXN< literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/jkff_SR.png b/qucs/bitmaps/dark/jkff_SR.png new file mode 100644 index 0000000000000000000000000000000000000000..17cea377b9b47a979005df430a228d22d5105206 GIT binary patch literal 339 zcmV-Z0j&OsP)6J>0;R{_tlbk|6;#yG8=3L=o_6%t-Z$**=QEsG0hM2*|I`{##jm zyv>i(y_8+qeYOe#4|>bFb^bfFaRkxOu?0?`<@HMR$SZVW9kRKAam;i(EBbLnlD z*>4I#FYw@zoTs{BZ!po-Ju)N74UZ@=`V1SXcE}B*`Z5>L*QNm3`fMGV(W(c?U&Tyd lBrk&@Jt{7J8U4-M@BtdqeK6CN8L9vP002ovPDHLkV1fock0}5E literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/jkflipflop.png b/qucs/bitmaps/dark/jkflipflop.png new file mode 100644 index 0000000000000000000000000000000000000000..03ad2205dbd748454fc8e247a7939ed8996d2aa1 GIT binary patch literal 311 zcmV-70m%M|P)7hgHTzooRj0YVt=VkVD@a0?*k zqU3}T5>RX1N+}_XZZUyJ@*!(SB8LK^Uq>R4OHcpZzzVAKr zvPixx+v!>BZrSNeI16YwMgk=0qZCU1m-lc7wBVL=I|q76pIri-0c&<(2&1itva_}T z-BKPmOb%Gu&_iz8h)^3^Kt|%$cVN_pKg&Q%1hP)o=;_HjC&F2~4QHm>Y15FcMpm9S z4UZ7;-_vkrBa)-|9@Egf|LZ!}U$KQ8b%q5abf~!WWOSRe;R^|!eK2SJL=yl2002ov JPDHLkV1ijTf{XwF literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/line.png b/qucs/bitmaps/dark/line.png new file mode 100644 index 0000000000000000000000000000000000000000..e94b1bdc939bb8802da1085e907359e607857258 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ8J;eVArbCxukRE+pdjGv7|iuo z+*R|Na$!=Rt;)n1Z2xp7mdK II;Vst0Qlfd+yDRo literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/log_amp.png b/qucs/bitmaps/dark/log_amp.png new file mode 100644 index 0000000000000000000000000000000000000000..0170797131bca9f14dce10c16789aed032f86dc3 GIT binary patch literal 296 zcmV+@0oVSCP)_qKMI%%qfz6kT7KZI!Lxwj82+v2Azj=wzs|L;I+ZHGFkwN8N@ z9tr>u9M|lkRRcia8E%*WP<^HwKY%mQ`?>qy4rmUEeDeS-ci;dj)9fMquWzCN0000$g)3v{9uC5I*#LoJFa=2r*fvd zbgcz6rV)o@=vDeX0tgjm&-x$*5YtDkYtNpp65dHMMT~^9()FH zsj4a@aBJ;cL{0#pn$2}xx7eRfCy<;Z(6R)}5(EGdc@vSC=eZ;z`~CiyW>r&yEX!JK zi=y}{B7g9pk_;q6+B40DWY|@wPL$T`ezQsH?RJaVY<6WO-B{gYlw|0;faI5|s(z(j zl|EvO*J#BUuXF>Ms%zEmVRJ{0(wGQ);FD@EH#^Ne9b mKS*;%WZiFGIvAbTf&RZ(LEUi??aE330000 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/mirrory.png b/qucs/bitmaps/dark/mirrory.png new file mode 100644 index 0000000000000000000000000000000000000000..4a7bb15c7c68939bb52695fc8b814d1c9947308a GIT binary patch literal 464 zcmV;>0WbcEP)2v2u99AaD+9ixyoX4&7xD#Uz!lliGnrHK~)tZ zf*2!=F=*QsS(ah3Sn!P%s?}MgF-DMthyVbrwJ^rOS_@TuW6?z(mt`pfAf+_=Cn69L zv~4?r+c9E2k(f0}CIIx_YumOXkB7*z3@Ige@3kz;{0N@1gZwsHJLfp4a?XjWKGb#n zqbLfTCUv{r9_$q0j4dXFkN_l-KUMXPA#}Z3tX8W>`>$DXX?+h+5y5;u|4#C^y%ut!Qb=~*dmW&sBh+4d?H>A2*Yz*& z{c#Yzp3C+luSW<0MNweC-*+Tsxm?a(@4aePy!TrC*LViFVdQ&MBb@06O_l6951J literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/mscoupled.png b/qucs/bitmaps/dark/mscoupled.png new file mode 100644 index 0000000000000000000000000000000000000000..346b50dd19b29a5b8df67057800887005a860c51 GIT binary patch literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ?Vc`3yR!*A6nf{s5e={RL?XzjDF#q{!^4GbN5$z00a=Krc7;-jcF{LPoyBLMtT5V+D zHK)g(O>f`vuLq=F4qy#l!3R54bX0Dpm#S z9Ez8i5T)}yF4}yR*&5S@H`Cd!DJC5DxE+@H)H}ViLL}Hh(_`h`9ed4s>{yC8suw>m o$&pxFER>}deb(G9!KzWX`^zlFZS$Y*1bTtN)78&qol`;+0H_RKqW}N^ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/mscross.png b/qucs/bitmaps/dark/mscross.png new file mode 100644 index 0000000000000000000000000000000000000000..c054f414b62b41901929384dfdf6727efc1f9157 GIT binary patch literal 258 zcmV+d0sa1oP)&oLYPepLp*~##XhXH8qZel! z0cQ`&l>~CWjX?RTeVGp=k)_frL23IC$@?9Dd3V#T1T4*?t>e=Ej3zw05jxWn1N9ku z6Sk;mn-H0tNx(!v8^KFUP$&1UYnZ?kP!sTc%OsYo1h4oTE{=l5AKx&q2mk;807*qo IM6N<$f+0z1*Z=?k literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/msgap.png b/qucs/bitmaps/dark/msgap.png new file mode 100644 index 0000000000000000000000000000000000000000..8bd94b097c789fc0ef5c290a5d622327e937bd03 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ*`6+rArbCxr#bR9DDbd6RsZ(C zf0ezXSCgW~CN@F-*Q|U?ta(~rOglM$_MH6!4Qv@e#9*{w)xUQq#U@6u$4Y91ET~G{pe>*E3^I1CYahCDlO1(NlACZ ztr*b*YYG_mGwg|fZokQ4G2^2(#s)kms?+Nv-UiOs+a~Ba)hxw~w`ZN5-j8jpJKbgp z&U+Rz`-3pUTIH}`>)%RWHLT%YIFp?LWPC*41BN*|zKUj%SY>dO!TqygGheB=p8fcAopUDpncut*cC)!T`^IW(v7K7D%sg_cfEI(qhN}!$ j`Qr=^v<6r=B{Sr4MNe1!l@&V~=zIoGS3j3^P6Z8 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/msopen.png b/qucs/bitmaps/dark/msopen.png new file mode 100644 index 0000000000000000000000000000000000000000..add3a3aad547611ccb8c3507e97aa9027e03edd8 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJW=|K#kO=p;QylpYC~&ZR)%^26 z@QZpFpWK!RrK2;{ULR#X)wkGi`C(=GbN&nsj1oXpAf52+(a&R@D^CAmF)-WQz+%PX zko|;nx@|D?)%=yNTldK>XgytHXwN6UaGzQ>)IFInOOaq&u}eU{`Ix$!vD;x g6*hl`8n=Tn#LQjsT0`n=pmP{JUHx3vIVCg!05L{I0RR91 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/msrstub.png b/qucs/bitmaps/dark/msrstub.png new file mode 100644 index 0000000000000000000000000000000000000000..7ef3132f790ae72777efeb1606f566ab8fa1da92 GIT binary patch literal 283 zcmV+$0p$LPP)nTy8sEOgXg&)0z_P3;Qs@_;{ua?(WM+%0ziRavzHuL z0)T-~vX>pG0O;;3)01w(-Z!5T&^3s98LO6m0K*-)ev^)?k=(uHK3FoT!6OhMfI9@b hn$~(4z#F)pI{`Xfz#$|p1KR)q002ovPDHLkV1l;=Z{Pp` literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/msstep.png b/qucs/bitmaps/dark/msstep.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1ec1766358f2acd40914e954a0ac48ad2a8b00 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ6`n4RArbCxr(Wc3P~dS%72f?n zpj4Peh^O&_bN3_npN0{qWY_cV$o*K*{ngw!fu-lbe@=tV?&Yk4wsssoJ!~qBBJR)5 z9uQ#?O1mPT#XRYUM|}*N)9T*_o}Y~hQzp;rjLTa&mF08)58D~D{|dOBbdbH>`A9SN zS`NpRb@qx2);_)~H0AYG-;O-5kbRnL6FOXO@bCya@Sj?(>hS26g~|d^ho5N&I3yZ{ Y8Gp4ZW^vq72fCTT)78&qol`;+0P)vT*Z=?k literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/mstee.png b/qucs/bitmaps/dark/mstee.png new file mode 100644 index 0000000000000000000000000000000000000000..a84bc840637adeaa3661b4f442ed82de76015e10 GIT binary patch literal 242 zcmV-`Va-Nba81VJ?jOS(VHQoQH$rsi1un8o^s8c+gz6F@{e>MsF+>}IP3 z$UteL#8_>eeGE9(*13rc%_QLU9zp*>?+Y=aJL(9+MNa_Qsrhu@(ozDYK+QY?uenbM za}-MVKrI*2IpUj;I~J~AK z;1~5UzPME#*=v?)?wuj>N>7;kSi&Edv8f2VpF7aeAYH)pU**E@_gmu(jinzv zT-dp&@Wuh2&Y7oH2i{%$Fu1B3KkNA1=+^WBY9ZP)M;OK_`d*2ZjQSX2G2Y!T_wZVB`U${;VE63uf&Wroid|ehgsc zN|s56m4FY`OgdB4y^tJL;4Z`C9_TZF9H93Azaw{n`zjt~jw)gTu(*87J|J6a=Kf0<#OK{SJFzW!pg@OaMq*AwidBfu+_K2=^?o1k?WOo`zn43qSEBFjeP@ QGynhq07*qoM6N<$g3<0sEt43nIjj024#j@s%{C zA4r((mmx%tAhUc@0;(ot$AUaU6NpTRgir!1=0S~9s~E-b&NBfdzb8=|7K&cjtas{yL>x_})P1jaDy?H#570000!Zg|9=$wN!uW0ico@0Mt7LDOQ!;faU7@R5&T+fN3^#3zSdfzGvR^&m>pz6 zpg0r&j|~B*!K0^u+y)?<@OA)N3J>5m2H1Lg`?fJ4!84-V1|XB1F2U9C$JGwKBSuB* zJ7vIj1Oo~(pvmR=YOT|(Ni=~C;sKm#1Okx5s|;AhBY{!?GU`Q%b)5oW8SoCWb@%o` z0HX%%%|;ENV3B~~Fj{3GVkE`DY#c|(5fe71x7S{{_da4^1R33Q+-F-_*PgYC;S|mJ z{-ZwNX&`bmhKXAkn3c^=N7{;a`M}q@014N#?&u7qfmQ!UU0~O#E?}K7Q%dTil=b~I z0LBNHmP-L(X2EYWfLiL4+tWt$*8synwiKv)raq8O>W$?n)(JWG2tRty(y#yk002ov JPDHLkV1n0+oWuYC literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/mux8to1.png b/qucs/bitmaps/dark/mux8to1.png new file mode 100644 index 0000000000000000000000000000000000000000..7de74f5df3bd936568347fe990965640b52f3d22 GIT binary patch literal 363 zcmV-x0hIoUP)!Zg|9=$wN!uW0ico@0Mt7LDOQ!;faU7@R5&T+fN3^#3zSdfzGvR^&m>pz6 zpg0r&j|~B*!K0^u+y)?<@OA)N3J>5m2H1Lg`?fJ4!84-V1|XB1F2U9C$JGwKBSuB* zJ7vIj1Oo~(pvmR=YOT|(Ni=~C;sKm#1Okx5s|;AhBY{!?GU`Q%b)5oW8SoCWb@%o` z0HX%%%|;ENV3B~~Fj{3GVkE`DY#c|(5fe71x7S{{_da4^1R33Q+-F-_*PgYC;S|mJ z{-ZwNX&`bmhKXAkn3c^=N7{;a`M}q@014N#?&u7qfmQ!UU0~O#E?}K7Q%dTil=b~I z0LBNHmP-L(X2EYWfLiL4+tWt$*8synwiKv)raq8O>W$?n)(JWG2tRty(y#yk002ov JPDHLkV1n0+oWuYC literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/nand.png b/qucs/bitmaps/dark/nand.png new file mode 100644 index 0000000000000000000000000000000000000000..f59053b3bedd254259288111b796cc7ecfae7a86 GIT binary patch literal 252 zcmVxm5qS(+38xCOqO zga9Nl2J?cL0oauqpmx8U0Efr<_z+<<0-Bf_P-1avgB^mT`!YJk_`>>3i&goBOXcGH+PQ>@mr&n$@5E+Q;PmdA}df(F~rhelF{r5}E+(!CIF9 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/nigbt.png b/qucs/bitmaps/dark/nigbt.png new file mode 100644 index 0000000000000000000000000000000000000000..f19a4b6f8a10eecba5be2dfb29ec8ae7aa084a91 GIT binary patch literal 256 zcmV+b0ssDqP)pCul#K5al&(1IBRw%thwV=~O+!;@`1YKl}?Ig^=zOL5G4Cx9k#e z6v7RF;ZSkD#}$BxQj8JW6I$F$%m$cRfv1>8T-AgklnZLbT>vcNW&qv*jomXza12Wp z^y1n2zY0*BYEuC6xqcG84!~u%dM}%PvjQ#8rdTiv@QD;yd%-1!7F%Edv8VJb&{(1d z$oqt0L2t;ud_aBOGVoOpJQ>#aepdXt4N#*tAAPr=+5>X07&(mKp03GnRpOb4KOaKH* zlU(A=0GK(&7~%OaVB`wqode*eKr4|sKu)j)K&wzqU4RtOx@Xvi+W=_4v=uj10d3`% zFcpBdhkvhNBzZLp$|-g+Lv^LfCGk`j%u+zBh*=G|0kq_I1K6S!|Fv9K1*WUODAygS+LI3~&07*qoM6N<$ Ef~DPK`v3p{ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/nmosfet_sub.png b/qucs/bitmaps/dark/nmosfet_sub.png new file mode 100644 index 0000000000000000000000000000000000000000..466bb9725010c3932698b1c344920c903a403918 GIT binary patch literal 259 zcmV+e0sQ`nP)V&N$2%vLkyF@=;5D2NM~RuHYBn@W^)u`IDo*S z=Av~0VCFlRqdYmW<{yka|Zv$`_nV%!uKf{jRyPb?wUsemPur!BCwL7f2|^Ou(OkgrO=zFR zi_eJ>KF&2awzyAji{orySg`8*)d}y+d`}dhLSRuN$+ga?EDrp6n{Kd&Ho=tyj3Aa$hUZZakpdWF%-(w{Mr!i~C{utE>-iC_1y>DlVooL%&}-;`g8?|1mfd={Kp=o!5)|qL z0RvDF>9ec@`mXIjYr+KB1=aur7=dsBu#~4R*x9nP0RqtSOOTb+o{oS3w8txeXg9zB z+GFb-osuTNskl~2Jo3ZGarqpum+4rH-Dy^*Kd@-(%P~Hd_^+CaKU9_ z1i%!`U<@nJdtY%|o9B6-yFJTq>p9v0B@ltjxc){}G=^5}T?9m8?+C2j{#1cV%9aR- z(QrXDT82m#)|T7$*V}%p7b<$`r9O2{Cp8S~?_RrJv>WD#oEeRK=LHv%SE=a6J%p zx{L=h7?(7xxLq$ag7J(x5J`pOthr<>;H47k^z(AobGk0atX*pi^FosCWUMP@F@|nL znKrCr*pY3qe*(`|AiC3MJP~2M@69N)Ym6x?FuG7R{sZStR!i7yGq3;v002ovPDHLk FV1k%Gm;C?$ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/noise_iv.png b/qucs/bitmaps/dark/noise_iv.png new file mode 100644 index 0000000000000000000000000000000000000000..9d272075a068db7f50dedbc98b9cc3fe4a796797 GIT binary patch literal 365 zcmV-z0h0cSP)cD=SR6E)dhHU~Y9>$PAlH-GBQ>lc^6TFSaj_=#kMLBS<3 z0`L^fU<@nJTHA0-S(fF9-Jj*R^&D-$B@ltjxc){}G=^5}T?9m8mI7G%*jzDSdNckaNMosEU8RCV5B+$bT+zO{zm}jb_;_w zDZ!`=7)@k#JulAdj5_W_K=SE1*h5w`2cZZEicK!sIobil^g1&#(#F>5<|M<5gc5<&45 z1Pvfb#yYP=J?dy+Xkr80k~@f*Hv8?I*jTt)~00000NkvXXu0mjfI2m&# literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/noise_vv.png b/qucs/bitmaps/dark/noise_vv.png new file mode 100644 index 0000000000000000000000000000000000000000..ac6ee99b62ea4fd177fd547b5094e4418cf0c964 GIT binary patch literal 332 zcmV-S0ki&zP)kY#o41{5n>^~Hvq)8-@`qr+AEN%{iy?)C7Tk^ zgGMK$LGuXlGHw~L63*K+5mCkvpd}ft1S#=o3~hI2O47tpvgu+E$tabr7%>f z)^~<+6M!nG?b%5=;}Q_DPTP#KjNw4Ue(qFu1)by8XF#i_uW!j2Zubo18T&vs{d_z2 z=ICoDq;^|Jtz^9G6`E`~SJvV>%5s0G@}veZ9nQv1F<9@w-6Uny9BTL8;}-**5JPpMM? zU4ZyC{0JZbw1CTvF^MeSZ5zwru0VNiv`+=wh7uR{pF~k9)@w(8R zfx?P+e%~!N4h1M%R#TFx0OUjsg0nXrKq|)zfLe|l;J#v(a7j}$)Pax;Xhgp~kDmj7 zF$pa}EhFFEhCSj0;|6&2JP>*!viw*)YnvtTY-;&t0W1eD)NPp`9SR$K00000NkvXX Hu0mjfv^-+z literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/npn.png b/qucs/bitmaps/dark/npn.png new file mode 100644 index 0000000000000000000000000000000000000000..d6ab3a8c29f6650f78b547635b96b041f21ac878 GIT binary patch literal 251 zcmV7whDAD1!agn$b z!VLi7q~iFFD*yoGl#=M1qQjhH4#3h5)M6TO(-M|~T5%Tui?|s8KOnVT?Ig7gt(6l< z7l2E(sQ_iJUjW_wv9|wp2ex*Ai(Gs@bp)dTpKyV-6D~F+2n~!20PTckBx-j zms-;WfW()MpyiYUz@=xaYi>Jm{tHIpd+G?Z05{eQhao*rqFev~002ovPDHLkV1o9l BW1s*4 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/npn_therm.png b/qucs/bitmaps/dark/npn_therm.png new file mode 100644 index 0000000000000000000000000000000000000000..b27593a33dcec76eb1b43c885b971fef51f16dee GIT binary patch literal 264 zcmV+j0r&oiP)L9$5l8`Ep#pCwLS#q~7MKtK+6l`@#6B>q4$o+B zw9@PXjC_C#9y)^72PDBIcf!5}J*jR7;M}tZZB{`W?Ef#2*!R*ASOG5Fa+)FdzE8*i O0000(03r?m2*(L;;e+k29s7>E&v&f#mfNp56RzTK%1VY72&=YXsNZn56=OsfVS=dr~$Dd_=2dr P00000NkvXXu0mjfBpYjD literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/npnsub_therm.png b/qucs/bitmaps/dark/npnsub_therm.png new file mode 100644 index 0000000000000000000000000000000000000000..9a4c907f7d62d6d24458b864c9b0c9b169e87f26 GIT binary patch literal 285 zcmV+&0pk9NP)d zL|6cc@sd;RAp#Jw0e}n3Rm3;v7I3KpoGe1_8p4q+WIf@wEf;uc6&cW`MnRSv9jKmtFs1w02d;F>ck2Q)b_JCiOzN>9@eT3xvR j3#^Xu^X4Fm67u>Nf=R?7u0huw00000NkvXXu0mjfddqYw literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/opamp.png b/qucs/bitmaps/dark/opamp.png new file mode 100644 index 0000000000000000000000000000000000000000..8fc7b5066a1c2b703b914b3699b409e108b9048c GIT binary patch literal 289 zcmV++0p9+JP)3`C?(GB9GZ_jF?i*b=>N4+T&wn3o&hfE=9m1+hpo7hnz2>W0_>3eIF_ zrz~!$YM_-SOKqqCBrT|Q!yQ2DMi{`qxsj(b6d;FSXJ!EE^~4aN0Ihns#R2JjaCcy6 z7f4m-?JS;zzlpuCgL7Kd1%UJ}s12eX)x8cJ;#*W#0a|0WrqHUo8^B9-7l5Z~HNeon nV#yV3dFOHxS`L?d`vQCb_Cm`c14bhr00000NkvXXu0mjfgN1UY literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/or.png b/qucs/bitmaps/dark/or.png new file mode 100644 index 0000000000000000000000000000000000000000..de2bf82eb5f7278cb5cbda81066f60d949655a7e GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJU7jwEArbCxr+M==DDb#ERQvX? zeU-W6t^*1WgEi)_*kLGm(q{SFj<9b1y%F)b4Q~%r%Q(0Q&z4{isAZ`(W;}94CPKSI z;=s;HOgc}`FdwMOdDE;R;@q$A89_ zUb{1m5!2-uOpVcIq8m^%XQJ!Jkdh8mT|0K4pE6cxkSlOVI zAv3a;U7#aoa}B%OkZ{ Z?(e_463`EIMxc{N(O=w)nk&C=cs3||mPoxAg&*O#mD4VZirG77^p8~GNG5{8jAeI4; zvynKhSqjiv>$TQBDWK>q0O`!%9UyTod@4`~0I^c*rZfk#0VHhb0EzR4sGxYA+!O6} z0XXvUZVfLM)VQfS}N00fY!;lE(GxUS>_zAkMVoc05Xy>Dz6qy0Ay~<;*%m4 z4D$TrfIPWgtxcWKoB~8tuDMc><-kaSYf<^kN)I%MegTQID9}X~z So}01&00008&qaBbwYGEv@$&ZoU#06O4pza+OnxBv*0 zCAq}80Wfn;DZ%q$Ku-zeodpo4fR@M|pd^?AKxPnYO!l5o0rGQllw;l)s(BuyTm|_&ajoeTLhPnWH?+QSp z*j<4F`dbemrNR{W&4x<>q=5BK>AnkE0PEinm8af60A}^$A!+?%*Z=?k07*qoM6N<$ Ef{k2f+5i9m literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/pmosfet_sub.png b/qucs/bitmaps/dark/pmosfet_sub.png new file mode 100644 index 0000000000000000000000000000000000000000..f26ef05e33b46af0cba8feb95f5f104a5c2ea3da GIT binary patch literal 265 zcmV+k0rvihP)I3Lh@jk1kf#L_`vE-WfF%?TPz9y{um&`A3tA3%wx(+hrvdO(YQ^5>fM@bG z%mD!Xhg&T`ApSLW0DZ+4=BB$c$BA%y*+62W(*)I}iF)etsO6AORm937K_%k1bT(R)78&qol`;+0Qdu8*8l(j literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/polar.png b/qucs/bitmaps/dark/polar.png new file mode 100644 index 0000000000000000000000000000000000000000..a2a47803de43e7f15b148d56a24a8f7a91319ee1 GIT binary patch literal 329 zcmV-P0k-~$P)3`CowaQ{Pbltx5y<+xtP1|{?>MT7ltypZEl`1Rhu*0$E#kueF2xl`_Btjqrd zfWU+R&%>Y>1KY)z$EP$rJ0c4$50OX!B zfYu9;vNHkD)63H0`;fAe)$@x00-$NoHQ60$9}HjtX4lmSR8Q|EA!_rAKqQXZZKX|< z-+cfwBXp&9p9pwOkY#&2!xwavj0#XrIjmD5qkIz+mVugO)-2t4CHuCJgv2NcI-UQqoPt4_C~#t{yzRT z00o8unBh!W1n}Oovt4!wFj8)YR%KEEMRA8%m4g7P(h5K(`v*`lUIjq%7l4X!bQP7V zj}T>mSlJ$0srnRvd7mjq=M)e-_ltl6fI^&|Q}syztl7*qsebMYpwglqKMQAeDZmOG zbFS-t4nSpu?v%Yf0+t3eqHj+D>j&Eax_9v^vf{nm0;O7!0W*xYA~qLFolxobCZl?8 z@KPuAg*5U^$$5;LG!2>Jm_jtFeVzCyQ2-_UtcGIWNCA*1$^=yMo-MKIPKd6S_augy zRlU3uW~8I`t3)7^dG2?CkHjb)Y#(5$q@QLHBq~H*5DlIzg)+dX0R4YTF?#tafSvom Y2L z`y-9D6C5};>TZ4HCH}6$Ski8*%HCN=bfwpvT-VJc=zlwaK|<)d691RWpF$UKi*<-f zGubmP`Y=u2{l=V4k^h$bICnMLhrNNxv*AJZfhYHN{}XNPJ$z{Kg?oEX%9{ty-KVhm l{PPRD+HvbF`!!*JYD@<);T3K0RU*?O0@t0 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/potentiometer.png b/qucs/bitmaps/dark/potentiometer.png new file mode 100644 index 0000000000000000000000000000000000000000..16c22a89c761cb927ec7fd5b25a529b3b9ea6a6a GIT binary patch literal 262 zcmV+h0r~!kP)AYemwz7Ip}*T9w9uUaSZp3264G0KAiH zVEb=~`*_RREgAtFbXgNGbifZk}MPqEeg#xC8EhJKzqy0C|Y6ACwv*^8f$< M07*qoM6N<$f^}AH`Tzg` literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/pshifter.png b/qucs/bitmaps/dark/pshifter.png new file mode 100644 index 0000000000000000000000000000000000000000..60a0acb0c744c1d38c2c9dc84ff3e37bb1c2b6c7 GIT binary patch literal 267 zcmV+m0rdWfP)x1Z;P*eas2HApw{{*rAVRP!H(dj zh7#fhV41gf#rCWR@cSM;U#Z0Z6rrz$D>H6=-$#L{$H)}8H-L57UWc990(NF(_7s4h z7wFu`vOj#l0KF_m&PVGoK;|e~LxMv9h$C;qj`iUdFa?LeQmuH#Av;G>1(@vFz-Au; zD6&tBP?0@!3TCB6-y5C+)KO;lvsQctCaNik0v^0o;|t(Smdv|0nx(&Cy$@d*08|5v dgp6%=3Z4cD_#qJL!EXQn002ovPDHLkV1jiEcNhQw literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/rect3d.png b/qucs/bitmaps/dark/rect3d.png new file mode 100644 index 0000000000000000000000000000000000000000..6c0d0c9c0ef08111ad5e4ae74fca19ee1459e1df GIT binary patch literal 236 zcmV+lx~H z%INbv^%yzn}5Nq<(i m9H2oFFvHJKx)STS7zPKliF{xsz)&@0fJta|Q(hyw#73s6|U@uY7= or0xQa^=B^HAIJ{iQfN59CfQb@=qJ#56KDm4r>mdKI;Vst0DbW-nE(I) literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/rectline.png b/qucs/bitmaps/dark/rectline.png new file mode 100644 index 0000000000000000000000000000000000000000..7d78537d33d58fb8f6ec9070b24df166da05c37b GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJO`a}}ArbCxrzY|>C~&lXRV)1O ze9_nIR>_&5d&|z%U6`NNef&AIVcS{%J9F$U8mu4i?O^t0pYc;lGRTExXExIUC(|`K z44rS8IvBLRJQWklX6i6dx}r5*l$$Z7L)12qA?SE)X5cl`om(f%#mKHMw&ncHUOE4a z{#wbs6I}U~Zl<2G{Qr>Q(m`YI1)odXTm5#iI>;Z)W%$LRG?`aZJ%;J;<5jyEcNw^` hO%Q#}@D61E9lL|Qif`oDP61ud;OXk;vd$@?2>>krSeO6+ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/relais.png b/qucs/bitmaps/dark/relais.png new file mode 100644 index 0000000000000000000000000000000000000000..b36c57649c5f8ff5f6bc565a3efd0aead2293f63 GIT binary patch literal 268 zcmV+n0rUQeP)`r)R0@Do&bg$N%t}DTBNKc89;E=1>5+2n0RR-?r5(psx1$1(21Kw@dyW{E zV^@F+*eV2eBYUZuEP!LuHfY;WaE_p~-$=SL;*$0NNSXHRS`}*(O6xjXf}{WPTW|tE zNjb}OBt8CLGKjeTdItb*zgVKce*$pb3BRp)X3lGU&DL&h;^8E`8c^%!uD}l$=<``Y S+l~7G0000>cyS!1tN5BL@UoIU7#8>Q|9r- o!d6~|M;>~-AoCbFmk3)hOf#}oY|%3)06L1n)78&qol`;+0Ivu{H~;_u literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/resistor_us.png b/qucs/bitmaps/dark/resistor_us.png new file mode 100644 index 0000000000000000000000000000000000000000..8633554f170a1e5d93e9d624bd455f6642bce6a7 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJUQZXtkO=p;Qyuvl6nI!p`@i`w zA6nn^Eubml(5x8+k@_wgZww{`q3BHfwzS4 sHs%G(F6=tbcA@p671IR-`Va-9+t@5<&`n0$Ipb{}7?j=f{(3IySq~W_peg zP|D|$g%$OOW$c=2d0*!K2+$5`-^_Wv+IXcuT3$gtq)A>xLLsS!Oymino`F$8T|yS( z-j;1`YAprQiqH{4C6FktQCz=TT#;l*%(7aBBtv3`1tE)%#ytM~7)>-gFaBITf4gdfE07*qoM6N<$f{kc$E&u=k literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/rlcg.png b/qucs/bitmaps/dark/rlcg.png new file mode 100644 index 0000000000000000000000000000000000000000..81e771f50d281a7def7ad118e77416c052d5e30e GIT binary patch literal 276 zcmV+v0qg#WP)pE_dgW7i4zkR!k}QP?LP3Q5ehsW6xz1BcHYflzlF=#U z@}AUra^3V@0PK(hYXIJVbWeg9V!&dAoO^QX$%hO`XW7iO4F%SvV=y5AnNb8FTdH&k ztR7%vsnaqBZOPM3IBP`z&mcM;{eGaC0!YR>1G0e5H{zr0zW^x9#xcJcFJ<7-lmq8e zYTm=}13)jKyV=nbvCBYq@-fJ(_sK3bime56HJG=cOaPS<|wF`=YVxSn% a4154W?)f43hhq`|00008=Hv|3+Dk8dwfqne%`z9doKpjdUXJ*;v(9w)`BD$fK1vUI`HW-70AfT@6 zCK|Z*(r`GOvQdktffuq6SROgFfN!Kc-?_nA(1oqw6|11yU4!-3^&D+XcRzTAV jFjBu+Yn}_71>|Rct9j}dXE+nj00000NkvXXu0mjf`VZJ4 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/rsflipflop.png b/qucs/bitmaps/dark/rsflipflop.png new file mode 100644 index 0000000000000000000000000000000000000000..a0ade64af132acb85715dfd16a0f798d0395d1f3 GIT binary patch literal 289 zcmV++0p9+JP)-|7dfU&@OjF|gE(YwX^ddWU?eCAx_SJtcoJpexG zLqwT=>b_ZzRGD21XxVw5N5v&=tb^(x^MCs- z01QkDAc2uH3!t;l)=t|HAaX8&ezk!BjN=s$E&x+HJBUoby`;VXv=OR;H+T%dte9PU z0q_D^py|X5)@@k|Ak-+ZHwWmP5O59q0mw3_%tf?iB@u~70WfV4n=BDq(K3K8xy`1t zE#CmyX%+s%J%O5#w*uI9*`0I&s7UBa+kGm~ky~bfqXTT&40u6GyMW2W zR!DEZjyV0-Nmvo2tmjY*qBgKXq}9&bs-YSp07i(i8L}|093x$4E+5RqBca;wPFRuD ziY=;(;W!E63Ac`ZQxC_13o`${I;B`#zBMbOl!40kp3dVGsFq?Dc>A00000 LNkvXXu0mjfmW-Ps literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/smithpolar.png b/qucs/bitmaps/dark/smithpolar.png new file mode 100644 index 0000000000000000000000000000000000000000..eaeefb48d94c20e03c893f7dcc9eabff86f5f240 GIT binary patch literal 369 zcmV-%0gnEOP)AUiQ_;g+uAXds~p$__7T8b*5_GbfPux1BI68V^K&8(B)ijflB$D$wahRGDV0 zWT&@cHUdcQz3&2V@jxSWbR6HhASyb&X#VwWh`dIyY%9w7^l{3x;*87>Xc6Ibg-p7# P00000NkvXXu0mjfz|WY? literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/source.png b/qucs/bitmaps/dark/source.png new file mode 100644 index 0000000000000000000000000000000000000000..b42413725071fbc303de3a5d84b0cc43f4168fac GIT binary patch literal 278 zcmV+x0qOpUP)7p nrU1PKrkNYdJ)lV<#kd2!4z9x?;iFC+00000NkvXXu0mjf*~MR1 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/spfile2.png b/qucs/bitmaps/dark/spfile2.png new file mode 100644 index 0000000000000000000000000000000000000000..a8655493c83a9c28b9e1f305017e2c1c3ffb97de GIT binary patch literal 278 zcmV+x0qOpUP)EC2ui07*qoM6N<$f+N^(d;kCd literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/spfile3.png b/qucs/bitmaps/dark/spfile3.png new file mode 100644 index 0000000000000000000000000000000000000000..c4af9c00672fe8198b15072b4aa7365489a3c869 GIT binary patch literal 295 zcmV+?0oeYDP)gq;2Q=|$Yj_;D5iJ8C+458CnpZ&kcQlPCI$+wmb*}(7udWp+ tza!~mwkv>T-=4O<9zu`Er(3W*zzNq$ATad~$L#YKnJR4@GD`L!Mcb0vno+ZD{d)vjt2em>c0iMiO@ z#VP!PyEAP|?f0i}C`7v5;91UjMsB9uM)igWjx_Iv9czOx#HaigIpcBhz*3gFqwi-I oi_FeC6#CIehIax3=Y#{?=dI7m^Dx;Y1HHiD>FVdQ&MBb@09A=u!2kdN literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/subport.png b/qucs/bitmaps/dark/subport.png new file mode 100644 index 0000000000000000000000000000000000000000..cbc7f03a409ec3182630fb7eb8266b0292b1fd17 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJMo$;VkO=p;QylpYC~&YmRe$=w z|B+@G|6Y@+xz4<^*0}e+v(N~d)UNVeoaq7s?}Y<$Y-iTovtG999}_?S%ZL7ni+`?P zdzaNgG2<`qnUaRE-M5_DEE5^tPixQe7voprX^?wd!py<2w|Q&*LD%`W*e4u%VWs0} h!thodXc)*m&R^f$6wN!PC{xWt~$(69CUdM4P9MT7aLfqAdkI7( z90r#rt_M-1da9HrX^I12w+2exd0QYA@=Uj^>jbjcAYXgNaSTqcb#5Gg1&l2haWG?9=0jCIvE?x0%HQ0Spqt z4J)md-JQ>yH#2K1>%v1_*uS*^SQt=QmX&iCVv;15@B5m44Zv}n*-~Kwj^o%0f1WNX;Lz9@6-8Lc-waa4h6DzZV{ zJ%}DU1nAZP$n*To^Smbm*4XL=AbAstUx=Iye>2T^JAUZZyZV+It s7IDWrK8D@Vva?X$hiU<^Ft9N23-2hU4-k3BTL1t607*qoM6N<$f}FtBVE_OC literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/switch.png b/qucs/bitmaps/dark/switch.png new file mode 100644 index 0000000000000000000000000000000000000000..3b9714caa4a709a4346fb98d72d3b8f1e5f7226a GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ37#&FArbCxr#bR9DDbd6RR8wB zf0aFBRmP%AB1xSpX?rU&cRk)BP<-pple0fL84MVh4L;~IpNV;rrn=}Q|7^W4>)x0j zyrs_~z{$tBhNFz}mV$S1@#e(~jg6<>dM+1XyENRKNq5TklXrUSwj@Z^vD$U0XhaJ< vxIag237{117H*qZ)T~;&98P7=r#sVS3j3^P6}LW)(`+0_%RK51*B;Kv7~LSn}HG72tfOm zF}K!ezv~Dh4FDxWLfvM75^z18T-f zs10}Rc>6veD?$A)!BX6j8xa!VQ3ep0a2Je}9>12ao^*%_w-+1(5cL97A)0qHfEHSv Ze*j7!R4~xIwfF!4002ovPDHLkV1nZ;gv9^= literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/tabular.png b/qucs/bitmaps/dark/tabular.png new file mode 100644 index 0000000000000000000000000000000000000000..15b0e7317833d83edec736df6c1e613c8bce411d GIT binary patch literal 346 zcmV-g0j2(lP)a*y>`q>n~Y+|)iQvi%R_%aVZySLVd06Zyua52z8-s z0rPa3$c&s>V#|G%a5S+6(lS!!yVCeb+|_W%F@ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/text.png b/qucs/bitmaps/dark/text.png new file mode 100644 index 0000000000000000000000000000000000000000..2fe75a1509cfc7fb1fc17fcbd8fd7ea3d7778145 GIT binary patch literal 608 zcmV-m0-ybfP)gR?eBqzzc?>>`e$z5K~IrrS}=bdx!eQ~=gJlqx5cU1wL zR-lj84T$!|us@i#)G5GmB9R!*7V~<&Z?Oaa1E3x8t3pCRbm0GP0^y_rF92980`L<5 zdRYNH9?z$EJpQ1NNFWe62hLYcfNlgnTM5vH9^#gBvhz(_unNF}*nIEs4W@knsP@d; zt%3=F8=-$fd>i{4{@21^gMDiU!UVvNP*eyFVPD|?A^hq%s$;1gCIBIXri4%}wyH{$ zm_Mrxd;Ff%sx!eZKs^F~h4>Ekvy^X!_?Cz_V*k-W*adimz=1`X+lc2}Ky1b_=0{2e z5J6y60MudMWcg$p4vCGF0-zc3UqU>DJuMb5)P@%3{Ir6w(}E`es7;j_sq)HQuG;WX z%zKKxdtZPf7B>FMDN#UAcw{cALLj;dlu_rVY$*US|cu3Bv=^j`C;FSPS z=USa_tI>cCC%HX u!{hvTEauK)f0g;VQ(#li`LrrPwE}lHcC{h$eAfX00000m6a$$6X3Eblk89O35B;c)%NFbFUftC_2V)Z#bqax5UQyqwayk7wUuvGU}gelc7ZH-*+uj-1h(x0 z&Aj)f0B*w-Caf_=yTG&!kpkMSTAy2H!Yu@>Ro8K*f5n>QvzJv1)Agu0`ZD^Px8Vh8 WS57dS2$LEB0000$4m v!U1;&kT(H*6vx9vQ?8?b)tAu@Q6A$2*Tjn<7(q$F00000NkvXXu0mjfAt_$P literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/timing.png b/qucs/bitmaps/dark/timing.png new file mode 100644 index 0000000000000000000000000000000000000000..1ba30d8605ef00c1546401de72994bd26d942880 GIT binary patch literal 276 zcmV+v0qg#WP)8nJRv06MW(1Oa+EZUg8ZLJEk_Mi@8(MgbOJgnU&2OCbtCy6bPxg!(93 zG2>B}7#iTIJ@Es0ssNK0nsC=(R`D$pGF|M(m>xh&Ww)58$YliR%zGD?cK&LN3osJT zHl2K1jrkkFY}cb3lUc>kgtHN>cIPPw?}C{LSLdrCJfBc|;7;f3T)B$78X^CJdJGAW a3VZ>wdvEzufucVQNE%m-!bqrLtK{jAobRBKAI;F`q50yZ5WsUEi>N&wb-9UV3p(-oh7~fTrK!j9JZGs%XBHZw=6O44$rjF6*2UngC2j BOpgEn literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/tline_4port.png b/qucs/bitmaps/dark/tline_4port.png new file mode 100644 index 0000000000000000000000000000000000000000..d822ec043c143f43efa35c7f0544292ac90a46eb GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJrJgR1ArbCxL!*Tn6gZB|KJu5} z)!cAvhT8I)mR9*6k1d+tY44RiUe`o$A|J7GcX)$sZ zoWA>$bHz4?QV#dV&oVYot&7?$qKM4@Er=^}6 n5%`@LTI($XvI49MEUv&E0i;SWKsVBK00000NkvXXu0mjfN%*0~ literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/transformer.png b/qucs/bitmaps/dark/transformer.png new file mode 100644 index 0000000000000000000000000000000000000000..8d054f0f85e5c9c715c1c58526350bf6443e41a0 GIT binary patch literal 268 zcmV+n0rUQeP)K;N}@sXelovp5&=~Z59Y_^+y49@k`;AN0#?8RA__z?kOJAcFq7B+hsMLZ zz)Pwg@XA;skxx8Pm_W9|%oFGdTLhLAus)c10I9!}X^DWXYqalCP@AU+EGbYP_-_+# zzYEaYP0NJFU+M>ti{^4aFzbjAaEZCSBSL{c#eLNg-9aGAv2+stfL2t;)h_aBOGV(W*AG2nTG#H6vmAUsb%o73ShAI_gb0cuM13rNMJoL6e~6;vB2r5!R7}bl73>AL3jAMzwnNkj$Ue6z)rLso*^c~OgUAYMB}WjH0$pCT zQ)C~H$pz2?^d!5dacj+ P00000NkvXXu0mjfqGxLo literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/truth.png b/qucs/bitmaps/dark/truth.png new file mode 100644 index 0000000000000000000000000000000000000000..ef9864ae8defd5392223e0201fc06a301d22eef9 GIT binary patch literal 291 zcmV+;0o?wHP)!Gs0VXg}miI(J p5h7+ZFX@KAD@57MSJ%6ndI9=IoIheqi@*Q?002ovPDHLkV1l*Ybxr^P literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/tunneldiode.png b/qucs/bitmaps/dark/tunneldiode.png new file mode 100644 index 0000000000000000000000000000000000000000..bc1efa0fa99b102f82e0eb268c8416a1d7705165 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJRh}-6ArbCxr#T8WC~&xbRxAAP ze9_lO% z3Zq~ZchvV;8~u4aCT^>EQuXEFYYvfPJ6S@s?)lgnt?dkZF1Xs!GXBh}%+=Sg-MY{< z$HnMy$k%_)2YwrNez|pubA4lAlJ2{&w@z)&^55GQ{he{W>+17|S;AQN6dEuvDKIeI b=Dbr7u~Jd;`ie%Ns~J39{an^LB{Ts5camPX literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/twistedpair.png b/qucs/bitmaps/dark/twistedpair.png new file mode 100644 index 0000000000000000000000000000000000000000..f733fa182f9df1232676051f5314aaaa11ff5dff GIT binary patch literal 237 zcmVb09v%^JfEe<^2O0n}YnIcV(*;0d^eOjJ&8QWS z0N&n9`%C~vC(?7Dt^hDspf5x!K&}o%0NOmRT-%w~z*AJ?`LwkQ2*&jsm^qQ9-d}1% vSAea5!(Yw=nsm9&0~!F=c_08nff)rZk9^V{4;N}o00000NkvXXu0mjf`>bDM literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vcresistor.png b/qucs/bitmaps/dark/vcresistor.png new file mode 100644 index 0000000000000000000000000000000000000000..a3d6c47f92ae462cbacbaab520be43afb64e5a06 GIT binary patch literal 243 zcmVwcAS0WGzwiak7O4Um4n7Ok8h+4M-YRMlyKma6cw=>N-hX5c!pUz(M z46FbOkS9d;7=S6DDj-HG*QfDNny#A(^Y*H>)eFEDVb8aDrYayCk!ps{ftHDkz^*ll tr~VCpc^^RhGW0%x01P#u0hj_U3S21Uza6{q7GMAX002ovPDHLkV1ld4UMv6r literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vcvs.png b/qucs/bitmaps/dark/vcvs.png new file mode 100644 index 0000000000000000000000000000000000000000..764adf36b5bf97cec2cc6c0c253b8e23203e2719 GIT binary patch literal 266 zcmV+l0rmcgP)-`Va-2}y?3nTOct*cq^4NRY z0N@5pnwehe_(oK#(gIOor60WjYP6)iD?2-2aqHuN8uEz+BLFT)w>@n+dw?oV^L?(F z0W7wT_MUR)vI80bH?Mu?;(#V1%`brGJ3#x_k5bw7t>bbIwB^OM;?OFfh^0QjHB@sB z%yi^|8|~rrrTHrWmj3_=Z}0BmuF0L1%oeng9r0?@>>WZpY(*wFyq zNh4hW1E9gtb*50)w}A#lWo95C1uOtkY+C_DFM$}LtU6l(tO7O>Yg4)gZc)H1*O?mY z@+Pk1m9K1}QWof96aqPU7(lyVOoGmcaUV1X&XU>Rk@+xFCIo<5f>^Nwz+TnM_{#-o w>mjFojRlk#DGQjd-!rN(!1vdTGTK@E1AeXJA>KGKUH||907*qoM6N<$f-1Fqg#Z8m literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vfile.png b/qucs/bitmaps/dark/vfile.png new file mode 100644 index 0000000000000000000000000000000000000000..636876d9eddeb4b2ec79371e899968e5759ca493 GIT binary patch literal 330 zcmV-Q0k!^#P)|-G2WOPa&%qdbsi$T{_=E%2zPt4Hp4G_KR~Mk^$@H;{b3QdTG_Boi%d3b`?d4 zXrS+JsY_ahv^BE?ks5N4e(%&}gw6r&2JuqP_f1d2AV7ar4>4B(s8{X>ke-28e@wn# cvzf2U8+5A{FxRxzuK)l507*qoM6N<$f(jsqS^xk5 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vhdlfile.png b/qucs/bitmaps/dark/vhdlfile.png new file mode 100644 index 0000000000000000000000000000000000000000..8a13f177b4be2511978c812091e32ccaa003653b GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ4W2HJArbCxrzY|>C~&lXRxAAP ze9_nER>nDl6K5m1|L>UjOK!eHW})24$a+p@M+J_WW(K8a6YCfmvKn5o38^tpJDoN8 znsH)6M?=f@*xA2Wf_bKxoM&zKI3hGRm0vw`Z7IhmrnAzEA_{XwuQb^zU2@fCaGe?P zx#tIG<2Dmr|Df4B1uo3;(Ob8%u$QH?(5nc1Z&F)Zl4FX ddx!81#wBmpD&9LY^()Zr44$rjF6*2UngE(bRj~j7 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vprobe.png b/qucs/bitmaps/dark/vprobe.png new file mode 100644 index 0000000000000000000000000000000000000000..7f99b1a47065d53c3e5185e2fbdeec16f13c5a6a GIT binary patch literal 282 zcmV+#0pk`2L6TQPQwLLezvQU?ElMHiCH_KIS}{e`mA)VFJuKuWGn4#+TkBz$zdL zMSmy+P~ij#rvNfeuy7fGOsLDT0^I^Y!j_o+Rtn%HV@IUjUW_{hRsyT08lnt9*V_ZI zKy)71fz|vY5ZfFepmqQRV!H!e8f#ho2SD@zlJ108aaMe_oMcXS3||0p;69D6+p5(0 z7VZHO=Q8{VAy2yaLDKF(YZF$9KW$5>v5-e6`dYpKkOR>@fW)}~oCHZG`v8q|0Wy04 gfrbF8$5H0{0MPM&Fkb{9BLDyZ07*qoM6N<$f@nZ*g#Z8m literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/vpulse.png b/qucs/bitmaps/dark/vpulse.png new file mode 100644 index 0000000000000000000000000000000000000000..c6edc6c17188e2074e273e26c858028cacd78a51 GIT binary patch literal 286 zcmV+(0pb3MP)0PAr1$9qW%8(PF_s3eXB*IU0%P^7>MkJRQt}6fu@KJ5zn*mxo-Bkf(1e`JNR>1T1 kdnHR)f$!JMe-d;X>z@JLT{K)0Hej_6!~9q=rr z_2mvApa?m9AMn7v^&|H}Dd3H_k76xEo+w&$+6Bk~y*Xp~6$0d^+C88fV71*-9f*vI rJ?7mGAh+LNwxk{S|C&LSW(0o#5YNvc3BKj700000NkvXXu0mjf@~V68 literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/wire.png b/qucs/bitmaps/dark/wire.png new file mode 100644 index 0000000000000000000000000000000000000000..dfc91dfc2bc70dd22f0f367b3ef977d67952b1df GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4flRRAjQUFsA7cm!TO zga9Nl28)6W1F$PSKV)q<}8)NAYcpSMLLAHu))&^|uAE9QYpx5b>y03;?7K zVO~rCH8BQ@f}{c1l@?&H&-?&f9v|0>DwIXQ@{b1kim^D2J7N{wVzU=wr~^cu0=SEp z-dI+JcE$q{NW!#(v50;*haf7@Tekp~11GvA V;33;5Cqn=L002ovPDHLkV1iMnXmS7m literal 0 HcmV?d00001 diff --git a/qucs/bitmaps/dark/ysmith.png b/qucs/bitmaps/dark/ysmith.png new file mode 100644 index 0000000000000000000000000000000000000000..da8b9cc4d322ec83a6dae041382c52d4652f4778 GIT binary patch literal 361 zcmV-v0ha!WP)MJ0iB&$M4H7_Sy>qOdfRcb4+0kL+u{Kyu*!UR%#c|9#3M~tNu8SW6Ot~u6 zvo(l36R9%-O7ST>u6h6?@r?kR6vL_tjG~l=TM|HxXLN_k=1u}5E%eU0>qMYyw~yC= znrlTnSb?vh1FC#JqJ%80Y+T)pr)HgQ$V5X`z#O5W`@k#-RPoW?-iQ?at}Y#JWBtF< zlQnO}Bayh;${l0vKO>ayNB<2`UqCIHUF-5Xnu0rff92}~fYbSONO8+M00000NkvXX Hu0mjfOKX}- literal 0 HcmV?d00001 diff --git a/qucs/misc.cpp b/qucs/misc.cpp index 31c90806..3b782751 100644 --- a/qucs/misc.cpp +++ b/qucs/misc.cpp @@ -46,6 +46,18 @@ bool misc::isDarkTheme() return is_dark_theme; } +QString misc::getIconPath(const QString &file) +{ + QString icon_path =":bitmaps/"; + if (QucsSettings.hasDarkTheme) { + QString icon_path_dark = ":bitmaps/dark/"; + if (QFileInfo::exists(icon_path_dark + file)) + icon_path = icon_path_dark; + } + icon_path += file; + return icon_path; +} + // ######################################################################### QString misc::complexRect(double real, double imag, int Precision) { diff --git a/qucs/misc.h b/qucs/misc.h index 3cfecde8..2f5b9608 100644 --- a/qucs/misc.h +++ b/qucs/misc.h @@ -27,6 +27,7 @@ class QString; #include #include #include +#include #include #include @@ -77,6 +78,9 @@ namespace misc { p->setIcon(icon); p->setIconSize(pixmap.rect().size()); } + + QString getIconPath(const QString &file); + bool isDarkTheme(); } diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index c9a7f47d..fe9b0b8f 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -729,14 +729,7 @@ void QucsApp::slotSetCompView (int index) if (Infos) { /// \todo warning: expression result unused, can we rewrite this? (void) *((*it)->info) (Name, File, false); - QString icon_path; - if (QucsSettings.hasDarkTheme) { - icon_path = ":/bitmaps/dark/" + QString (File) + ".png"; - if (!QFile::exists(icon_path)) - icon_path = ":/bitmaps/" + QString (File) + ".png"; - } else { - icon_path = ":/bitmaps/" + QString (File) + ".png"; - } + QString icon_path = misc::getIconPath(QString (File) + ".png"); QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(Name); iconCompInfo = iconCompInfoStruct{catIdx, compIdx}; @@ -793,14 +786,7 @@ void QucsApp::slotSearchComponent(const QString &searchText) if((Name.indexOf(searchText, 0, Qt::CaseInsensitive)) != -1) { //match - QString icon_path; - if (QucsSettings.hasDarkTheme) { - icon_path = ":/bitmaps/dark/" + QString (File) + ".png"; - if (!QFile::exists(icon_path)) - icon_path = ":/bitmaps/" + QString (File) + ".png"; - } else { - icon_path = ":/bitmaps/" + QString (File) + ".png"; - } + QString icon_path = misc::getIconPath(QString (File) + ".png"); QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(it + ": " + Name); // add component category and module indexes to the icon diff --git a/qucs/qucs.qrc b/qucs/qucs.qrc index 13eeb50d..3b13077c 100644 --- a/qucs/qucs.qrc +++ b/qucs/qucs.qrc @@ -315,5 +315,169 @@ bitmaps/dark/and.png bitmaps/dark/andor4x3.png bitmaps/dark/andor4x4.png + bitmaps/dark/equation.png + bitmaps/dark/gear.png + bitmaps/dark/ground.png + bitmaps/dark/mirror.png + bitmaps/dark/mirrory.png + bitmaps/dark/port.png + bitmaps/dark/wire.png + bitmaps/dark/andor4x2.png + bitmaps/dark/arrow.png + bitmaps/dark/attenuator.png + bitmaps/dark/biast.png + bitmaps/dark/binarytogrey4bit.png + bitmaps/dark/bondwire.png + bitmaps/dark/buffer.png + bitmaps/dark/capacitor.png + bitmaps/dark/cccs.png + bitmaps/dark/ccvs.png + bitmaps/dark/circulator.png + bitmaps/dark/coaxial.png + bitmaps/dark/comp_1bit.png + bitmaps/dark/comp_2bit.png + bitmaps/dark/comp_4bit.png + bitmaps/dark/coplanar.png + bitmaps/dark/coupler.png + bitmaps/dark/cpwgap.png + bitmaps/dark/cpwopen.png + bitmaps/dark/cpwshort.png + bitmaps/dark/cpwstep.png + bitmaps/dark/ctline.png + bitmaps/dark/curve.png + bitmaps/dark/dc.png + bitmaps/dark/dc_current.png + bitmaps/dark/dc_voltage.png + bitmaps/dark/dcblock.png + bitmaps/dark/dcfeed.png + bitmaps/dark/dff_SR.png + bitmaps/dark/diac.png + bitmaps/dark/digi.png + bitmaps/dark/diode.png + bitmaps/dark/dmosfet.png + bitmaps/dark/dmosfet_sub.png + bitmaps/dark/dmux2to4.png + bitmaps/dark/dmux3to8.png + bitmaps/dark/dmux4to16.png + bitmaps/dark/ecvs.png + bitmaps/dark/edd.png + bitmaps/dark/EKV26nMOS.png + bitmaps/dark/EKV26pMOS.png + bitmaps/dark/ellipse.png + bitmaps/dark/ellipsearc.png + bitmaps/dark/fa1b.png + bitmaps/dark/fa2b.png + bitmaps/dark/gatedDlatch.png + bitmaps/dark/gnd.png + bitmaps/dark/greytobinary4bit.png + bitmaps/dark/gyrator.png + bitmaps/dark/ha1b.png + bitmaps/dark/hb.png + bitmaps/dark/hpribin4bit.png + bitmaps/dark/hybrid.png + bitmaps/dark/iexp.png + bitmaps/dark/inductor.png + bitmaps/dark/inverter.png + bitmaps/dark/iprobe.png + bitmaps/dark/ipulse.png + bitmaps/dark/isolator.png + bitmaps/dark/jkff_SR.png + bitmaps/dark/jkflipflop.png + bitmaps/dark/line.png + bitmaps/dark/log_amp.png + bitmaps/dark/mscorner.png + bitmaps/dark/mscoupled.png + bitmaps/dark/mscross.png + bitmaps/dark/msgap.png + bitmaps/dark/msline.png + bitmaps/dark/msmbend.png + bitmaps/dark/msopen.png + bitmaps/dark/msrstub.png + bitmaps/dark/msstep.png + bitmaps/dark/mstee.png + bitmaps/dark/msvia.png + bitmaps/dark/mutual.png + bitmaps/dark/mutual2.png + bitmaps/dark/mux2to1.png + bitmaps/dark/mux4to1.png + bitmaps/dark/mux8to1.png + bitmaps/dark/nand.png + bitmaps/dark/nfet.png + bitmaps/dark/nigbt.png + bitmaps/dark/nmosfet.png + bitmaps/dark/nmosfet_sub.png + bitmaps/dark/noise_current.png + bitmaps/dark/noise_ii.png + bitmaps/dark/noise_iv.png + bitmaps/dark/noise_volt.png + bitmaps/dark/noise_vv.png + bitmaps/dark/nor.png + bitmaps/dark/npn.png + bitmaps/dark/npn_therm.png + bitmaps/dark/npnsub.png + bitmaps/dark/npnsub_therm.png + bitmaps/dark/opamp.png + bitmaps/dark/or.png + bitmaps/dark/pfet.png + bitmaps/dark/pm_mod.png + bitmaps/dark/pmosfet.png + bitmaps/dark/pmosfet_sub.png + bitmaps/dark/pnp.png + bitmaps/dark/polar.png + bitmaps/dark/polarsmith.png + bitmaps/dark/potentiometer.png + bitmaps/dark/pshifter.png + bitmaps/dark/rect.png + bitmaps/dark/rect3d.png + bitmaps/dark/rectangle.png + bitmaps/dark/rectline.png + bitmaps/dark/relais.png + bitmaps/dark/resistor.png + bitmaps/dark/resistor_us.png + bitmaps/dark/rfedd.png + bitmaps/dark/rlcg.png + bitmaps/dark/rotate_ccw.png + bitmaps/dark/rsflipflop.png + bitmaps/dark/smith.png + bitmaps/dark/smithpolar.png + bitmaps/dark/source.png + bitmaps/dark/spfile1.png + bitmaps/dark/spfile2.png + bitmaps/dark/spfile3.png + bitmaps/dark/subcircuit.png + bitmaps/dark/subport.png + bitmaps/dark/substrate.png + bitmaps/dark/sweep.png + bitmaps/dark/switch.png + bitmaps/dark/symtrans.png + bitmaps/dark/tabular.png + bitmaps/dark/text.png + bitmaps/dark/tff_SR.png + bitmaps/dark/thyristor.png + bitmaps/dark/timing.png + bitmaps/dark/tline.png + bitmaps/dark/tline_4port.png + bitmaps/dark/tran.png + bitmaps/dark/transformer.png + bitmaps/dark/triac.png + bitmaps/dark/truth.png + bitmaps/dark/tunneldiode.png + bitmaps/dark/twistedpair.png + bitmaps/dark/vccs.png + bitmaps/dark/vcresistor.png + bitmaps/dark/vcvs.png + bitmaps/dark/vexp.png + bitmaps/dark/vfile.png + bitmaps/dark/vhdlfile.png + bitmaps/dark/vprobe.png + bitmaps/dark/xnor.png + bitmaps/dark/xor.png + bitmaps/dark/ysmith.png + bitmaps/dark/ac.png + bitmaps/dark/marker.png + bitmaps/dark/nodename.png + bitmaps/dark/vpulse.png + bitmaps/dark/vrect.png + bitmaps/dark/irect.png diff --git a/qucs/qucs_init.cpp b/qucs/qucs_init.cpp index e745fd57..0c2c1724 100644 --- a/qucs/qucs_init.cpp +++ b/qucs/qucs_init.cpp @@ -426,7 +426,7 @@ void QucsApp::initActions() tr("Select Markers\n\nSelects all diagram markers of the document")); connect(selectMarker, SIGNAL(triggered()), SLOT(slotSelectMarker())); - editRotate = new QAction(QIcon((":/bitmaps/rotate_ccw.png")), tr("Rotate"), this); + editRotate = new QAction(QIcon(misc::getIconPath("rotate_ccw.png")), tr("Rotate"), this); editRotate->setShortcut(Qt::CTRL+Qt::Key_R); editRotate->setStatusTip(tr("Rotates the selected component by 90\x00B0")); editRotate->setWhatsThis( @@ -434,7 +434,7 @@ void QucsApp::initActions() editRotate->setCheckable(true); connect(editRotate, SIGNAL(toggled(bool)), SLOT(slotEditRotate(bool))); - editMirror = new QAction(QIcon((":/bitmaps/mirror.png")), tr("Mirror about X Axis"), this); + editMirror = new QAction(QIcon(misc::getIconPath("mirror.png")), tr("Mirror about X Axis"), this); editMirror->setShortcut(Qt::CTRL+Qt::Key_J); editMirror->setStatusTip(tr("Mirrors the selected item about X Axis")); editMirror->setWhatsThis( @@ -442,7 +442,7 @@ void QucsApp::initActions() editMirror->setCheckable(true); connect(editMirror, SIGNAL(toggled(bool)), SLOT(slotEditMirrorX(bool))); - editMirrorY = new QAction(QIcon((":/bitmaps/mirrory.png")), tr("Mirror about Y Axis"), this); + editMirrorY = new QAction(QIcon(misc::getIconPath("mirrory.png")), tr("Mirror about Y Axis"), this); editMirrorY->setShortcut(Qt::CTRL+Qt::Key_M); editMirrorY->setStatusTip(tr("Mirrors the selected item about Y Axis")); editMirrorY->setWhatsThis( @@ -465,7 +465,7 @@ void QucsApp::initActions() connect(popH, SIGNAL(triggered()), SLOT(slotPopHierarchy())); popH->setEnabled(false); // only enabled if useful !!!! - editActivate = new QAction(QIcon((":/bitmaps/deactiv.png")), tr("Deactivate/Activate"), this); + editActivate = new QAction(QIcon(misc::getIconPath("deactiv.png")), tr("Deactivate/Activate"), this); editActivate->setShortcut(Qt::CTRL+Qt::Key_D); editActivate->setStatusTip(tr("Deactivate/Activate selected components")); editActivate->setWhatsThis( @@ -473,7 +473,7 @@ void QucsApp::initActions() editActivate->setCheckable(true); connect(editActivate, SIGNAL(toggled(bool)), SLOT(slotEditActivate(bool))); - insEquation = new QAction(QIcon((":/bitmaps/equation.png")), tr("Insert Equation"), this); + insEquation = new QAction(QIcon(misc::getIconPath("equation.png")), tr("Insert Equation"), this); insEquation->setShortcut(Qt::CTRL+Qt::Key_Less); insEquation->setStatusTip(tr("Inserts an equation")); insEquation->setWhatsThis( @@ -481,27 +481,27 @@ void QucsApp::initActions() insEquation->setCheckable(true); connect(insEquation, SIGNAL(toggled(bool)), SLOT(slotInsertEquation(bool))); - insGround = new QAction(QIcon((":/bitmaps/ground.png")), tr("Insert Ground"), this); + insGround = new QAction(QIcon(misc::getIconPath("ground.png")), tr("Insert Ground"), this); insGround->setShortcut(Qt::CTRL+Qt::Key_G); insGround->setStatusTip(tr("Inserts a ground symbol")); insGround->setWhatsThis(tr("Insert Ground\n\nInserts a ground symbol")); insGround->setCheckable(true); connect(insGround, SIGNAL(toggled(bool)), SLOT(slotInsertGround(bool))); - insPort = new QAction(QIcon((":/bitmaps/port.png")), tr("Insert Port"), this); + insPort = new QAction(QIcon(misc::getIconPath("port.png")), tr("Insert Port"), this); insPort->setStatusTip(tr("Inserts a port symbol")); insPort->setWhatsThis(tr("Insert Port\n\nInserts a port symbol")); insPort->setCheckable(true); connect(insPort, SIGNAL(toggled(bool)), SLOT(slotInsertPort(bool))); - insWire = new QAction(QIcon((":/bitmaps/wire.png")), tr("Wire"), this); + insWire = new QAction(QIcon(misc::getIconPath("wire.png")), tr("Wire"), this); insWire->setShortcut(Qt::CTRL+Qt::Key_E); insWire->setStatusTip(tr("Inserts a wire")); insWire->setWhatsThis(tr("Wire\n\nInserts a wire")); insWire->setCheckable(true); connect(insWire, SIGNAL(toggled(bool)), SLOT(slotSetWire(bool))); - insLabel = new QAction(QIcon((":/bitmaps/nodename.png")), tr("Wire Label"), this); + insLabel = new QAction(QIcon(misc::getIconPath("nodename.png")), tr("Wire Label"), this); insLabel->setShortcut(Qt::CTRL+Qt::Key_L); insLabel->setStatusTip(tr("Inserts a wire or pin label")); insLabel->setWhatsThis(tr("Wire Label\n\nInserts a wire or pin label")); From 8b1c17bddb2b224ad11cfdfc9bcb1a171795f44c Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 23 Feb 2022 21:51:56 +0100 Subject: [PATCH 03/45] Fix warnings in components and dialogs --- qucs/components/rlcg.cpp | 2 +- qucs/components/spicefile.cpp | 4 ++-- qucs/components/symtrafo.cpp | 4 ++-- qucs/dialogs/loaddialog.cpp | 6 ++++-- qucs/dialogs/qucssettingsdialog.cpp | 6 +++--- qucs/dialogs/savedialog.h | 2 +- qucs/dialogs/sweepdialog.cpp | 2 +- qucs/spicecomponents/xspicegeneric.cpp | 3 ++- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/qucs/components/rlcg.cpp b/qucs/components/rlcg.cpp index beb5b200..4c8eb996 100644 --- a/qucs/components/rlcg.cpp +++ b/qucs/components/rlcg.cpp @@ -42,7 +42,7 @@ RLCG::RLCG() QFontMetrics smallmetrics(Font, 0); int fHeight = smallmetrics.lineSpacing(); QString tmp = QObject::tr("RLCG"); - int w = smallmetrics.width(tmp); + int w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(w/-2, -fHeight, tmp)); Ports.append(new Port(-30, 0)); diff --git a/qucs/components/spicefile.cpp b/qucs/components/spicefile.cpp index 82984595..a61190b2 100644 --- a/qucs/components/spicefile.cpp +++ b/qucs/components/spicefile.cpp @@ -106,7 +106,7 @@ void SpiceFile::createSymbol() if(withSim) { i = fHeight - 2; tmp = QObject::tr("sim"); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(w/-2, 0, tmp, Qt::red)); } tmp = QObject::tr("spice"); @@ -119,7 +119,7 @@ void SpiceFile::createSymbol() Lines.append(new qucs::Line(-30, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-30, y)); tmp = PortNames.section(',', i, i).mid(4); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-20-w, y-fHeight-2, tmp)); // text right-aligned i++; diff --git a/qucs/components/symtrafo.cpp b/qucs/components/symtrafo.cpp index e42721e6..ab43ef2d 100644 --- a/qucs/components/symtrafo.cpp +++ b/qucs/components/symtrafo.cpp @@ -60,9 +60,9 @@ symTrafo::symTrafo() Lines.append(new qucs::Line( -1,-57, -1, 57,QPen(Qt::darkBlue,1))); Lines.append(new qucs::Line( 1,-57, 1, 57,QPen(Qt::darkBlue,1))); - stmp = "T1"; w = smallmetrics.width(stmp); // compute width to right-align + stmp = "T1"; w = smallmetrics.boundingRect(stmp).width(); // compute width to right-align Texts.append(new Text(-13-w,-57,stmp)); - stmp = "T2"; w = smallmetrics.width(stmp); // compute width to right-align + stmp = "T2"; w = smallmetrics.boundingRect(stmp).width(); // compute width to right-align Texts.append(new Text(-13-w, 22,stmp)); // mark the turn direction diff --git a/qucs/dialogs/loaddialog.cpp b/qucs/dialogs/loaddialog.cpp index 047c3d3c..bfa14534 100644 --- a/qucs/dialogs/loaddialog.cpp +++ b/qucs/dialogs/loaddialog.cpp @@ -296,10 +296,12 @@ void LoadDialog::slotChangeIcon() if (line.contains("BitmapFile")){ QString change = QString(" \"BitmapFile\" : \"%1\",").arg(newIcon); - ba.append(change+"\n"); + QString stmp = change + "\n"; + ba.append(stmp.toLatin1()); } else{ - ba.append(line+"\n"); + QString stmp = line + "\n"; + ba.append(stmp.toLatin1()); } } } diff --git a/qucs/dialogs/qucssettingsdialog.cpp b/qucs/dialogs/qucssettingsdialog.cpp index aa51e675..2aba4c1d 100644 --- a/qucs/dialogs/qucssettingsdialog.cpp +++ b/qucs/dialogs/qucssettingsdialog.cpp @@ -514,7 +514,7 @@ void QucsSettingsDialog::slotApply() // if user aborts closing, just return if(!App->closeAllFiles()) return; - QucsSettings.QucsHomeDir = homeEdit->text(); + QucsSettings.QucsHomeDir.setPath(homeEdit->text()); homeDirChanged = true; // later below the file tree will be refreshed } @@ -617,8 +617,8 @@ void QucsSettingsDialog::slotApply() } /*! Update QucsSettings, tool paths */ - QucsSettings.AdmsXmlBinDir = admsXmlEdit->text(); - QucsSettings.AscoBinDir = ascoEdit->text(); + QucsSettings.AdmsXmlBinDir.setPath(admsXmlEdit->text()); + QucsSettings.AscoBinDir.setPath(ascoEdit->text()); QucsSettings.OctaveExecutable = octaveEdit->text(); if (QucsSettings.IgnoreFutureVersion != checkLoadFromFutureVersions->isChecked()) diff --git a/qucs/dialogs/savedialog.h b/qucs/dialogs/savedialog.h index b6d35f6d..13e3fa5a 100644 --- a/qucs/dialogs/savedialog.h +++ b/qucs/dialogs/savedialog.h @@ -50,7 +50,7 @@ class SaveDialog : public QDialog SaveSelected }; - SaveDialog(QWidget* p = 0, const char* n = 0, bool modal = true, Qt::WindowFlags fl = 0 ); + SaveDialog(QWidget* p = 0, const char* n = 0, bool modal = true, Qt::WindowFlags fl = Qt::WindowFlags() ); ~SaveDialog(); void addUnsavedDoc(QucsDoc *doc); void setApp(QucsApp *a); diff --git a/qucs/dialogs/sweepdialog.cpp b/qucs/dialogs/sweepdialog.cpp index 48a290b0..6ac4c5a6 100644 --- a/qucs/dialogs/sweepdialog.cpp +++ b/qucs/dialogs/sweepdialog.cpp @@ -49,7 +49,7 @@ QString mySpinBox::textFromValue(int Val) const { if (Values == NULL) return ""; - qDebug() << "Values + Val" << *(Values+Val) << endl; + //qDebug() << "Values + Val" << *(Values+Val) << endl; return QString::number(*(Values+Val)); } diff --git a/qucs/spicecomponents/xspicegeneric.cpp b/qucs/spicecomponents/xspicegeneric.cpp index 1a285ac6..06f4d71a 100644 --- a/qucs/spicecomponents/xspicegeneric.cpp +++ b/qucs/spicecomponents/xspicegeneric.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "xspicegeneric.h" @@ -112,7 +113,7 @@ void XspiceGeneric::createSymbol() Ports.append(new Port(-40, y)); // tmp = PortNames.section(',', i, i).mid(4); tmp = n_ports.at(i); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-40-w, y-fHeight-2, tmp)); // text right-aligned i++; From 269315eac2a7b4f15d33531e64a5f835f7907988 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 23 Feb 2022 22:08:20 +0100 Subject: [PATCH 04/45] Get rid of Q3ValueList --- qucs/qt3_compat/CMakeLists.txt | 2 +- qucs/qt3_compat/q3glist.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qucs/qt3_compat/CMakeLists.txt b/qucs/qt3_compat/CMakeLists.txt index 60d91c33..535b7516 100755 --- a/qucs/qt3_compat/CMakeLists.txt +++ b/qucs/qt3_compat/CMakeLists.txt @@ -15,7 +15,7 @@ qt_compat.h q3ptrlist.h q3glist.h q3gvector.h -q3valuelist.h +#q3valuelist.h ) SET(QT3_COMPAT_SRCS diff --git a/qucs/qt3_compat/q3glist.cpp b/qucs/qt3_compat/q3glist.cpp index c54fc3d5..43341660 100644 --- a/qucs/qt3_compat/q3glist.cpp +++ b/qucs/qt3_compat/q3glist.cpp @@ -41,8 +41,8 @@ #include "q3glist.h" #include "q3gvector.h" -#include "qdatastream.h" -#include "q3valuelist.h" +#include +//#include "q3valuelist.h" QT_BEGIN_NAMESPACE @@ -113,7 +113,7 @@ public: } else if ( list ) { list->push_front( i ); } else { - list = new Q3ValueList; + list = new std::list; list->push_front( i ); } } @@ -123,7 +123,7 @@ public: iterator = 0; } else if ( list ) { list->remove( i ); - if ( list->isEmpty() ) { + if ( list->empty() ) { delete list; list = 0; } @@ -137,7 +137,7 @@ public: iterator->curNode = 0; } if ( list ) { - for ( Q3ValueList::Iterator i = list->begin(); i != list->end(); ++i ) { + for ( auto i = list->begin(); i != list->end(); ++i ) { if ( zeroList ) (*i)->list = 0; (*i)->curNode = 0; @@ -151,7 +151,7 @@ public: iterator->curNode = curNode; } if ( list ) { - for ( Q3ValueList::Iterator i = list->begin(); i != list->end(); ++i ) { + for ( auto i = list->begin(); i != list->end(); ++i ) { if ( (*i)->curNode == n ) (*i)->curNode = curNode; } @@ -159,7 +159,7 @@ public: } private: - Q3ValueList* list; + std::list* list; Q3GListIterator* iterator; }; From c6003e97af85764899120038e03aa2e5b0472ac5 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 23 Feb 2022 22:54:50 +0100 Subject: [PATCH 05/45] More fixed in paintings --- qucs/extsimkernels/abstractspicekernel.cpp | 5 ++++- qucs/paintings/graphictext.cpp | 10 +++++----- qucs/paintings/id_text.cpp | 2 +- qucs/paintings/portsymbol.cpp | 8 ++++---- qucs/qt3_compat/q3scrollview.cpp | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index c8750c97..feb387e0 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -27,7 +27,10 @@ #include "main.h" #include "../paintings/id_text.h" #include "dialogs/sweepdialog.h" + + #include +#include /*! \file abstractspicekernel.cpp @@ -234,7 +237,7 @@ void AbstractSpiceKernel::createSubNetlsit(QTextStream &stream, bool lib) pc->Ports.first()->Connection->Name)); } } - qSort(ports); + std::sort(ports.begin(), ports.end()); QPair pp; if (lib) header += " gnd "; // Ground node forwarding for Library foreach(pp,ports) { diff --git a/qucs/paintings/graphictext.cpp b/qucs/paintings/graphictext.cpp index 09c1afe4..c2c1b0d3 100644 --- a/qucs/paintings/graphictext.cpp +++ b/qucs/paintings/graphictext.cpp @@ -51,10 +51,10 @@ void GraphicText::paint(ViewPainter *p) // keep track of painter state p->Painter->save(); - QMatrix wm = p->Painter->worldMatrix(); - QMatrix Mat(1.0, 0.0, 0.0, 1.0, p->DX + float(cx) * p->Scale, - p->DY + float(cy) * p->Scale); - p->Painter->setWorldMatrix(Mat); + QTransform wm = p->Painter->worldTransform(); + QTransform Mat(1.0, 0.0, 0.0, 1.0, p->DX + qreal(cx) * p->Scale, + p->DY + qreal(cy) * p->Scale); + p->Painter->setWorldTransform(Mat); p->Painter->rotate(-Angle); // automatically enables transformation int Size = Font.pointSize(); @@ -77,7 +77,7 @@ void GraphicText::paint(ViewPainter *p) } Font.setPointSize(Size); // restore real font size - p->Painter->setWorldMatrix(wm); + p->Painter->setWorldTransform(wm); p->Painter->setWorldMatrixEnabled(false); // restore painter state diff --git a/qucs/paintings/id_text.cpp b/qucs/paintings/id_text.cpp index cbcc3c86..101d08e3 100644 --- a/qucs/paintings/id_text.cpp +++ b/qucs/paintings/id_text.cpp @@ -62,7 +62,7 @@ void ID_Text::paint(ViewPainter *p) if(isSelected) { p->Painter->setPen(QPen(Qt::darkGray,3)); - p->Painter->drawRoundRect(x-4, y-4, x2+8, y2+8); + p->Painter->drawRoundedRect(x-4, y-4, x2+8, y2+8, 4.0, 4.0); } x2 = int(float(x2) / p->Scale); diff --git a/qucs/paintings/portsymbol.cpp b/qucs/paintings/portsymbol.cpp index 682f0d73..0e3e60f4 100644 --- a/qucs/paintings/portsymbol.cpp +++ b/qucs/paintings/portsymbol.cpp @@ -60,10 +60,10 @@ void PortSymbol::paint(ViewPainter *p) x2 = Unit - x1; y2 = r.height() + Unit; - QMatrix wm = p->Painter->worldMatrix(); - QMatrix Mat(1.0, 0.0, 0.0, 1.0, p->DX + float(cx) * p->Scale, + QTransform wm = p->Painter->worldTransform(); + QTransform Mat(1.0, 0.0, 0.0, 1.0, p->DX + float(cx) * p->Scale, p->DY + float(cy) * p->Scale); - p->Painter->setWorldMatrix(Mat); + p->Painter->setWorldTransform(Mat); int tmp, tx, ty; tx = x1 + (Unit >> 1); @@ -91,7 +91,7 @@ void PortSymbol::paint(ViewPainter *p) p->Painter->drawText(tx, ty, 0, 0, Qt::TextDontClip, nameStr); - p->Painter->setWorldMatrix(wm); + p->Painter->setWorldTransform(wm); p->Painter->setWorldMatrixEnabled(false); // restore painter state diff --git a/qucs/qt3_compat/q3scrollview.cpp b/qucs/qt3_compat/q3scrollview.cpp index c3e00375..d9d7fee4 100644 --- a/qucs/qt3_compat/q3scrollview.cpp +++ b/qucs/qt3_compat/q3scrollview.cpp @@ -1372,7 +1372,7 @@ void Q3ScrollView::addChild(QWidget* child, int x, int y) setResizePolicy(Manual); } if (child->parentWidget() != viewport()) { - child->setParent(viewport(),0); + child->setParent(viewport(), Qt::WindowFlags()); child->move(QPoint(0,0)); child->hide(); // child->reparent(viewport(), 0, QPoint(0,0), false); From 189802ab0d4c7170c4c71092bfd74e352d08cc26 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 24 Feb 2022 00:13:12 +0100 Subject: [PATCH 06/45] Fix more warnings in components --- qucs/components/component.cpp | 22 ++++++++--------- qucs/components/mutual2.cpp | 4 ++-- qucs/components/rfedd.cpp | 4 ++-- qucs/components/rfedd2p.cpp | 4 ++-- qucs/components/sparamfile.cpp | 4 ++-- qucs/components/spicedialog.cpp | 13 +++++----- qucs/components/verilogfile.cpp | 4 ++-- qucs/components/vhdlfile.cpp | 4 ++-- qucs/diagrams/curvediagram.cpp | 4 ++-- qucs/diagrams/diagram.cpp | 34 +++++++++++++-------------- qucs/diagrams/marker.cpp | 6 ++--- qucs/diagrams/rect3ddiagram.cpp | 8 +++---- qucs/diagrams/rectdiagram.cpp | 4 ++-- qucs/diagrams/timingdiagram.cpp | 4 ++-- qucs/diagrams/truthdiagram.cpp | 6 ++--- qucs/extsimkernels/codemodelgen.cpp | 6 ++--- qucs/main.cpp | 6 ++--- qucs/spicecomponents/spicegeneric.cpp | 2 +- qucs/textdoc.cpp | 2 +- qucs/viewpainter.cpp | 4 ++-- 20 files changed, 73 insertions(+), 72 deletions(-) diff --git a/qucs/components/component.cpp b/qucs/components/component.cpp index 42b160e2..b23eaf17 100644 --- a/qucs/components/component.cpp +++ b/qucs/components/component.cpp @@ -91,14 +91,14 @@ int Component::textSize(int& _dx, int& _dy) int tmp, count=0; _dx = _dy = 0; if(showName) { - _dx = metrics.width(Name); + _dx = metrics.boundingRect(Name).width(); _dy = metrics.height(); count++; } for(Property *pp = Props.first(); pp != 0; pp = Props.next()) if(pp->display) { // get width of text - tmp = metrics.width(pp->Name+"="+pp->Value); + tmp = metrics.boundingRect(pp->Name+"="+pp->Value).width(); if(tmp > _dx) _dx = tmp; _dy += metrics.height(); count++; @@ -170,7 +170,7 @@ int Component::getTextSelected(int x_, int y_, float Corr) if(!pp) return -1; // get width of text - w = metrics.width(pp->Name+"="+pp->Value); + w = metrics.boundingRect(pp->Name+"="+pp->Value).width(); if(x_ > w) return -1; // clicked past the property text end - selection invalid return Props.at()+1; // number the property } @@ -264,11 +264,11 @@ void Component::paint(ViewPainter *p) // keep track of painter state p->Painter->save(); - QMatrix wm = p->Painter->worldMatrix(); + QTransform wm = p->Painter->worldTransform(); // write all text foreach(Text *pt, Texts) { - p->Painter->setWorldMatrix( - QMatrix(pt->mCos, -pt->mSin, pt->mSin, pt->mCos, + p->Painter->setWorldTransform( + QTransform(pt->mCos, -pt->mSin, pt->mSin, pt->mCos, p->DX + float(cx+pt->x) * p->Scale, p->DY + float(cy+pt->y) * p->Scale)); newFont.setPointSizeF(p->Scale * pt->Size); @@ -284,7 +284,7 @@ void Component::paint(ViewPainter *p) Q_UNUSED(w); } } - p->Painter->setWorldMatrix(wm); + p->Painter->setWorldTransform(wm); p->Painter->setWorldMatrixEnabled(false); // restore painter state @@ -477,13 +477,13 @@ void Component::rotate() QFontMetrics metrics(QucsSettings.font, 0); // get size of text dx = dy = 0; if(showName) { - dx = metrics.width(Name); + dx = metrics.boundingRect(Name).width(); dy = metrics.lineSpacing(); } for(Property *pp = Props.first(); pp != 0; pp = Props.next()) if(pp->display) { // get width of text - tmp = metrics.width(pp->Name+"="+pp->Value); + tmp = metrics.boundingRect(pp->Name+"="+pp->Value).width(); if(tmp > dx) dx = tmp; dy += metrics.lineSpacing(); } @@ -610,11 +610,11 @@ void Component::mirrorY() QFontMetrics metrics(QucsSettings.font, 0); // get size of text int dx = 0; if(showName) - dx = metrics.width(Name); + dx = metrics.boundingRect(Name).width(); for(Property *pp = Props.first(); pp != 0; pp = Props.next()) if(pp->display) { // get width of text - tmp = metrics.width(pp->Name+"="+pp->Value); + tmp = metrics.boundingRect(pp->Name+"="+pp->Value).width(); if(tmp > dx) dx = tmp; } if((ty > y1) && (ty < y2)) tx = -tx-dx; // mirror text position diff --git a/qucs/components/mutual2.cpp b/qucs/components/mutual2.cpp index a367fd29..1d9444b9 100644 --- a/qucs/components/mutual2.cpp +++ b/qucs/components/mutual2.cpp @@ -56,9 +56,9 @@ Mutual2::Mutual2() Lines.append(new qucs::Line(-10, 10,-30, 10,QPen(Qt::darkBlue,2))); Lines.append(new qucs::Line(-10, 10,-10, 22,QPen(Qt::darkBlue,2))); - stmp = "1"; w = smallmetrics.width(stmp); // compute width to right-align + stmp = "1"; w = smallmetrics.boundingRect(stmp).width(); // compute width to right-align Texts.append(new Text(-13-w,-61,stmp)); - stmp = "2"; w = smallmetrics.width(stmp); // compute width to right-align + stmp = "2"; w = smallmetrics.boundingRect(stmp).width(); // compute width to right-align Texts.append(new Text(-13-w, 18,stmp)); Texts.append(new Text( 13,-22,"3")); // left-aligned, no need to compute width diff --git a/qucs/components/rfedd.cpp b/qucs/components/rfedd.cpp index da7f08bf..61075e69 100644 --- a/qucs/components/rfedd.cpp +++ b/qucs/components/rfedd.cpp @@ -158,7 +158,7 @@ void RFedd::createSymbol() // component text name, centered tmp = QObject::tr("RF"); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-w/2, -fHeight/2, tmp)); // text centered in box i = 0; @@ -168,7 +168,7 @@ void RFedd::createSymbol() Lines.append(new qucs::Line(-30, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-30, y)); tmp = QString::number(i+1); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-25-w, y-fHeight-2, tmp)); // text right-aligned i++; diff --git a/qucs/components/rfedd2p.cpp b/qucs/components/rfedd2p.cpp index a872c04e..50ee83a7 100644 --- a/qucs/components/rfedd2p.cpp +++ b/qucs/components/rfedd2p.cpp @@ -125,7 +125,7 @@ void RFedd2P::createSymbol() // component text name tmp = Props.at(0)->Value; - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-w/2, -fHeight/2, tmp)); // text centered in the box // add port numbers text @@ -134,7 +134,7 @@ void RFedd2P::createSymbol() Lines.append(new qucs::Line(-30, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-30, y)); tmp = QString::number(i+1); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-25-w, y-fHeight-2, tmp)); // text right-aligned i++; diff --git a/qucs/components/sparamfile.cpp b/qucs/components/sparamfile.cpp index 34404422..ff747fe6 100644 --- a/qucs/components/sparamfile.cpp +++ b/qucs/components/sparamfile.cpp @@ -163,7 +163,7 @@ void SParamFile::createSymbol() Lines.append(new qucs::Line(-15, h, 15, h,QPen(Qt::darkBlue,2))); Lines.append(new qucs::Line(-15, -h,-15, h,QPen(Qt::darkBlue,2))); stmp = QObject::tr("file"); - w = smallmetrics.width(stmp); // compute text size to center it + w = smallmetrics.boundingRect(stmp).width(); // compute text size to center it Texts.append(new Text(-w/2, -fHeight/2, stmp)); int i=0, y = 15-h; @@ -172,7 +172,7 @@ void SParamFile::createSymbol() Lines.append(new qucs::Line(-30, y,-15, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-30, y)); stmp = QString::number(i); - w = smallmetrics.width(stmp); + w = smallmetrics.boundingRect(stmp).width(); Texts.append(new Text(-25-w, y-fHeight-2, stmp)); // text right-aligned if(i == Num) break; // if odd number of ports there will be one port less on the right side diff --git a/qucs/components/spicedialog.cpp b/qucs/components/spicedialog.cpp index 7e82abb1..39ecbcaa 100644 --- a/qucs/components/spicedialog.cpp +++ b/qucs/components/spicedialog.cpp @@ -350,11 +350,12 @@ bool SpiceDialog::loadSpiceNetList(const QString& s) piping = false; } script = QucsSettings.BinDir + script; - QString spiceCommand; + QString spiceExe; + QStringList spiceArgs; SpicePrep = new QProcess(this); - spiceCommand+=interpreter + " "; - spiceCommand+=script + " "; - spiceCommand+=FileInfo.filePath() + " "; + spiceExe=interpreter; + spiceArgs.append(script); + spiceArgs.append(FileInfo.filePath()); QFile PrepFile; QFileInfo PrepInfo(QucsSettings.QucsWorkDir, s + ".pre"); @@ -362,7 +363,7 @@ bool SpiceDialog::loadSpiceNetList(const QString& s) if (!piping) { - spiceCommand += PrepName + " "; + spiceArgs.append(PrepName); connect(SpicePrep, SIGNAL(readyReadStandardOutput()), SLOT(slotSkipOut())); connect(SpicePrep, SIGNAL(readyReadStandardError()), SLOT(slotGetPrepErr())); } @@ -391,7 +392,7 @@ bool SpiceDialog::loadSpiceNetList(const QString& s) } prestream = new QTextStream(&PrepFile); } - SpicePrep->start(spiceCommand); + SpicePrep->start(spiceExe, spiceArgs); if ((SpicePrep->state() != QProcess::Starting) && (SpicePrep->state() != QProcess::Running)) { diff --git a/qucs/components/verilogfile.cpp b/qucs/components/verilogfile.cpp index 30f63b39..d441301f 100644 --- a/qucs/components/verilogfile.cpp +++ b/qucs/components/verilogfile.cpp @@ -131,7 +131,7 @@ void Verilog_File::createSymbol() Lines.append(new qucs::Line(-HALFWIDTH, -h,-HALFWIDTH, h,QPen(Qt::darkBlue,2))); tmp = QObject::tr("verilog"); - int w = metrics.width(tmp); + int w = metrics.boundingRect(tmp).width(); Texts.append(new Text(w/-2, fHeight/-2, tmp)); @@ -140,7 +140,7 @@ void Verilog_File::createSymbol() Lines.append(new qucs::Line(-30, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-30, y)); tmp = PortNames.section(',', i, i); - w = metrics.width(tmp); + w = metrics.boundingRect(tmp).width(); Texts.append(new Text(-26-w, y-fHeight-2, tmp)); i++; diff --git a/qucs/components/vhdlfile.cpp b/qucs/components/vhdlfile.cpp index 5dc25513..e15da3ad 100644 --- a/qucs/components/vhdlfile.cpp +++ b/qucs/components/vhdlfile.cpp @@ -143,7 +143,7 @@ void VHDL_File::createSymbol() Lines.append(new qucs::Line(-HALFWIDTH, -h,-HALFWIDTH, h,QPen(Qt::darkBlue,2))); tmp = QObject::tr("vhdl"); - int w = metrics.width(tmp); + int w = metrics.boundingRect(tmp).width(); Texts.append(new Text(w/-2, fHeight/-2, tmp)); int y = 15-h, i = 0; @@ -154,7 +154,7 @@ void VHDL_File::createSymbol() Ports.append(pp); pp->Type = TypeNames.section(',', i, i); tmp = PortNames.section(',', i, i); - w = metrics.width(tmp); + w = metrics.boundingRect(tmp).width(); Texts.append(new Text(-19-w, y-fHeight-2, tmp)); i++; diff --git a/qucs/diagrams/curvediagram.cpp b/qucs/diagrams/curvediagram.cpp index f7d4d10d..b8093acd 100644 --- a/qucs/diagrams/curvediagram.cpp +++ b/qucs/diagrams/curvediagram.cpp @@ -167,7 +167,7 @@ if(xAxis.log) { if((zD < 1.5*zDstep) || (z == 0) || (z == x2)) { tmp = misc::StringNiceNum(zD); if(xAxis.up < 0.0) tmp = '-'+tmp; - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text // center text horizontally under the x tick mark Texts.append(new Text(z-(w>>1), -y1, tmp)); Lines.append(new qucs::Line(z, 5, z, -5, QPen(Qt::black,0))); // x tick marks @@ -195,7 +195,7 @@ else { // not logarithmical while((z <= x2) && (z >= 0)) { // create all grid lines if(fabs(GridNum) < 0.01*pow(10.0, Expo)) GridNum = 0.0;// make 0 really 0 tmp = misc::StringNiceNum(GridNum); - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text // center text horizontally under the x tick mark Texts.append(new Text(z-(w>>1), -y1, tmp)); // Text(x, y, str, ...) GridNum += GridStep; diff --git a/qucs/diagrams/diagram.cpp b/qucs/diagrams/diagram.cpp index 9d61255d..13e4c2fc 100644 --- a/qucs/diagrams/diagram.cpp +++ b/qucs/diagrams/diagram.cpp @@ -117,17 +117,17 @@ void Diagram::paintDiagram(ViewPainter *p) p->Painter->save(); // write whole text (axis label inclusively) - QMatrix wm = p->Painter->worldMatrix(); + QTransform wm = p->Painter->worldTransform(); foreach(Text *pt, Texts) { - p->Painter->setWorldMatrix( - QMatrix(pt->mCos, -pt->mSin, pt->mSin, pt->mCos, + p->Painter->setWorldTransform( + QTransform(pt->mCos, -pt->mSin, pt->mSin, pt->mCos, p->DX + float(cx+pt->x) * p->Scale, p->DY + float(cy-pt->y) * p->Scale)); p->Painter->setPen(pt->Color); p->Painter->drawText(0, 0, pt->s); } - p->Painter->setWorldMatrix(wm); + p->Painter->setWorldTransform(wm); p->Painter->setWorldMatrixEnabled(false); // restore painter state @@ -186,12 +186,12 @@ void Diagram::createAxisLabels() if(!pD) continue; y -= LineSpacing; if(Name[0] != 'C') { // locus curve ? - w = metrics.width(pD->Var) >> 1; + w = metrics.boundingRect(pD->Var).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x-w, y, pD->Var, pg->Color, 12.0)); } else { - w = metrics.width("real("+pg->Var+")") >> 1; + w = metrics.boundingRect("real("+pg->Var+")").width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x-w, y, "real("+pg->Var+")", pg->Color, 12.0)); @@ -201,7 +201,7 @@ void Diagram::createAxisLabels() else { y -= LineSpacing; encode_String(xAxis.Label, Str); - w = metrics.width(Str) >> 1; + w = metrics.boundingRect(Str).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x-w, y, Str, Qt::black, 12.0)); } @@ -221,19 +221,19 @@ void Diagram::createAxisLabels() if(pg->yAxisNo != 0) continue; if(pg->cPointsY) { if(Name[0] != 'C') { // location curve ? - w = metrics.width(pg->Var) >> 1; + w = metrics.boundingRect(pg->Var).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y-w, pg->Var, pg->Color, 12.0, 0.0, 1.0)); } else { - w = metrics.width("imag("+pg->Var+")") >> 1; + w = metrics.boundingRect("imag("+pg->Var+")").width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y-w, "imag("+pg->Var+")", pg->Color, 12.0, 0.0, 1.0)); } } else { // if no data => - w = metrics.width(pg->Var+INVALID_STR) >> 1; + w = metrics.boundingRect(pg->Var+INVALID_STR).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y-w, pg->Var+INVALID_STR, pg->Color, 12.0, 0.0, 1.0)); @@ -243,7 +243,7 @@ void Diagram::createAxisLabels() } else { encode_String(yAxis.Label, Str); - w = metrics.width(Str) >> 1; + w = metrics.boundingRect(Str).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y-w, Str, Qt::black, 12.0, 0.0, 1.0)); x -= LineSpacing; @@ -259,20 +259,20 @@ void Diagram::createAxisLabels() if(pg->yAxisNo != 1) continue; if(pg->cPointsY) { if(Name[0] != 'C') { // location curve ? - w = metrics.width(pg->Var) >> 1; + w = metrics.boundingRect(pg->Var).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y+w, pg->Var, pg->Color, 12.0, 0.0, -1.0)); } else { - w = metrics.width("imag("+pg->Var+")") >> 1; + w = metrics.boundingRect("imag("+pg->Var+")").width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y+w, "imag("+pg->Var+")", pg->Color, 12.0, 0.0, -1.0)); } } else { // if no data => - w = metrics.width(pg->Var+INVALID_STR) >> 1; + w = metrics.boundingRect(pg->Var+INVALID_STR).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y+w, pg->Var+INVALID_STR, pg->Color, 12.0, 0.0, -1.0)); @@ -282,7 +282,7 @@ void Diagram::createAxisLabels() } else { encode_String(zAxis.Label, Str); - w = metrics.width(Str) >> 1; + w = metrics.boundingRect(Str).width() >> 1; if(w > wmax) wmax = w; Texts.append(new Text(x, y+w, Str, Qt::black, 12.0, 0.0, -1.0)); } @@ -1923,7 +1923,7 @@ if(Axis->log) { tmp = misc::StringNiceNum(zD); if(Axis->up < 0.0) tmp = '-'+tmp; - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text if(maxWidth < w) maxWidth = w; if(x0 > 0) Texts.append(new Text(x0+7, z-6, tmp)); // text aligned left @@ -1957,7 +1957,7 @@ else { // not logarithmical if(fabs(GridNum) < 0.01*pow(10.0, Expo)) GridNum = 0.0;// make 0 really 0 tmp = misc::StringNiceNum(GridNum); - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text if(maxWidth < w) maxWidth = w; if(x0 > 0) Texts.append(new Text(x0+8, z-6, tmp)); // text aligned left diff --git a/qucs/diagrams/marker.cpp b/qucs/diagrams/marker.cpp index 011360e0..b6209bd6 100644 --- a/qucs/diagrams/marker.cpp +++ b/qucs/diagrams/marker.cpp @@ -355,8 +355,8 @@ void Marker::paint(ViewPainter *p, int x0, int y0) // Workaround for bug in Qt: If WorldMatrix is turned off, \n in the // text creates a terrible mess. p->Painter->setWorldMatrixEnabled(true); - QMatrix wm = p->Painter->worldMatrix(); - p->Painter->setWorldMatrix(QMatrix()); + QTransform wm = p->Painter->worldTransform(); + p->Painter->setWorldTransform(QTransform()); int x2_, y2_; p->Painter->setPen(QPen(Qt::black,1)); @@ -367,7 +367,7 @@ void Marker::paint(ViewPainter *p, int x0, int y0) p->eraseRect(x0+x1, y0+y1, x2_, y2_); p->drawText(Text, x0+x1+3, y0+y1+3); } - p->Painter->setWorldMatrix(wm); + p->Painter->setWorldTransform(wm); p->Painter->setWorldMatrixEnabled(false); // restore painter state diff --git a/qucs/diagrams/rect3ddiagram.cpp b/qucs/diagrams/rect3ddiagram.cpp index 230350e1..6418cb07 100644 --- a/qucs/diagrams/rect3ddiagram.cpp +++ b/qucs/diagrams/rect3ddiagram.cpp @@ -699,7 +699,7 @@ int Rect3DDiagram::calcAxis(Axis *Axis, int x, int y, tmp = misc::StringNiceNum(yD); if(Axis->up < 0.0) tmp = '-'+tmp; - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text if(maxWidth < w) maxWidth = w; xLen = int(ystepD * cos(phi) + 0.5) + x; @@ -735,7 +735,7 @@ int Rect3DDiagram::calcAxis(Axis *Axis, int x, int y, if(fabs(GridNum) < 0.01*pow(10.0, Expo)) GridNum = 0.0; // make 0 really 0 tmp = misc::StringNiceNum(GridNum); - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text if(maxWidth < w) maxWidth = w; // if(Qt::DockRight) Texts.append(new Text(x+3+gx, y-6+gy, tmp)); // place text right @@ -804,7 +804,7 @@ void Rect3DDiagram::createAxis(Axis *Axis, bool Right, } x += int(double(metrics.lineSpacing())*sin_phi); y -= int(double(metrics.lineSpacing())*cos_phi); - w = metrics.width(s); + w = metrics.boundingRect(s).width(); Texts.append(new Text(x+int(double((z-w)>>1)*cos_phi), y+int(double((z-w)>>1)*sin_phi), s, pg->Color, 12.0, cos_phi, sin_phi)); @@ -813,7 +813,7 @@ void Rect3DDiagram::createAxis(Axis *Axis, bool Right, else { x += int(double(metrics.lineSpacing())*sin_phi); y -= int(double(metrics.lineSpacing())*cos_phi); - w = metrics.width(Axis->Label); + w = metrics.boundingRect(Axis->Label).width(); Texts.append(new Text(x+int(double((z-w)>>1)*cos_phi), y+int(double((z-w)>>1)*sin_phi), Axis->Label, Qt::black, 12.0, cos_phi, sin_phi)); diff --git a/qucs/diagrams/rectdiagram.cpp b/qucs/diagrams/rectdiagram.cpp index 4a7679a5..c43397bf 100644 --- a/qucs/diagrams/rectdiagram.cpp +++ b/qucs/diagrams/rectdiagram.cpp @@ -176,7 +176,7 @@ if(xAxis.log) { if((zD < 1.5*zDstep) || (z == 0) || (z == x2)) { tmp = misc::StringNiceNum(zD); if(xAxis.up < 0.0) tmp = '-'+tmp; - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text // center text horizontally under the x tick mark Texts.append(new Text(z-(w>>1), -y1, tmp)); Lines.append(new qucs::Line(z, 5, z, -5, QPen(Qt::black,0))); // x tick marks @@ -204,7 +204,7 @@ else { // not logarithmical while((z <= x2) && (z >= 0)) { // create all grid lines if(fabs(GridNum) < 0.01*pow(10.0, Expo)) GridNum = 0.0;// make 0 really 0 tmp = misc::StringNiceNum(GridNum); - w = metrics.width(tmp); // width of text + w = metrics.boundingRect(tmp).width(); // width of text // center text horizontally under the x tick mark Texts.append(new Text(z-(w>>1), -y1, tmp)); // Text(x, y, str, ...) GridNum += GridStep; diff --git a/qucs/diagrams/timingdiagram.cpp b/qucs/diagrams/timingdiagram.cpp index 1d246282..7cd53943 100644 --- a/qucs/diagrams/timingdiagram.cpp +++ b/qucs/diagrams/timingdiagram.cpp @@ -200,7 +200,7 @@ int TimingDiagram::calcDiagram() colWidth = z; } } - int TimeStepWidth = colWidth * metrics.width("X") + 8; + int TimeStepWidth = colWidth * metrics.boundingRect("X").width() + 8; if(TimeStepWidth < 40) TimeStepWidth = 40; @@ -259,7 +259,7 @@ if(!firstGraph->isEmpty()) { z = pD->count - z; for( ; z>0; z--) { Str = misc::num2str(*(px++)); - colWidth = metrics.width(Str); // width of text + colWidth = metrics.boundingRect(Str).width(); // width of text if(x+colWidth+2 >= x2) break; Texts.append(new Text( x, y2-2, Str)); diff --git a/qucs/diagrams/truthdiagram.cpp b/qucs/diagrams/truthdiagram.cpp index 9cb164c3..a9028b86 100644 --- a/qucs/diagrams/truthdiagram.cpp +++ b/qucs/diagrams/truthdiagram.cpp @@ -120,8 +120,8 @@ int TruthDiagram::calcDiagram() colWidth = 0; Texts.append(new Text(x-4, y2-2, Str)); // independent variable if(NumAll != 0) { - z = metrics.width("1"); - colWidth = metrics.width("0"); + z = metrics.boundingRect("1").width(); + colWidth = metrics.boundingRect("0").width(); if(z > colWidth) colWidth = z; colWidth += 2; counting = int(log(double(NumAll)) / log(2.0) + 0.9999); // number of bits @@ -188,7 +188,7 @@ int TruthDiagram::calcDiagram() py = (char*)g->cPointsY; counting = strlen((char*)py); // count number of "bits" - digitWidth = metrics.width("X") + 2; + digitWidth = metrics.boundingRect("X").width() + 2; if((x+digitWidth*counting) >= x2) { // enough space for "bit vector" ? checkColumnWidth("0", metrics, 0, x2, y); goto funcEnd; diff --git a/qucs/extsimkernels/codemodelgen.cpp b/qucs/extsimkernels/codemodelgen.cpp index e4b5a235..9f058060 100644 --- a/qucs/extsimkernels/codemodelgen.cpp +++ b/qucs/extsimkernels/codemodelgen.cpp @@ -459,7 +459,7 @@ bool CodeModelGen::executeGinacCmd(QString &cmd, QString &result) } else return false; ginac.setStandardInputFile(ginac_task.fileName()); - ginac.start("ginsh"); + ginac.start("ginsh",QStringList()); ginac.waitForFinished(); result = ginac.readAllStandardOutput(); result.chop(1); // remove newline char @@ -620,8 +620,8 @@ void CodeModelGen::scanEquations(Schematic *sch,QStringList &pars, } else { int Nv = init_pars.count(); // Reverse init parameters list before exit for(int i = 0; i < (Nv/2); i++) { - init_pars.swap(i,Nv-(1+i)); - InitEqns.swap(i,Nv-(1+i)); + init_pars.swapItemsAt(i,Nv-(1+i)); + InitEqns.swapItemsAt(i,Nv-(1+i)); } return; } diff --git a/qucs/main.cpp b/qucs/main.cpp index 8e84eb4d..ad322538 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -116,8 +116,8 @@ bool loadSettings() //if(settings.contains("BinDir"))QucsSettings.BinDir = settings.value("BinDir").toString(); //if(settings.contains("LangDir"))QucsSettings.LangDir = settings.value("LangDir").toString(); //if(settings.contains("LibDir"))QucsSettings.LibDir = settings.value("LibDir").toString(); - if(settings.contains("AdmsXmlBinDir"))QucsSettings.AdmsXmlBinDir = settings.value("AdmsXmlBinDir").toString(); - if(settings.contains("AscoBinDir"))QucsSettings.AscoBinDir = settings.value("AscoBinDir").toString(); + if(settings.contains("AdmsXmlBinDir"))QucsSettings.AdmsXmlBinDir.setPath(settings.value("AdmsXmlBinDir").toString()); + if(settings.contains("AscoBinDir"))QucsSettings.AscoBinDir.setPath(settings.value("AscoBinDir").toString()); //if(settings.contains("OctaveDir"))QucsSettings.OctaveDir = settings.value("OctaveDir").toString(); //if(settings.contains("ExamplesDir"))QucsSettings.ExamplesDir = settings.value("ExamplesDir").toString(); //if(settings.contains("DocDir"))QucsSettings.DocDir = settings.value("DocDir").toString(); @@ -581,7 +581,7 @@ void createIcons() { image.fill(Qt::transparent); QPainter painter(&image); - QPainter::RenderHints hints = 0; + QPainter::RenderHints hints = QPainter::RenderHints(); // Ask to antialias drawings if requested if (QucsSettings.GraphAntiAliasing) hints |= QPainter::Antialiasing; // Ask to antialias text if requested diff --git a/qucs/spicecomponents/spicegeneric.cpp b/qucs/spicecomponents/spicegeneric.cpp index 798b81a4..411b4de1 100644 --- a/qucs/spicecomponents/spicegeneric.cpp +++ b/qucs/spicecomponents/spicegeneric.cpp @@ -99,7 +99,7 @@ void SpiceGeneric::createSymbol() Lines.append(new qucs::Line(-40, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2))); Ports.append(new Port(-40, y)); tmp = QString::number(i+1); - w = smallmetrics.width(tmp); + w = smallmetrics.boundingRect(tmp).width(); Texts.append(new Text(-40-w, y-fHeight-2, tmp)); // text right-aligned i++; diff --git a/qucs/textdoc.cpp b/qucs/textdoc.cpp index 53fe31bd..355406a8 100644 --- a/qucs/textdoc.cpp +++ b/qucs/textdoc.cpp @@ -256,7 +256,7 @@ void TextDoc::becomeCurrent (bool) bool TextDoc::baseSearch(const QString &str, bool CaseSensitive, bool wordOnly, bool backward) { - QTextDocument::FindFlags flag = 0; + QTextDocument::FindFlags flag = QTextDocument::FindFlags(); bool finded; if (CaseSensitive) { diff --git a/qucs/viewpainter.cpp b/qucs/viewpainter.cpp index d81b2e83..ece211ff 100644 --- a/qucs/viewpainter.cpp +++ b/qucs/viewpainter.cpp @@ -58,7 +58,7 @@ void ViewPainter::init(QPainter *p, float Scale_, int DX_, int DY_, LineSpacing = p->fontMetrics().lineSpacing(); p-> setMatrixEnabled(false); // we use our own coordinate transformation - QPainter::RenderHints hints = 0; + QPainter::RenderHints hints = QPainter::RenderHints(); // Ask to to antialias drawings if requested if (QucsSettings.GraphAntiAliasing) hints |= QPainter::Antialiasing; // Ask to antialias text if requested @@ -289,7 +289,7 @@ void ViewPainter::drawRoundRect(int x1i, int y1i, int dxi, int dyi) dx = float(dxi)*Scale; dy = float(dyi)*Scale; - Painter->drawRoundRect(QRectF(x1, y1, dx, dy)); + Painter->drawRoundedRect(QRectF(x1, y1, dx, dy),4,4); } // ------------------------------------------------------------- From 19af73bc125a855246870f58b3bd67088d59aba6 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 24 Feb 2022 22:30:33 +0100 Subject: [PATCH 07/45] Fix more fontMetrics warnings --- qucs/components/component.cpp | 2 +- qucs/components/componentdialog.cpp | 4 ++-- qucs/components/mstee.cpp | 2 +- qucs/printerwriter.cpp | 18 +++++++++--------- qucs/qucs.cpp | 2 +- qucs/qucs.h | 3 ++- qucs/qucs_actions.cpp | 22 +++++++++++----------- qucs/schematic.cpp | 4 ++-- 8 files changed, 29 insertions(+), 28 deletions(-) diff --git a/qucs/components/component.cpp b/qucs/components/component.cpp index b23eaf17..38fb4e97 100644 --- a/qucs/components/component.cpp +++ b/qucs/components/component.cpp @@ -155,7 +155,7 @@ int Component::getTextSelected(int x_, int y_, float Corr) // use the screen-compatible metric QFontMetrics metrics(QucsSettings.font, 0); if(showName) { - w = metrics.width(Name); + w = metrics.boundingRect(Name).width(); if(dy < 1) { if(x_ < w) return 0; return -1; diff --git a/qucs/components/componentdialog.cpp b/qucs/components/componentdialog.cpp index 2bf18ee4..610f4a99 100644 --- a/qucs/components/componentdialog.cpp +++ b/qucs/components/componentdialog.cpp @@ -668,8 +668,8 @@ void ComponentDialog::slotSelectProperty(QTableWidgetItem *item) // use the screen-compatible metric QFontMetrics metrics(QucsSettings.font, 0); // get size of text - qDebug() << "desc = " << desc << metrics.width(desc); - while(metrics.width(desc) > 270) { // if description too long, cut it nicely + qDebug() << "desc = " << desc << metrics.boundingRect(desc).width(); + while(metrics.boundingRect(desc).width() > 270) { // if description too long, cut it nicely // so 270 above will be the maximum size of the name label and associated edit line widget if (desc.lastIndexOf(' ') != -1) desc = desc.left(desc.lastIndexOf(' ')) + "...."; diff --git a/qucs/components/mstee.cpp b/qucs/components/mstee.cpp index 2cf60f75..e0a6ddac 100644 --- a/qucs/components/mstee.cpp +++ b/qucs/components/mstee.cpp @@ -97,7 +97,7 @@ void MStee::createSymbol() if(Props.getLast()->Value.at(0) != 'n') { QString stmp = "1"; - int w = smallmetrics.width(stmp); + int w = smallmetrics.boundingRect(stmp).width(); int d = smallmetrics.descent(); int a = smallmetrics.ascent(); diff --git a/qucs/printerwriter.cpp b/qucs/printerwriter.cpp index 3751902a..21c1f0df 100644 --- a/qucs/printerwriter.cpp +++ b/qucs/printerwriter.cpp @@ -37,7 +37,7 @@ PrinterWriter::PrinterWriter() Printer->setOptionEnabled(QPrinter::PrintPageRange, false); Printer->setOptionEnabled(QPrinter::PrintToFile, true);*/ - Printer->setPaperSize(QPrinter::A4); + Printer->setPageSize(QPageSize(QPageSize::A4)); Printer->setColorMode(QPrinter::Color); Printer->setFullPage(true); @@ -59,13 +59,13 @@ PrinterWriter::noGuiPrint(QWidget *doc, QString printFile, //page size if (page == "A3") { - Printer->setPaperSize(QPrinter::A3); + Printer->setPageSize(QPageSize(QPageSize::A3)); } else if (page == "B4") { - Printer->setPaperSize(QPrinter::B4); + Printer->setPageSize(QPageSize(QPageSize::B4)); } else if (page == "B5") { - Printer->setPaperSize(QPrinter::B5); + Printer->setPageSize(QPageSize(QPageSize::B5)); } else { - Printer->setPaperSize(QPrinter::A4); + Printer->setPageSize(QPageSize(QPageSize::A4)); } //dpi Printer->setResolution(dpi); @@ -77,9 +77,9 @@ PrinterWriter::noGuiPrint(QWidget *doc, QString printFile, } //orientation if (orientation == "landscape") { - Printer->setOrientation(QPrinter::Landscape); + Printer->setPageOrientation(QPageLayout::Landscape); } else { - Printer->setOrientation(QPrinter::Portrait); + Printer->setPageOrientation(QPageLayout::Portrait); } QPainter Painter(Printer); if(!Painter.device()) { // valid device available ? @@ -104,7 +104,7 @@ PrinterWriter::print(QWidget *doc) } } else { - Printer->setOrientation(QPrinter::Landscape); + Printer->setPageOrientation(QPageLayout::Landscape); if (dialog->exec() == QDialog::Accepted) { @@ -113,7 +113,7 @@ PrinterWriter::print(QWidget *doc) delete dialog; return; } - for (int z = Printer->numCopies(); z > 0; --z) { + for (int z = Printer->copyCount(); z > 0; --z) { if (Printer->printerState() == QPrinter::Aborted) { break; } diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index 2fb42c8f..58282920 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -2712,7 +2712,7 @@ void QucsApp::slotEditElement() // looses the focus. void QucsApp::slotHideEdit() { - editText->setParent(this, 0); + editText->setParent(this, Qt::WindowFlags()); editText->setHidden(true); } diff --git a/qucs/qucs.h b/qucs/qucs.h index 920f3114..9aa96d61 100644 --- a/qucs/qucs.h +++ b/qucs/qucs.h @@ -386,7 +386,8 @@ private slots: private: bool performToggleAction(bool, QAction*, pToggleFunc, pMouseFunc, pMouseFunc2); - void launchTool(const QString&, const QString&, const QString& = "",bool qucs_tool = false); // tool, description and args + void launchTool(const QString&, const QString&, + const QStringList& = QStringList(),bool qucs_tool = false); // tool, description and args friend class SaveDialog; QString lastExportFilename; }; diff --git a/qucs/qucs_actions.cpp b/qucs/qucs_actions.cpp index 3ff12fcf..8fdd3d2f 100644 --- a/qucs/qucs_actions.cpp +++ b/qucs/qucs_actions.cpp @@ -809,7 +809,7 @@ void QucsApp::slotCallActiveFilter() // Is called to start the transmission line calculation program. void QucsApp::slotCallLine() { - launchTool("qucstrans", "line calculation","",true); + launchTool("qucstrans", "line calculation",QStringList(),true); } // ------------------------------------------------------------------------ @@ -831,14 +831,14 @@ void QucsApp::slotCallMatch() // Is called to start the attenuator calculation program. void QucsApp::slotCallAtt() { - launchTool("qucsattenuator", "attenuator calculation","",true); + launchTool("qucsattenuator", "attenuator calculation",QStringList(),true); } // ------------------------------------------------------------------------ // Is called to start the resistor color code calculation program. void QucsApp::slotCallRes() { - launchTool("qucsrescodes", "resistor color code calculation","",true); + launchTool("qucsrescodes", "resistor color code calculation",QStringList(),true); } /*! @@ -848,7 +848,7 @@ void QucsApp::slotCallRes() * \param progDesc program description string (used for error messages) * \param args arguments to pass to the executable */ -void QucsApp::launchTool(const QString& prog, const QString& progDesc, const QString& args, +void QucsApp::launchTool(const QString& prog, const QString& progDesc, const QStringList &args, bool qucs_tool) { QProcess *tool = new QProcess(); @@ -857,16 +857,16 @@ void QucsApp::launchTool(const QString& prog, const QString& progDesc, const QSt if (qucs_tool) tooldir = QucsSettings.QucsatorDir; else tooldir = QucsSettings.BinDir; #ifdef __MINGW32__ - QString cmd = QDir::toNativeSeparators("\""+tooldir + prog + ".exe\"") + " " + args; + QString cmd = QDir::toNativeSeparators("\""+tooldir + prog + ".exe\""); #elif __APPLE__ - QString cmd = QDir::toNativeSeparators(tooldir + prog + ".app/Contents/MacOS/" + prog) + " " + args; + QString cmd = QDir::toNativeSeparators(tooldir + prog + ".app/Contents/MacOS/" + prog); #else - QString cmd = QDir::toNativeSeparators(tooldir + prog) + " " + args; + QString cmd = QDir::toNativeSeparators(tooldir + prog); #endif tool->setWorkingDirectory(tooldir); qDebug() << "Command :" << cmd; - tool->start(cmd); + tool->start(cmd,args); if(!tool->waitForStarted(1000) ) { QMessageBox::critical(this, tr("Error"), @@ -1193,7 +1193,7 @@ void QucsApp::slotApplyCompText() // avoid seeing the property text behind the line edit if(pp) // Is it first property or component name ? s = pp->Value; - editText->setMinimumWidth(editText->fontMetrics().width(s)+4); + editText->setMinimumWidth(editText->fontMetrics().boundingRect(s).width()+4); Doc->contentsToViewport(int(Doc->Scale * float(view->MAx1 - Doc->ViewX1)), @@ -1202,7 +1202,7 @@ void QucsApp::slotApplyCompText() editText->setReadOnly(false); if(pp) { // is it a property ? s = pp->Value; - view->MAx2 += editText->fontMetrics().width(pp->Name+"="); + view->MAx2 += editText->fontMetrics().boundingRect(pp->Name+"=").width(); if(pp->Description.indexOf('[') >= 0) // is selection list ? editText->setReadOnly(true); Expr_CompProp.setPattern("[^\"]*"); @@ -1230,7 +1230,7 @@ void QucsApp::slotApplyCompText() // the width of the edit field. void QucsApp::slotResizePropEdit(const QString& t) { - editText->resize(editText->fontMetrics().width(t)+4, + editText->resize(editText->fontMetrics().boundingRect(t).width()+4, editText->fontMetrics().lineSpacing()); } diff --git a/qucs/schematic.cpp b/qucs/schematic.cpp index b4f4afe7..6a5ab040 100644 --- a/qucs/schematic.cpp +++ b/qucs/schematic.cpp @@ -439,7 +439,7 @@ void Schematic::drawContents(QPainter *p, int, int, int, int) x = pn->cx; y = pn->cy + 4; z = pn->x1; - if(z & 1) x -= Painter.Painter->fontMetrics().width(pn->Name); + if(z & 1) x -= Painter.Painter->fontMetrics().boundingRect(pn->Name).width(); if(!(z & 2)) { y -= (Painter.LineSpacing>>1) + 4; if(z & 1) x -= 4; @@ -732,7 +732,7 @@ void Schematic::paintSchToViewpainter(ViewPainter *p, bool printAll, bool toImag x = pn->cx; y = pn->cy + 4; z = pn->x1; - if(z & 1) x -= p->Painter->fontMetrics().width(pn->Name); + if(z & 1) x -= p->Painter->fontMetrics().boundingRect(pn->Name).width(); if(!(z & 2)) { y -= (p->LineSpacing>>1) + 4; if(z & 1) x -= 4; From 89755d6b615ac2f6c658c6d6932a5e189fb7719b Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 24 Feb 2022 23:16:43 +0100 Subject: [PATCH 08/45] Fix endl and inkscape start --- qucs/extsimkernels/abstractspicekernel.cpp | 10 ++++---- qucs/imagewriter.cpp | 30 ++++++++++++++-------- qucs/viewpainter.cpp | 2 +- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index feb387e0..0b20b959 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -1116,14 +1116,14 @@ void AbstractSpiceKernel::convertToQucsData(const QString &qucs_dataset) if (!indep.isEmpty()) { ds_stream<\n").arg(indep).arg(indep_cnt); // output indep var: TODO: parameter sweep for (int i=0;i\n"; } ds_stream<\n").arg(swp_var).arg(swp_var_val.count()); foreach (QString val,swp_var_val) { - ds_stream<\n"; if (indep.isEmpty()) indep = swp_var; @@ -1131,7 +1131,7 @@ void AbstractSpiceKernel::convertToQucsData(const QString &qucs_dataset) if (hasDblParSweep) { ds_stream<\n").arg(swp_var2).arg(swp_var2_val.count()); foreach (QString val,swp_var2_val) { - ds_stream<\n"; indep += " " + swp_var2; @@ -1139,7 +1139,7 @@ void AbstractSpiceKernel::convertToQucsData(const QString &qucs_dataset) } else if (!indep.isEmpty()) { ds_stream<\n").arg(indep).arg(sim_points.count()); // output indep var: TODO: parameter sweep foreach (sim_point,sim_points) { - ds_stream<\n"; } @@ -1158,7 +1158,7 @@ void AbstractSpiceKernel::convertToQucsData(const QString &qucs_dataset) s += QString::number(fabs(im),'e',12) + "\n"; ds_stream<\n"; diff --git a/qucs/imagewriter.cpp b/qucs/imagewriter.cpp index f14bb71d..ae23f8cf 100644 --- a/qucs/imagewriter.cpp +++ b/qucs/imagewriter.cpp @@ -75,14 +75,18 @@ ImageWriter::noGuiPrint(QWidget *doc, QString printFile, QString color) delete svg1; if (!printFile.endsWith(".svg")) { - QString cmd = "inkscape -z -D --file="; - cmd += tempfile + " "; + QString cmd = "inkscape"; + QStringList args; + args<<"-z"<<"-D"; + QString tmpf = "--file=" + tempfile; + args<needsInkscape()) { - QString cmd = "inkscape -z -D --file="; - cmd += filename+".tmp.svg "; + QString cmd = "inkscape"; + QStringList args; + args<<"-z"<<"-D"; + QString stmp = "--file=" + filename+".tmp.svg"; + args<isPdf_Tex()) { QString tmp = filename; tmp.chop(4); - cmd = cmd + "--export-pdf="+ tmp + " --export-latex"; + stmp = "--export-pdf="+ tmp + " --export-latex"; + args<isPdf()) { - cmd = cmd + "--export-pdf=" + filename; + stmp = "--export-pdf=" + filename; + args<isEps()) { - cmd = cmd + "--export-eps=" + filename; + stmp = "--export-eps=" + filename; + args<setFont(f); LineSpacing = p->fontMetrics().lineSpacing(); - p-> setMatrixEnabled(false); // we use our own coordinate transformation + p-> setWorldMatrixEnabled(false); // we use our own coordinate transformation QPainter::RenderHints hints = QPainter::RenderHints(); // Ask to to antialias drawings if requested From 3a3481afeb4e725d1d52955ca5a333a68b8ca88f Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 24 Feb 2022 23:45:28 +0100 Subject: [PATCH 09/45] Fix QString::SkipEmptyParts --- qucs/components/param_sweep.cpp | 2 +- qucs/extsimkernels/abstractspicekernel.cpp | 20 ++++++++--------- qucs/extsimkernels/qucs2spice.cpp | 26 ++++++++++++---------- qucs/extsimkernels/spicecompat.cpp | 3 ++- qucs/main.cpp | 2 +- qucs/misc.h | 14 ++++++++++-- qucs/schematic.cpp | 12 +++++----- 7 files changed, 46 insertions(+), 33 deletions(-) diff --git a/qucs/components/param_sweep.cpp b/qucs/components/param_sweep.cpp index 5c4c1e0e..affb9b03 100644 --- a/qucs/components/param_sweep.cpp +++ b/qucs/components/param_sweep.cpp @@ -157,7 +157,7 @@ QString Param_Sweep::getNgspiceBeforeSim(QString sim, int lvl) QString mod,mod_par; if (!par.contains('@')) { - QStringList par_lst = par.split('.',QString::SkipEmptyParts); + QStringList par_lst = par.split('.',qucs::SkipEmptyParts); if (par_lst.count()>1) { mod_par = par_lst.at(1); // Schematic *sch = (Schematic *) QucsMain->DocumentTab->currentPage(); diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index 0b20b959..8fcff100 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -383,7 +383,7 @@ void AbstractSpiceKernel::parseHBOutput(QString ngspice_file, QList sim_point; sim_point.clear(); for (int i=1;i=2) { - QStringList nods = lines.at(0).split(QRegExp("\\s"),QString::SkipEmptyParts); - QStringList vals = lines.at(1).split(QRegExp("\\s"),QString::SkipEmptyParts); + QStringList nods = lines.at(0).split(QRegExp("\\s"),qucs::SkipEmptyParts); + QStringList vals = lines.at(1).split(QRegExp("\\s"),qucs::SkipEmptyParts); QStringList::iterator n,v; for(n = nods.begin(),v = vals.begin();n!=nods.end()||v!=vals.end();n++,v++) { if ((*n).startsWith("I(")) { @@ -800,7 +800,7 @@ bool AbstractSpiceKernel::extractASCIISamples(QString &lin, QTextStream &ngsp_da sim_point.append(indep_val); for (int i=0;i sim_point; foreach (QString val, val_lst) { sim_point.append(val.toDouble()); @@ -922,10 +922,10 @@ void AbstractSpiceKernel::parseResFile(QString resfile, QString &var, QStringLis QRegExp sep("\\s"); QString lin = swp_data.readLine(); if (var_pattern.exactMatch(lin)) { - var = lin.split(sep,QString::SkipEmptyParts).last(); + var = lin.split(sep,qucs::SkipEmptyParts).last(); } if (point_pattern.exactMatch(lin)) { - values.append(lin.split(sep,QString::SkipEmptyParts).last()); + values.append(lin.split(sep,qucs::SkipEmptyParts).last()); } } ofile.close(); diff --git a/qucs/extsimkernels/qucs2spice.cpp b/qucs/extsimkernels/qucs2spice.cpp index a0b664fb..835ada21 100644 --- a/qucs/extsimkernels/qucs2spice.cpp +++ b/qucs/extsimkernels/qucs2spice.cpp @@ -22,6 +22,8 @@ #include "spicecompat.h" #include "components/equation.h" +#include "misc.h" + /*! \file qucs2spice.cpp \brief Implementation of qucs2spice namespace @@ -123,7 +125,7 @@ QString qucs2spice::convert_netlist(QString netlist, bool xyce) QString qucs2spice::convert_rcl(QString line) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString s1 = lst.takeFirst(); s += s1.remove(':'); s += " " + lst.takeFirst(); @@ -139,7 +141,7 @@ QString qucs2spice::convert_header(QString line) { QString s = line; s.replace(".Def:",".SUBCKT "); - QStringList lst = s.split(' ',QString::SkipEmptyParts); + QStringList lst = s.split(' ',qucs::SkipEmptyParts); lst.insert(2," gnd "); // ground s = lst.join(" "); s += "\n"; @@ -149,7 +151,7 @@ QString qucs2spice::convert_header(QString line) QString qucs2spice::convert_diode(QString line,bool xyce) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -166,7 +168,7 @@ QString qucs2spice::convert_diode(QString line,bool xyce) QString qucs2spice::convert_mosfet(QString line, bool xyce) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -208,7 +210,7 @@ QString qucs2spice::convert_mosfet(QString line, bool xyce) QString qucs2spice::convert_jfet(QString line, bool xyce) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -239,7 +241,7 @@ QString qucs2spice::convert_jfet(QString line, bool xyce) QString qucs2spice::convert_bjt(QString line) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -289,7 +291,7 @@ QString qucs2spice::convert_ccvs(QString line) QString qucs2spice::convert_ccs(QString line, bool voltage) { - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -321,7 +323,7 @@ QString qucs2spice::convert_vcvs(QString line) QString qucs2spice::convert_vcs(QString line,bool voltage) { - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString name = lst.takeFirst(); int idx = name.indexOf(':'); name = name.right(name.count()-idx-1); // name @@ -344,7 +346,7 @@ QString qucs2spice::convert_vcs(QString line,bool voltage) QString qucs2spice::convert_dc_src(QString line) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString s1 = lst.takeFirst(); s += s1.remove(':'); s += " " + lst.takeFirst(); @@ -359,7 +361,7 @@ QString qucs2spice::convert_dc_src(QString line) QString qucs2spice::convert_edd(QString line, QStringList &EqnsAndVars) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QStringList nods; QString nam = lst.takeFirst().remove(':'); @@ -404,7 +406,7 @@ QString qucs2spice::convert_edd(QString line, QStringList &EqnsAndVars) QString qucs2spice::convert_subckt(QString line) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString s1 = lst.takeFirst(); s += "X" + s1.remove("Sub:") + " gnd "; @@ -438,7 +440,7 @@ QString qucs2spice::convert_subckt(QString line) QString qucs2spice::convert_gyrator(QString line) { QString s=""; - QStringList lst = line.split(" ",QString::SkipEmptyParts); + QStringList lst = line.split(" ",qucs::SkipEmptyParts); QString Name = lst.takeFirst(); Name = Name.section(':',1,1); QString n1 = lst.takeFirst(); diff --git a/qucs/extsimkernels/spicecompat.cpp b/qucs/extsimkernels/spicecompat.cpp index 2cecd3b8..1d870b68 100644 --- a/qucs/extsimkernels/spicecompat.cpp +++ b/qucs/extsimkernels/spicecompat.cpp @@ -1,5 +1,6 @@ #include "spicecompat.h" #include "main.h" +#include "misc.h" #include @@ -273,7 +274,7 @@ int spicecompat::getPins(const QString &file, const QString &compname, QStringLi QRegExp subckt_header("^\\s*\\.(S|s)(U|u)(B|b)(C|c)(K|k)(T|t)\\s.*"); if (subckt_header.exactMatch(lin)) { QRegExp sep("\\s"); - QStringList lst2 = lin.split(sep,QString::SkipEmptyParts); + QStringList lst2 = lin.split(sep,qucs::SkipEmptyParts); QString name = lin.section(sep,1,1,QString::SectionSkipEmpty).toLower(); QString refname = compname.toLower(); if (name != refname) continue; diff --git a/qucs/main.cpp b/qucs/main.cpp index ad322538..1be513bb 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -165,7 +165,7 @@ bool loadSettings() if (settings.contains("TextAntiAliasing")) QucsSettings.TextAntiAliasing = settings.value("TextAntiAliasing").toBool(); else QucsSettings.TextAntiAliasing = false; - QucsSettings.RecentDocs = settings.value("RecentDocs").toString().split("*",QString::SkipEmptyParts); + QucsSettings.RecentDocs = settings.value("RecentDocs").toString().split("*",qucs::SkipEmptyParts); QucsSettings.numRecentDocs = QucsSettings.RecentDocs.count(); diff --git a/qucs/misc.h b/qucs/misc.h index abd0bd65..c775f335 100644 --- a/qucs/misc.h +++ b/qucs/misc.h @@ -22,8 +22,7 @@ * \Declaration of some miscellaneous function */ -class QString; - +#include #include #include #include @@ -31,8 +30,19 @@ class QString; #include + #define Q_UINT32 uint32_t + +namespace qucs { +#if QT_VERSION >= 0x050e00 + const auto SkipEmptyParts = Qt::SkipEmptyParts; +#else + const auto SkipEmptyParts = QString::SkipEmptyParts; +#endif +} + + namespace misc { QString complexRect(double, double, int Precision=3); QString complexDeg (double, double, int Precision=3); diff --git a/qucs/schematic.cpp b/qucs/schematic.cpp index 6a5ab040..6545aa5d 100644 --- a/qucs/schematic.cpp +++ b/qucs/schematic.cpp @@ -1439,7 +1439,7 @@ int Schematic::adjustPortNumbers() VInfo = VHDL_File_Info (Name, true); if (!VInfo.PortNames.isEmpty()) - Names = VInfo.PortNames.split(",", QString::SkipEmptyParts); + Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts); for(pp = SymbolPaints.first(); pp!=0; pp = SymbolPaints.next()) if(pp->Name == ".ID ") { @@ -1447,11 +1447,11 @@ int Schematic::adjustPortNumbers() id->Prefix = VInfo.EntityName.toUpper(); id->Parameter.clear(); if (!VInfo.GenNames.isEmpty()) - GNames = VInfo.GenNames.split(",", QString::SkipEmptyParts); + GNames = VInfo.GenNames.split(",", qucs::SkipEmptyParts); if (!VInfo.GenTypes.isEmpty()) - GTypes = VInfo.GenTypes.split(",", QString::SkipEmptyParts); + GTypes = VInfo.GenTypes.split(",", qucs::SkipEmptyParts); if (!VInfo.GenDefs.isEmpty()) - GDefs = VInfo.GenDefs.split(",", QString::SkipEmptyParts);; + GDefs = VInfo.GenDefs.split(",", qucs::SkipEmptyParts);; for(Number = 1, it = GNames.begin(); it != GNames.end(); ++it) { id->Parameter.append(new SubParameter( true, @@ -1499,7 +1499,7 @@ int Schematic::adjustPortNumbers() else VInfo = Verilog_File_Info (Name, true); if (!VInfo.PortNames.isEmpty()) - Names = VInfo.PortNames.split(",", QString::SkipEmptyParts); + Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts); for(pp = SymbolPaints.first(); pp!=0; pp = SymbolPaints.next()) if(pp->Name == ".ID ") { @@ -1546,7 +1546,7 @@ int Schematic::adjustPortNumbers() VInfo = VerilogA_File_Info (Name, true); if (!VInfo.PortNames.isEmpty()) - Names = VInfo.PortNames.split(",", QString::SkipEmptyParts); + Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts); for(pp = SymbolPaints.first(); pp!=0; pp = SymbolPaints.next()) if(pp->Name == ".ID ") { From 2a0edc4f54a29a587f708e6721dd6e4892fd3688 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Fri, 25 Feb 2022 23:31:19 +0100 Subject: [PATCH 10/45] Fix warnings in WheelEvent in Q3ScrollView --- qucs/qt3_compat/q3scrollview.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/qucs/qt3_compat/q3scrollview.cpp b/qucs/qt3_compat/q3scrollview.cpp index d9d7fee4..bd9aa92e 100644 --- a/qucs/qt3_compat/q3scrollview.cpp +++ b/qucs/qt3_compat/q3scrollview.cpp @@ -1141,13 +1141,22 @@ void Q3ScrollView::mouseMoveEvent(QMouseEvent *e) #ifndef QT_NO_WHEELEVENT void Q3ScrollView::wheelEvent(QWheelEvent *e) { +#if QT_VERSION >= 0x050f00 + QPoint pe(e->globalPosition().x(),e->globalPosition().y()); + QPoint pg = viewport()->mapFromGlobal(pe); + QPointF pgf(pg.x(),pg.y()); + QWheelEvent ce(pgf, + e->globalPosition(), e->pixelDelta(), e->angleDelta(), + e->buttons(), e->modifiers(), e->phase(), e->inverted()); +#else QWheelEvent ce(viewport()->mapFromGlobal(e->globalPos()), e->globalPos(), e->delta(), e->buttons(), e->modifiers()); +#endif viewportWheelEvent(&ce); if (!ce.isAccepted()) { - if (e->orientation() == Horizontal && horizontalScrollBar()) + if (e->angleDelta().x() != 0 && horizontalScrollBar()) horizontalScrollBar()->event(e); - else if (e->orientation() == Vertical && verticalScrollBar()) + else if (e->angleDelta().y() != 0 && verticalScrollBar()) verticalScrollBar()->event(e); } else { e->accept(); @@ -1872,8 +1881,17 @@ void Q3ScrollView::viewportWheelEvent(QWheelEvent* e) be sent to the focus widget if the widget-under-mouse doesn't want the event itself. */ - QWheelEvent ce(viewportToContents(e->pos()), - e->globalPos(), e->delta(), e->buttons(), e->modifiers()); +#if QT_VERSION >= 0x050f00 + QPoint pe(e->globalPosition().x(),e->globalPosition().y()); + QPoint pg = viewport()->mapFromGlobal(pe); + QPointF pgf(pg.x(),pg.y()); + QWheelEvent ce(pgf, + e->globalPosition(), e->pixelDelta(), e->angleDelta(), + e->buttons(), e->modifiers(), e->phase(), e->inverted()); +#else + QWheelEvent ce(viewport()->mapFromGlobal(e->globalPos()), + e->globalPos(), e->delta(), e->buttons(), e->modifiers()); +#endif contentsWheelEvent(&ce); if (ce.isAccepted()) e->accept(); From a416dead5c33f9ec2d1ac3529d7080e64950049a Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Fri, 25 Feb 2022 23:59:27 +0100 Subject: [PATCH 11/45] Fix warnings in wheel event in Schematic --- qucs/extsimkernels/ngspice.cpp | 3 ++- qucs/schematic.cpp | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index 78d9ce76..b8a94837 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -26,6 +26,7 @@ #include "spicecomponents/sp_spiceinit.h" #include "spicecomponents/xsp_cmlib.h" #include "main.h" +#include "misc.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -234,7 +235,7 @@ void Ngspice::createNetlist(QTextStream &stream, int , custom_vars = pc->Props.at(1)->Value; custom_vars.replace(";"," "); QString cust_out = pc->Props.at(2)->Value; - outputs.append(cust_out.split(';',QString::SkipEmptyParts)); + outputs.append(cust_out.split(';',qucs::SkipEmptyParts)); } if (sim_typ==".SW") { QString SwpSim = pc->Props.at(0)->Value; diff --git a/qucs/schematic.cpp b/qucs/schematic.cpp index 6545aa5d..e9f2091c 100644 --- a/qucs/schematic.cpp +++ b/qucs/schematic.cpp @@ -1885,11 +1885,14 @@ void Schematic::contentsWheelEvent(QWheelEvent *Event) { App->editText->setHidden(true); // disable edit of component property // use smaller steps; typically the returned delta() is a multiple of 120 - int delta = Event->delta() >> 1; + //int delta = Event->delta() >> 1; // ................................................................... if((Event->modifiers() & Qt::ShiftModifier) || - (Event->orientation() == Qt::Horizontal)) { // scroll horizontally ? + (Event->angleDelta().x() != 0)) { // scroll horizontally ? + int delta = Event->angleDelta().y() / 2; + if (Event->angleDelta().x() != 0) + delta = Event->angleDelta().x() / 2; if(delta > 0) { if(scrollLeft(delta)) scrollBy(-delta, 0); } else { if(scrollRight(delta)) scrollBy(-delta, 0); } viewport()->update(); // because QScrollView thinks nothing has changed @@ -1899,14 +1902,21 @@ void Schematic::contentsWheelEvent(QWheelEvent *Event) else if(Event->modifiers() & Qt::ControlModifier) { // use mouse wheel to zoom ? // zoom factor scaled according to the wheel delta, to accomodate // values different from 60 (slower or faster zoom) + int delta = Event->angleDelta().y(); float Scaling = pow(1.1, delta/60.0); zoom(Scaling); Scaling -= 1.0; +#if QT_VERSION >= 0x050f00 + scrollBy( int(Scaling * float(Event->position().x())), + int(Scaling * float(Event->position().y())) ); +#else scrollBy( int(Scaling * float(Event->pos().x())), int(Scaling * float(Event->pos().y())) ); +#endif } // ................................................................... else { // scroll vertically ! + int delta = Event->angleDelta().y() / 2; if(delta > 0) { if(scrollUp(delta)) scrollBy(0, -delta); } else { if(scrollDown(delta)) scrollBy(0, -delta); } viewport()->update(); // because QScrollView thinks nothing has changed From 901f407d4a48df9205f21ff6c1776e8c7dbdeb91 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 8 Mar 2022 00:15:37 +0100 Subject: [PATCH 12/45] Fix QProcess execution --- qucs/components/spicefile.cpp | 5 +++- qucs/extsimkernels/ngspice.cpp | 5 +++- qucs/extsimkernels/xspice_cmbuilder.cpp | 6 ++-- qucs/extsimkernels/xyce.cpp | 6 +++- qucs/misc.cpp | 38 +++++++++++++++++++++++++ qucs/misc.h | 1 + qucs/qucs.cpp | 5 +++- 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/qucs/components/spicefile.cpp b/qucs/components/spicefile.cpp index a61190b2..0173c6a0 100644 --- a/qucs/components/spicefile.cpp +++ b/qucs/components/spicefile.cpp @@ -408,7 +408,10 @@ bool SpiceFile::recreateSubNetlist(QString *SpiceFile, QString *FileName) QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("PATH", env.value("PATH") ); SpicePrep->setProcessEnvironment(env); - SpicePrep->start(script.join(" ")); + QString cmd = script.at(0); + QStringList script_args = script; + script_args.removeAt(0); + SpicePrep->start(cmd,script_args); //QucsHelp->setCommunication(0); if(SpicePrep->state()!=QProcess::Running&& diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index b8a94837..efde879d 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -447,7 +447,10 @@ void Ngspice::slotSimulate() SimProcess->setWorkingDirectory(workdir); qDebug()<start(cmd); + QStringList cmd_args = misc::parseCmdArgs(cmd); + QString ngsp_cmd = cmd_args.at(0); + cmd_args.removeAt(0); + SimProcess->start(ngsp_cmd,cmd_args); emit started(); } diff --git a/qucs/extsimkernels/xspice_cmbuilder.cpp b/qucs/extsimkernels/xspice_cmbuilder.cpp index 16763a42..82a492ff 100644 --- a/qucs/extsimkernels/xspice_cmbuilder.cpp +++ b/qucs/extsimkernels/xspice_cmbuilder.cpp @@ -338,12 +338,12 @@ void XSPICE_CMbuilder::compileCMlib(QString &output) output += QString("Working directory is %1\n").arg(cmdir); QProcess *make = new QProcess(); - make->setReadChannelMode(QProcess::MergedChannels); + make->setProcessChannelMode(QProcess::MergedChannels); make->setWorkingDirectory(cmdir); #ifdef __MINGW32__ - make->start("mingw32-make.exe"); // For Unix + make->start("mingw32-make.exe",QStringList()); // For Unix #else - make->start("make"); // For Unix + make->start("make",QStringList()); // For Unix #endif make->waitForFinished(); output += make->readAll(); diff --git a/qucs/extsimkernels/xyce.cpp b/qucs/extsimkernels/xyce.cpp index a6feca22..32803494 100644 --- a/qucs/extsimkernels/xyce.cpp +++ b/qucs/extsimkernels/xyce.cpp @@ -19,6 +19,7 @@ #include "xyce.h" #include "components/equation.h" #include "main.h" +#include "misc.h" /*! @@ -382,7 +383,10 @@ void Xyce::nextSimulation() if (file.endsWith(".noise.cir")) Noisesim = true; SimProcess->setWorkingDirectory(workdir); QString cmd = QString("%1 %2 \"%3\"").arg(simulator_cmd,simulator_parameters,file); - SimProcess->start(cmd); + QStringList cmd_args = misc::parseCmdArgs(cmd); + QString xyce_cmd = cmd_args.at(0); + cmd_args.removeAt(0); + SimProcess->start(xyce_cmd,cmd_args); } else { output += "No simulations!\n" "Exiting...\n"; diff --git a/qucs/misc.cpp b/qucs/misc.cpp index 54966c11..823c9076 100644 --- a/qucs/misc.cpp +++ b/qucs/misc.cpp @@ -442,6 +442,44 @@ VersionTriplet::VersionTriplet(const QString& version) { } } +QStringList misc::parseCmdArgs(const QString &program) +{ + QStringList args; + QString tmp; + int quoteCount = 0; + bool inQuote = false; + // handle quoting. tokens can be surrounded by double quotes + // "hello world". three consecutive double quotes represent + // the quote character itself. + for (int i = 0; i < program.size(); ++i) { + if (program.at(i) == QLatin1Char('"')) { + ++quoteCount; + if (quoteCount == 3) { + // third consecutive quote + quoteCount = 0; + tmp += program.at(i); + } + continue; + } + if (quoteCount) { + if (quoteCount == 1) + inQuote = !inQuote; + quoteCount = 0; + } + if (!inQuote && program.at(i).isSpace()) { + if (!tmp.isEmpty()) { + args += tmp; + tmp.clear(); + } + } else { + tmp += program.at(i); + } + } + if (!tmp.isEmpty()) + args += tmp; + return args; +} + VersionTriplet::VersionTriplet(){ major = minor = patch = 0; } diff --git a/qucs/misc.h b/qucs/misc.h index c775f335..de677f96 100644 --- a/qucs/misc.h +++ b/qucs/misc.h @@ -87,6 +87,7 @@ namespace misc { p->setIcon(icon); p->setIconSize(pixmap.rect().size()); } + QStringList parseCmdArgs(const QString &program); } /*! handle the application version string diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index 58282920..cad0a4f1 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -2321,7 +2321,10 @@ void QucsApp::slotOpenContent(const QModelIndex &idx) QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("PATH", env.value("PATH") ); Program->setProcessEnvironment(env); - Program->start(com.join(" ")); + QString cmd = com.at(0); + QStringList com_args = com; + com_args.removeAt(0); + Program->start(cmd, com_args); if(Program->state()!=QProcess::Running&& Program->state()!=QProcess::Starting) { QMessageBox::critical(this, tr("Error"), From c1225b97e8a536a026f38e2567047671be188001 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 8 Mar 2022 00:20:21 +0100 Subject: [PATCH 13/45] Add conditional compilation --- qucs/extsimkernels/codemodelgen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qucs/extsimkernels/codemodelgen.cpp b/qucs/extsimkernels/codemodelgen.cpp index 9f058060..80fcf80d 100644 --- a/qucs/extsimkernels/codemodelgen.cpp +++ b/qucs/extsimkernels/codemodelgen.cpp @@ -620,8 +620,13 @@ void CodeModelGen::scanEquations(Schematic *sch,QStringList &pars, } else { int Nv = init_pars.count(); // Reverse init parameters list before exit for(int i = 0; i < (Nv/2); i++) { +#if QT_VERSION >= 0x050e00 init_pars.swapItemsAt(i,Nv-(1+i)); InitEqns.swapItemsAt(i,Nv-(1+i)); +#else + init_pars.swap(i,Nv-(1+i)); + InitEqns.swap(i,Nv-(1+i)); +#endif } return; } From 6f68fbaa65fbebe18b61dc2150675538a24673e1 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 8 Mar 2022 00:24:01 +0100 Subject: [PATCH 14/45] Fix warnings --- qucs/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qucs/main.cpp b/qucs/main.cpp index f858b116..20956ab9 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -285,8 +285,10 @@ void qucsMessageOutput(QtMsgType type, const QMessageLogContext &, const QString break; case QtFatalMsg: fprintf(stderr, "Fatal: %s\n", msg); + break; case QtInfoMsg: fprintf(stderr,"Info %s\n", msg); + break; default: fprintf(stderr,"%s\n", msg); } From 1cc5da31285cc95fd6b7563a518522c9ce053c35 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 10 Mar 2022 00:20:30 +0100 Subject: [PATCH 15/45] Fix drag'n'drop on schematic --- qucs/qt3_compat/q3scrollview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qucs/qt3_compat/q3scrollview.cpp b/qucs/qt3_compat/q3scrollview.cpp index bd9aa92e..67001554 100644 --- a/qucs/qt3_compat/q3scrollview.cpp +++ b/qucs/qt3_compat/q3scrollview.cpp @@ -1811,6 +1811,8 @@ void Q3ScrollView::viewportDragEnterEvent(QDragEnterEvent* e) e->mouseButtons(),e->keyboardModifiers()); //e->setPoint(viewportToContents(e->pos())); contentsDragEnterEvent(&de); + if (de.isAccepted()) e->accept(); + else e->ignore(); //e->setPoint(contentsToViewport(e->pos())); } @@ -1829,6 +1831,8 @@ void Q3ScrollView::viewportDragMoveEvent(QDragMoveEvent* e) e->mouseButtons(),e->keyboardModifiers()); //e->setPoint(viewportToContents(e->pos())); contentsDragMoveEvent(&de); + if (de.isAccepted()) e->accept(); + else e->ignore(); //e->setPoint(contentsToViewport(e->pos())); } @@ -1860,6 +1864,8 @@ void Q3ScrollView::viewportDropEvent(QDropEvent* e) e->mouseButtons(),e->keyboardModifiers()); //e->setPoint(viewportToContents(e->pos())); contentsDropEvent(&de); + if (de.isAccepted()) e->accept(); + else e->ignore(); //e->setPoint(contentsToViewport(e->pos())); } From 3295a776f56e41a96e8129d68cb83e51a97e0cde Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 12 Mar 2022 10:43:07 +0100 Subject: [PATCH 16/45] Fix layout in arrowdialog.cpp #81 --- qucs/paintings/arrowdialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qucs/paintings/arrowdialog.cpp b/qucs/paintings/arrowdialog.cpp index d04cd976..a842fb12 100644 --- a/qucs/paintings/arrowdialog.cpp +++ b/qucs/paintings/arrowdialog.cpp @@ -79,13 +79,13 @@ ArrowDialog::ArrowDialog(QWidget *parent, const char *name) StyleBox->addItem(tr("dash dot dot line")); connect(StyleBox, SIGNAL(activated(int)), SLOT(slotSetStyle(int))); LineStyle = Qt::SolidLine; - all->addWidget(StyleBox, 2,2,1,2); + all->addWidget(StyleBox, 2,1,1,3); all->addWidget(new QLabel(tr("Arrow head: "), this), 3,0); ArrowStyleBox = new QComboBox(this); ArrowStyleBox->addItem(tr("two lines")); ArrowStyleBox->addItem(tr("filled")); - all->addWidget(ArrowStyleBox, 3,3,1,2); + all->addWidget(ArrowStyleBox, 3,1,1,3); QWidget *h1 = new QWidget(this); @@ -100,7 +100,7 @@ ArrowDialog::ArrowDialog(QWidget *parent, const char *name) connect(ButtCancel, SIGNAL(clicked()), SLOT(reject())); h1->setLayout(h1Layout); - all->addWidget(h1, 4,4,0,3); + all->addWidget(h1, 4,0); ButtOK->setFocus(); } From 61df64878a04eaadfabf175149920fa7bdc175f9 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 12 Mar 2022 11:45:02 +0100 Subject: [PATCH 17/45] Provide setting to set Schematic/Application fonts separately --- qucs/dialogs/qucssettingsdialog.cpp | 53 ++++++++++++++++++++--------- qucs/dialogs/qucssettingsdialog.h | 4 ++- qucs/main.cpp | 7 ++-- qucs/main.h | 2 ++ 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/qucs/dialogs/qucssettingsdialog.cpp b/qucs/dialogs/qucssettingsdialog.cpp index 2aba4c1d..7c127d55 100644 --- a/qucs/dialogs/qucssettingsdialog.cpp +++ b/qucs/dialogs/qucssettingsdialog.cpp @@ -74,23 +74,28 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent) QWidget *appSettingsTab = new QWidget(t); QGridLayout *appSettingsGrid = new QGridLayout(appSettingsTab); - appSettingsGrid->addWidget(new QLabel(tr("Font (set after reload):"), appSettingsTab), 0,0); + appSettingsGrid->addWidget(new QLabel(tr("Schematic font (set after reload):"), appSettingsTab), 0,0); FontButton = new QPushButton(appSettingsTab); connect(FontButton, SIGNAL(clicked()), SLOT(slotFontDialog())); appSettingsGrid->addWidget(FontButton,0,1); + appSettingsGrid->addWidget(new QLabel(tr("Application font (set after reload):"), appSettingsTab), 1,0); + AppFontButton = new QPushButton(appSettingsTab); + connect(AppFontButton, SIGNAL(clicked()), SLOT(slotAppFontDialog())); + appSettingsGrid->addWidget(AppFontButton,1,1); + val50 = new QIntValidator(1, 50, this); - appSettingsGrid->addWidget(new QLabel(tr("Large font size:"), appSettingsTab), 1,0); + appSettingsGrid->addWidget(new QLabel(tr("Large font size:"), appSettingsTab), 2,0); LargeFontSizeEdit = new QLineEdit(appSettingsTab); LargeFontSizeEdit->setValidator(val50); - appSettingsGrid->addWidget(LargeFontSizeEdit,1,1); + appSettingsGrid->addWidget(LargeFontSizeEdit,2,1); - appSettingsGrid->addWidget(new QLabel(tr("Document Background Color:"), appSettingsTab) ,2,0); + appSettingsGrid->addWidget(new QLabel(tr("Document Background Color:"), appSettingsTab) ,3,0); BGColorButton = new QPushButton(" ", appSettingsTab); connect(BGColorButton, SIGNAL(clicked()), SLOT(slotBGColorDialog())); - appSettingsGrid->addWidget(BGColorButton,2,1); + appSettingsGrid->addWidget(BGColorButton,3,1); - appSettingsGrid->addWidget(new QLabel(tr("Language (set after reload):"), appSettingsTab) ,3,0); + appSettingsGrid->addWidget(new QLabel(tr("Language (set after reload):"), appSettingsTab) ,4,0); LanguageCombo = new QComboBox(appSettingsTab); LanguageCombo->insertItem(-1, tr("Ukrainian")+" (uk)"); LanguageCombo->insertItem(-1, tr("Turkish")+" (tr)"); @@ -114,39 +119,39 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent) LanguageCombo->insertItem(-1, tr("Arabic")+" (ar)"); LanguageCombo->insertItem(-1, tr("English")+" (en)"); LanguageCombo->insertItem(-1, tr("system language")); - appSettingsGrid->addWidget(LanguageCombo,3,1); + appSettingsGrid->addWidget(LanguageCombo,4,1); val200 = new QIntValidator(0, 200, this); - appSettingsGrid->addWidget(new QLabel(tr("Maximum undo operations:"), appSettingsTab) ,4,0); + appSettingsGrid->addWidget(new QLabel(tr("Maximum undo operations:"), appSettingsTab) ,5,0); undoNumEdit = new QLineEdit(appSettingsTab); undoNumEdit->setValidator(val200); - appSettingsGrid->addWidget(undoNumEdit,4,1); + appSettingsGrid->addWidget(undoNumEdit,5,1); - appSettingsGrid->addWidget(new QLabel(tr("Text editor:"), appSettingsTab) ,5,0); + appSettingsGrid->addWidget(new QLabel(tr("Text editor:"), appSettingsTab) ,6,0); editorEdit = new QLineEdit(appSettingsTab); editorEdit->setToolTip(tr("Set to qucs, qucsedit or the path to your favorite text editor.")); - appSettingsGrid->addWidget(editorEdit,5,1); + appSettingsGrid->addWidget(editorEdit,6,1); - appSettingsGrid->addWidget(new QLabel(tr("Start wiring when clicking open node:"), appSettingsTab) ,6,0); + appSettingsGrid->addWidget(new QLabel(tr("Start wiring when clicking open node:"), appSettingsTab) ,7,0); checkWiring = new QCheckBox(appSettingsTab); - appSettingsGrid->addWidget(checkWiring,6,1); + appSettingsGrid->addWidget(checkWiring,7,1); appSettingsGrid->addWidget(new QLabel(tr("Load documents from future versions:"))); checkLoadFromFutureVersions = new QCheckBox(appSettingsTab); checkLoadFromFutureVersions->setToolTip(tr("Try to load also documents created with newer versions of Qucs.")); - appSettingsGrid->addWidget(checkLoadFromFutureVersions,7,1); + appSettingsGrid->addWidget(checkLoadFromFutureVersions,8,1); checkLoadFromFutureVersions->setChecked(QucsSettings.IgnoreFutureVersion); appSettingsGrid->addWidget(new QLabel(tr("Draw diagrams with anti-aliasing feature:"))); checkAntiAliasing = new QCheckBox(appSettingsTab); checkAntiAliasing->setToolTip(tr("Use anti-aliasing for graphs for a smoother appereance.")); - appSettingsGrid->addWidget(checkAntiAliasing,8,1); + appSettingsGrid->addWidget(checkAntiAliasing,9,1); checkAntiAliasing->setChecked(QucsSettings.GraphAntiAliasing); appSettingsGrid->addWidget(new QLabel(tr("Draw text with anti-aliasing feature:"))); checkTextAntiAliasing = new QCheckBox(appSettingsTab); checkTextAntiAliasing->setToolTip(tr("Use anti-aliasing for text for a smoother appereance.")); - appSettingsGrid->addWidget(checkTextAntiAliasing,9,1); + appSettingsGrid->addWidget(checkTextAntiAliasing,10,1); checkTextAntiAliasing->setChecked(QucsSettings.TextAntiAliasing); t->addTab(appSettingsTab, tr("Settings")); @@ -406,7 +411,9 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent) // ........................................................... // fill the fields with the Qucs-Properties Font = QucsSettings.font; + AppFont = QucsSettings.appFont; FontButton->setText(Font.toString()); + AppFontButton->setText(AppFont.toString()); QString s = QString::number(QucsSettings.largeFontSize, 'f', 1); LargeFontSizeEdit->setText(s); @@ -541,6 +548,7 @@ void QucsSettingsDialog::slotApply() } QucsSettings.font=Font; + QucsSettings.appFont = AppFont; QucsSettings.Language = LanguageCombo->currentText().section('(',1,1).remove(')'); @@ -684,6 +692,17 @@ void QucsSettingsDialog::slotFontDialog() } } +void QucsSettingsDialog::slotAppFontDialog() +{ + bool ok; + QFont tmpFont = QFontDialog::getFont(&ok, AppFont, this); + if(ok) + { + AppFont = tmpFont; + AppFontButton->setText(AppFont.toString()); + } +} + // ----------------------------------------------------------- void QucsSettingsDialog::slotBGColorDialog() { @@ -702,8 +721,10 @@ void QucsSettingsDialog::slotDefaultValues() { QPalette p; Font = QApplication::font(); + AppFont = QucsSettings.sysDefaultFont; Font.setPointSize(12); FontButton->setText(Font.toString()); + AppFontButton->setText(AppFont.toString()); LargeFontSizeEdit->setText(QString::number(16.0)); LanguageCombo->setCurrentIndex(0); diff --git a/qucs/dialogs/qucssettingsdialog.h b/qucs/dialogs/qucssettingsdialog.h index b45e17f1..5677174f 100644 --- a/qucs/dialogs/qucssettingsdialog.h +++ b/qucs/dialogs/qucssettingsdialog.h @@ -47,6 +47,7 @@ private slots: void slotOK(); void slotApply(); void slotFontDialog(); + void slotAppFontDialog(); void slotBGColorDialog(); void slotDefaultValues(); void slotAddFileType(); @@ -77,10 +78,11 @@ public: QucsApp *App; QFont Font; + QFont AppFont; QCheckBox *checkWiring, *checkLoadFromFutureVersions, *checkAntiAliasing, *checkTextAntiAliasing; QComboBox *LanguageCombo; - QPushButton *FontButton, *BGColorButton; + QPushButton *FontButton, *AppFontButton, *BGColorButton; QLineEdit *LargeFontSizeEdit, *undoNumEdit, *editorEdit, *Input_Suffix, *Input_Program, *homeEdit, *admsXmlEdit, *ascoEdit, *octaveEdit; QTableWidget *fileTypesTableWidget, *pathsTableWidget; diff --git a/qucs/main.cpp b/qucs/main.cpp index 20956ab9..414d3253 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -84,6 +84,7 @@ bool loadSettings() if(settings.contains("dx"))QucsSettings.dx=settings.value("dx").toInt(); if(settings.contains("dy"))QucsSettings.dy=settings.value("dy").toInt(); if(settings.contains("font"))QucsSettings.font.fromString(settings.value("font").toString()); + if(settings.contains("appFont"))QucsSettings.appFont.fromString(settings.value("appFont").toString()); if(settings.contains("LargeFontSize"))QucsSettings.largeFontSize=settings.value("LargeFontSize").toDouble(); // use toDouble() as it can interpret the string according to the current locale if(settings.contains("maxUndo"))QucsSettings.maxUndo=settings.value("maxUndo").toInt(); if(settings.contains("NodeWiring"))QucsSettings.NodeWiring=settings.value("NodeWiring").toInt(); @@ -200,6 +201,7 @@ bool saveApplSettings() settings.setValue("dx", QucsSettings.dx); settings.setValue("dy", QucsSettings.dy); settings.setValue("font", QucsSettings.font.toString()); + settings.setValue("appFont", QucsSettings.appFont.toString()); // store LargeFontSize as a string, so it will be also human-readable in the settings file (will be a @Variant() otherwise) settings.setValue("LargeFontSize", QString::number(QucsSettings.largeFontSize)); settings.setValue("maxUndo", QucsSettings.maxUndo); @@ -789,6 +791,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); QDesktopWidget *d = a.desktop(); QucsSettings.font = QApplication::font(); + QucsSettings.appFont = QApplication::font(); QucsSettings.font.setPointSize(12); int w = d->width(); int h = d->height(); @@ -906,8 +909,8 @@ int main(int argc, char *argv[]) if(!QucsSettings.Task.isValid()) QucsSettings.Task = Qt::darkRed; - - //a.setFont(QucsSettings.font); + QucsSettings.sysDefaultFont = QApplication::font(); + a.setFont(QucsSettings.appFont); // set codecs QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); diff --git a/qucs/main.h b/qucs/main.h index dc84eb6b..3703def7 100644 --- a/qucs/main.h +++ b/qucs/main.h @@ -43,6 +43,8 @@ struct tQucsSettings { int x, y, dx, dy; // position and size of main window QFont font; + QFont appFont; + QFont sysDefaultFont; float largeFontSize; QColor BGColor; // background color of view area QString Language; From da6bc383e1b62598f92387bf94d355af54399f0f Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 12 Mar 2022 16:22:13 +0100 Subject: [PATCH 18/45] Provide settings to set light/dark icon theme manually --- qucs/dialogs/qucssettingsdialog.cpp | 19 +++++++++++++++++++ qucs/dialogs/qucssettingsdialog.h | 1 + qucs/main.cpp | 7 +++++++ qucs/main.h | 8 ++++++++ qucs/misc.cpp | 27 +++++++++++++++++++++++++-- qucs/misc.h | 8 ++------ qucs/qucs.cpp | 4 ++-- qucs/qucs_init.cpp | 18 +++++++++--------- 8 files changed, 73 insertions(+), 19 deletions(-) diff --git a/qucs/dialogs/qucssettingsdialog.cpp b/qucs/dialogs/qucssettingsdialog.cpp index 7c127d55..99ab5c3d 100644 --- a/qucs/dialogs/qucssettingsdialog.cpp +++ b/qucs/dialogs/qucssettingsdialog.cpp @@ -154,6 +154,19 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent) appSettingsGrid->addWidget(checkTextAntiAliasing,10,1); checkTextAntiAliasing->setChecked(QucsSettings.TextAntiAliasing); + QStringList lst_icons; + lst_icons<<"Automatic"<<"Light"<<"Dark"; + PanelIconsCombo = new QComboBox; + PanelIconsCombo->addItems(lst_icons); + PanelIconsCombo->setCurrentIndex(QucsSettings.panelIconsTheme); + appSettingsGrid->addWidget(new QLabel(tr("Panel icons theme (set after reload):"),appSettingsTab),11,0); + appSettingsGrid->addWidget(PanelIconsCombo,11,1); + CompIconsCombo = new QComboBox; + CompIconsCombo->addItems(lst_icons); + CompIconsCombo->setCurrentIndex(QucsSettings.compIconsTheme); + appSettingsGrid->addWidget(new QLabel(tr("Components icons theme (set after reload):"),appSettingsTab),12,0); + appSettingsGrid->addWidget(CompIconsCombo,12,1); + t->addTab(appSettingsTab, tr("Settings")); // ........................................................... @@ -550,6 +563,9 @@ void QucsSettingsDialog::slotApply() QucsSettings.font=Font; QucsSettings.appFont = AppFont; + QucsSettings.panelIconsTheme = PanelIconsCombo->currentIndex(); + QucsSettings.compIconsTheme = CompIconsCombo->currentIndex(); + QucsSettings.Language = LanguageCombo->currentText().section('(',1,1).remove(')'); @@ -728,6 +744,9 @@ void QucsSettingsDialog::slotDefaultValues() LargeFontSizeEdit->setText(QString::number(16.0)); LanguageCombo->setCurrentIndex(0); + + PanelIconsCombo->setCurrentIndex(0); + CompIconsCombo->setCurrentIndex(0); p = BGColorButton->palette(); p.setColor(BGColorButton->backgroundRole(), QColor(255,250,225)); diff --git a/qucs/dialogs/qucssettingsdialog.h b/qucs/dialogs/qucssettingsdialog.h index 5677174f..0121d3f8 100644 --- a/qucs/dialogs/qucssettingsdialog.h +++ b/qucs/dialogs/qucssettingsdialog.h @@ -82,6 +82,7 @@ public: QCheckBox *checkWiring, *checkLoadFromFutureVersions, *checkAntiAliasing, *checkTextAntiAliasing; QComboBox *LanguageCombo; + QComboBox *PanelIconsCombo, *CompIconsCombo; QPushButton *FontButton, *AppFontButton, *BGColorButton; QLineEdit *LargeFontSizeEdit, *undoNumEdit, *editorEdit, *Input_Suffix, *Input_Program, *homeEdit, *admsXmlEdit, *ascoEdit, *octaveEdit; diff --git a/qucs/main.cpp b/qucs/main.cpp index 414d3253..c094e46a 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -102,6 +102,11 @@ bool loadSettings() if(settings.contains("Directive"))QucsSettings.Directive.setNamedColor(settings.value("Directive").toString()); if(settings.contains("Task"))QucsSettings.Task.setNamedColor(settings.value("Task").toString()); + if (settings.contains("panelIconsTheme")) QucsSettings.panelIconsTheme = settings.value("panelIconsTheme").toInt(); + else QucsSettings.panelIconsTheme = qucs::autoIcons; + if (settings.contains("compIconsTheme")) QucsSettings.compIconsTheme = settings.value("compIconsTheme").toInt(); + else QucsSettings.compIconsTheme = qucs::autoIcons; + if(settings.contains("Qucsator")) { QucsSettings.Qucsator = settings.value("Qucsator").toString(); QFileInfo inf(QucsSettings.Qucsator); @@ -243,6 +248,8 @@ bool saveApplSettings() settings.setValue("IgnoreVersion", QucsSettings.IgnoreFutureVersion); settings.setValue("GraphAntiAliasing", QucsSettings.GraphAntiAliasing); settings.setValue("TextAntiAliasing", QucsSettings.TextAntiAliasing); + settings.setValue("panelIconsTheme",QucsSettings.panelIconsTheme); + settings.setValue("compIconsTheme",QucsSettings.compIconsTheme); // Copy the list of directory paths in which Qucs should // search for subcircuit schematics from qucsPathList diff --git a/qucs/main.h b/qucs/main.h index 9b703503..b141b8e0 100644 --- a/qucs/main.h +++ b/qucs/main.h @@ -38,9 +38,17 @@ class VersionTriplet; static const double pi = 3.1415926535897932384626433832795029; /* pi */ +namespace qucs { +enum iconType { panelIcons = 0, compIcons = 1 }; +enum iconTheme { autoIcons = 0, lightIcons = 1, darkIcons = 2 }; +} + struct tQucsSettings { int DefaultSimulator; + int panelIconsTheme; + int compIconsTheme; + int x, y, dx, dy; // position and size of main window QFont font; QFont appFont; diff --git a/qucs/misc.cpp b/qucs/misc.cpp index 1ce4c2db..729522e6 100644 --- a/qucs/misc.cpp +++ b/qucs/misc.cpp @@ -46,10 +46,33 @@ bool misc::isDarkTheme() return is_dark_theme; } -QString misc::getIconPath(const QString &file) +QString misc::getIconPath(const QString &file, int icon_type) { + auto icons_theme = QucsSettings.panelIconsTheme; + switch (icon_type) { + case qucs::panelIcons: + icons_theme = QucsSettings.panelIconsTheme; + break; + case qucs::compIcons: + icons_theme = QucsSettings.compIconsTheme; + break; + } + + bool loadDark = false; + switch (icons_theme) { + case qucs::autoIcons: + loadDark = QucsSettings.hasDarkTheme; + break; + case qucs::darkIcons: + loadDark = true; + break; + case qucs::lightIcons: + loadDark = false; + break; + } + QString icon_path =":bitmaps/"; - if (QucsSettings.hasDarkTheme) { + if (loadDark) { QString icon_path_dark = ":bitmaps/dark/"; if (QFileInfo::exists(icon_path_dark + file)) icon_path = icon_path_dark; diff --git a/qucs/misc.h b/qucs/misc.h index c35cedd4..27844976 100644 --- a/qucs/misc.h +++ b/qucs/misc.h @@ -88,14 +88,10 @@ namespace misc { p->setIcon(icon); p->setIconSize(pixmap.rect().size()); } -<<<<<<< HEAD + QStringList parseCmdArgs(const QString &program); -======= - - QString getIconPath(const QString &file); - + QString getIconPath(const QString &file, int icon_type); bool isDarkTheme(); ->>>>>>> dark } /*! handle the application version string diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index d98c440c..4548c6e2 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -729,7 +729,7 @@ void QucsApp::slotSetCompView (int index) if (Infos) { /// \todo warning: expression result unused, can we rewrite this? (void) *((*it)->info) (Name, File, false); - QString icon_path = misc::getIconPath(QString (File) + ".png"); + QString icon_path = misc::getIconPath(QString (File) + ".png", qucs::compIcons); QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(Name); iconCompInfo = iconCompInfoStruct{catIdx, compIdx}; @@ -786,7 +786,7 @@ void QucsApp::slotSearchComponent(const QString &searchText) if((Name.indexOf(searchText, 0, Qt::CaseInsensitive)) != -1) { //match - QString icon_path = misc::getIconPath(QString (File) + ".png"); + QString icon_path = misc::getIconPath(QString (File) + ".png", qucs::compIcons); QListWidgetItem *icon = new QListWidgetItem(QPixmap(icon_path), Name); icon->setToolTip(it + ": " + Name); // add component category and module indexes to the icon diff --git a/qucs/qucs_init.cpp b/qucs/qucs_init.cpp index 0c2c1724..989cff20 100644 --- a/qucs/qucs_init.cpp +++ b/qucs/qucs_init.cpp @@ -426,7 +426,7 @@ void QucsApp::initActions() tr("Select Markers\n\nSelects all diagram markers of the document")); connect(selectMarker, SIGNAL(triggered()), SLOT(slotSelectMarker())); - editRotate = new QAction(QIcon(misc::getIconPath("rotate_ccw.png")), tr("Rotate"), this); + editRotate = new QAction(QIcon(misc::getIconPath("rotate_ccw.png", qucs::panelIcons)), tr("Rotate"), this); editRotate->setShortcut(Qt::CTRL+Qt::Key_R); editRotate->setStatusTip(tr("Rotates the selected component by 90\x00B0")); editRotate->setWhatsThis( @@ -434,7 +434,7 @@ void QucsApp::initActions() editRotate->setCheckable(true); connect(editRotate, SIGNAL(toggled(bool)), SLOT(slotEditRotate(bool))); - editMirror = new QAction(QIcon(misc::getIconPath("mirror.png")), tr("Mirror about X Axis"), this); + editMirror = new QAction(QIcon(misc::getIconPath("mirror.png", qucs::panelIcons)), tr("Mirror about X Axis"), this); editMirror->setShortcut(Qt::CTRL+Qt::Key_J); editMirror->setStatusTip(tr("Mirrors the selected item about X Axis")); editMirror->setWhatsThis( @@ -442,7 +442,7 @@ void QucsApp::initActions() editMirror->setCheckable(true); connect(editMirror, SIGNAL(toggled(bool)), SLOT(slotEditMirrorX(bool))); - editMirrorY = new QAction(QIcon(misc::getIconPath("mirrory.png")), tr("Mirror about Y Axis"), this); + editMirrorY = new QAction(QIcon(misc::getIconPath("mirrory.png", qucs::panelIcons)), tr("Mirror about Y Axis"), this); editMirrorY->setShortcut(Qt::CTRL+Qt::Key_M); editMirrorY->setStatusTip(tr("Mirrors the selected item about Y Axis")); editMirrorY->setWhatsThis( @@ -465,7 +465,7 @@ void QucsApp::initActions() connect(popH, SIGNAL(triggered()), SLOT(slotPopHierarchy())); popH->setEnabled(false); // only enabled if useful !!!! - editActivate = new QAction(QIcon(misc::getIconPath("deactiv.png")), tr("Deactivate/Activate"), this); + editActivate = new QAction(QIcon(misc::getIconPath("deactiv.png", qucs::panelIcons)), tr("Deactivate/Activate"), this); editActivate->setShortcut(Qt::CTRL+Qt::Key_D); editActivate->setStatusTip(tr("Deactivate/Activate selected components")); editActivate->setWhatsThis( @@ -473,7 +473,7 @@ void QucsApp::initActions() editActivate->setCheckable(true); connect(editActivate, SIGNAL(toggled(bool)), SLOT(slotEditActivate(bool))); - insEquation = new QAction(QIcon(misc::getIconPath("equation.png")), tr("Insert Equation"), this); + insEquation = new QAction(QIcon(misc::getIconPath("equation.png", qucs::panelIcons)), tr("Insert Equation"), this); insEquation->setShortcut(Qt::CTRL+Qt::Key_Less); insEquation->setStatusTip(tr("Inserts an equation")); insEquation->setWhatsThis( @@ -481,27 +481,27 @@ void QucsApp::initActions() insEquation->setCheckable(true); connect(insEquation, SIGNAL(toggled(bool)), SLOT(slotInsertEquation(bool))); - insGround = new QAction(QIcon(misc::getIconPath("ground.png")), tr("Insert Ground"), this); + insGround = new QAction(QIcon(misc::getIconPath("ground.png", qucs::panelIcons)), tr("Insert Ground"), this); insGround->setShortcut(Qt::CTRL+Qt::Key_G); insGround->setStatusTip(tr("Inserts a ground symbol")); insGround->setWhatsThis(tr("Insert Ground\n\nInserts a ground symbol")); insGround->setCheckable(true); connect(insGround, SIGNAL(toggled(bool)), SLOT(slotInsertGround(bool))); - insPort = new QAction(QIcon(misc::getIconPath("port.png")), tr("Insert Port"), this); + insPort = new QAction(QIcon(misc::getIconPath("port.png", qucs::panelIcons)), tr("Insert Port"), this); insPort->setStatusTip(tr("Inserts a port symbol")); insPort->setWhatsThis(tr("Insert Port\n\nInserts a port symbol")); insPort->setCheckable(true); connect(insPort, SIGNAL(toggled(bool)), SLOT(slotInsertPort(bool))); - insWire = new QAction(QIcon(misc::getIconPath("wire.png")), tr("Wire"), this); + insWire = new QAction(QIcon(misc::getIconPath("wire.png", qucs::panelIcons)), tr("Wire"), this); insWire->setShortcut(Qt::CTRL+Qt::Key_E); insWire->setStatusTip(tr("Inserts a wire")); insWire->setWhatsThis(tr("Wire\n\nInserts a wire")); insWire->setCheckable(true); connect(insWire, SIGNAL(toggled(bool)), SLOT(slotSetWire(bool))); - insLabel = new QAction(QIcon(misc::getIconPath("nodename.png")), tr("Wire Label"), this); + insLabel = new QAction(QIcon(misc::getIconPath("nodename.png", qucs::panelIcons)), tr("Wire Label"), this); insLabel->setShortcut(Qt::CTRL+Qt::Key_L); insLabel->setStatusTip(tr("Inserts a wire or pin label")); insLabel->setWhatsThis(tr("Wire Label\n\nInserts a wire or pin label")); From cb2eb5362189649b3a4dec71efc2d62d82b536b2 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 12 Mar 2022 18:04:35 +0100 Subject: [PATCH 19/45] Add initial support for S-parameter analysis with Xyce --- qucs/components/source_ac.cpp | 43 +++++++++++++++++++++++ qucs/components/source_ac.h | 5 ++- qucs/components/sp_sim.cpp | 66 +++++++++++++++++++++++++++++++++++ qucs/components/sp_sim.h | 5 +++ qucs/extsimkernels/xyce.cpp | 5 +++ qucs/module.cpp | 8 ++--- 6 files changed, 127 insertions(+), 5 deletions(-) diff --git a/qucs/components/source_ac.cpp b/qucs/components/source_ac.cpp index b80b2eb2..75e976ed 100644 --- a/qucs/components/source_ac.cpp +++ b/qucs/components/source_ac.cpp @@ -16,7 +16,10 @@ ***************************************************************************/ #include "source_ac.h" +#include "node.h" +#include "extsimkernels/spicecompat.h" +#include Source_ac::Source_ac() { @@ -52,6 +55,7 @@ Source_ac::Source_ac() tx = x1+4; ty = y2+4; Model = "Pac"; + SpiceModel = "P"; Name = "P"; // This property must be the first one ! @@ -86,3 +90,42 @@ Element* Source_ac::info(QString& Name, char* &BitmapFile, bool getNewOne) if(getNewOne) return new Source_ac(); return 0; } + + +QString Source_ac::ngspice_netlist() +{ + QString s = "*Stub! Will be added in Ngspice-37\n"; + return s; +} + +QString Source_ac::xyce_netlist() +{ + QString s = spicecompat::check_refdes(Name,SpiceModel); + foreach(Port *p1, Ports) { + QString nam = p1->Connection->Name; + if (nam=="gnd") nam = "0"; + s += " "+ nam; // node names + } + s += QString(" port=%1 ").arg(getProperty("Num")->Value); + QString s_z0 = spicecompat::normalize_value(getProperty("Z")->Value); + double z0 = s_z0.toDouble(); + QString s_p = spicecompat::normalize_value(getProperty("P")->Value); + double p = s_p.toDouble(); + double vrms = sqrt(z0/1000.0)*pow(10, p/20.0); + double vamp = vrms*sqrt(2.0); + s += QString(" z0=%1 ").arg(s_z0); + QString f = spicecompat::normalize_value(getProperty("f")->Value); + s += QString(" AC %1 ").arg(vamp); + s += QString(" SIN 0 %1 %2").arg(vamp).arg(f); + s += "\n"; + return s; +} + +QString Source_ac::spice_netlist(bool isXyce) +{ + if (isXyce) { + return xyce_netlist(); + } else { + return ngspice_netlist(); + } +} diff --git a/qucs/components/source_ac.h b/qucs/components/source_ac.h index 315f1163..8ec11db2 100644 --- a/qucs/components/source_ac.h +++ b/qucs/components/source_ac.h @@ -20,13 +20,16 @@ #include "component.h" - class Source_ac : public Component { +private: + QString ngspice_netlist(); + QString xyce_netlist(); public: Source_ac(); ~Source_ac(); Component* newOne(); static Element* info(QString&, char* &, bool getNewOne=false); + QString spice_netlist(bool isXyce); }; #endif diff --git a/qucs/components/sp_sim.cpp b/qucs/components/sp_sim.cpp index 6585d744..6790bc55 100644 --- a/qucs/components/sp_sim.cpp +++ b/qucs/components/sp_sim.cpp @@ -16,10 +16,13 @@ ***************************************************************************/ #include "sp_sim.h" #include "main.h" +#include "misc.h" +#include "schematic.h" SP_Sim::SP_Sim() { + isSimulation = true; Description = QObject::tr("S parameter simulation"); QString s = Description; @@ -41,6 +44,7 @@ SP_Sim::SP_Sim() ty = y2+1; Model = ".SP"; Name = "SP"; + SpiceModel = ".SP"; // The index of the first 4 properties must not changed. Used in recreate(). Props.append(new Property("Type", "lin", true, @@ -103,3 +107,65 @@ void SP_Sim::recreate(Schematic*) Props.next()->Name = "Points"; } } + +int SP_Sim::getSPortsNumber() +{ + int p_num = 0; + if (containingSchematic != NULL) { + auto comps = containingSchematic->DocComps; + for(Component *pc = comps.first(); pc != 0; pc = comps.next()) { + if (pc->Model == "Pac") p_num++; + } + return p_num; + } else { + return p_num; + } +} + +QString SP_Sim::ngspice_netlist() +{ + QString s = "*Stub!\n"; + return s; +} + +QString SP_Sim::xyce_netlist() +{ + QString s = ".AC "; + QString unit; + if (Props.at(0)->Value=="log") { // convert points number for spice compatibility + double Np,Fstart,Fstop,fac = 1.0; + misc::str2num(Props.at(3)->Value,Np,unit,fac); // Points number + Np *= fac; + misc::str2num(Props.at(1)->Value,Fstart,unit,fac); + Fstart *= fac; + misc::str2num(Props.at(2)->Value,Fstop,unit,fac); + Fstop *= fac; + double Nd = ceil(log10(Fstop/Fstart)); // number of decades + double Npd = ceil(Np/Nd); // points per decade + s += QString("DEC %1 ").arg(Npd); + } else { // no need conversion + s += QString("LIN %1 ").arg(Props.at(3)->Value); + } + QString fstart = spicecompat::normalize_value(Props.at(1)->Value); // Start freq. + QString fstop = spicecompat::normalize_value(Props.at(2)->Value); // Stop freq. + s += QString("%1 %2 \n").arg(fstart).arg(fstop); + s += ".LIN format=touchstone sparcalc=1\n"; // enable s-param + int ports_num = getSPortsNumber(); + s += ".PRINT ac format=std file=spice4qucs_sparam.prn "; + for (int i = 0; i < ports_num; i++) { + for (int j = 0; j < ports_num; j++) { + s += QString(" sdb(%1,%2) s(%1,%2) sp(%1,%2) y(%1,%2) z(%1,%2) ").arg(i+1).arg(j+1); + } + } + s += "\n"; + return s; +} + +QString SP_Sim::spice_netlist(bool isXyce) +{ + if (isXyce) { + return xyce_netlist(); + } else { + return ngspice_netlist(); + } +} diff --git a/qucs/components/sp_sim.h b/qucs/components/sp_sim.h index 8265fbd5..2969db65 100644 --- a/qucs/components/sp_sim.h +++ b/qucs/components/sp_sim.h @@ -22,12 +22,17 @@ class SP_Sim : public Component { +private: + QString xyce_netlist(); + QString ngspice_netlist(); + int getSPortsNumber(); public: SP_Sim(); ~SP_Sim(); Component* newOne(); static Element* info(QString&, char* &, bool getNewOne=false); void recreate(Schematic*); + QString spice_netlist(bool isXyce); }; #endif diff --git a/qucs/extsimkernels/xyce.cpp b/qucs/extsimkernels/xyce.cpp index 32803494..f697bea3 100644 --- a/qucs/extsimkernels/xyce.cpp +++ b/qucs/extsimkernels/xyce.cpp @@ -54,6 +54,7 @@ void Xyce::determineUsedSimulations(QStringList *sim_lst) if (sim_typ==".NOISE") simulationsQueue.append("noise"); if (sim_typ==".TR") simulationsQueue.append("tran"); if (sim_typ==".HB") simulationsQueue.append("hb"); + if (sim_typ==".SP") simulationsQueue.append("sp"); if (sim_typ==".SENS_XYCE") simulationsQueue.append("sens"); if (sim_typ==".SENS_TR_XYCE") simulationsQueue.append("sens_tr"); if (sim_typ==".XYCESCR") simulationsQueue.append(pc->Name); // May be >= XYCE scripts @@ -163,6 +164,7 @@ void Xyce::createNetlist(QTextStream &stream, int , QStringList &simulations, if ((sim_typ==".NOISE")&&(sim=="noise")) stream<Name) stream< Date: Sun, 13 Mar 2022 12:48:03 +0100 Subject: [PATCH 20/45] Reassemble complex variables when reading Xyce STD --- qucs/extsimkernels/abstractspicekernel.cpp | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index 8fcff100..e66dfbd6 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -840,6 +840,8 @@ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList complex_var_idx; while (!ngsp_data.atEnd()) { // Parse header; QString lin = ngsp_data.readLine(); if (lin.isEmpty()) continue; @@ -847,17 +849,45 @@ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList sim_point; - foreach (QString val, val_lst) { - sim_point.append(val.toDouble()); + for (int i = 1; i <= var_list.count(); i++ ) { + if (isComplex && i != 1) { + sim_point.append(val_lst.at(i).toDouble()); // Re and Im + sim_point.append(0.0); // real vars + } else { + sim_point.append(val_lst.at(i).toDouble()); + } } - sim_point.removeFirst(); // Index + if (isComplex) { // reassemble complex variables + for (int j = 0; j < complex_var_list.count(); j++) { + int idx = complex_var_idx[j]; + sim_point.append(val_lst.at(idx).toDouble()); + sim_point.append(val_lst.at(idx+1).toDouble()); + } + } + //sim_point.removeFirst(); // Index sim_points.append(sim_point); } } + if (isComplex) { + var_list.append(complex_var_list); + } } From c475e3b217eefa3889fa4c3f2080224fa369c8a6 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 13 Mar 2022 16:29:31 +0100 Subject: [PATCH 21/45] Check if schematic contains only DC sim and show error #78 --- qucs/extsimkernels/abstractspicekernel.cpp | 26 ++++++++++++++++++++++ qucs/extsimkernels/abstractspicekernel.h | 2 ++ qucs/extsimkernels/ngspice.cpp | 15 +++++++++++++ qucs/extsimkernels/xyce.cpp | 8 +++++++ 4 files changed, 51 insertions(+) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index e66dfbd6..c25946fc 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -139,6 +139,32 @@ bool AbstractSpiceKernel::checkGround() return r; } +bool AbstractSpiceKernel::checkSimulations() +{ + if (DC_OP_only) return true; + bool r = false; + for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) { + if (pc->isSimulation) { + r = true; + break; + } + } + return r; +} + +bool AbstractSpiceKernel::checkDCSimulation() +{ + if (DC_OP_only) return true; + bool r = false; + for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) { + if (pc->isSimulation && pc->Model != ".DC") { + r = true; + break; + } + } + return r; +} + /*! * \brief AbstractSpiceKernel::startNetlist Outputs .PARAM , .GLOABAL_PARAM, * and .OPTIONS sections to netlist. These sections are placed on schematic diff --git a/qucs/extsimkernels/abstractspicekernel.h b/qucs/extsimkernels/abstractspicekernel.h index 374346c7..94225000 100644 --- a/qucs/extsimkernels/abstractspicekernel.h +++ b/qucs/extsimkernels/abstractspicekernel.h @@ -69,6 +69,8 @@ protected: QStringList& vars, QStringList &outputs); void removeAllSimulatorOutputs(); bool checkGround(); + bool checkSimulations(); + bool checkDCSimulation(); public: diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index efde879d..48fb62c0 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -418,6 +418,21 @@ void Ngspice::slotSimulate() return; } + if (!checkSimulations()) { + output.append("No simulation found. Please add at least one simulation!\n"); + emit finished(); + emit errors(QProcess::FailedToStart); + return; + } + + if (!checkDCSimulation()) { + output.append("Only DC simulation found in the schematic. It has no effect!" + " Add TRAN, AC, or Sweep simulation to proceed.\n"); + emit finished(); + emit errors(QProcess::FailedToStart); + return; + } + if (!checkNodeNames(incompat)) { QString s = incompat.join("; "); output.append("There were Nutmeg-incompatible node names. Simulator cannot proceed.\n"); diff --git a/qucs/extsimkernels/xyce.cpp b/qucs/extsimkernels/xyce.cpp index f697bea3..0e37dbea 100644 --- a/qucs/extsimkernels/xyce.cpp +++ b/qucs/extsimkernels/xyce.cpp @@ -277,6 +277,14 @@ void Xyce::slotSimulate() return; } + if (!checkDCSimulation()) { + output.append("Only DC simulation found in the schematic. It has no effect!" + " Add TRAN, AC, or Sweep simulation to proceed.\n"); + emit finished(); + emit errors(QProcess::FailedToStart); + return; + } + int num=0; netlistQueue.clear(); output_files.clear(); From 0b30f80dc84a1ee4dc2bb82dcd26ec0060c07bca Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 20 Mar 2022 11:56:16 +0100 Subject: [PATCH 22/45] Correct distortion example #83 --- examples/ngspice/Distortion.sch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/ngspice/Distortion.sch b/examples/ngspice/Distortion.sch index 24bcadab..35df324c 100644 --- a/examples/ngspice/Distortion.sch +++ b/examples/ngspice/Distortion.sch @@ -26,9 +26,8 @@ - + - From 57b147feb1822469af1a3e83f9339686b64b35e3 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 20 Mar 2022 12:55:42 +0100 Subject: [PATCH 23/45] Switch HB dataset parser to STD format parser; fix for #28 --- qucs/extsimkernels/abstractspicekernel.cpp | 20 +++++++++++++------- qucs/extsimkernels/abstractspicekernel.h | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index c25946fc..d6cdb02b 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -851,7 +851,7 @@ bool AbstractSpiceKernel::extractASCIISamples(QString &lin, QTextStream &ngsp_da * \param isComplex[out] Type of variables. True if complex. False if real. */ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList > &sim_points, - QStringList &var_list, bool &isComplex) + QStringList &var_list, bool &isComplex, bool &hasParSweep) { isComplex = false; QString content; @@ -871,6 +871,10 @@ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList > &sim_points, - QStringList &var_list, bool &isComplex); + QStringList &var_list, bool &isComplex, bool &hasParSweep); void parseXYCENoiseLog(QString logfile, QList< QList > &sim_points, QStringList &var_list); void parseResFile(QString resfile, QString &var, QStringList &values); From 455727b62f4a4d3be96c4a7dd49d42602556c697 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 20 Mar 2022 13:02:09 +0100 Subject: [PATCH 24/45] Fixed XYCE HB example to reflect #28 --- examples/xyce/hb-test.sch | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/xyce/hb-test.sch b/examples/xyce/hb-test.sch index 1f115091..dccc39fc 100644 --- a/examples/xyce/hb-test.sch +++ b/examples/xyce/hb-test.sch @@ -1,6 +1,6 @@ - + - + @@ -21,7 +21,7 @@ - <.HB HB1 1 40 10 0 71 0 0 "1 MHz" 1 "17" 1 "1 pA" 1 "1 uV" 1 "0.001" 1 "150" 0> + <.HB HB1 1 40 10 0 75 0 0 "1 MHz" 1 "17" 1 "1 pA" 1 "1 uV" 1 "0.001" 1 "150" 0> @@ -49,15 +49,15 @@ <450 270 450 300 "" 0 0 0 ""> - - <"xyce/NODE1.Vb" #0000ff 0 3 0 6 0> - <"xyce/NODE3.Vb" #ff0000 0 3 0 6 0> + + <"xyce/V(NODE1)" #0000ff 0 3 0 6 0> + <"xyce/V(NODE3)" #ff0000 0 3 0 6 0> - - <"xyce/VPR2.Vb" #0000ff 0 3 0 6 0> + + <"xyce/I(PR2)" #0000ff 0 3 0 6 0> - - <"xyce/PR1.Vb" #0000ff 0 3 0 6 0> + + <"xyce/V(PR1)" #0000ff 0 3 0 6 0> From bd974d63ed4748649c37ef9b89a5053719a83e0c Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 28 Mar 2022 22:05:38 +0200 Subject: [PATCH 25/45] Replace links for Qucs tutorial by Qucs-S tutorial --- qucs/qucs_actions.cpp | 2 +- qucs/qucs_init.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qucs/qucs_actions.cpp b/qucs/qucs_actions.cpp index 8fdd3d2f..6c167465 100644 --- a/qucs/qucs_actions.cpp +++ b/qucs/qucs_actions.cpp @@ -894,7 +894,7 @@ void QucsApp::slotHelpQucsIndex() // -------------------------------------------------------------- void QucsApp::slotGettingStarted() { - QDesktopServices::openUrl(QUrl("https://qucs-help.readthedocs.io/en/0.0.18/start.html")); + QDesktopServices::openUrl(QUrl("https://ra3xdh.github.io/pdf/qucs_s_tutorial.pdf")); } // --------------------------------------------------------------------- diff --git a/qucs/qucs_init.cpp b/qucs/qucs_init.cpp index 989cff20..2ef6169c 100644 --- a/qucs/qucs_init.cpp +++ b/qucs/qucs_init.cpp @@ -652,10 +652,10 @@ void QucsApp::initActions() helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help")); connect(helpIndex, SIGNAL(triggered()), SLOT(slotHelpIndex())); - helpQucsIndex = new QAction(tr("Help Index (basic Qucs version)"), this); + /*helpQucsIndex = new QAction(tr("Help Index (basic Qucs version)"), this); helpQucsIndex->setStatusTip(tr("Index of basic Qucs Help")); helpQucsIndex->setWhatsThis(tr("Help Index\n\nIndex of basic Qucs help")); - connect(helpQucsIndex, SIGNAL(triggered()), SLOT(slotHelpQucsIndex())); + connect(helpQucsIndex, SIGNAL(triggered()), SLOT(slotHelpQucsIndex()));*/ helpGetStart = new QAction(tr("Getting Started..."), this); helpGetStart->setStatusTip(tr("Getting Started with Qucs")); @@ -824,7 +824,7 @@ void QucsApp::initMenuBar() helpMenu = new QMenu(tr("&Help")); // menuBar entry helpMenu helpMenu->addAction(helpIndex); - helpMenu->addAction(helpQucsIndex); + //helpMenu->addAction(helpQucsIndex); helpMenu->addAction(helpGetStart); helpMenu->addSeparator(); From 186c19aa47bb8e58179683adec97a9a012452e04 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 2 Apr 2022 19:39:55 +0200 Subject: [PATCH 26/45] Added basic S-parameter support for Ngspice --- qucs/components/source_ac.cpp | 18 +++++++++++++++++- qucs/components/sp_sim.cpp | 29 +++++++++++++++++++---------- qucs/components/sp_sim.h | 1 + qucs/extsimkernels/ngspice.cpp | 25 +++++++++++++++++++++++++ qucs/extsimkernels/spicecompat.cpp | 3 +++ qucs/module.cpp | 2 +- qucs/spicecomponents/sp_nutmeg.cpp | 2 +- 7 files changed, 67 insertions(+), 13 deletions(-) diff --git a/qucs/components/source_ac.cpp b/qucs/components/source_ac.cpp index 75e976ed..a06323d6 100644 --- a/qucs/components/source_ac.cpp +++ b/qucs/components/source_ac.cpp @@ -94,7 +94,23 @@ Element* Source_ac::info(QString& Name, char* &BitmapFile, bool getNewOne) QString Source_ac::ngspice_netlist() { - QString s = "*Stub! Will be added in Ngspice-37\n"; + QString s = QString("V%1").arg(Name); + foreach(Port *p1, Ports) { + QString nam = p1->Connection->Name; + if (nam=="gnd") nam = "0"; + s += " "+ nam; // node names + } + + double z0 = spicecompat::normalize_value(getProperty("Z")->Value).toDouble(); + double p = spicecompat::normalize_value(getProperty("P")->Value).toDouble(); + double vrms = sqrt(z0/1000.0)*pow(10, p/20.0); + double vamp = vrms*sqrt(2.0); + QString f = spicecompat::normalize_value(getProperty("f")->Value); + s += QString(" dc 0 ac %1").arg(vamp); + s += QString(" SIN(0 %1 %2)").arg(vamp).arg(f); + s += QString(" portnum %1").arg(getProperty("Num")->Value); + s += QString(" z0 %1").arg(z0); + s += "\n"; return s; } diff --git a/qucs/components/sp_sim.cpp b/qucs/components/sp_sim.cpp index 6790bc55..a8bff6d0 100644 --- a/qucs/components/sp_sim.cpp +++ b/qucs/components/sp_sim.cpp @@ -122,15 +122,9 @@ int SP_Sim::getSPortsNumber() } } -QString SP_Sim::ngspice_netlist() +QString SP_Sim::getSweepString() { - QString s = "*Stub!\n"; - return s; -} - -QString SP_Sim::xyce_netlist() -{ - QString s = ".AC "; + QString s; QString unit; if (Props.at(0)->Value=="log") { // convert points number for spice compatibility double Np,Fstart,Fstop,fac = 1.0; @@ -148,8 +142,23 @@ QString SP_Sim::xyce_netlist() } QString fstart = spicecompat::normalize_value(Props.at(1)->Value); // Start freq. QString fstop = spicecompat::normalize_value(Props.at(2)->Value); // Stop freq. - s += QString("%1 %2 \n").arg(fstart).arg(fstop); - s += ".LIN format=touchstone sparcalc=1\n"; // enable s-param + s += QString("%1 %2").arg(fstart).arg(fstop); + return s; +} + +QString SP_Sim::ngspice_netlist() +{ + QString s = "SP "; + s += getSweepString(); + s += "\n"; + return s; +} + +QString SP_Sim::xyce_netlist() +{ + QString s = ".AC "; + s += getSweepString(); + s += "\n.LIN format=touchstone sparcalc=1\n"; // enable s-param int ports_num = getSPortsNumber(); s += ".PRINT ac format=std file=spice4qucs_sparam.prn "; for (int i = 0; i < ports_num; i++) { diff --git a/qucs/components/sp_sim.h b/qucs/components/sp_sim.h index 2969db65..ae2370b4 100644 --- a/qucs/components/sp_sim.h +++ b/qucs/components/sp_sim.h @@ -26,6 +26,7 @@ private: QString xyce_netlist(); QString ngspice_netlist(); int getSPortsNumber(); + QString getSweepString(); public: SP_Sim(); ~SP_Sim(); diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index 48fb62c0..2bb5a026 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -99,6 +99,7 @@ void Ngspice::createNetlist(QTextStream &stream, int , if (sim_typ==".PZ") simulations.append("pz"); if (sim_typ==".SENS") simulations.append("sens"); if (sim_typ==".SENS_AC") simulations.append("sens_ac"); + if (sim_typ==".SP") simulations.append("sp"); if ((sim_typ==".SW")&& (pc->Props.at(0)->Value.startsWith("DC"))) simulations.append("dc"); // stream<Model; QString s = pc->getSpiceNetlist(); if ((sim_typ==".AC")&&(sim=="ac")) stream<DocComps; + for(Component *pc = comps.first(); pc != 0; pc = comps.next()) { + if (pc->Model == "Pac") port_number++; + } + for (int i = 0; i < port_number; i++) { + for (int j = 0; j < port_number; j++) { + QString tail = QString("_%1_%2").arg(i+1).arg(j+1); + nods.append(QString("S%1 ").arg(tail)); + nods.append(QString("Y%1 ").arg(tail)); + nods.append(QString("Z%1 ").arg(tail)); + } + } + } for (QStringList::iterator it = vars_eq.begin();it != vars_eq.end(); it++) { nods += " " + *it; } @@ -323,6 +345,9 @@ void Ngspice::createNetlist(QTextStream &stream, int , if (SwpSim.startsWith("AC")&&(sim=="ac")) { s += getParentSWPscript(pc,sim,false,b); stream< Date: Sun, 3 Apr 2022 11:54:42 +0200 Subject: [PATCH 27/45] Introduce Component::getExtraVaribales --- qucs/components/component.cpp | 5 +++++ qucs/components/component.h | 1 + qucs/components/sp_sim.cpp | 15 +++++++++++++++ qucs/components/sp_sim.h | 1 + qucs/extsimkernels/ngspice.cpp | 20 +++++++------------- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/qucs/components/component.cpp b/qucs/components/component.cpp index 38fb4e97..9833b7e0 100644 --- a/qucs/components/component.cpp +++ b/qucs/components/component.cpp @@ -752,6 +752,11 @@ QString Component::getEquations(QString, QStringList &) return QString(""); } +QStringList Component::getExtraVariables() +{ + return QStringList(); +} + QString Component::getProbeVariable(bool) { return QString(""); diff --git a/qucs/components/component.h b/qucs/components/component.h index 515fa10a..0daf84e5 100644 --- a/qucs/components/component.h +++ b/qucs/components/component.h @@ -40,6 +40,7 @@ public: QString getVerilogACode(); virtual QString getExpression(bool isXyce = false); virtual QString getEquations(QString sim, QStringList &dep_vars); + virtual QStringList getExtraVariables(); virtual QString getProbeVariable(bool isXyce = false); virtual QString getSpiceModel(); virtual QString getNgspiceBeforeSim(QString sim, int lvl=0); diff --git a/qucs/components/sp_sim.cpp b/qucs/components/sp_sim.cpp index a8bff6d0..ef6c06c8 100644 --- a/qucs/components/sp_sim.cpp +++ b/qucs/components/sp_sim.cpp @@ -122,6 +122,21 @@ int SP_Sim::getSPortsNumber() } } +QStringList SP_Sim::getExtraVariables() +{ + QStringList vars; + int port_number = getSPortsNumber(); + for (int i = 0; i < port_number; i++) { + for (int j = 0; j < port_number; j++) { + QString tail = QString("_%1_%2").arg(i+1).arg(j+1); + vars.append(QString("S%1").arg(tail)); + vars.append(QString("Y%1").arg(tail)); + vars.append(QString("Z%1").arg(tail)); + } + } + return vars; +} + QString SP_Sim::getSweepString() { QString s; diff --git a/qucs/components/sp_sim.h b/qucs/components/sp_sim.h index ae2370b4..2cd8cbc4 100644 --- a/qucs/components/sp_sim.h +++ b/qucs/components/sp_sim.h @@ -34,6 +34,7 @@ public: static Element* info(QString&, char* &, bool getNewOne=false); void recreate(Schematic*); QString spice_netlist(bool isXyce); + QStringList getExtraVariables(); }; #endif diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index 2bb5a026..b9a6f31b 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -200,6 +200,7 @@ void Ngspice::createNetlist(QTextStream &stream, int , QString custom_vars; + QStringList spar_vars; // Hack: Such indexation method is needed to avoid entering infinite loop // in some cases of recursive access to Sch->DocComps list for(unsigned int i=0;iDocComps.count();i++) { @@ -208,7 +209,10 @@ void Ngspice::createNetlist(QTextStream &stream, int , QString sim_typ = pc->Model; QString s = pc->getSpiceNetlist(); if ((sim_typ==".AC")&&(sim=="ac")) stream<getExtraVariables(); + } if ((sim_typ==".DISTO")&&(sim=="disto")) stream<DocComps; - for(Component *pc = comps.first(); pc != 0; pc = comps.next()) { - if (pc->Model == "Pac") port_number++; - } - for (int i = 0; i < port_number; i++) { - for (int j = 0; j < port_number; j++) { - QString tail = QString("_%1_%2").arg(i+1).arg(j+1); - nods.append(QString("S%1 ").arg(tail)); - nods.append(QString("Y%1 ").arg(tail)); - nods.append(QString("Z%1 ").arg(tail)); - } + for (const auto &var : spar_vars) { + nods += " " + var; } } for (QStringList::iterator it = vars_eq.begin();it != vars_eq.end(); it++) { From 13665358edcd3e7f23751e78bfe8cc9e95e1695f Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 3 Apr 2022 12:28:07 +0200 Subject: [PATCH 28/45] Add support for S-par+Noise for Ngspice --- qucs/components/sp_sim.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qucs/components/sp_sim.cpp b/qucs/components/sp_sim.cpp index ef6c06c8..8d4e321e 100644 --- a/qucs/components/sp_sim.cpp +++ b/qucs/components/sp_sim.cpp @@ -125,6 +125,8 @@ int SP_Sim::getSPortsNumber() QStringList SP_Sim::getExtraVariables() { QStringList vars; + bool donoise = false; + if (getProperty("Noise")->Value == "yes") donoise = true; int port_number = getSPortsNumber(); for (int i = 0; i < port_number; i++) { for (int j = 0; j < port_number; j++) { @@ -132,8 +134,17 @@ QStringList SP_Sim::getExtraVariables() vars.append(QString("S%1").arg(tail)); vars.append(QString("Y%1").arg(tail)); vars.append(QString("Z%1").arg(tail)); + if (donoise) { + vars.append(QString("Cy%1").arg(tail)); + } } } + if (port_number == 2 && donoise) { + vars.append("Rn"); + vars.append("NF"); + vars.append("SOpt"); + vars.append("NFmin"); + } return vars; } @@ -157,7 +168,7 @@ QString SP_Sim::getSweepString() } QString fstart = spicecompat::normalize_value(Props.at(1)->Value); // Start freq. QString fstop = spicecompat::normalize_value(Props.at(2)->Value); // Stop freq. - s += QString("%1 %2").arg(fstart).arg(fstop); + s += QString("%1 %2").arg(fstart).arg(fstop); return s; } @@ -165,6 +176,7 @@ QString SP_Sim::ngspice_netlist() { QString s = "SP "; s += getSweepString(); + if (getProperty("Noise")->Value == "yes") s += " 1"; s += "\n"; return s; } From c4c625236925e32ca0e704c201e6e72aab23cf53 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 3 Apr 2022 15:59:10 +0200 Subject: [PATCH 29/45] Add examples on S-parameter simulation --- examples/ngspice/s_param_wideband_amp.sch | 112 ++++++++++++++++++ .../ngspice/s_param_wideband_amp_noise.sch | 111 +++++++++++++++++ examples/xyce/s_param_lc_filter.sch | 63 ++++++++++ examples/xyce/s_param_wideband_amp.sch | 102 ++++++++++++++++ 4 files changed, 388 insertions(+) create mode 100644 examples/ngspice/s_param_wideband_amp.sch create mode 100644 examples/ngspice/s_param_wideband_amp_noise.sch create mode 100644 examples/xyce/s_param_lc_filter.sch create mode 100644 examples/xyce/s_param_wideband_amp.sch diff --git a/examples/ngspice/s_param_wideband_amp.sch b/examples/ngspice/s_param_wideband_amp.sch new file mode 100644 index 00000000..c4890223 --- /dev/null +++ b/examples/ngspice/s_param_wideband_amp.sch @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + <_BJT T_2N2222_1 1 570 460 12 -32 0 0 "npn" 0 "1e-14" 0 "1" 0 "1" 0 "0.3" 0 "0" 0 "100" 0 "0" 0 "0" 0 "1.5" 0 "0" 0 "2" 0 "200" 0 "3" 0 "0" 0 "0" 0 "3" 0 "1" 0 "10" 0 "25e-12" 0 "0.75" 0 "0.33" 0 "8e-12" 0 "0.75" 0 "0.33" 0 "1.0" 0 "0" 0 "0.75" 0 "0" 0 "0.5" 0 "400e-12" 0 "3" 0 "0.0" 0 "2" 0 "100e-9" 0 "26.85" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "0.0" 0 "3.0" 0 "1.11" 0 "26.85" 0 "1.0" 0> + + + + + + + + + + + + + + + + + + + + + + + + <.TR TR1 1 270 90 0 75 0 0 "lin" 1 "0" 1 "1 us" 1 "200" 0 "Trapezoidal" 0 "2" 0 "1 ns" 0 "1e-16" 0 "150" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "26.85" 0 "1e-3" 0 "1e-6" 0 "1" 0 "CroutLU" 0 "no" 0 "yes" 0 "0" 0> + + <.SP SP1 1 270 270 0 79 0 0 "lin" 1 "1 MHz" 1 "20 MHz" 1 "500" 1 "no" 0 "1" 0 "2" 0 "no" 0 "no" 0> + + + <530 320 530 360 "" 0 0 0 ""> + <450 340 450 400 "" 0 0 0 ""> + <470 320 470 340 "" 0 0 0 ""> + <470 340 470 360 "" 0 0 0 ""> + <450 340 470 340 "" 0 0 0 ""> + <530 360 620 360 "" 0 0 0 ""> + <450 460 540 460 "" 0 0 0 ""> + <570 320 570 430 "" 0 0 0 ""> + <570 230 570 260 "" 0 0 0 ""> + <570 230 620 230 "" 0 0 0 ""> + <620 230 620 340 "" 0 0 0 ""> + <620 340 670 340 "" 0 0 0 ""> + <670 320 670 340 "" 0 0 0 ""> + <620 340 620 360 "" 0 0 0 ""> + <620 360 720 360 "" 0 0 0 ""> + <570 550 570 560 "" 0 0 0 ""> + <570 550 650 550 "" 0 0 0 ""> + <650 550 650 560 "" 0 0 0 ""> + <570 620 570 630 "" 0 0 0 ""> + <650 620 650 630 "" 0 0 0 ""> + <450 460 450 510 "" 0 0 0 ""> + <280 510 280 580 "" 0 0 0 ""> + <280 510 370 510 "in" 250 460 21 ""> + <430 510 450 510 "" 0 0 0 ""> + <450 630 450 640 "" 0 0 0 ""> + <830 360 830 430 "" 0 0 0 ""> + <780 360 830 360 "out" 840 330 31 ""> + <670 220 670 260 "" 0 0 0 ""> + <670 220 730 220 "" 0 0 0 ""> + <670 200 670 220 "" 0 0 0 ""> + <780 150 780 170 "" 0 0 0 ""> + <670 90 670 140 "" 0 0 0 ""> + <670 90 780 90 "" 0 0 0 ""> + <790 220 830 220 "" 0 0 0 ""> + <830 220 830 250 "" 0 0 0 ""> + + + + <"ngspice/ac.v(s_2_1)" #0000ff 0 3 0 0 0> + + + <"ngspice/ac.k" #0000ff 0 3 0 0 0> + + + <"ngspice/ac.v(s_1_1)" #0000ff 0 3 0 0 0> + + <"ngspice/ac.v(s_2_2)" #ff0000 0 3 0 0 0> + + + + <"ngspice/ac.vswrin" #0000ff 0 3 0 0 0> + + <"ngspice/ac.vswrout" #ff0000 0 3 0 0 0> + + + + <"ngspice/tran.v(in)" #0000ff 0 3 0 0 0> + <"ngspice/tran.v(out)" #ff0000 0 3 0 0 0> + + + + = 37 is required\nThe VSWR and Gp in dB are computed using\nNutmeg equations"> + diff --git a/examples/ngspice/s_param_wideband_amp_noise.sch b/examples/ngspice/s_param_wideband_amp_noise.sch new file mode 100644 index 00000000..0c8ad3e9 --- /dev/null +++ b/examples/ngspice/s_param_wideband_amp_noise.sch @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + <_BJT T_2N2222_1 1 570 460 12 -32 0 0 "npn" 0 "1e-14" 0 "1" 0 "1" 0 "0.3" 0 "0" 0 "100" 0 "0" 0 "0" 0 "1.5" 0 "0" 0 "2" 0 "200" 0 "3" 0 "0" 0 "0" 0 "3" 0 "1" 0 "10" 0 "25e-12" 0 "0.75" 0 "0.33" 0 "8e-12" 0 "0.75" 0 "0.33" 0 "1.0" 0 "0" 0 "0.75" 0 "0" 0 "0.5" 0 "400e-12" 0 "3" 0 "0.0" 0 "2" 0 "100e-9" 0 "26.85" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "0.0" 0 "3.0" 0 "1.11" 0 "26.85" 0 "1.0" 0> + + + + + + + + + + + + + + + + + + + + + + + + + <.SP SP1 1 270 160 0 79 0 0 "lin" 1 "1 MHz" 1 "20 MHz" 1 "500" 1 "yes" 1 "1" 0 "2" 0 "no" 0 "no" 0> + + + <530 320 530 360 "" 0 0 0 ""> + <450 340 450 400 "" 0 0 0 ""> + <470 320 470 340 "" 0 0 0 ""> + <470 340 470 360 "" 0 0 0 ""> + <450 340 470 340 "" 0 0 0 ""> + <530 360 620 360 "" 0 0 0 ""> + <450 460 540 460 "" 0 0 0 ""> + <570 320 570 430 "" 0 0 0 ""> + <570 230 570 260 "" 0 0 0 ""> + <570 230 620 230 "" 0 0 0 ""> + <620 230 620 340 "" 0 0 0 ""> + <620 340 670 340 "" 0 0 0 ""> + <670 320 670 340 "" 0 0 0 ""> + <620 340 620 360 "" 0 0 0 ""> + <620 360 720 360 "" 0 0 0 ""> + <570 550 570 560 "" 0 0 0 ""> + <570 550 650 550 "" 0 0 0 ""> + <650 550 650 560 "" 0 0 0 ""> + <570 620 570 630 "" 0 0 0 ""> + <650 620 650 630 "" 0 0 0 ""> + <450 460 450 510 "" 0 0 0 ""> + <280 510 280 580 "" 0 0 0 ""> + <280 510 370 510 "in" 250 460 21 ""> + <430 510 450 510 "" 0 0 0 ""> + <450 630 450 640 "" 0 0 0 ""> + <830 360 830 430 "" 0 0 0 ""> + <780 360 830 360 "out" 840 330 31 ""> + <670 220 670 260 "" 0 0 0 ""> + <670 220 730 220 "" 0 0 0 ""> + <670 200 670 220 "" 0 0 0 ""> + <780 150 780 170 "" 0 0 0 ""> + <670 90 670 140 "" 0 0 0 ""> + <670 90 780 90 "" 0 0 0 ""> + <790 220 830 220 "" 0 0 0 ""> + <830 220 830 250 "" 0 0 0 ""> + + + + <"ngspice/ac.v(cy_1_1)" #0000ff 0 3 0 0 0> + <"ngspice/ac.v(cy_1_2)" #ff0000 0 3 0 0 0> + <"ngspice/ac.v(cy_2_1)" #ff00ff 0 3 0 0 0> + <"ngspice/ac.v(cy_2_2)" #00ff00 0 3 0 0 0> + + + <"ngspice/ac.v(nfmin)" #0000ff 0 3 0 0 0> + <"ngspice/ac.v(nf)" #ff0000 0 3 0 0 0> + + + <"ngspice/ac.v(sopt)" #0000ff 0 3 0 0 0> + + + <"ngspice/ac.v(rn)" #0000ff 0 3 0 0 0> + + + <"ngspice/ac.k" #0000ff 0 3 0 0 0> + + + <"ngspice/ac.v(s_2_1)" #0000ff 0 3 0 0 0> + + + + = 37 is required\nNoise computation is enabled"> + diff --git a/examples/xyce/s_param_lc_filter.sch b/examples/xyce/s_param_lc_filter.sch new file mode 100644 index 00000000..e8d5df8f --- /dev/null +++ b/examples/xyce/s_param_lc_filter.sch @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <.SP SP1 1 40 390 0 87 0 0 "log" 1 "1MHz" 1 "100MHz" 1 "200" 1 "no" 0 "1" 0 "2" 0 "no" 0 "no" 0> + + + <230 180 230 260 "" 0 0 0 ""> + <320 180 320 260 "" 0 0 0 ""> + <300 180 320 180 "" 0 0 0 ""> + <230 180 240 180 "" 0 0 0 ""> + <320 180 330 180 "" 0 0 0 ""> + <390 180 410 180 "" 0 0 0 ""> + <410 180 410 260 "" 0 0 0 ""> + <410 180 500 180 "out" 440 120 90 ""> + <500 180 500 230 "" 0 0 0 ""> + <170 180 230 180 "" 0 0 0 ""> + <170 180 170 230 "" 0 0 0 ""> + <170 290 170 320 "" 0 0 0 ""> + <500 290 500 320 "" 0 0 0 ""> + + + + <"xyce/SDB(2,1)" #0000ff 0 3 0 0 0> + + + + <"xyce/S(2,1)" #0000ff 0 3 0 0 0> + + + <"xyce/S(1,1)" #0000ff 0 3 0 0 0> + + + + + + diff --git a/examples/xyce/s_param_wideband_amp.sch b/examples/xyce/s_param_wideband_amp.sch new file mode 100644 index 00000000..9b2b9525 --- /dev/null +++ b/examples/xyce/s_param_wideband_amp.sch @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + <_BJT T_2N2222_1 1 570 460 12 -32 0 0 "npn" 0 "1e-14" 0 "1" 0 "1" 0 "0.3" 0 "0" 0 "100" 0 "0" 0 "0" 0 "1.5" 0 "0" 0 "2" 0 "200" 0 "3" 0 "0" 0 "0" 0 "3" 0 "1" 0 "10" 0 "25e-12" 0 "0.75" 0 "0.33" 0 "8e-12" 0 "0.75" 0 "0.33" 0 "1.0" 0 "0" 0 "0.75" 0 "0" 0 "0.5" 0 "400e-12" 0 "3" 0 "0.0" 0 "2" 0 "100e-9" 0 "26.85" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "0.0" 0 "3.0" 0 "1.11" 0 "26.85" 0 "1.0" 0> + + + + + + + + + + + + + + + + + + + + + + + + <.DC DC1 1 990 90 0 47 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0> + <.SP SP1 1 990 180 0 79 0 0 "lin" 1 "1 MHz" 1 "30 MHz" 1 "500" 1 "yes" 1 "1" 0 "2" 0 "no" 0 "no" 0> + + + <530 320 530 360 "" 0 0 0 ""> + <450 340 450 400 "" 0 0 0 ""> + <470 320 470 340 "" 0 0 0 ""> + <470 340 470 360 "" 0 0 0 ""> + <450 340 470 340 "" 0 0 0 ""> + <530 360 620 360 "" 0 0 0 ""> + <450 460 540 460 "" 0 0 0 ""> + <570 320 570 430 "" 0 0 0 ""> + <570 230 570 260 "" 0 0 0 ""> + <570 230 620 230 "" 0 0 0 ""> + <620 230 620 340 "" 0 0 0 ""> + <620 340 670 340 "" 0 0 0 ""> + <670 320 670 340 "" 0 0 0 ""> + <620 340 620 360 "" 0 0 0 ""> + <620 360 720 360 "" 0 0 0 ""> + <570 550 570 560 "" 0 0 0 ""> + <570 550 650 550 "" 0 0 0 ""> + <650 550 650 560 "" 0 0 0 ""> + <570 620 570 630 "" 0 0 0 ""> + <650 620 650 630 "" 0 0 0 ""> + <450 460 450 510 "" 0 0 0 ""> + <280 510 280 580 "" 0 0 0 ""> + <280 510 370 510 "in" 250 460 21 ""> + <430 510 450 510 "" 0 0 0 ""> + <450 630 450 640 "" 0 0 0 ""> + <830 360 830 430 "" 0 0 0 ""> + <780 360 830 360 "out" 840 330 31 ""> + <670 220 670 260 "" 0 0 0 ""> + <670 220 730 220 "" 0 0 0 ""> + <670 200 670 220 "" 0 0 0 ""> + <780 150 780 170 "" 0 0 0 ""> + <670 90 670 140 "" 0 0 0 ""> + <670 90 780 90 "" 0 0 0 ""> + <790 220 830 220 "" 0 0 0 ""> + <830 220 830 250 "" 0 0 0 ""> + + + + <"xyce/S(2,1)" #0000ff 0 3 0 0 0> + <"ngspice/ac.v(s_2_1)" #ff0000 0 3 0 0 0> + + + <"xyce/S(2,1)" #0000ff 0 3 0 0 0> + + + <"xyce/S(1,1)" #0000ff 0 3 0 0 0> + + <"xyce/S(2,2)" #ff0000 0 3 0 0 0> + + + + + + From fc8a5d6be7c713d8f1d3670740163cd5263aaf84 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 13 Apr 2022 17:30:16 +0200 Subject: [PATCH 30/45] Set the default path for file save as $HOME instead of $HOME/.qucs --- qucs/qucs.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp index 4548c6e2..31e44c30 100644 --- a/qucs/qucs.cpp +++ b/qucs/qucs.cpp @@ -1548,7 +1548,7 @@ bool QucsApp::saveAs() Info.setFile(s); if(s.isEmpty()) { // which is default directory ? if(ProjName.isEmpty()) { - if(lastDirOpenSave.isEmpty()) s = QDir::currentPath(); + if(lastDirOpenSave.isEmpty()) s = QDir::homePath(); else s = lastDirOpenSave; } else s = QucsSettings.QucsWorkDir.path(); @@ -1570,8 +1570,7 @@ bool QucsApp::saveAs() Filter = QucsFileFilter; s = QFileDialog::getSaveFileName(this, tr("Enter a Document Name"), - QucsSettings.QucsWorkDir.absolutePath(), - Filter); + s, Filter); if(s.isEmpty()) return false; Info.setFile(s); // try to guess the best extension ... ext = Info.suffix(); From 5344ae34d4633481c0c7ad3d8a5bc8323a98a783 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 26 Apr 2022 14:27:22 +0300 Subject: [PATCH 31/45] Fixed .SP+.STEP analysis with Xyce --- qucs/components/sp_sim.cpp | 34 ++++++++++++++++++++++++++++++++-- qucs/components/sp_sim.h | 3 +++ qucs/extsimkernels/xyce.cpp | 21 ++++++++++++++++++--- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/qucs/components/sp_sim.cpp b/qucs/components/sp_sim.cpp index 8d4e321e..589a3be4 100644 --- a/qucs/components/sp_sim.cpp +++ b/qucs/components/sp_sim.cpp @@ -123,6 +123,19 @@ int SP_Sim::getSPortsNumber() } QStringList SP_Sim::getExtraVariables() +{ + switch (QucsSettings.DefaultSimulator) { + case spicecompat::simNgspice: + return getNgspiceExtraVariables(); + case spicecompat::simXycePar: + case spicecompat::simXyceSer: + return getXyceExtraVariables(); + default: + return QStringList(); + } +} + +QStringList SP_Sim::getNgspiceExtraVariables() { QStringList vars; bool donoise = false; @@ -148,6 +161,23 @@ QStringList SP_Sim::getExtraVariables() return vars; } +QStringList SP_Sim::getXyceExtraVariables() +{ + QStringList vars; + int ports_num = getSPortsNumber(); + for (int i = 0; i < ports_num; i++) { + for (int j = 0; j < ports_num; j++) { + QString tail = QString("(%1,%2)").arg(i+1).arg(j+1); + vars.append(QString("sdb%1").arg(tail)); + vars.append(QString("s%1").arg(tail)); + vars.append(QString("sp%1").arg(tail)); + vars.append(QString("y%1").arg(tail)); + vars.append(QString("z%1").arg(tail)); + } + } + return vars; +} + QString SP_Sim::getSweepString() { QString s; @@ -186,14 +216,14 @@ QString SP_Sim::xyce_netlist() QString s = ".AC "; s += getSweepString(); s += "\n.LIN format=touchstone sparcalc=1\n"; // enable s-param - int ports_num = getSPortsNumber(); + /*int ports_num = getSPortsNumber(); s += ".PRINT ac format=std file=spice4qucs_sparam.prn "; for (int i = 0; i < ports_num; i++) { for (int j = 0; j < ports_num; j++) { s += QString(" sdb(%1,%2) s(%1,%2) sp(%1,%2) y(%1,%2) z(%1,%2) ").arg(i+1).arg(j+1); } } - s += "\n"; + s += "\n";*/ return s; } diff --git a/qucs/components/sp_sim.h b/qucs/components/sp_sim.h index 2cd8cbc4..e4b301dc 100644 --- a/qucs/components/sp_sim.h +++ b/qucs/components/sp_sim.h @@ -27,6 +27,9 @@ private: QString ngspice_netlist(); int getSPortsNumber(); QString getSweepString(); + + QStringList getNgspiceExtraVariables(); + QStringList getXyceExtraVariables(); public: SP_Sim(); ~SP_Sim(); diff --git a/qucs/extsimkernels/xyce.cpp b/qucs/extsimkernels/xyce.cpp index 0e37dbea..b513be5f 100644 --- a/qucs/extsimkernels/xyce.cpp +++ b/qucs/extsimkernels/xyce.cpp @@ -155,7 +155,7 @@ void Xyce::createNetlist(QTextStream &stream, int , QStringList &simulations, } QString sim = simulations.first(); - + QStringList spar_vars; for(Component *pc = Sch->DocComps.first(); pc != 0; pc = Sch->DocComps.next()) { // Xyce can run if(pc->isSimulation) { // only one simulations per time. QString sim_typ = pc->Model; // Multiple simulations are forbidden. @@ -164,7 +164,10 @@ void Xyce::createNetlist(QTextStream &stream, int , QStringList &simulations, if ((sim_typ==".NOISE")&&(sim=="noise")) stream<getExtraVariables(); + stream<Name) stream< Date: Tue, 26 Apr 2022 16:40:35 +0300 Subject: [PATCH 32/45] Update minimum cmake version --- CMakeLists.txt | 4 ++-- qucs-activefilter/CMakeLists.txt | 4 ++-- qucs-attenuator/CMakeLists.txt | 4 ++-- qucs-filter/CMakeLists.txt | 4 ++-- qucs-lib/CMakeLists.txt | 4 ++-- qucs/CMakeLists.txt | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4031a60..83dbe425 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(qucs-suite CXX) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -cmake_policy(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) SET(QUCS_NAME "qucs-s") diff --git a/qucs-activefilter/CMakeLists.txt b/qucs-activefilter/CMakeLists.txt index ada5ed16..858deb8e 100644 --- a/qucs-activefilter/CMakeLists.txt +++ b/qucs-activefilter/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(qucsactivefilter CXX C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -cmake_policy(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) SET(QUCS_NAME "qucs-s") diff --git a/qucs-attenuator/CMakeLists.txt b/qucs-attenuator/CMakeLists.txt index c33a1607..c10fd1e4 100644 --- a/qucs-attenuator/CMakeLists.txt +++ b/qucs-attenuator/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(qucsattenuator CXX C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -cmake_policy(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) # use top VERSION file file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION) diff --git a/qucs-filter/CMakeLists.txt b/qucs-filter/CMakeLists.txt index 2f600d3d..921dd625 100644 --- a/qucs-filter/CMakeLists.txt +++ b/qucs-filter/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(qucsfilter CXX C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -cmake_policy(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) SET(QUCS_NAME "qucs-s") diff --git a/qucs-lib/CMakeLists.txt b/qucs-lib/CMakeLists.txt index 90ecdf0c..cd532cad 100644 --- a/qucs-lib/CMakeLists.txt +++ b/qucs-lib/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(qucslib CXX C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -cmake_policy(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) SET(QUCS_NAME "qucs-s") diff --git a/qucs/CMakeLists.txt b/qucs/CMakeLists.txt index e09606d3..2a95d94d 100755 --- a/qucs/CMakeLists.txt +++ b/qucs/CMakeLists.txt @@ -10,8 +10,8 @@ # By default, the prefix is "/usr/local" PROJECT(qucs-s CXX) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -cmake_policy(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_policy(VERSION 3.0) SET(QUCS_NAME "${PROJECT_NAME}") From 31ef9c4694aa4604bac4b36b7bddd369c5bc5ce7 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 9 May 2022 19:21:34 +0300 Subject: [PATCH 33/45] Insert NutmegEquation if Ngspice is selected --- qucs/qucs_actions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qucs/qucs_actions.cpp b/qucs/qucs_actions.cpp index 6c167465..a92640a7 100644 --- a/qucs/qucs_actions.cpp +++ b/qucs/qucs_actions.cpp @@ -51,6 +51,7 @@ #include "components/ground.h" #include "components/subcirport.h" #include "components/equation.h" +#include "spicecomponents/sp_nutmeg.h" #include "dialogs/matchdialog.h" #include "dialogs/changedialog.h" #include "dialogs/searchdialog.h" @@ -404,7 +405,11 @@ void QucsApp::slotInsertEquation(bool on) if(view->selElem) delete view->selElem; // delete previously selected component - view->selElem = new Equation(); + if (QucsSettings.DefaultSimulator == spicecompat::simNgspice) { + view->selElem = new NutmegEquation(); + } else { + view->selElem = new Equation(); + } Schematic *Doc = (Schematic*)DocumentTab->currentWidget(); if(view->drawn) Doc->viewport()->update(); From b34a9793503f79ec3ec83ea786e4476f91c700a2 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 11 May 2022 21:39:10 +0300 Subject: [PATCH 34/45] Implemented Ngspice Spectrum (FFT) analysis --- qucs/bitmaps/sp_fft.png | Bin 0 -> 369 bytes qucs/components/component.cpp | 3 +- qucs/components/componentdialog.cpp | 2 +- qucs/extsimkernels/ngspice.cpp | 45 ++++++++---- qucs/module.cpp | 1 + qucs/qucs.qrc | 1 + qucs/spicecomponents/CMakeLists.txt | 2 + qucs/spicecomponents/sp_nutmeg.cpp | 2 +- qucs/spicecomponents/sp_spectrum.cpp | 94 +++++++++++++++++++++++++ qucs/spicecomponents/sp_spectrum.h | 35 +++++++++ qucs/spicecomponents/spicecomponents.h | 1 + 11 files changed, 169 insertions(+), 17 deletions(-) create mode 100644 qucs/bitmaps/sp_fft.png create mode 100644 qucs/spicecomponents/sp_spectrum.cpp create mode 100644 qucs/spicecomponents/sp_spectrum.h diff --git a/qucs/bitmaps/sp_fft.png b/qucs/bitmaps/sp_fft.png new file mode 100644 index 0000000000000000000000000000000000000000..cde464ea4d9d77858c447d133d5507c040c74ef0 GIT binary patch literal 369 zcmV-%0gnEOP)QfQLqrP_7LhZyprG*yoKJt zScn&}6GRIUeHMeP!^|wp7CR~Cuaf^w=Kpx}LZU=O2&k`+;Srz|01CnmVFKY0lq$gy zM1aI)j>m91*?yM6atV`(d$Z{j)@%2(07(Kx@e6>%0j^gV3{1aXhuaPIduX>I&&_(Z zs@L4_`o1XO@qp3j8^9s4)NG3M`?fD4vfYY+$b9auf2!LR>2&;c5D7j5N_W6CTP--B z?G~?Ax{bpjG#dIC-bz#0?acMP9$YSPJbJ>FX9hqAWtr(!D)4;j>srmMr>SqJpXCL} zbJ%Qb|2@UC87vlm3;k5^8HfPRx8UEx0^ P00000NkvXXu0mjfFpZ#c literal 0 HcmV?d00001 diff --git a/qucs/components/component.cpp b/qucs/components/component.cpp index 9833b7e0..3403e107 100644 --- a/qucs/components/component.cpp +++ b/qucs/components/component.cpp @@ -200,7 +200,8 @@ void Component::paint(ViewPainter *p) if ((Model==".CUSTOMSIM")||(Model==".DISTO") ||(Model==".NOISE")||(Model==".PZ")|| - (Model==".SENS")||(Model==".SENS_AC")) + (Model==".SENS")||(Model==".SENS_AC")|| + (Model==".FFT")) p->Painter->setPen(QPen(Qt::blue,2)); else if ((Model==".XYCESCR")||(Model==".SENS_XYCE") ||(Model==".SENS_TR_XYCE")) p->Painter->setPen(QPen(Qt::darkGreen,2)); diff --git a/qucs/components/componentdialog.cpp b/qucs/components/componentdialog.cpp index 610f4a99..b0b855b3 100644 --- a/qucs/components/componentdialog.cpp +++ b/qucs/components/componentdialog.cpp @@ -71,7 +71,7 @@ ComponentDialog::ComponentDialog(Component *c, Schematic *d) if((Comp->Model[0] == '.') && (Comp->Model != ".DC") && (Comp->Model != ".HB") && (Comp->Model != ".Digi") && (Comp->Model != ".ETR") && - (Comp->Model != ".FOURIER") && + (Comp->Model != ".FOURIER") && (Comp->Model != ".FFT") && (Comp->Model != ".PZ") && (Comp->Model != ".SENS") && (Comp->Model != ".SENS_AC") && (Comp->Model != ".SENS_XYCE") && (Comp->Model != ".SENS_TR_XYCE")) { diff --git a/qucs/extsimkernels/ngspice.cpp b/qucs/extsimkernels/ngspice.cpp index b9a6f31b..9bad565f 100644 --- a/qucs/extsimkernels/ngspice.cpp +++ b/qucs/extsimkernels/ngspice.cpp @@ -100,6 +100,7 @@ void Ngspice::createNetlist(QTextStream &stream, int , if (sim_typ==".SENS") simulations.append("sens"); if (sim_typ==".SENS_AC") simulations.append("sens_ac"); if (sim_typ==".SP") simulations.append("sp"); + if (sim_typ==".FFT") simulations.append("fft"); if ((sim_typ==".SW")&& (pc->Props.at(0)->Value.startsWith("DC"))) simulations.append("dc"); // stream<DocComps list for(unsigned int i=0;iDocComps.count();i++) { @@ -211,7 +216,11 @@ void Ngspice::createNetlist(QTextStream &stream, int , if ((sim_typ==".AC")&&(sim=="ac")) stream<getExtraVariables(); + ext_vars = pc->getExtraVariables(); + } + if ((sim_typ==".FFT")&&(sim=="fft")) { + stream<getExtraVariables(); } if ((sim_typ==".DISTO")&&(sim=="disto")) stream<bitmaps/NMOS_SPICE.png bitmaps/PMOS_SPICE.png bitmaps/sp_fourier.png + bitmaps/sp_fft.png bitmaps/sp_customsim.png bitmaps/sp_disto.png bitmaps/Vac_SPICE.png diff --git a/qucs/spicecomponents/CMakeLists.txt b/qucs/spicecomponents/CMakeLists.txt index 5df71043..bd584504 100644 --- a/qucs/spicecomponents/CMakeLists.txt +++ b/qucs/spicecomponents/CMakeLists.txt @@ -65,6 +65,7 @@ sp_sens.cpp sp_sens_ac.cpp sp_sens_xyce.cpp sp_sens_tr_xyce.cpp +sp_spectrum.cpp # # Qucs-S new components cpp list @@ -153,6 +154,7 @@ sp_sens_ac.h sp_sens_xyce.h sp_sens_tr_xyce.h xyce_script.h +sp_spectrum.h # # Qucs-S new components h list diff --git a/qucs/spicecomponents/sp_nutmeg.cpp b/qucs/spicecomponents/sp_nutmeg.cpp index a8879a89..87fe301a 100644 --- a/qucs/spicecomponents/sp_nutmeg.cpp +++ b/qucs/spicecomponents/sp_nutmeg.cpp @@ -48,7 +48,7 @@ NutmegEquation::NutmegEquation() Name = "NutmegEq"; Props.append(new Property("Simulation","ac",true, - "Used simulation [ac, tran, dc, disto, sp, all]")); + "Used simulation [ac, tran, dc, disto, sp, fft, all]")); Props.append(new Property("y", "1", true)); } diff --git a/qucs/spicecomponents/sp_spectrum.cpp b/qucs/spicecomponents/sp_spectrum.cpp new file mode 100644 index 00000000..836cb816 --- /dev/null +++ b/qucs/spicecomponents/sp_spectrum.cpp @@ -0,0 +1,94 @@ +/*************************************************************************** + sp_fourier.cpp + ------------ + begin : Sun May 17 2015 + copyright : (C) 2015 by Vadim Kuznetsov + email : ra3xdh@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "sp_spectrum.h" +#include "main.h" +#include "misc.h" +#include "extsimkernels/spicecompat.h" + + +SpiceFFT::SpiceFFT() +{ + isSimulation = true; + Description = QObject::tr("Spectrum analysis"); + + QString s = Description; + int a = s.indexOf(" "); + if (a != -1) s[a] = '\n'; + + Texts.append(new Text(0, 0, s.left(a), Qt::darkBlue, QucsSettings.largeFontSize)); + if (a != -1) + Texts.append(new Text(0, 0, s.mid(a+1), Qt::darkBlue, QucsSettings.largeFontSize)); + + x1 = -10; y1 = -9; + x2 = x1+104; y2 = y1+59; + + tx = 0; + ty = y2+1; + Model = ".FFT"; + Name = "FFT"; + SpiceModel = ".FFT"; + + // The index of the first 4 properties must not changed. Used in recreate(). + Props.append(new Property("BW","1MHz",true,"Bandwidth")); + Props.append(new Property("dF","10kHz",true,"Frequency step")); + Props.append(new Property("Window","hanning", true, "Window type " + "[none,rectangular,bartlet,blackman,hanning,hamming,gaussian,flattop]")); + Props.append(new Property("Order","2",false,"Order of the Gaussian window")); + +} + +SpiceFFT::~SpiceFFT() +{ +} + +Component* SpiceFFT::newOne() +{ + return new SpiceFFT(); +} + +Element* SpiceFFT::info(QString& Name, char* &BitmapFile, bool getNewOne) +{ + Name = QObject::tr("Spectrum analysis"); + BitmapFile = (char *) "sp_fft"; + + if(getNewOne) return new SpiceFFT(); + return 0; +} + +QString SpiceFFT::spice_netlist(bool isXyce) +{ + Q_UNUSED(isXyce); + + QString s; + QString unit; + double num,fac; + misc::str2num(getProperty("BW")->Value,num,unit,fac); + double bw = num*fac; + misc::str2num(getProperty("dF")->Value,num,unit,fac); + double df = num*fac; + double tstop = 1.0/df; + double tstep = 1.0/(2*bw); + QString win = getProperty("Window")->Value; + s = QString("tran %1 %2 0\n").arg(tstep).arg(tstop); + s += QString("set specwindow=%1\n").arg(win); + if (win == "gaussian") { + s += QString("set specwindoworder=%1\n") + .arg(getProperty("Order")->Value); + } + + return s; +} diff --git a/qucs/spicecomponents/sp_spectrum.h b/qucs/spicecomponents/sp_spectrum.h new file mode 100644 index 00000000..56a36b93 --- /dev/null +++ b/qucs/spicecomponents/sp_spectrum.h @@ -0,0 +1,35 @@ +/*************************************************************************** + sp_fourier.h + ---------- + begin : Sun May 17 2015 + copyright : (C) 2015 by Vadim Kuznetsov + email : ra3xdh@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SP_SPECTRUM_H +#define SP_SPECTRUM_H + +#include "components/component.h" + + +class SpiceFFT : public Component { +public: + SpiceFFT(); + ~SpiceFFT(); + Component* newOne(); + static Element* info(QString&, char* &, bool getNewOne=false); + +protected: + QString spice_netlist(bool isXyce = false); +}; + +#endif diff --git a/qucs/spicecomponents/spicecomponents.h b/qucs/spicecomponents/spicecomponents.h index a504a11f..0ea2ad75 100644 --- a/qucs/spicecomponents/spicecomponents.h +++ b/qucs/spicecomponents/spicecomponents.h @@ -86,6 +86,7 @@ #include "sp_sens_ac.h" #include "sp_sens_xyce.h" #include "sp_sens_tr_xyce.h" +#include "sp_spectrum.h" // XSpice file components #include "xspicegeneric.h" From 01160df5945ce59bfc9cf133e86a8e196f82de6d Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 17 May 2022 20:31:44 +0300 Subject: [PATCH 35/45] Add TL431 model --- qucs-lib/library/Regulators.lib | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/qucs-lib/library/Regulators.lib b/qucs-lib/library/Regulators.lib index e28febbb..2b92d1e2 100644 --- a/qucs-lib/library/Regulators.lib +++ b/qucs-lib/library/Regulators.lib @@ -900,3 +900,54 @@ Sub:X1 _net0 _net1 _net2 gnd Type="lm337h_2_mod" + + + +TL431 2.5V voltage reference + + +.Def:TL431_TL431 _net0 _net1 _net2 +Sub:X1 _net0 _net1 _net2 gnd Type="TL431_cir" +.Def:End + + + * Qucs 0.0.23 TL431_TL431.sch + +* TL431 Current Regulator +.subckt nTL431 CATHODE ANODE REF +Q1 N004 N003 N001 0 P +Q2 ANODE N002 N001 0 P +Q3 CATHODE N005 ANODE 0 N +R1 N002 ANODE 600k +R2 REF N002 648k +I1 CATHODE N001 5u +V1 N003 ANODE 1.2V +Q4 CATHODE N004 N005 0 N +R6 N004 ANODE 640k +.model N NPN(BF=250 Cje=.5p Cjc=.5p Rb=500) +.model P PNP(BF=120 Cje=.3p Cjc=1.5p Rb=250) +.ends TL431 + + + +.SUBCKT Regulators_TL431 gnd _net0 _net1 _net2 +X1 _net0 _net1 _net2 nTL431 +.ENDS + + + + + + <.PortSym 80 0 1 0> + <.PortSym 80 90 2 0> + <.PortSym 40 50 3 0> + + + + + + + <.ID 120 24 X> + + + From 01d60d8d8b9a58c24828e68600382cb744f8b18d Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Fri, 20 May 2022 21:09:02 +0300 Subject: [PATCH 36/45] Added XTAL library --- qucs-lib/library/Crystal.lib | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 qucs-lib/library/Crystal.lib diff --git a/qucs-lib/library/Crystal.lib b/qucs-lib/library/Crystal.lib new file mode 100644 index 00000000..e40d49c3 --- /dev/null +++ b/qucs-lib/library/Crystal.lib @@ -0,0 +1,40 @@ + + + + +Crystal resonator + + +.Def:Crystal_Crystal _net0 _net1 Fs="8863k" Lq="0.01406" Cp="6.5p" Rs="5" +R:R1 _net0 _net1 R="50 MOhm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85" +L:L1 _net2 _net3 L="Lq" I="" +C:C2 _net0 _net2 C="Cq" V="" +R:R2 _net3 _net1 R="Rs" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85" +Eqn:Eqn1 Cq="1/(4*pi*pi*Lq*Fs*Fs)" Export="yes" +C:C1 _net0 _net1 C="Cp" V="" +.Def:End + + * Qucs 0.0.23 Crystal_quartz.sch + +.SUBCKT Crystal_Crystal gnd _net0 _net1 Fs=8863k Lq=0.01406 Cp=6.5p Rs=5 +.PARAM Cq=1/(4*3.1415926539*3.1415926539*Lq*Fs*Fs) +R1 _net0 _net1 50MEG +L1 _net2 _net3 {LQ} +C2 _net0 _net2 {CQ} +R2 _net3 _net1 {RS} +C1 _net0 _net1 {CP} +.ENDS + + + + + + + + + <.PortSym 40 0 2 0> + <.PortSym -40 0 1 0> + <.ID -20 34 Y "1=Fs=8863k=series resonance frequency=" "1=Lq=0.01406=equivalent inductance=" "1=Cp=6.5p=parallel capacitance=" "1=Rs=5=series resistance="> + + + From 82adfc53246c9158a614dc685edc5be269ff7681 Mon Sep 17 00:00:00 2001 From: Krasilnikov Sergey Date: Sun, 29 May 2022 17:57:00 +0300 Subject: [PATCH 37/45] use QJsonDocument instead of QScriptEngine --- qucs/components/vacomponent.cpp | 453 +++++++++++++++++--------------- qucs/components/vacomponent.h | 11 +- 2 files changed, 242 insertions(+), 222 deletions(-) diff --git a/qucs/components/vacomponent.cpp b/qucs/components/vacomponent.cpp index 5ccdf30c..656889ea 100644 --- a/qucs/components/vacomponent.cpp +++ b/qucs/components/vacomponent.cpp @@ -19,18 +19,22 @@ #include "vacomponent.h" #include -#include -#include -#include #include #include #include +#include +#include +#include /*! * \file vacomponent.cpp * \brief Implementation of the vacomponent class. */ +vacomponent::vacomponent(QJsonObject json) +{ + parseJson(json); +} /*! @@ -39,54 +43,54 @@ */ vacomponent::vacomponent(QString filename) { - QString data = getData(filename); - - /// \todo check if JSON is error free - /// \todo Need to destroy engine? - QScriptEngine engine; - QScriptValue vadata = engine.evaluate("(" + data + ")"); - - Description = getString(vadata, "description"); - - QScriptValue entries = vadata.property("property"); - - QScriptValueIterator it(entries); - - while (it.hasNext()) { - it.next(); - - QScriptValue entry = it.value(); - - // skip length named iterate - if (it.name().compare("length")) { - QString name = getString(entry, "name"); - QString value = getString(entry, "value"); - QString display = getString(entry, "display"); - QString desc = getString(entry, "desc"); - // QString unit = getString(entry, "unit"); - - /// \todo append units to description - - bool show; - if (!display.compare("false")) - show = false; - else - show = true; - - /// \todo what if there are no properties? - - Props.append (new Property (name, value, show, desc)); + //QString data = getData(filename); + QJsonObject json; + try { + json = getJsonObject(filename); + } catch (const std::runtime_error& ex) { + return; } - } + parseJson(json); +} - createSymbol(filename); +void vacomponent::parseJson(QJsonObject json) +{ + /// \todo check if JSON is error free + /// \todo Need to destroy engine? - Model = getString(vadata, "Model"); - Name = getString(vadata, "SymName"); + Description = getString(json, "description"); - /// TODO adjust location of text - tx = x1+100; - ty = y1+20; + QJsonArray propArray = json["property"].toArray(); + + for (int propIndex = 0; propIndex < propArray.size(); ++propIndex) { + QJsonObject property = propArray[propIndex].toObject(); + //if (it.name().compare("length")) { + QString name = getString(property, "name"); + QString value = getString(property, "value"); + QString display = getString(property, "display"); + QString desc = getString(property, "desc"); + // QString unit = getString(entry, "unit"); + + /// \todo append units to description + + bool show; + if (!display.compare("false")) + show = false; + else + show = true; + + /// \todo what if there are no properties? + Props.append (new Property (name, value, show, desc)); + } + + createSymbol(json); + + Model = getString(json, "Model"); + Name = getString(json, "SymName"); + + /// TODO adjust location of text + tx = x1+100; + ty = y1+20; } /*! @@ -118,20 +122,22 @@ Component *vacomponent::newOne(QString filename) Element *vacomponent::info(QString &Name, QString &BitmapFile, bool getNewOne, QString filename) { - // get variables out of file - QString data = getData(filename); + // get variables out of file + QJsonObject json; + try { + json = getJsonObject(filename); + } catch (const std::runtime_error& ex) { + return 0; + } - QScriptEngine engine; - QScriptValue vadata = engine.evaluate("(" + data + ")"); + Name = getString(json, "Model"); - Name = getString(vadata, "Model"); + /// Default BitmapFile is [modulename] + /// The BitmapFile JSON entry can be modified in \see LoadDialog::slotChangeIcon() + BitmapFile = getString(json, "BitmapFile"); - /// Default BitmapFile is [modulename] - /// The BitmapFile JSON entry can be modified in \see LoadDialog::slotChangeIcon() - BitmapFile = getString(vadata, "BitmapFile"); - - if(getNewOne) return new vacomponent(filename); - return 0; + if(getNewOne) return new vacomponent(json); + return 0; } /*! @@ -140,193 +146,208 @@ Element *vacomponent::info(QString &Name, QString &BitmapFile, * It reads the JSON file and parses the symbol paintings. Data is appended to * to the appropriate lists, Lines, Rects, Ellips, ... */ -void vacomponent::createSymbol(QString filename) +void vacomponent::createSymbol(QJsonObject json) { - // map string to Qt Pen/Brush - // any better to convert QString into Qt::BrushStyle ? - QMap brushMap; - QMap penMap; + // map string to Qt Pen/Brush + // any better to convert QString into Qt::BrushStyle ? + QMap brushMap; + QMap penMap; - brushMap.insert("Qt::NoBrush", Qt::NoBrush); - brushMap.insert("Qt::SolidPattern", Qt::SolidPattern); - brushMap.insert("Qt::Dense1Pattern", Qt::Dense1Pattern); - brushMap.insert("Qt::Dense2Pattern", Qt::Dense2Pattern); - brushMap.insert("Qt::Dense3Pattern", Qt::Dense3Pattern); - brushMap.insert("Qt::Dense4Pattern", Qt::Dense4Pattern); - brushMap.insert("Qt::Dense5Pattern", Qt::Dense5Pattern); - brushMap.insert("Qt::Dense6Pattern", Qt::Dense6Pattern); - brushMap.insert("Qt::Dense7Pattern", Qt::Dense7Pattern); - brushMap.insert("Qt::HorPattern", Qt::HorPattern); - brushMap.insert("Qt::VerPattern", Qt::VerPattern); - brushMap.insert("Qt::CrossPattern", Qt::CrossPattern); - brushMap.insert("Qt::BDiagPattern", Qt::BDiagPattern); - brushMap.insert("Qt::FDiagPattern", Qt::FDiagPattern); - brushMap.insert("Qt::DiagCrossPattern", Qt::DiagCrossPattern); + brushMap.insert("Qt::NoBrush", Qt::NoBrush); + brushMap.insert("Qt::SolidPattern", Qt::SolidPattern); + brushMap.insert("Qt::Dense1Pattern", Qt::Dense1Pattern); + brushMap.insert("Qt::Dense2Pattern", Qt::Dense2Pattern); + brushMap.insert("Qt::Dense3Pattern", Qt::Dense3Pattern); + brushMap.insert("Qt::Dense4Pattern", Qt::Dense4Pattern); + brushMap.insert("Qt::Dense5Pattern", Qt::Dense5Pattern); + brushMap.insert("Qt::Dense6Pattern", Qt::Dense6Pattern); + brushMap.insert("Qt::Dense7Pattern", Qt::Dense7Pattern); + brushMap.insert("Qt::HorPattern", Qt::HorPattern); + brushMap.insert("Qt::VerPattern", Qt::VerPattern); + brushMap.insert("Qt::CrossPattern", Qt::CrossPattern); + brushMap.insert("Qt::BDiagPattern", Qt::BDiagPattern); + brushMap.insert("Qt::FDiagPattern", Qt::FDiagPattern); + brushMap.insert("Qt::DiagCrossPattern", Qt::DiagCrossPattern); - penMap.insert("Qt::NoPen", Qt::NoPen); - penMap.insert("Qt::SolidLine", Qt::SolidLine); - penMap.insert("Qt::DashLine", Qt::DashLine); - penMap.insert("Qt::DotLine", Qt::DotLine); - penMap.insert("Qt::DashDotLine", Qt::DashDotLine); - penMap.insert("Qt::DashDotDotLine", Qt::DashDotDotLine); - penMap.insert("Qt::CustomDashLine", Qt::CustomDashLine); + penMap.insert("Qt::NoPen", Qt::NoPen); + penMap.insert("Qt::SolidLine", Qt::SolidLine); + penMap.insert("Qt::DashLine", Qt::DashLine); + penMap.insert("Qt::DotLine", Qt::DotLine); + penMap.insert("Qt::DashDotLine", Qt::DashDotLine); + penMap.insert("Qt::DashDotDotLine", Qt::DashDotDotLine); + penMap.insert("Qt::CustomDashLine", Qt::CustomDashLine); - QString data = getData(filename); - QScriptEngine engine; - QScriptValue vadata = engine.evaluate("(" + data + ")"); + QJsonArray paintArray = json["paintings"].toArray(); - // get array of symbol paintigs - QScriptValue entries = vadata.property("paintings"); + for (int paintIndex = 0; paintIndex < paintArray.size(); ++paintIndex) { + QJsonObject paint = paintArray[paintIndex].toObject(); - QScriptValueIterator it(entries); - while (it.hasNext()) { - it.next(); + qreal x, x1, x2, y, y1, y2, w, h, thick, angle, arclen; + qreal size, cos, sin; + QString color, style , colorfill, stylefill, s; - qreal x, x1, x2, y, y1, y2, w, h, thick, angle, arclen; - qreal size, cos, sin; - QString color, style , colorfill, stylefill, s; + //QScriptValue entry = it.value(); + QString type = getString(paint, "type"); - QScriptValue entry = it.value(); - QString type = getString(entry, "type"); + if (!type.compare("line")) { + x1 = getDouble(paint, "x1"); + y1 = getDouble(paint, "y1"); + x2 = getDouble(paint, "x2"); + y2 = getDouble(paint, "y2"); + color = getString(paint, "color"); + thick = getDouble(paint, "thick"); + style = getString(paint, "style"); - if (!type.compare("line")) { - x1 = getDouble(entry, "x1"); - y1 = getDouble(entry, "y1"); - x2 = getDouble(entry, "x2"); - y2 = getDouble(entry, "y2"); - color = getString(entry, "color"); - thick = getDouble(entry, "thick"); - style = getString(entry, "style"); + Lines.append (new qucs::Line (x1, y1, x2, y2, + QPen (QColor (color), thick, penMap.value(style)))); + } - Lines.append (new qucs::Line (x1, y1, x2, y2, - QPen (QColor (color), thick, penMap.value(style)))); + if (!type.compare("rectangle")) { + x = getDouble(paint, "x"); + y = getDouble(paint, "y"); + w = getDouble(paint, "w"); + h = getDouble(paint, "h"); + color = getString(paint, "color"); + thick = getDouble(paint, "thick"); + style = getString(paint, "style"); + colorfill = getString(paint, "colorfill"); + stylefill = getString(paint, "stylefill"); + + Rects.append (new qucs::Area (x, y, w, h, + QPen (QColor (color), thick, penMap.value(style)), + QBrush(QColor (colorfill), brushMap.value(stylefill)) + )); + } + + if (!type.compare("ellipse")) { + x = getDouble(paint, "x"); + y = getDouble(paint, "y"); + w = getDouble(paint, "w"); + h = getDouble(paint, "h"); + color = getString(paint, "color"); + thick = getDouble(paint, "thick"); + style = getString(paint, "style"); + colorfill = getString(paint, "colorfill"); + stylefill = getString(paint, "stylefill"); + + Ellips.append (new qucs::Area (x, y, w, h, + QPen (QColor (color), thick, penMap.value(style)), + QBrush(QColor (colorfill), brushMap.value(stylefill)) + )); + } + + if (!type.compare("ellipsearc")) { + x = getDouble(paint, "x"); + y = getDouble(paint, "y"); + w = getDouble(paint, "w"); + h = getDouble(paint, "h"); + angle = getDouble(paint, "angle"); + arclen = getDouble(paint, "arclen"); + color = getString(paint, "color"); + thick = getDouble(paint, "thick"); + style = getString(paint, "style"); + + Arcs.append (new qucs::Arc (x, y, w, h, angle, arclen, + QPen (QColor (color), thick, penMap.value(style)))); + } + + if (!type.compare("portsymbol")) { + x = getDouble(paint, "x"); + y = getDouble(paint, "y"); + Ports.append (new Port (x, y)); + } + + if (!type.compare("graphictext")) { + x = getDouble(paint, "x"); + y = getDouble(paint, "y"); + s = getString(paint, "s"); + color = getString(paint, "color"); + size = getDouble(paint, "size"); + cos = getDouble(paint, "cos"); + sin = getDouble(paint, "sin"); + Texts.append (new Text (x, y, s, + QColor (color), size, cos, sin)); + } + + if (!type.compare("arrow")) { + x1 = getDouble(paint, "x1"); + y1 = getDouble(paint, "y1"); + x2 = getDouble(paint, "x2"); + y2 = getDouble(paint, "y2"); + color = getString(paint, "color"); + thick = getDouble(paint, "thick"); + style = getString(paint, "style"); + Lines.append (new qucs::Line (x1, y1, x2, y2, + QPen (QColor (color), thick, penMap.value(style)))); + } } - if (!type.compare("rectangle")) { - x = getDouble(entry, "x"); - y = getDouble(entry, "y"); - w = getDouble(entry, "w"); - h = getDouble(entry, "h"); - color = getString(entry, "color"); - thick = getDouble(entry, "thick"); - style = getString(entry, "style"); - colorfill = getString(entry, "colorfill"); - stylefill = getString(entry, "stylefill"); - - Rects.append (new qucs::Area (x, y, w, h, - QPen (QColor (color), thick, penMap.value(style)), - QBrush(QColor (colorfill), brushMap.value(stylefill)) - )); - } - - if (!type.compare("ellipse")) { - x = getDouble(entry, "x"); - y = getDouble(entry, "y"); - w = getDouble(entry, "w"); - h = getDouble(entry, "h"); - color = getString(entry, "color"); - thick = getDouble(entry, "thick"); - style = getString(entry, "style"); - colorfill = getString(entry, "colorfill"); - stylefill = getString(entry, "stylefill"); - - Ellips.append (new qucs::Area (x, y, w, h, - QPen (QColor (color), thick, penMap.value(style)), - QBrush(QColor (colorfill), brushMap.value(stylefill)) - )); - } - - if (!type.compare("ellipsearc")) { - x = getDouble(entry, "x"); - y = getDouble(entry, "y"); - w = getDouble(entry, "w"); - h = getDouble(entry, "h"); - angle = getDouble(entry, "angle"); - arclen = getDouble(entry, "arclen"); - color = getString(entry, "color"); - thick = getDouble(entry, "thick"); - style = getString(entry, "style"); - - Arcs.append (new qucs::Arc (x, y, w, h, angle, arclen, - QPen (QColor (color), thick, penMap.value(style)))); - } - - if (!type.compare("portsymbol")) { - x = getDouble(entry, "x"); - y = getDouble(entry, "y"); - Ports.append (new Port (x, y)); - } - - if (!type.compare("graphictext")) { - x = getDouble(entry, "x"); - y = getDouble(entry, "y"); - s = getString(entry, "s"); - color = getString(entry, "color"); - size = getDouble(entry, "size"); - cos = getDouble(entry, "cos"); - sin = getDouble(entry, "sin"); - Texts.append (new Text (x, y, s, - QColor (color), size, cos, sin)); - } - - if (!type.compare("arrow")) { - x1 = getDouble(entry, "x1"); - y1 = getDouble(entry, "y1"); - x2 = getDouble(entry, "x2"); - y2 = getDouble(entry, "y2"); - color = getString(entry, "color"); - thick = getDouble(entry, "thick"); - style = getString(entry, "style"); - Lines.append (new qucs::Line (x1, y1, x2, y2, - QPen (QColor (color), thick, penMap.value(style)))); - } - } - - // bounding box, painted gray if component selected - x1 = getDouble(vadata, "x1"); - y1 = getDouble(vadata, "y1"); - x2 = getDouble(vadata, "x2"); - y2 = getDouble(vadata, "y2"); + // bounding box, painted gray if component selected + x1 = getDouble(json, "x1"); + y1 = getDouble(json, "y1"); + x2 = getDouble(json, "x2"); + y2 = getDouble(json, "y2"); } // Move this elsewhere? + + /*! - * \brief getData Reads the JSON file + * \brief getJsonObject Reads the JSON file * \param filename File (JSON) containing the symbol paintings and properties. - * \return the JSON file as a QString + * \return the parsed JSON file as a QJsonObject */ -QString getData(QString filename) +QJsonObject getJsonObject(QString filename) { - // Try to open the JSON file - QFile file(filename); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QMessageBox::critical(0, QObject::tr("Error"), - QObject::tr("Symbol file not found: %1").arg(filename)); - return ""; - } + // Try to open the JSON file + QFile file(filename); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QMessageBox::critical(0, QObject::tr("Error"), + QObject::tr("Symbol file not found: %1").arg(filename)); + throw std::runtime_error("File not found"); + } - // Stream-in the file - QTextStream in(&file); + // Stream-in the file + QTextStream in(&file); - // Put into a string - QString data = (QString) in.readAll(); - // close - file.close(); + // Put into a string + QString data = (QString) in.readAll(); + // remove trailing comma`s + data = data.simplified(); + data.remove(" "); + data.replace(",]","]"); + data.replace(",}","}"); + // close + file.close(); - return data; + QJsonParseError error; + + QJsonDocument jdoc = QJsonDocument::fromJson(data.toUtf8(), &error); + + + if(error.error != QJsonParseError::NoError) { + QMessageBox::critical(0, QObject::tr("Error"), + QObject::tr("Symbol file not found: %1").arg(filename)); + throw std::runtime_error("Json parse error"); + } + + + QJsonObject object = jdoc.object(); + + return object; } /*! * \brief getDouble Helper to get a property out of a JSON script - * \param data JSON data as a QScritValue + * \param data JSON data as a QJsonObject * \param prop JSON property key * \return a double corresponding to the JSON value */ -double getDouble(QScriptValue data, QString prop){ - return data.property(prop).toString().toDouble(); +double getDouble(QJsonObject data, QString prop){ + return data[prop].toDouble(); } /*! @@ -335,8 +356,6 @@ double getDouble(QScriptValue data, QString prop){ * \param prop JSON property key * \return a QString corresponding to the JSON value */ -QString getString(QScriptValue data, QString prop){ - return data.property(prop).toString(); +QString getString(QJsonObject data, QString prop){ + return data[prop].toString(); } - - diff --git a/qucs/components/vacomponent.h b/qucs/components/vacomponent.h index 6bea29e4..f1495a1a 100644 --- a/qucs/components/vacomponent.h +++ b/qucs/components/vacomponent.h @@ -35,18 +35,19 @@ class vacomponent : public Component public: using Component::newOne; vacomponent(QString filename); + vacomponent(QJsonObject json); ~vacomponent() { }; virtual Component* newOne(QString filename); static Element* info(QString&, QString &, bool getNewOne=false, QString filename=""); protected: - void createSymbol(QString filename); + void createSymbol(QJsonObject json); + void parseJson(QJsonObject json); }; -// -QString getData(QString filename); -double getDouble(QScriptValue data, QString prop); -QString getString(QScriptValue data, QString prop); +QJsonObject getJsonObject(QString filename); +double getDouble(QJsonObject data, QString prop); +QString getString(QJsonObject data, QString prop); #endif /* vacomponent_H */ From dc04a935d8e849692131acd05efc70ace2cd2f1a Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Tue, 31 May 2022 19:23:50 +0300 Subject: [PATCH 38/45] Remove QtScript refence from CMake and loaddialog.cpp --- CMakeLists.txt | 2 +- qucs-lib/CMakeLists.txt | 2 +- qucs/CMakeLists.txt | 2 +- qucs/components/vacomponent.h | 4 +--- qucs/dialogs/loaddialog.cpp | 3 --- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83dbe425..a59389c1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ ENDIF() message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX} ${qucs-suite_BINARY_DIR}" ) -FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets LinguistTools Script REQUIRED ) +FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets LinguistTools REQUIRED ) ADD_DEFINITIONS(${QT_DEFINITIONS}) diff --git a/qucs-lib/CMakeLists.txt b/qucs-lib/CMakeLists.txt index cd532cad..0f7799cb 100644 --- a/qucs-lib/CMakeLists.txt +++ b/qucs-lib/CMakeLists.txt @@ -31,7 +31,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ") # enable warning level SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") # enable C++11 -FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets Svg Xml Script PrintSupport REQUIRED) +FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets Svg Xml PrintSupport REQUIRED) #INCLUDE( ${QT_USE_FILE} ) INCLUDE_DIRECTORIES( diff --git a/qucs/CMakeLists.txt b/qucs/CMakeLists.txt index 2a95d94d..7c94f6c4 100755 --- a/qucs/CMakeLists.txt +++ b/qucs/CMakeLists.txt @@ -54,7 +54,7 @@ endif() # ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets Svg Xml Script PrintSupport REQUIRED) +FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets Svg Xml PrintSupport REQUIRED) #INCLUDE( ${QT_USE_FILE} ) INCLUDE_DIRECTORIES( diff --git a/qucs/components/vacomponent.h b/qucs/components/vacomponent.h index f1495a1a..d8fd2bc4 100644 --- a/qucs/components/vacomponent.h +++ b/qucs/components/vacomponent.h @@ -19,11 +19,9 @@ #define VACOMPONENT_H #include "component.h" - -#include +#include class QString; -class QScriptValue; /*! * \file vacomponent.h diff --git a/qucs/dialogs/loaddialog.cpp b/qucs/dialogs/loaddialog.cpp index bfa14534..0c9ef1ee 100644 --- a/qucs/dialogs/loaddialog.cpp +++ b/qucs/dialogs/loaddialog.cpp @@ -27,9 +27,6 @@ #include #include #include -#include -#include -#include #include #include #include From 819fee41c90cf26d7dd4d03a46b5af87dae7fcd2 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sat, 11 Jun 2022 17:35:41 +0300 Subject: [PATCH 39/45] Added 'X position' input field in MarkerDialog --- qucs/diagrams/marker.h | 1 + qucs/diagrams/markerdialog.cpp | 27 +++++++++++++++++++++++---- qucs/diagrams/markerdialog.h | 1 + 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/qucs/diagrams/marker.h b/qucs/diagrams/marker.h index c30d7cb3..eed3ff02 100644 --- a/qucs/diagrams/marker.h +++ b/qucs/diagrams/marker.h @@ -61,6 +61,7 @@ public: // power matching stuff. some sort of VarPos (ab?)use double powFreq() const {return VarPos[0];} double powReal() const {return VarDep[0];} double powImag() const {return VarDep[1];} + void setPos(const double xpos) { VarPos[0] = xpos; } // private: // not yet Graph const *pGraph; // the corresponding graph diff --git a/qucs/diagrams/markerdialog.cpp b/qucs/diagrams/markerdialog.cpp index 1ffd6f70..e85a20ad 100644 --- a/qucs/diagrams/markerdialog.cpp +++ b/qucs/diagrams/markerdialog.cpp @@ -39,6 +39,16 @@ MarkerDialog::MarkerDialog(Marker *pm_, QWidget *parent) Precision->setText(QString::number(pMarker->Precision)); Precision->setValidator(new QIntValidator(0, 12, this)); + XPosition = new QLineEdit(); + if (pMarker->varPos().size() > 0) { + XPosition->setText(QString::number(pMarker->varPos().at(0), + 'g', pMarker->precision())); + } else { + XPosition->setText("0"); + XPosition->setEnabled(false); + } + XPosition->setValidator(new QDoubleValidator(this)); + g->addWidget(new QLabel(tr("Precision: ")), 0, 0); g->addWidget(Precision, 0, 1); @@ -51,6 +61,9 @@ MarkerDialog::MarkerDialog(Marker *pm_, QWidget *parent) g->addWidget(new QLabel(tr("Number Notation: ")), 1,0); g->addWidget(NumberBox, 1, 1); + g->addWidget(new QLabel(tr("X-axis position:")), 2, 0); + g->addWidget(XPosition, 2, 1); + assert(pMarker->diag()); if(pMarker->diag()->Name=="Smith") // BUG { @@ -58,13 +71,13 @@ MarkerDialog::MarkerDialog(Marker *pm_, QWidget *parent) SourceImpedance = new QLineEdit(); SourceImpedance->setText(QString::number(pMarker->Z0)); - g->addWidget(new QLabel(tr("Z0: ")), 2,0); - g->addWidget(SourceImpedance,2,1); + g->addWidget(new QLabel(tr("Z0: ")), 3,0); + g->addWidget(SourceImpedance,3,1); } TransBox = new QCheckBox(tr("transparent")); TransBox->setChecked(pMarker->transparent); - g->addWidget(TransBox,3,0); + g->addWidget(TransBox,4,0); // first => activated by pressing RETURN QPushButton *ButtOK = new QPushButton(tr("OK")); @@ -77,7 +90,7 @@ MarkerDialog::MarkerDialog(Marker *pm_, QWidget *parent) b->setSpacing(5); b->addWidget(ButtOK); b->addWidget(ButtCancel); - g->addLayout(b,4,0,1,2); + g->addLayout(b,5,0,1,2); this->setLayout(g); } @@ -114,6 +127,12 @@ void MarkerDialog::slotAcceptValues() changed = true; } + double xpos = XPosition->text().toDouble(); + if (xpos != pMarker->powFreq()) { + pMarker->setPos(XPosition->text().toDouble()); + changed = true; + } + if(changed) { pMarker->createText(); done(2); diff --git a/qucs/diagrams/markerdialog.h b/qucs/diagrams/markerdialog.h index 8925b8fb..30c8d296 100644 --- a/qucs/diagrams/markerdialog.h +++ b/qucs/diagrams/markerdialog.h @@ -38,6 +38,7 @@ public: QComboBox *NumberBox; QLineEdit *Precision; + QLineEdit *XPosition; QLineEdit *SourceImpedance; QCheckBox *TransBox; }; From cd113ed9074ec5cdd65a3f7fa1f1e9848f4d2ab1 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 13 Jun 2022 10:48:07 +0300 Subject: [PATCH 40/45] Show Freq. instead of X-pos. for Smith chart; fix indentation --- qucs/diagrams/markerdialog.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/qucs/diagrams/markerdialog.cpp b/qucs/diagrams/markerdialog.cpp index e85a20ad..0698c2ba 100644 --- a/qucs/diagrams/markerdialog.cpp +++ b/qucs/diagrams/markerdialog.cpp @@ -61,19 +61,21 @@ MarkerDialog::MarkerDialog(Marker *pm_, QWidget *parent) g->addWidget(new QLabel(tr("Number Notation: ")), 1,0); g->addWidget(NumberBox, 1, 1); - g->addWidget(new QLabel(tr("X-axis position:")), 2, 0); + QLabel *lblXpos = new QLabel(tr("X-axis position:")); + g->addWidget(lblXpos, 2, 0); g->addWidget(XPosition, 2, 1); assert(pMarker->diag()); if(pMarker->diag()->Name=="Smith") // BUG { - //S parameter also displayed as Z, need Z0 here - SourceImpedance = new QLineEdit(); - SourceImpedance->setText(QString::number(pMarker->Z0)); + //S parameter also displayed as Z, need Z0 here + lblXpos->setText("Frequency:"); + SourceImpedance = new QLineEdit(); + SourceImpedance->setText(QString::number(pMarker->Z0)); - g->addWidget(new QLabel(tr("Z0: ")), 3,0); - g->addWidget(SourceImpedance,3,1); - } + g->addWidget(new QLabel(tr("Z0: ")), 3,0); + g->addWidget(SourceImpedance,3,1); + } TransBox = new QCheckBox(tr("transparent")); TransBox->setChecked(pMarker->transparent); @@ -128,7 +130,8 @@ void MarkerDialog::slotAcceptValues() } double xpos = XPosition->text().toDouble(); - if (xpos != pMarker->powFreq()) { + if ((xpos != pMarker->powFreq()) && + (pMarker->varPos().size() > 0)) { pMarker->setPos(XPosition->text().toDouble()); changed = true; } From bba59f0b08149bf580a7831c15221d511cddbd15 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 20 Jun 2022 18:01:13 +0300 Subject: [PATCH 41/45] Search for ngspice executable in binary directory, rely on PATH if not found --- qucs/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qucs/main.cpp b/qucs/main.cpp index c094e46a..27cb9a0c 100644 --- a/qucs/main.cpp +++ b/qucs/main.cpp @@ -128,7 +128,12 @@ bool loadSettings() //if(settings.contains("ExamplesDir"))QucsSettings.ExamplesDir = settings.value("ExamplesDir").toString(); //if(settings.contains("DocDir"))QucsSettings.DocDir = settings.value("DocDir").toString(); if(settings.contains("NgspiceExecutable")) QucsSettings.NgspiceExecutable = settings.value("NgspiceExecutable").toString(); - else QucsSettings.NgspiceExecutable = "ngspice"; + else { + QString ngsp_exe = QCoreApplication::applicationDirPath() + + QDir::separator() + "ngspice" + executableSuffix; + if (!QFile::exists(ngsp_exe)) ngsp_exe = QString("ngspice") + executableSuffix; + QucsSettings.NgspiceExecutable = ngsp_exe; + } if(settings.contains("XyceExecutable")) QucsSettings.XyceExecutable = settings.value("XyceExecutable").toString(); else { #ifdef Q_OS_WIN From 9457952f574141edc1ab1ae0ee61fa91a8a786d4 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Wed, 29 Jun 2022 16:32:27 +0300 Subject: [PATCH 42/45] Added FFT example --- examples/Mixer_FFT.sch | 81 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 examples/Mixer_FFT.sch diff --git a/examples/Mixer_FFT.sch b/examples/Mixer_FFT.sch new file mode 100644 index 00000000..2d7307fd --- /dev/null +++ b/examples/Mixer_FFT.sch @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <.FFT FFT1 1 970 370 0 75 0 0 "30MHz" 1 "50kHz" 1 "hanning" 1 "2" 0> + + + + + + <470 390 530 390 "" 0 0 0 ""> + <350 390 410 390 "" 0 0 0 ""> + <530 390 530 510 "" 0 0 0 ""> + <470 510 530 510 "" 0 0 0 ""> + <350 510 410 510 "" 0 0 0 ""> + <350 510 350 580 "" 0 0 0 ""> + <510 580 590 580 "" 0 0 0 ""> + <290 580 350 580 "" 0 0 0 ""> + <290 390 350 390 "" 0 0 0 ""> + <130 580 130 590 "" 0 0 0 ""> + <130 580 160 580 "" 0 0 0 ""> + <60 390 60 420 "" 0 0 0 ""> + <60 390 170 390 "signal" 90 320 11 ""> + <530 390 590 390 "" 0 0 0 ""> + <790 390 790 440 "" 0 0 0 ""> + <710 390 790 390 "heterodin" 760 340 25 ""> + <560 480 590 480 "" 0 0 0 ""> + <560 480 560 520 "" 0 0 0 ""> + <530 300 530 350 "" 0 0 0 ""> + <290 480 310 480 "" 0 0 0 ""> + <310 300 310 480 "" 0 0 0 ""> + <310 300 350 300 "out" 350 330 16 ""> + <410 300 530 300 "" 0 0 0 ""> + <350 390 350 460 "" 0 0 0 ""> + <510 460 510 580 "" 0 0 0 ""> + <470 460 510 460 "" 0 0 0 ""> + <350 460 410 460 "" 0 0 0 ""> + <470 580 510 580 "" 0 0 0 ""> + <350 580 410 580 "" 0 0 0 ""> + + + + <"ngspice/ac.v(out)" #0000ff 0 3 0 0 0> + <"ngspice/ac.v(signal)" #ff00ff 0 3 0 0 0> + + + <"ngspice/ac.s" #0000ff 0 3 0 0 0> + + + + + From 2ea606db79ea3b62f3fd0ef866dec6acc566cf95 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 30 Jun 2022 16:37:20 +0300 Subject: [PATCH 43/45] Added workround for diode bug for Ngspice-37 --- qucs/components/diode.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qucs/components/diode.cpp b/qucs/components/diode.cpp index a56dbfff..fcbfe82c 100644 --- a/qucs/components/diode.cpp +++ b/qucs/components/diode.cpp @@ -18,6 +18,7 @@ #include "diode.h" #include "node.h" #include "main.h" +#include "misc.h" #include "extsimkernels/spicecompat.h" Diode::Diode() @@ -119,7 +120,27 @@ QString Diode::spice_netlist(bool isXyce) spice_incompat<<"Cp"<<"Isr"<<"Nr"<<"Ffe"<<"Temp"<<"Area"<<"Symbol"; } - QString par_str = form_spice_param_list(spice_incompat,spice_tr); + QString par_str; + //= form_spice_param_list(spice_incompat,spice_tr); + + for (unsigned int i=0;iName)) { + if (Props.at(i)->Name == "Ikf") { // Bug Ngspice37 + if (Props.at(i)->Value == "0") continue; // convergence error if Ikf=0 + } + QString unit,nam; + if (spice_tr.contains(Props.at(i)->Name)) { + nam = spice_tr.at(spice_tr.indexOf(Props.at(i)->Name)+1); + } else { + nam = Props.at(i)->Name; + } + double val,fac; + misc::str2num(Props.at(i)->Value,val,unit,fac); + val *= fac; + par_str += QString("%1=%2 ").arg(nam).arg(val); + } + + } s += QString(" DMOD_%1 AREA=%2 Temp=%3\n").arg(Name).arg(getProperty("Area")->Value) .arg(getProperty("Temp")->Value); From 214e0e94e0ff1ef442d5141924407d68eb83c874 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 30 Jun 2022 16:43:07 +0300 Subject: [PATCH 44/45] Update version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index df5db66f..b056f412 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.23 +0.0.24 From e7f47a0abbeaa0d4fc87febae8efc44bbe8d00ab Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 30 Jun 2022 17:03:21 +0300 Subject: [PATCH 45/45] Correct about dialog --- qucs/dialogs/aboutdialog.cpp | 16 +++++----------- qucs/qucs_init.cpp | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/qucs/dialogs/aboutdialog.cpp b/qucs/dialogs/aboutdialog.cpp index 7703b593..bbffb27c 100644 --- a/qucs/dialogs/aboutdialog.cpp +++ b/qucs/dialogs/aboutdialog.cpp @@ -162,15 +162,9 @@ AboutDialog::AboutDialog(QWidget *parent) QString supportText; // link to home page, help mailing list, IRC ? - supportText = tr("Home Page") + " : http://qucs.sourceforge.net/
"+ - tr("Documentation start page") + " : http://qucs.sourceforge.net/docs.html
" + - tr("Components reference manual") + " : http://qucs.github.io/qucs-manual/

" + - tr("If you need help on using Qucs, please join the") + "
" + - tr("help mailing list") + " : " + tr("qucs-help on SourceForge") + "
" + - "(" + tr("please attach the schematic you are having problems with") + ")

" + - // use http://webchat.freenode.net/?channels=qucs ? - tr("IRC general discussion channel") + " : #qucs on freenode.net

" + - tr("Additional resources") + " : https://github.com/Qucs/qucs#resources"; + supportText = tr("Home Page") + " : https://ra3xdh.github.io/
"+ + tr("Documentation start page") + " : https://qucs-s-help.readthedocs.io/
" + + tr("Bugtracker page") + " : https://github.com/ra3xdh/qucs_s/issues
"; QTextBrowser *supportBrowser = new QTextBrowser; supportBrowser->viewport()->installEventFilter(this); @@ -178,7 +172,7 @@ AboutDialog::AboutDialog(QWidget *parent) supportBrowser->setHtml(supportText); QString licenseText; - licenseText = "Qucs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This software is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details..

You should have received a copy of the GNU General Public License along with Qucs, see the file COPYING. If not see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,Boston, MA 02110-1301, USA."; + licenseText = "Qucs-S is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This software is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details..

You should have received a copy of the GNU General Public License along with Qucs, see the file COPYING. If not see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,Boston, MA 02110-1301, USA."; QTextBrowser *licenseBrowser = new QTextBrowser; licenseBrowser->viewport()->installEventFilter(this); @@ -223,7 +217,7 @@ void AboutDialog::currentChangedSlot(int index) { void AboutDialog::setAuthorsText() { QString authorsText; - authorsText = tr("Qucs-S subproject team:"); + authorsText = tr("Qucs-S project team:"); authorsText += "
    "; for(QString& tStr : qucs_sDevs) { authorsText += ("
  • " + tStr + "
  • "); diff --git a/qucs/qucs_init.cpp b/qucs/qucs_init.cpp index 2ef6169c..971797e0 100644 --- a/qucs/qucs_init.cpp +++ b/qucs/qucs_init.cpp @@ -663,7 +663,7 @@ void QucsApp::initActions() tr("Getting Started\n\nShort introduction into Qucs")); connect(helpGetStart, SIGNAL(triggered()), SLOT(slotGettingStarted())); - helpAboutApp = new QAction(tr("&About Qucs..."), this); + helpAboutApp = new QAction(tr("&About Qucs-S..."), this); helpAboutApp->setStatusTip(tr("About the application")); helpAboutApp->setWhatsThis(tr("About\n\nAbout the application")); connect(helpAboutApp, SIGNAL(triggered()), SLOT(slotHelpAbout()));