Skip to content

Commit

Permalink
Merge pull request #578 from ra3xdh/release/24.1
Browse files Browse the repository at this point in the history
Fixes after release 24.1.0
  • Loading branch information
ra3xdh authored Mar 4, 2024
2 parents 1a7aaba + a73ac7c commit cc991c6
Show file tree
Hide file tree
Showing 28 changed files with 532 additions and 91 deletions.
14 changes: 7 additions & 7 deletions examples/ngspice/Distortion.sch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=40,6,1652,922,0.974891,0,0>
<View=40,6,1709,1022,0.974891,0,0>
<Grid=10,10,1>
<DataSet=Distortion.dat>
<DataDisplay=Distortion.dpl>
Expand Down Expand Up @@ -33,14 +33,14 @@
<GND * 1 100 300 0 0 0 0>
<NutmegEq NutmegEq1 5 130 530 -27 17 0 0 "DISTO1" 1 "h2.out=disto1.v(out)" 1 "h3.out=disto2.v(out)" 1>
<NutmegEq NutmegEq2 5 280 550 -27 17 0 0 "DISTO2" 1 "s1.out=disto1.v(out)" 1 "s2.out=disto2.v(out)" 1 "s3.out=disto3.v(out)" 1>
<.DC DC1 5 280 670 0 44 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.DISTO DISTO3 1 400 350 0 79 0 0 "lin" 1 "10 kHz" 1 "1 MHz" 1 "100" 0 "" 0>
<NutmegEq NutmegEq3 5 430 530 -27 17 0 0 "DISTO3" 1 "h2.out=disto1.v(out)" 1 "h3.out=disto2.v(out)" 1>
<.DISTO DISTO1 1 100 350 0 79 0 0 "log" 1 "1 Hz" 1 "1 GHz" 1 "900" 0 "" 0>
<.DISTO DISTO2 1 250 350 0 79 0 0 "log" 1 "1 Hz" 1 "1 GHz" 1 "900" 0 "0.9" 1>
<.AC AC1 5 100 670 0 44 0 0 "log" 1 "1 Hz" 1 "1 GHz" 1 "900" 0 "no" 0>
<R R1 1 360 270 15 -26 0 1 "2kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<S4Q_V V2 1 100 210 18 -26 0 1 "DISTOF1 0.2" 1 "+ AC 0.2" 0 "" 0 "" 0 "" 0>
<.DC DC1 5 300 670 0 44 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
</Components>
<Wires>
<360 210 450 210 "" 0 0 0 "">
Expand Down Expand Up @@ -78,11 +78,11 @@
<"ngspice/disto2.ac.v(s3.out)" #ff00ff 2 3 0 0 0>
<"ngspice/ac1.ac.v(out)" #550000 2 3 0 1 1>
</Rect>
<Tab 100 855 548 54 3 #c0c0c0 1 00 1 0 1 1 1 0 1 1 1 0 1 1 315 0 225 1 0 0 "" "" "">
<"ngspice/dc1.b" #0000ff 0 3 1 0 0>
<"ngspice/dc1.e" #0000ff 0 3 1 0 0>
<"ngspice/dc1.c" #0000ff 0 3 1 0 0>
<"ngspice/dc1.vpr1#branch" #0000ff 0 3 0 0 0>
<Tab 100 848 375 49 3 #c0c0c0 1 00 1 0 1 1 1 0 1 1 1 0 1 1 315 0 225 1 0 0 "" "" "">
<"ngspice/dc1.v(b)" #0000ff 0 3 0 0 0>
<"ngspice/dc1.v(e)" #0000ff 0 3 0 0 0>
<"ngspice/dc1.v(c)" #0000ff 0 3 0 0 0>
<"ngspice/dc1.i(pr1)" #0000ff 0 3 0 0 0>
</Tab>
<Rect 640 500 240 160 3 #c0c0c0 1 00 1 0 200000 1e+06 1 0.0132354 0.002 0.018 1 0.00284697 0.0005 0.00364608 315 0 225 1 0 0 "" "" "">
<"ngspice/disto3.ac.v(h2.out)" #0000ff 2 3 0 0 0>
Expand Down
126 changes: 126 additions & 0 deletions examples/templates_ngspice/Pwr-Amp_DC_analysis.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=-242,0,1251,874,1.05263,0,0>
<Grid=10,10,1>
<DataSet=Pwr-Amp_DC_analysis.dat>
<DataDisplay=Pwr-Amp_DC_analysis.dpl>
<OpenDisplay=0>
<Script=Pwr-Amp_DC_analysis.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
</Symbol>
<Components>
<R R7 1 250 130 -18 12 0 0 "10" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R6 1 250 470 -23 -49 1 0 "10" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<Idc I1 1 200 90 -83 -26 0 3 "13 mA" 1>
<Idc I2 1 200 510 -83 -26 0 3 "13 mA" 1>
<R R3 1 400 430 -25 -47 1 0 "470" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R4 1 400 170 -24 9 0 0 "470" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<Vdc V1 1 540 80 19 -12 1 1 "50 V" 1>
<GND * 1 540 120 0 0 0 0>
<Vdc V2 1 540 520 19 -12 1 1 "50 V" 1>
<GND * 1 560 480 0 0 0 0>
<MOS_SPICE M1 1 480 170 18 -17 0 0 "M" 0 "3" 0 "nmos" 0 "IRFP240" 1 "" 0 "" 0 "" 0 "" 0>
<MOS_SPICE M2 1 480 430 17 -18 1 0 "M" 0 "3" 0 "pmos" 0 "IRFP9240" 1 "" 0 "" 0 "" 0 "" 0>
<NPN_SPICE Q1 1 340 130 7 -31 0 0 "MJE340" 1 "" 0 "" 0 "" 0 "" 0>
<PNP_SPICE Q2 1 340 470 9 -10 1 0 "MJE350" 1 "" 0 "" 0 "" 0 "" 0>
<GND * 1 100 400 0 0 0 0>
<S4Q_V Vin 1 100 350 -48 -26 1 1 "0" 1 "" 0 "" 0 "" 0 "" 0>
<Vdc V3 1 200 230 -69 -11 0 1 "Vv1" 1>
<Vdc V4 1 200 390 -67 -11 0 1 "Vv1" 1>
<R R5 1 340 310 -64 -20 1 1 "870" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R2 1 480 250 -69 -15 1 1 "0.33" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R1 1 480 350 -68 -20 1 1 "0.33" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<GND * 1 600 400 0 0 0 0>
<R RLoad 1 600 350 19 -19 0 1 "8" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<INCLSCR INCLSCR1 1 -90 60 -70 18 0 0 "\n.PARAM Temperature = 27\n.TEMP {Temperature}\n.PARAM Vv1 = 4.8\n.PROBE P(M1) P(M2)\n.PROBE P(RLoad) I(RLoad)\n.PROBE P(V1) P(V2)" 1 "" 0 "" 0>
<.SW SW2 0 360 590 0 83 0 0 "SW1" 1 "list" 1 "Vv1" 1 "5 Ohm" 0 "50 Ohm" 0 "[4.7;4.9;5.1]" 1 "false" 0>
<.SW SW1 1 210 590 0 83 0 0 "DC1" 1 "lin" 1 "Vin" 1 "-20" 1 "20" 1 "100" 1 "false" 0>
<SpiceModel SpiceModel1 1 -130 800 -27 16 0 0 ".model IRFP240 VDMOS (nchan Vto=4 Kp=5.9 Lambda=.001 Theta=0.015 ksubthres=.27 Rd=61m Rs=18m Rg=3 Rds=1e7 Cgdmax=2.45n Cgdmin=10p a=0.3 Cgs=1.2n Is=60p N=1.1 Rb=14m XTI=3 Cjo=1.5n Vj=0.8 m=0.5 tcvth=0.0065 MU=-1.27 texp0=1.5 mtriode=0.8)" 0 ".model IRFP9240 VDMOS (pchan Vto=-4 Kp=8.8 Lambda=.003 Theta=0.08 ksubthres=.35 Rd=180m Rs=50m Rg=3 Rds=1e7 Cgdmax=1.25n Cgdmin=50p a=0.23 Cgs=1.15n Is=150p N=1.3 Rb=16m XTI=2 Cjo=1.3n Vj=0.8 m=0.5 tcvth=0.004 MU=-1.27 texp0=1.5 mtriode=0.6)" 0 ".model MJE340 NPN (Is=1.03431e-13 BF=172.974 NF=.939811 VAF=27.3487 IKF=0.0260146 ISE=4.48447e-11 Ne=1.61605 Br=16.6725 Nr=0.796984 VAR=6.11596 IKR=0.10004 Isc=9.99914e-14 Nc=1.99995 RB=1.47761 IRB=0.2 RBM=1.47761 Re=0.0001 RC=1.42228 XTB=2.70726 XTI=1 Eg=1.206 CJE=1e-11 VJE=0.75 Mje=.33 TF=1e-09 XTF=1 VTF=10 ITF=0.01 CJC=1e-11 VJC=.75 MJC=0.33 XCJC=.9 Fc=0.5 CJS=0 VJS=0.75 MJS=0.5 TR=1e-07 PTF=0 KF=0 AF=1)" 0 ".model MJE350 PNP (Is=6.01619e-15 BF=157.387 NF=.910131 VAF=23.273 IKF=0.0564808 Ise=4.48479e-12 Ne=1.58557 BR=0.1 NR=1.03823 VAR=4.14543 IKR=.0999978 ISC=1.00199e-13 Nc=1.98851 RB=.1 IRB=0.202965 RBM=0.1 Re=.0710678 Rc=.355339 XTB=1.03638 XTI=3.8424 Eg=1.206 Cje=1e-11 Vje=0.75 Mje=0.33 TF=1e-09 XTF=1 VTF=10 ITF=0.01 Cjc=1e-11 Vjc=0.75 Mjc=0.33 XCJC=0.9 Fc=0.5 Cjs=0 Vjs=0.75 Mjs=0.5 TR=1e-07 PTF=0 KF=0 AF=1)" 0 "Line_5=" 0>
<.DC DC1 1 -150 230 0 49 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<NutmegEq NutmegEq2 1 -130 320 -27 16 0 0 "ALL" 1 "i(load)=i(RLoad)" 1 "M1_pwr=M1:power" 1 "M2_pwr=M2:power" 1 "Load_pwr=RLoad:power" 1 "Total_pwr=-1*(V1:power+V2:power)" 1>
<NutmegEq NutmegEq1 1 -130 480 -27 16 0 0 "SW1" 1 "dd=deriv(out)" 1>
<.SW SW3 0 510 590 0 73 0 0 "SW1" 1 "list" 1 "Temperature" 1 "-40" 0 "80" 0 "[0;25;40]" 1 "false" 0>
</Components>
<Wires>
<200 120 200 130 "" 0 0 0 "">
<280 470 310 470 "" 0 0 0 "">
<280 130 310 130 "" 0 0 0 "">
<340 160 340 170 "" 0 0 0 "">
<340 170 340 280 "" 0 0 0 "">
<340 170 370 170 "" 0 0 0 "">
<340 340 340 430 "" 0 0 0 "">
<340 430 340 440 "" 0 0 0 "">
<340 430 370 430 "" 0 0 0 "">
<480 200 480 220 "" 0 0 0 "">
<480 380 480 400 "" 0 0 0 "">
<430 430 450 430 "" 0 0 0 "">
<430 170 450 170 "" 0 0 0 "">
<200 40 200 60 "" 0 0 0 "">
<480 40 480 140 "" 0 0 0 "">
<200 40 340 40 "" 0 0 0 "">
<340 40 480 40 "" 0 0 0 "">
<340 40 340 100 "" 0 0 0 "">
<200 540 200 560 "" 0 0 0 "">
<480 460 480 560 "" 0 0 0 "">
<200 470 200 480 "" 0 0 0 "">
<200 470 220 470 "" 0 0 0 "">
<200 560 340 560 "" 0 0 0 "">
<340 560 480 560 "" 0 0 0 "">
<340 500 340 560 "" 0 0 0 "">
<200 130 220 130 "" 0 0 0 "">
<200 420 200 470 "" 0 0 0 "">
<200 260 200 300 "" 0 0 0 "">
<200 130 200 200 "" 0 0 0 "">
<480 40 540 40 "" 0 0 0 "">
<540 40 540 50 "" 0 0 0 "">
<540 110 540 120 "" 0 0 0 "">
<480 560 540 560 "" 0 0 0 "">
<540 550 540 560 "" 0 0 0 "">
<560 470 560 480 "" 0 0 0 "">
<540 470 540 490 "" 0 0 0 "">
<540 470 560 470 "" 0 0 0 "">
<480 280 480 300 "" 0 0 0 "">
<200 300 200 360 "" 0 0 0 "">
<100 300 200 300 "" 0 0 0 "">
<100 380 100 400 "" 0 0 0 "">
<100 300 100 320 "" 0 0 0 "">
<480 300 480 320 "" 0 0 0 "">
<600 380 600 400 "" 0 0 0 "">
<600 300 600 320 "" 0 0 0 "">
<480 300 600 300 "" 0 0 0 "">
<600 300 600 300 "OUT" 610 270 0 "">
</Wires>
<Diagrams>
<Rect 790 350 382 280 3 #c0c0c0 1 00 1 -20 5 20 1 0.89896 0.01 0.953349 1 -1 0.5 1 315 0 225 0 0 0 "" "" "">
<"ngspice/sw1.v(dd)" #0000ff 0 3 0 0 0>
<"ngspice/sw1.i(load)" #ff0000 0 3 0 0 1>
</Rect>
<Rect 790 740 382 280 3 #c0c0c0 1 00 1 -20 5 20 1 -12.0232 50 132.257 1 -1 0.5 1 315 0 225 0 0 0 "" "" "">
<"ngspice/sw1.m1_pwr" #0000ff 0 3 0 0 0>
<"ngspice/sw1.m2_pwr" #ff0000 0 3 0 0 0>
<"ngspice/sw1.load_pwr" #ff00ff 0 3 0 0 0>
<"ngspice/sw1.total_pwr" #00aa00 0 3 0 0 0>
</Rect>
<Tab -160 624 343 49 3 #c0c0c0 1 00 1 0 1 1 1 0 1 1 1 0 1 1 315 0 225 1 0 0 "" "" "">
<"ngspice/dc1.v(out)" #0000ff 0 3 1 0 0>
<"ngspice/dc1.i(load)" #0000ff 0 3 1 0 0>
<"ngspice/dc1.load_pwr" #0000ff 0 3 1 0 0>
</Tab>
<Tab -160 690 344 49 3 #c0c0c0 1 00 1 0 1 1 1 0 1 1 1 0 1 1 315 0 225 1 0 0 "" "" "">
<"ngspice/dc1.m1_pwr" #0000ff 0 3 1 0 0>
<"ngspice/dc1.m2_pwr" #0000ff 0 3 1 0 0>
<"ngspice/dc1.total_pwr" #0000ff 0 3 1 0 0>
</Tab>
</Diagrams>
<Paintings>
<Text 930 40 14 #000000 0 "Wingspread">
<Text 950 430 14 #000000 0 "Power">
<Text 350 790 14 #000000 0 "Enable SW2 and SW3 one at a time">
</Paintings>
8 changes: 4 additions & 4 deletions examples/templates_ngspice/Pwr-Amp_wingspread_analysis.sch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=12,0,3504,1129,1,0,454>
<View=12,-400,3138,1375,0.50304,1,0>
<Grid=10,10,1>
<DataSet=Pwr-Amp_wingspread_analysis.dat>
<DataDisplay=Pwr-Amp_wingspread_analysis.dpl>
Expand Down Expand Up @@ -33,7 +33,6 @@
<GND * 1 100 400 0 0 0 0>
<S4Q_V vin 1 100 350 -48 -26 1 1 "0" 1 "" 0 "" 0 "" 0 "" 0>
<.DC DC1 1 80 620 0 49 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<NutmegEq NutmegEq1 1 290 630 -27 16 0 0 "dc" 1 "dd=deriv(out)" 1 "iload=i(V5)" 1>
<.SW SW1 1 410 630 0 83 0 0 "DC1" 1 "lin" 1 "Vin" 1 "-20" 1 "20" 1 "101" 1 "false" 0>
<SpicePar SpicePar1 1 290 750 -28 16 0 0 "Vv1=4.8" 1>
<.SW SW2 1 570 630 0 83 0 0 "SW1" 1 "list" 1 "Vv1" 1 "5 Ohm" 0 "50 Ohm" 0 "[4.7;4.9;5.1]" 1 "false" 0>
Expand All @@ -46,6 +45,7 @@
<GND * 1 600 400 0 0 0 0>
<R RLoad 1 600 350 19 -19 0 1 "8" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<SpiceModel SpiceModel1 1 120 840 -27 16 0 0 ".model IRFP240 VDMOS (nchan Vto=4 Kp=5.9 Lambda=.001 Theta=0.015 ksubthres=.27 Rd=61m Rs=18m Rg=3 Rds=1e7 Cgdmax=2.45n Cgdmin=10p a=0.3 Cgs=1.2n Is=60p N=1.1 Rb=14m XTI=3 Cjo=1.5n Vj=0.8 m=0.5 tcvth=0.0065 MU=-1.27 texp0=1.5 mtriode=0.8)" 1 ".model IRFP9240 VDMOS (pchan Vto=-4 Kp=8.8 Lambda=.003 Theta=0.08 ksubthres=.35 Rd=180m Rs=50m Rg=3 Rds=1e7 Cgdmax=1.25n Cgdmin=50p a=0.23 Cgs=1.15n Is=150p N=1.3 Rb=16m XTI=2 Cjo=1.3n Vj=0.8 m=0.5 tcvth=0.004 MU=-1.27 texp0=1.5 mtriode=0.6)" 1 ".model MJE340 NPN (Is=1.03431e-13 BF=172.974 NF=.939811 VAF=27.3487 IKF=0.0260146 ISE=4.48447e-11 Ne=1.61605 Br=16.6725 Nr=0.796984 VAR=6.11596 IKR=0.10004 Isc=9.99914e-14 Nc=1.99995 RB=1.47761 IRB=0.2 RBM=1.47761 Re=0.0001 RC=1.42228 XTB=2.70726 XTI=1 Eg=1.206 CJE=1e-11 VJE=0.75 Mje=.33 TF=1e-09 XTF=1 VTF=10 ITF=0.01 CJC=1e-11 VJC=.75 MJC=0.33 XCJC=.9 Fc=0.5 CJS=0 VJS=0.75 MJS=0.5 TR=1e-07 PTF=0 KF=0 AF=1)" 1 ".model MJE350 PNP (Is=6.01619e-15 BF=157.387 NF=.910131 VAF=23.273 IKF=0.0564808 Ise=4.48479e-12 Ne=1.58557 BR=0.1 NR=1.03823 VAR=4.14543 IKR=.0999978 ISC=1.00199e-13 Nc=1.98851 RB=.1 IRB=0.202965 RBM=0.1 Re=.0710678 Rc=.355339 XTB=1.03638 XTI=3.8424 Eg=1.206 Cje=1e-11 Vje=0.75 Mje=0.33 TF=1e-09 XTF=1 VTF=10 ITF=0.01 Cjc=1e-11 Vjc=0.75 Mjc=0.33 XCJC=0.9 Fc=0.5 Cjs=0 Vjs=0.75 Mjs=0.5 TR=1e-07 PTF=0 KF=0 AF=1)" 1 "Line_5=" 0>
<NutmegEq NutmegEq1 1 290 630 -27 16 0 0 "SW1" 1 "dd=deriv(out)" 1 "iload=i(V5)" 1>
</Components>
<Wires>
<200 120 200 130 "" 0 0 0 "">
Expand Down Expand Up @@ -98,8 +98,8 @@
<600 300 600 300 "OUT" 610 270 0 "">
</Wires>
<Diagrams>
<Rect 840 520 382 280 3 #c0c0c0 1 00 1 -20 5 20 1 0.477221 1 6 1 -1 0.5 1 315 0 225 0 0 0 "" "" "">
<"ngspice/v(dd)" #0000ff 0 3 0 0 0>
<Rect 840 520 382 280 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 0.5 1 1 -1 0.5 1 315 0 225 0 0 0 "" "" "">
<"ngspice/sw1.v(dd)" #0000ff 0 3 0 0 0>
</Rect>
</Diagrams>
<Paintings>
Expand Down
4 changes: 4 additions & 0 deletions qucs/components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ indq.cpp
capq.cpp
circline.cpp
taperedline.cpp
circularloop.cpp
spiralinductor.cpp
)

SET(COMPONENTS_HDRS
Expand Down Expand Up @@ -227,6 +229,8 @@ volt_noise.h
vprobe.h
vpulse.h
vrect.h
circularloop.h
spiralinductor.h
)


Expand Down
2 changes: 1 addition & 1 deletion qucs/components/ac_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ QString AC_Sim::spice_netlist(bool isXyce)
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
double Npd = ceil((Np - 1)/Nd); // points per decade
s += QString("DEC %1 ").arg(Npd);
} else { // no need conversion
s += QString("LIN %1 ").arg(Props.at(3)->Value);
Expand Down
77 changes: 77 additions & 0 deletions qucs/components/circularloop.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* circularloop.cpp - Circular loop inductor class implementation
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This 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 this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/

#include "extsimkernels/spicecompat.h"
#include "circularloop.h"


circularloop::circularloop()
{
Description = QObject::tr("Printed loop inductor");

//Loop
Arcs.append(new qucs::Arc(-18, -25, 35, 35, -370, 16*230,QPen(Qt::darkBlue,3)));

Lines.append(new qucs::Line(-30, 0, -16, 0,QPen(Qt::darkBlue,4)));
Lines.append(new qucs::Line( 16, 0, 30, 0,QPen(Qt::darkBlue,4)));

Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));

x1 = -30; y1 =-30;
x2 = 30; y2 = 5;

tx = x1;
ty = y1+40;
Model = "CIRCULARLOOP";
Name = "CIRCULARLOOP";
Simulator = spicecompat::simQucsator;

Props.append(new Property("Subst", "Subst1", true,
QObject::tr("Substrate")));
Props.append(new Property("W", "25 um", false,
QObject::tr("Width of line")));
Props.append(new Property("a", "500 um", false,
QObject::tr("Radius")));
Props.append(new Property("Temp", "26.85", false,
QObject::tr("simulation temperature in degree Celsius")));

}

circularloop::~circularloop()
{
}

Component* circularloop::newOne()
{
return new circularloop();
}

Element* circularloop::info(QString& Name, char* &BitmapFile, bool getNewOne)
{
Name = QObject::tr("Circular loop");
BitmapFile = (char *) "circularloop";

if(getNewOne) return new circularloop();
return 0;
}
38 changes: 38 additions & 0 deletions qucs/components/circularloop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* circularloop.cpp - Circular loop inductor class definition
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This 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 this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/

#ifndef CIRCULARLOOP_H
#define CIRCULARLOOP_H

#include "component.h"


class circularloop : public Component {
public:
circularloop();
~circularloop();
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
};

#endif
9 changes: 6 additions & 3 deletions qucs/components/componentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ void ComponentDialog::slotNumberChanged(const QString&)
if(y == 0.0) y = x / 10.0;
if(x == 0.0) x = y * 10.0;
if(y == 0.0) { y = 1.0; x = 10.0; }
x = editNumber->text().toDouble() / log10(fabs(x / y));
x = (editNumber->text().toDouble() - 1) / log10(fabs(x / y));
Unit = QString::number(x);
}
else {
Expand Down Expand Up @@ -1450,7 +1450,7 @@ void ComponentDialog::slotStepChanged(const QString& Step)
}

editNumber->blockSignals(true); // do not calculate number again
editNumber->setText(QString::number(floor(x + 1.0)));
editNumber->setText(QString::number(round(x + 1.0), 'g', 16));
editNumber->blockSignals(false);
}

Expand Down Expand Up @@ -1543,7 +1543,10 @@ QStringList ComponentDialog::getSimulationList()
Component *c = sch->DocComps.at(i);
if (!c->isSimulation) continue;
if (c->Model == ".FOUR") continue;
if (c->Model == ".SW") continue;
if (c->Model == ".PZ") continue;
if (c->Model == ".SENS") continue;
if (c->Model == ".SENS_AC") continue;
if (c->Model == ".SW" && !c->Props.at(0)->Value.toUpper().startsWith("DC") ) continue;
sim_lst.append(c->Name);
}
QStringList sim_wo_numbers = sim_lst;
Expand Down
2 changes: 2 additions & 0 deletions qucs/components/components.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
#include "comp_2bit.h"
#include "comp_4bit.h"
#include "hpribin4bit.h"
#include "circularloop.h"
#include "spiralinductor.h"

// external simulation components
#include "etr_sim.h"
Expand Down
1 change: 0 additions & 1 deletion qucs/components/dc_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ QString DC_Sim::spice_netlist(bool isXyce)
QString s;
if ( !isXyce ) {
s += "op\n";
s += QString("print all > spice4qucs.%1.ngspice.dc.print\n").arg(Name.toLower());
}

return s;
Expand Down
Loading

0 comments on commit cc991c6

Please sign in to comment.