*** empty log message ***

This commit is contained in:
margraf 2006-12-18 06:57:24 +00:00
parent 227577657c
commit dee55cd7a2
25 changed files with 522 additions and 155 deletions

View File

@ -1,3 +1,7 @@
2006-12-09 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* added new LED components
2006-08-06 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* library/Transistors.lib: Added new transistor components

View File

@ -1,26 +1,126 @@
<Qucs Library 0.0.10 "LEDs">
<DefaultSymbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #000080 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #000080 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</DefaultSymbol>
<Component red>
<Component infrared>
<Description>
classical red light emitting diode, 2.2V, max 60mA
classical infra-red light emitting diode
1.7V @ 20mA, U_rev_break = 5V
</Description>
<Model>
.Def:LEDs_red _netA _netC
Diode:DLED _netA _netC Is="5e-21" N="1.9" Rs="4.7" Cj0="5e-11" M="0.5" Vj="0.7" Isr="1e-20" Bv="4" Ibv="1e-3" Tt="5e-09"
.Def:LEDs_infrared _netC _netA
Diode:D_IR _netC _netA Is="1e-10 A" N="3.45" Cj0="3 pF" M="0.5" Vj="0.7 V" Fc="0.5" Cp="0.0 fF" Isr="0.0" Nr="2.0" Rs="0.1 Ohm" Tt="4.0 us" Temp="26.85" Kf="0.0" Af="1.0" Ffe="1.0" Bv="5" Ibv="10 uA" Xti="3.0" Eg="1.11" Tbv="0.0" Trs="0.0" Ttt1="0.0" Ttt2="0.0" Tm1="0.0" Tm2="0.0" Tnom="26.85" Area="1.0"
R:Rleak _netA _netC R="50 MOhm" Temp="26.85"
.Def:End
</Model>
<Symbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #000080 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #000080 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</Symbol>
</Component>
<Component red>
<Description>
classical red light emitting diode
2.0V @ 20mA, U_rev_break = 5V
</Description>
<Model>
.Def:LEDs_red _netC _netA
Diode:D_red _netC _netA Is="1e-10 A" N="4.09" Cj0="3 pF" M="0.5" Vj="0.7 V" Fc="0.5" Cp="0.0 fF" Isr="0.0" Nr="2.0" Rs="0.1 Ohm" Tt="4.0 us" Temp="26.85" Kf="0.0" Af="1.0" Ffe="1.0" Bv="5" Ibv="10 uA" Xti="3.0" Eg="1.11" Tbv="0.0" Trs="0.0" Ttt1="0.0" Ttt2="0.0" Tm1="0.0" Tm2="0.0" Tnom="26.85" Area="1.0"
R:Rleak _netA _netC R="50 MOhm" Temp="26.85"
.Def:End
</Model>
<Symbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #ff0000 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #ff0000 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</Symbol>
</Component>
<Component yellow>
<Description>
classical yellow light emitting diode
2.2V @ 20mA, U_rev_break = 5V
</Description>
<Model>
.Def:LEDs_yellow _netC _netA
Diode:D_yellow _netC _netA Is="1e-10 A" N="4.45" Cj0="3 pF" M="0.5" Vj="0.7 V" Fc="0.5" Cp="0.0 fF" Isr="0.0" Nr="2.0" Rs="0.1 Ohm" Tt="4.0 us" Temp="26.85" Kf="0.0" Af="1.0" Ffe="1.0" Bv="5" Ibv="10 uA" Xti="3.0" Eg="1.11" Tbv="0.0" Trs="0.0" Ttt1="0.0" Ttt2="0.0" Tm1="0.0" Tm2="0.0" Tnom="26.85" Area="1.0"
R:Rleak _netA _netC R="50 MOhm" Temp="26.85"
.Def:End
</Model>
<Symbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #E0E000 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #E0E000 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</Symbol>
</Component>
<Component green>
<Description>
classical green light emitting diode
2.7V @ 20mA, U_rev_break = 5V
</Description>
<Model>
.Def:LEDs_green _netC _netA
Diode:D_green _netC _netA Is="1e-10 A" N="5.45" Cj0="3 pF" M="0.5" Vj="0.7 V" Fc="0.5" Cp="0.0 fF" Isr="0.0" Nr="2.0" Rs="0.1 Ohm" Tt="4.0 us" Temp="26.85" Kf="0.0" Af="1.0" Ffe="1.0" Bv="5" Ibv="10 uA" Xti="3.0" Eg="1.11" Tbv="0.0" Trs="0.0" Ttt1="0.0" Ttt2="0.0" Tm1="0.0" Tm2="0.0" Tnom="26.85" Area="1.0"
R:Rleak _netA _netC R="50 MOhm" Temp="26.85"
.Def:End
</Model>
<Symbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #00C000 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #00C000 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</Symbol>
</Component>
<Component blue>
<Description>
classical blue light emitting diode
3.3V @ 20mA, U_rev_break = 5V
</Description>
<Model>
.Def:LEDs_blue _netC _netA
Diode:D_blue _netC _netA Is="1e-10 A" N="6.68" Cj0="3 pF" M="0.5" Vj="0.7 V" Fc="0.5" Cp="0.0 fF" Isr="0.0" Nr="2.0" Rs="0.1 Ohm" Tt="4.0 us" Temp="26.85" Kf="0.0" Af="1.0" Ffe="1.0" Bv="5" Ibv="10 uA" Xti="3.0" Eg="1.11" Tbv="0.0" Trs="0.0" Ttt1="0.0" Ttt2="0.0" Tm1="0.0" Tm2="0.0" Tnom="26.85" Area="1.0"
R:Rleak _netA _netC R="50 MOhm" Temp="26.85"
.Def:End
</Model>
<Symbol>
<.ID -26 13 D>
<Line -30 0 60 0 #000080 2 1>
<Line -6 -9 0 18 #000080 2 1>
<Line 6 -9 0 18 #000080 2 1>
<Line -6 0 12 -9 #000080 2 1>
<Line -6 0 12 9 #000080 2 1>
<Arrow -5 -13 -10 -10 9 3 #0000ff 2 1 1>
<Arrow 5 -13 -10 -10 9 3 #0000ff 2 1 1>
<.PortSym -30 0 1 0>
<.PortSym 30 0 2 180>
</Symbol>
</Component>

View File

@ -1,5 +1,24 @@
<Qucs Library 0.0.10 "MOSFETs">
<DefaultSymbol>
<.ID 8 -26 T>
<Line -14 -13 0 26 #000080 3 1>
<Line -30 0 16 0 #000080 2 1>
<Line -10 -11 10 0 #000080 2 1>
<Line 0 -11 0 -19 #000080 2 1>
<Line -10 11 10 0 #000080 2 1>
<Line 0 0 0 30 #000080 2 1>
<Line -10 0 10 0 #000080 2 1>
<Line -10 -16 0 9 #000080 3 1>
<Line -10 -4 0 8 #000080 3 1>
<Line -10 7 0 9 #000080 3 1>
<Line -9 0 5 -5 #000080 2 1>
<Line -9 0 5 5 #000080 2 1>
<.PortSym -30 0 1 0>
<.PortSym 0 -30 2 270>
<.PortSym 0 30 3 90>
</DefaultSymbol>
<Component BSS123>
<Description>
enhancement n-channel MOSFET
@ -43,3 +62,138 @@
<_MOSFET T_BSS84W_ 1 0 0 8 -26 0 0 "pfet" 0 "-1.6" 1 "25m" 0 "1.98" 0 "0.75" 0 "108u" 0 "0.84" 0 "0.84" 0 "0" 0 "65f" 0 "1" 0 "0.0001" 0 "0.0001" 0 "0" 0 "1e-07" 0 "144n" 0 "120n" 0 "341n" 0 "64.2p" 0 "77.1p" 0 "0.8" 0 "0.46" 0 "0.5" 0 "0" 0 "0.33" 0 "0" 0 "0" 0 "0" 0 "1" 0 "600" 0 "0" 0 "1" 0 "1" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0" 0 "1" 0 "1" 0 "26.85" 0>
</Model>
</Component>
<Component IRFZ24N>
<Description>
enhancement n-channel power MOSFET
55V, 17A, 0.07 Ohm, HEXFET package: TO-220
Manufacturer: International Rectifier
</Description>
<Model>
.Def:MOSFETs_IRFZ24N _net2 _net1 _net3
MOSFET:M1 _net7 _net9 _net8 _net8 Type="nfet" L="100u" W="100u" Is="1e-32" Vt0="3.6319" Lambda="0" Kp="8.99346" Cgso="3.09714e-06" Cgdo="1.6185e-07" Rs="0" Rd="0" Ld="0" Cbd="0" Cbs="0" Cgbo="0" N="1" Gamma="0" Phi="0.6"
R:RS _net8 _net3 R="0.0409355"
Diode:D1 _net1 _net3 Is="1.43387e-10" Rs="0.0112766" N="1.28803" Bv="55" Ibv="0.00025" Eg="1.2" Xti="2.96465" Tt="0" Cj0="2.96476e-10" Vj="0.50803" M="0.3" Fc="0.5"
R:RDS _net3 _net1 R="2.2e+06"
R:RD _net9 _net1 R="0.0001"
R:RG _net2 _net7 R="2.4575"
Diode:D2 _net5 _net4 Is="1e-32" N="50" Cj0="4.37817e-10" Vj="0.5" M="0.578699" Fc="1e-08" Rs="0" Eg="1.11" Xti="3" Tt="0" Bv="0" Ibv="1mA"
Diode:D3 _net5 gnd Is="1e-10" N="0.4" Rs="3e-06" Eg="1.11" Xti="3" Tt="0" Cj0="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
R:RL _net5 _net10 R="1"
CCCS:FI2 _net4 _net7 _net9 gnd G="1"
VCVS:EV16 _net9 _net10 gnd _net7 G="1"
C:CAP _net11 _net10 C="6.81971e-10"
CCCS:FI1 _net11 _net7 _net9 _net6 G="1"
R:RCAP _net6 _net10 R="1"
Diode:D4 _net6 gnd Is="1e-10" N="0.4" Eg="1.11" Xti="3" Tt="0" Cj0="0" Rs="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
.Def:End
</Model>
</Component>
<Component IRFZ34N>
<Description>
enhancement n-channel power MOSFET
60V, 30A, 0.05 Ohm, HEXFET package: TO-220
Manufacturer: International Rectifier
</Description>
<Model>
.Def:MOSFETs_IRFZ34N _net2 _net1 _net3
MOSFET:M1 _net7 _net9 _net8 _net8 Type="nfet" L="100u" W="100u" Is="1e-32" Vt0="3.65645" Lambda="0" Kp="17.7646" Cgso="6.22832e-06" Cgdo="1.97453e-07" Rs="0" Rd="0" Ld="0" Cbd="0" Cbs="0" Cgbo="0" N="1" Gamma="0" Phi="0.6"
R:RS _net8 _net3 R="0.0280664"
Diode:D1 _net1 _net3 Is="1.0923e-13" Rs="0.00951665" N="0.960237" Bv="55" Ibv="0.00025" Eg="1" Xti="1" Tt="1e-07" Cj0="5.91562e-10" Vj="1.29493" M="0.482115" Fc="0.1"
R:RDS _net3 _net1 R="2.2e+06"
R:RD _net9 _net1 R="0.0001"
R:RG _net2 _net7 R="2.19574"
Diode:D2 _net5 _net4 Is="1e-32" N="50" Cj0="8.11706e-10" Vj="0.50002" M="0.598708" Fc="1e-08" Rs="0" Eg="1.11" Xti="3" Tt="0" Bv="0" Ibv="1mA"
Diode:D3 _net5 gnd Is="1e-10" N="0.419075" Rs="3e-06" Eg="1.11" Xti="3" Tt="0" Cj0="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
R:RL _net5 _net10 R="1"
CCCS:FI2 _net4 _net7 _net9 gnd G="1"
VCVS:EV16 _net9 _net10 gnd _net7 G="1"
C:CAP _net11 _net10 C="1.15458e-09"
CCCS:FI1 _net11 _net7 _net9 _net6 G="1"
R:RCAP _net6 _net10 R="1"
Diode:D4 _net6 gnd Is="1e-10" N="0.419075" Eg="1.11" Xti="3" Tt="0" Cj0="0" Rs="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
.Def:End
</Model>
</Component>
<Component IRFZ44N>
<Description>
enhancement n-channel power MOSFET
55V, 49A, 0.0175 Ohm, HEXFET package: TO-220
Manufacturer: International Rectifier
</Description>
<Model>
.Def:MOSFETs_IRFZ44N _net2 _net1 _net3
MOSFET:M1 _net7 _net9 _net8 _net8 Type="nfet" L="100u" W="100u" Is="1e-32" Vt0="3.56214" Lambda="0" Kp="39.3974" Cgso="1.25255e-05" Cgdo="2.2826e-07" Rs="0" Rd="0" Ld="0" Cbd="0" Cbs="0" Cgbo="0" N="1" Gamma="0" Phi="0.6"
R:RS _net8 _net3 R="0.0133305"
Diode:D1 _net1 _net3 Is="9.64635e-13" Rs="0.00967689" N="1.01377" Bv="55" Ibv="0.00025" Eg="1.08658" Xti="2.9994" Tt="1e-07" Cj0="1.39353e-09" Vj="0.5" M="0.42532" Fc="0.5"
R:RDS _net3 _net1 R="2.2e+06"
R:RD _net9 _net1 R="0.0001"
R:RG _net2 _net7 R="2.20235"
Diode:D2 _net5 _net4 Is="1e-32" N="50" Cj0="1.52875e-09" Vj="0.5" M="0.584414" Fc="1e-08" Rs="0" Eg="1.11" Xti="3" Tt="0" Bv="0" Ibv="1mA"
Diode:D3 _net5 gnd Is="1e-10" N="0.408752" Rs="3e-06" Eg="1.11" Xti="3" Tt="0" Cj0="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
R:RL _net5 _net10 R="1"
CCCS:FI2 _net4 _net7 _net9 gnd G="1"
VCVS:EV16 _net9 _net10 gnd _net7 G="1"
C:CAP _net11 _net10 C="2.06741e-09"
CCCS:FI1 _net11 _net7 _net9 _net6 G="1"
R:RCAP _net6 _net10 R="1"
Diode:D4 _net6 gnd Is="1e-10" N="0.408752" Eg="1.11" Xti="3" Tt="0" Cj0="0" Rs="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
.Def:End
</Model>
</Component>
<Component IRFZ46N>
<Description>
enhancement n-channel power MOSFET
55V, 53A, 0.0165 Ohm, HEXFET package: TO-220
Manufacturer: International Rectifier
</Description>
<Model>
.Def:MOSFETs_IRFZ46N _net2 _net1 _net3
MOSFET:M1 _net7 _net9 _net8 _net8 Type="nfet" L="100u" W="100u" Is="1e-32" Vt0="3.82619" Lambda="0" Kp="36.481" Cgso="1.3939e-05" Cgdo="5.05896e-07" Rs="0" Rd="0" Ld="0" Cbd="0" Cbs="0" Cgbo="0" N="1" Gamma="0" Phi="0.6"
R:RS _net8 _net3 R="0.013932"
Diode:D1 _net1 _net3 Is="8.99141e-09" Rs="0.00661401" N="1.46353" Bv="55" Ibv="0.00025" Eg="1" Xti="3.00311" Tt="1e-07" Cj0="1.41544e-09" Vj="1.09154" M="0.508083" Fc="0.5"
R:RDS _net3 _net1 R="2.2e+06"
R:RD _net9 _net1 R="0.0001"
R:RG _net2 _net7 R="3.53852"
Diode:D2 _net5 _net4 Is="1e-32" N="50" Cj0="1.4611e-09" Vj="0.5" M="0.675133" Fc="1e-08" Rs="0" Eg="1.11" Xti="3" Tt="0" Bv="0" Ibv="1mA"
Diode:D3 _net5 gnd Is="1e-10" N="0.4" Rs="3e-06" Eg="1.11" Xti="3" Tt="0" Cj0="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
R:RL _net5 _net10 R="1"
CCCS:FI2 _net4 _net7 _net9 gnd G="1"
VCVS:EV16 _net9 _net10 gnd _net7 G="1"
C:CAP _net11 _net10 C="1.83136e-09"
CCCS:FI1 _net11 _net7 _net9 _net6 G="1"
R:RCAP _net6 _net10 R="1"
Diode:D4 _net6 gnd Is="1e-10" N="0.4" Eg="1.11" Xti="3" Tt="0" Cj0="0" Rs="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
.Def:End
</Model>
</Component>
<Component IRF730>
<Description>
enhancement n-channel power MOSFET
400V, 5.5A, 0.75 Ohm, package: TO-220
Manufacturer: ST Microelectronics
</Description>
<Model>
.Def:MOSFETs_IRF730 _net2 _net1 _net3
MOSFET:M1 _net7 _net9 _net8 _net8 Type="nfet" L="100u" W="100u" Is="1e-32" Vt0="3.99" Lambda="0.000144225" Kp="2.88036" Cgso="6.42864e-06" Cgdo="1e-11" Rs="0" Rd="0" Ld="0" Cbd="0" Cbs="0" Cgbo="0" N="1" Gamma="0" Phi="0.6"
R:RS _net8 _net3 R="0.0001"
Diode:D1 _net1 _net3 Is="7.93539e-09" Rs="0.020221" N="1.5" Bv="400" Ibv="0.00025" Eg="1.2" Xti="3.05954" Tt="0" Cj0="5.57785e-10" Vj="5" M="0.688789" Fc="0.5"
R:RDS _net3 _net1 R="1e+06"
R:RD _net9 _net1 R="0.485778"
R:RG _net2 _net7 R="2.63633"
Diode:D2 _net5 _net4 Is="1e-32" N="50" Cj0="8.85779e-10" Vj="2.49436" M="0.9" Fc="1e-08" Rs="0" Eg="1.11" Xti="3" Tt="0" Bv="0" Ibv="1mA"
Diode:D3 _net5 gnd Is="1e-10" N="0.510385" Rs="3e-06" Eg="1.11" Xti="3" Tt="0" Cj0="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
R:RL _net5 _net10 R="1"
CCCS:FI2 _net4 _net7 _net9 gnd G="1"
VCVS:EV16 _net9 _net10 gnd _net7 G="1"
C:CAP _net11 _net10 C="8.85779e-10"
CCCS:FI1 _net11 _net7 _net9 _net6 G="1"
R:RCAP _net6 _net10 R="1"
Diode:D4 _net6 gnd Is="1e-10" N="0.510385" Eg="1.11" Xti="3" Tt="0" Cj0="0" Rs="0" Bv="0" Ibv="1mA" M="0.5" Vj="0.7"
.Def:End
</Model>
</Component>

View File

@ -1,3 +1,13 @@
2006-12-06 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* fixed small bug on creating paintings
* new capacitor property: symbol neutral/polar
* new diode property: symbol normal/Schottky/Zener
* fixed bug in wrong scrollbar position
* minimized flicker on scrollbar moving
* limit diagram size to scrollbar
* LaTeX symbols in text of schematic frame
2006-11-25 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* new symbol for ideal transmission line and coax line

View File

@ -22,30 +22,18 @@ Capacitor::Capacitor()
{
Description = QObject::tr("capacitor");
Lines.append(new Line( -4,-11, -4, 11,QPen(QPen::darkBlue,4)));
Lines.append(new Line( 4,-11, 4, 11,QPen(QPen::darkBlue,4)));
Lines.append(new Line(-30, 0, -4, 0,QPen(QPen::darkBlue,2)));
Lines.append(new Line( 4, 0, 30, 0,QPen(QPen::darkBlue,2)));
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 = -13;
x2 = 30; y2 = 13;
tx = x1+4;
ty = y2+4;
Model = "C";
Name = "C";
Props.append(new Property("C", "1 pF", true,
QObject::tr("capacitance in Farad")));
Props.append(new Property("V", "", false,
QObject::tr("initial voltage for transient simulation")));
}
Props.append(new Property("Symbol", "neutral", false,
QObject::tr("schematic symbol")+" [neutral, polar]"));
Capacitor::~Capacitor()
{
createSymbol();
tx = x1+4;
ty = y2+4;
Model = "C";
Name = "C";
}
Component* Capacitor::newOne()
@ -61,3 +49,26 @@ Element* Capacitor::info(QString& Name, char* &BitmapFile, bool getNewOne)
if(getNewOne) return new Capacitor();
return 0;
}
void Capacitor::createSymbol()
{
if(Props.getLast()->Value.at(0) == 'n') {
Lines.append(new Line( -4,-11, -4, 11,QPen(QPen::darkBlue,4)));
Lines.append(new Line( 4,-11, 4, 11,QPen(QPen::darkBlue,4)));
}
else {
Lines.append(new Line(-11, -5,-11,-11,QPen(QPen::red,1)));
Lines.append(new Line(-14, -8, -8, -8,QPen(QPen::red,1)));
Lines.append(new Line( -4,-11, -4, 11,QPen(QPen::darkBlue,3)));
Arcs.append(new Arc(4,-12, 20, 24, 16*122, 16*116,QPen(QPen::darkBlue,3)));
}
Lines.append(new Line(-30, 0, -4, 0,QPen(QPen::darkBlue,2)));
Lines.append(new Line( 4, 0, 30, 0,QPen(QPen::darkBlue,2)));
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 = -13;
x2 = 30; y2 = 13;
}

View File

@ -1,6 +1,6 @@
/***************************************************************************
capacitor.h - description
-------------------
capacitor.h
-------------
begin : Sat Aug 23 2003
copyright : (C) 2003 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
@ -21,12 +21,15 @@
#include "component.h"
class Capacitor : public Component {
class Capacitor : public MultiViewComponent {
public:
Capacitor();
~Capacitor();
~Capacitor() {};
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
};
#endif

View File

@ -59,7 +59,7 @@ CCCS::CCCS()
Props.append(new Property("G", "1", true,
QObject::tr("forward transfer factor")));
Props.append(new Property("T", "0", true, QObject::tr("delay time")));
Props.append(new Property("T", "0", false, QObject::tr("delay time")));
}
CCCS::~CCCS()

View File

@ -60,7 +60,7 @@ CCVS::CCVS()
Props.append(new Property("G", "1 Ohm", true,
QObject::tr("forward transfer factor")));
Props.append(new Property("T", "0", true, QObject::tr("delay time")));
Props.append(new Property("T", "0", false, QObject::tr("delay time")));
}
CCVS::~CCVS()

View File

@ -1364,6 +1364,7 @@ Component* getComponentFromName(QString& Line)
break;
case 'T' : if(cstr == "r") c = new Transformer();
else if(cstr == "LIN") c = new TLine();
else if(cstr == "LIN4P") c = new TLine_4Port();
break;
case 's' : if(cstr == "Tr") c = new symTrafo();
break;

View File

@ -1,6 +1,6 @@
/***************************************************************************
diode.cpp - description
-------------------
diode.cpp
-----------
begin : Sat Aug 23 2003
copyright : (C) 2003 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
@ -22,32 +22,15 @@ Diode::Diode()
{
Description = QObject::tr("diode");
Lines.append(new Line(-30, 0, 30, 0,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, -9, -6, 9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( 6, -9, 6, 9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, 0, 6, -9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, 0, 6, 9,QPen(QPen::darkBlue,2)));
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 = -11;
x2 = 30; y2 = 11;
tx = x1+4;
ty = y2+4;
Model = "Diode";
Name = "D";
Props.append(new Property("Is", "1e-15 A", true,
QObject::tr("saturation current")));
Props.append(new Property("N", "1", true,
QObject::tr("emission coefficient")));
Props.append(new Property("Cj0", "10 fF", true,
QObject::tr("zero-bias junction capacitance")));
Props.append(new Property("M", "0.5", true,
Props.append(new Property("M", "0.5", false,
QObject::tr("grading coefficient")));
Props.append(new Property("Vj", "0.7 V", true,
Props.append(new Property("Vj", "0.7 V", false,
QObject::tr("junction potential")));
Props.append(new Property("Fc", "0.5", false,
QObject::tr("forward-bias depletion capacitance coefficient")));
@ -93,10 +76,14 @@ Diode::Diode()
QObject::tr("temperature at which parameters were extracted")));
Props.append(new Property("Area", "1.0", false,
QObject::tr("default area for diode")));
}
Props.append(new Property("Symbol", "normal", false,
QObject::tr("schematic symbol")+" [normal, Schottky, Zener]"));
Diode::~Diode()
{
createSymbol();
tx = x1+4;
ty = y2+4;
Model = "Diode";
Name = "D";
}
Component* Diode::newOne()
@ -112,3 +99,27 @@ Element* Diode::info(QString& Name, char* &BitmapFile, bool getNewOne)
if(getNewOne) return new Diode();
return 0;
}
// -------------------------------------------------------
void Diode::createSymbol()
{
Lines.append(new Line(-30, 0, 30, 0,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, -9, -6, 9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( 6, -9, 6, 9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, 0, 6, -9,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, 0, 6, 9,QPen(QPen::darkBlue,2)));
if(Props.getLast()->Value.at(0) == 'S') {
Lines.append(new Line( -6, -9,-12,-12,QPen(QPen::darkBlue,2)));
Lines.append(new Line( -6, 9, 0, 12,QPen(QPen::darkBlue,2)));
}
else if(Props.getLast()->Value.at(0) == 'Z') {
Lines.append(new Line( -6, 9, -1, 9,QPen(QPen::darkBlue,2)));
}
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 = -11;
x2 = 30; y2 = 11;
}

View File

@ -1,6 +1,6 @@
/***************************************************************************
diode.h - description
-------------------
diode.h
---------
begin : Sat Aug 23 2003
copyright : (C) 2003 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
@ -21,12 +21,15 @@
#include "component.h"
class Diode : public Component {
class Diode : public MultiViewComponent {
public:
Diode();
~Diode();
~Diode() {};
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
};
#endif

View File

@ -61,7 +61,7 @@ VCCS::VCCS()
Props.append(new Property("G", "1 S", true,
QObject::tr("forward transconductance")));
Props.append(new Property("T", "0", true, QObject::tr("delay time")));
Props.append(new Property("T", "0", false, QObject::tr("delay time")));
}
VCCS::~VCCS()

View File

@ -62,7 +62,7 @@ VCVS::VCVS()
Props.append(new Property("G", "1", true,
QObject::tr("forward transfer factor")));
Props.append(new Property("T", "0", true, QObject::tr("delay time")));
Props.append(new Property("T", "0", false, QObject::tr("delay time")));
}
VCVS::~VCVS()

View File

@ -25,6 +25,7 @@
#include <qfile.h>
#define MIN_SCROLLBAR_SIZE 8
#define INVALID_STR QObject::tr(" <invalid>")

View File

@ -123,7 +123,14 @@ int TabDiagram::calcDiagram()
QFontMetrics metrics(QucsSettings.font);
int tHeight = metrics.lineSpacing();
QString Str;
int colWidth=0, x=8, y = y2-tHeight-6;
int colWidth=0, x=8, y;
if(y2 < (41 + MIN_SCROLLBAR_SIZE))
y2 = 41 + MIN_SCROLLBAR_SIZE;
if(y2 < (tHeight + 8))
y2 = tHeight + 8;
y = y2 - tHeight - 6;
// outer frame
Lines.append(new Line(0, y2, x2, y2, QPen(QPen::black,0)));
@ -165,8 +172,8 @@ if(g) if(!g->cPointsX.isEmpty()) {
invisibleCount = counting - y/tHeight;
if(invisibleCount <= 0) xAxis.limit_min = 0.0;// height bigger than needed
else {
NumLeft = invisibleCount - int(xAxis.limit_min);
if(invisibleCount < int(xAxis.limit_min))
NumLeft = invisibleCount - int(xAxis.limit_min + 0.5);
if(invisibleCount < int(xAxis.limit_min + 0.5))
xAxis.limit_min = double(invisibleCount); // adjust limit of scroll bar
}
@ -175,7 +182,7 @@ if(g) if(!g->cPointsX.isEmpty()) {
Str = pD->Var;
colWidth = checkColumnWidth(Str, metrics, colWidth, x, y2);
if(colWidth < 0) goto funcEnd;
startWriting = int(xAxis.limit_min); // when to reach visible area
startWriting = int(xAxis.limit_min + 0.5); // when to reach visible area
Texts.append(new Text(x-4, y2-2, Str)); // independent variable
if(pD->count != 0) {
@ -225,7 +232,7 @@ if(g) if(!g->cPointsX.isEmpty()) {
Texts.append(new Text(x, y2-2, Str)); // dependent variable
startWriting = int(xAxis.limit_min); // when to reach visible area
startWriting = int(xAxis.limit_min + 0.5); // when to reach visible area
py = g->cPointsY - 2;
if(g->cPointsX.getFirst()) {
@ -297,15 +304,19 @@ funcEnd:
zAxis.limit_max = double(NumAll); // number of data (rows)
// calculate data for painting scroll bar
xAxis.numGraphs = int(xAxis.limit_min);
NumLeft = NumAll - NumLeft - xAxis.numGraphs;
y = int(xAxis.limit_min + 0.5);
NumLeft = NumAll - NumLeft - y;
// position of scroll bar in pixel
yAxis.numGraphs = (y2 - 39) * y / NumAll;
// height of scroll bar
zAxis.numGraphs = (y2 - 39) * NumLeft / NumAll;
if(zAxis.numGraphs < 3) zAxis.numGraphs = 3;
// position of scroll bar in pixel
yAxis.numGraphs = (y2 - 39) * xAxis.numGraphs / NumAll;
if(zAxis.numGraphs < MIN_SCROLLBAR_SIZE) {
yAxis.numGraphs -= (MIN_SCROLLBAR_SIZE - zAxis.numGraphs + 1)
* y / NumAll;
zAxis.numGraphs = MIN_SCROLLBAR_SIZE;
}
xAxis.numGraphs = NumLeft; // number of lines in the diagram
}
@ -356,6 +367,7 @@ bool TabDiagram::scrollTo(int initial, int, int dy)
int tmp = int(xAxis.limit_min + 0.5);
xAxis.limit_min = double(initial);
xAxis.limit_min += double(dy) / double(y2 - 39) * zAxis.limit_max;
xAxis.limit_min = floor(xAxis.limit_min + 0.5);
calcDiagram();
if(tmp == int(xAxis.limit_min + 0.5))

View File

@ -118,12 +118,16 @@ int TimingDiagram::calcDiagram()
QFontMetrics metrics(QucsSettings.font);
int tHeight = metrics.lineSpacing();
QString Str;
int colWidth=0, x=4, y = y2-tHeight-6, xStart = 0, z;
int colWidth=0, x=4, y, xStart = 0, z;
int NumAll=0; // how many values per row
int NumLeft=0; // how many values could not be written
int invisibleCount = 0; // how many values are invisible
if(y2 < (tHeight + 8))
y2 = tHeight + 8;
y = y2 - tHeight - 6;
// outer frame
Lines.append(new Line(0, y2, x2, y2, QPen(QPen::black,0)));
Lines.append(new Line(0, y2, 0, 0, QPen(QPen::black,0)));
@ -219,8 +223,8 @@ if(!firstGraph->cPointsX.isEmpty()) {
invisibleCount = NumAll - (x2-xAxis.numGraphs)/TimeStepWidth;
if(invisibleCount <= 0) xAxis.limit_min = 0.0; // longer than needed
else {
NumLeft = invisibleCount - int(xAxis.limit_min);
if(invisibleCount < int(xAxis.limit_min))
NumLeft = invisibleCount - int(xAxis.limit_min + 0.5);
if(invisibleCount < int(xAxis.limit_min + 0.5))
xAxis.limit_min = double(invisibleCount); // adjust limit of scroll bar
}
@ -228,7 +232,7 @@ if(!firstGraph->cPointsX.isEmpty()) {
// write independent variable values (usually time)
y = y2-tHeight-4;
px = pD->Points;
z = int(xAxis.limit_min);
z = int(xAxis.limit_min + 0.5);
px += z;
z = pD->count - z;
for( ; z>0; z--) {
@ -286,7 +290,7 @@ if(!firstGraph->cPointsX.isEmpty()) {
case 2: Pen.setStyle(Qt::DotLine); break;
}
z = int(xAxis.limit_min);
z = int(xAxis.limit_min + 0.5);
if(g->Var.right(2) != ".X") { // not digital variable ?
px = g->cPointsY;
px += 2 * z;
@ -394,22 +398,36 @@ if(!firstGraph->cPointsX.isEmpty()) {
funcEnd:
if(invisibleCount > 0) { // could all values be displayed ?
x = x2 - xAxis.numGraphs - 37;
if(x < MIN_SCROLLBAR_SIZE+2) { // not enough space for scrollbar ?
Lines.append(new Line(x2, 0, x2, -17, QPen(QPen::red,0)));
Lines.append(new Line(xAxis.numGraphs, -17, x2, -17, QPen(QPen::red,0)));
Lines.append(new Line(xAxis.numGraphs, 0, xAxis.numGraphs, -17, QPen(QPen::red,0)));
return 1;
}
y1 = 18; // extend the select area to the bottom
x = (x2 - xAxis.numGraphs - 37);
z = int(xAxis.limit_min);
z = int(xAxis.limit_min + 0.5);
if(NumLeft < 0) NumLeft = 0;
y = NumAll - NumLeft - z;
// number of data (times)
zAxis.limit_max = double(firstGraph->cPointsX.getFirst()->count);
// length of scroll bar
zAxis.numGraphs = x * y / NumAll;
if(zAxis.numGraphs < 3) zAxis.numGraphs = 3;
// position of scroll bar in pixel
yAxis.numGraphs = x * z / NumAll + xAxis.numGraphs + 19;
// length of scroll bar
zAxis.numGraphs = x * y / NumAll;
if(zAxis.numGraphs < MIN_SCROLLBAR_SIZE) {
yAxis.numGraphs -= (MIN_SCROLLBAR_SIZE - zAxis.numGraphs + 1)
* z / NumAll;
zAxis.numGraphs = MIN_SCROLLBAR_SIZE;
x = x2 - 19 - yAxis.numGraphs - zAxis.numGraphs;
if(x < 0) yAxis.numGraphs += x;
}
xAxis.limit_max = double(y);
}
@ -459,6 +477,7 @@ bool TimingDiagram::scrollTo(int initial, int dx, int)
int tmp = int(xAxis.limit_min + 0.5);
xAxis.limit_min = double(initial);
xAxis.limit_min += double(dx) / double(x2-xAxis.numGraphs-39) * zAxis.limit_max;
xAxis.limit_min = floor(xAxis.limit_min + 0.5);
calcDiagram();
if(tmp == int(xAxis.limit_min + 0.5))

View File

@ -50,7 +50,14 @@ int TruthDiagram::calcDiagram()
QFontMetrics metrics(QucsSettings.font);
int tHeight = metrics.lineSpacing();
QString Str;
int colWidth=0, x=6, y = y2-tHeight-6;
int colWidth=0, x=6, y;
if(y2 < (41 + MIN_SCROLLBAR_SIZE))
y2 = 41 + MIN_SCROLLBAR_SIZE;
if(y2 < (tHeight + 8))
y2 = tHeight + 8;
y = y2 - tHeight - 6;
// outer frame
Lines.append(new Line(0, y2, x2, y2, QPen(QPen::black,0)));
@ -91,9 +98,9 @@ if(g) if(!g->cPointsX.isEmpty()) {
invisibleCount = NumAll - y/tHeight;
if(invisibleCount <= 0) xAxis.limit_min = 0.0;// height bigger than needed
else {
if(invisibleCount < int(xAxis.limit_min))
if(invisibleCount < int(xAxis.limit_min + 0.5))
xAxis.limit_min = double(invisibleCount); // adjust limit of scroll bar
NumLeft = invisibleCount - int(xAxis.limit_min);
NumLeft = invisibleCount - int(xAxis.limit_min + 0.5);
}
@ -113,7 +120,7 @@ if(g) if(!g->cPointsX.isEmpty()) {
y = y2-tHeight-5;
startWriting = x;
for(z=int(xAxis.limit_min); z<NumAll; z++) {
for(z=int(xAxis.limit_min + 0.5); z<NumAll; z++) {
if(y < tHeight) break; // no room for more rows ?
startWriting = x;
for(int zi=counting-1; zi>=0; zi--) {
@ -144,7 +151,7 @@ if(g) if(!g->cPointsX.isEmpty()) {
Texts.append(new Text(x, y2-2, Str)); // dependent variable
startWriting = int(xAxis.limit_min); // when to reach visible area
startWriting = int(xAxis.limit_min + 0.5); // when to reach visible area
if(g->cPointsX.getFirst()) {
if(sameDependencies(g, firstGraph)) {
@ -223,15 +230,19 @@ funcEnd:
zAxis.limit_max = double(NumAll); // number of data (rows)
// calculate data for painting scroll bar
xAxis.numGraphs = int(xAxis.limit_min);
NumLeft = NumAll - NumLeft - xAxis.numGraphs;
y = int(xAxis.limit_min + 0.5);
NumLeft = NumAll - NumLeft - y;
// position of scroll bar in pixel
yAxis.numGraphs = (y2 - 39) * y / NumAll;
// height of scroll bar
zAxis.numGraphs = (y2 - 39) * NumLeft / NumAll;
if(zAxis.numGraphs < 3) zAxis.numGraphs = 3;
// position of scroll bar in pixel
yAxis.numGraphs = (y2 - 39) * xAxis.numGraphs / NumAll;
if(zAxis.numGraphs < MIN_SCROLLBAR_SIZE) {
yAxis.numGraphs -= (MIN_SCROLLBAR_SIZE - zAxis.numGraphs + 1)
* y / NumAll;
zAxis.numGraphs = MIN_SCROLLBAR_SIZE;
}
xAxis.numGraphs = NumLeft; // number of lines in the diagram
}

View File

@ -19,6 +19,7 @@
#include "node.h"
#include "qucs.h"
#include "mnemo.h"
#include "schematic.h"
#include <qhbox.h>
@ -141,10 +142,16 @@ SettingsDialog::SettingsDialog(Schematic *Doc_)
Input_GridX->setText(QString::number(Doc->GridX));
Input_GridY->setText(QString::number(Doc->GridY));
Combo_Frame->setCurrentItem(Doc->showFrame);
Input_Frame0->setText(Doc->Frame_Text0);
Input_Frame1->setText(Doc->Frame_Text1);
Input_Frame2->setText(Doc->Frame_Text2);
Input_Frame3->setText(Doc->Frame_Text3);
QString Text_;
decode_String(Text_ = Doc->Frame_Text0);
Input_Frame0->setText(Text_);
decode_String(Text_ = Doc->Frame_Text1);
Input_Frame1->setText(Text_);
decode_String(Text_ = Doc->Frame_Text2);
Input_Frame2->setText(Text_);
decode_String(Text_ = Doc->Frame_Text3);
Input_Frame3->setText(Text_);
resize(250, 200);
}
@ -202,23 +209,28 @@ void SettingsDialog::slotApply()
changed = true;
}
if(Doc->Frame_Text0 != Input_Frame0->text()) {
Doc->Frame_Text0 = Input_Frame0->text();
QString t;
encode_String(Input_Frame0->text(), t);
if(Doc->Frame_Text0 != t) {
Doc->Frame_Text0 = t;
changed = true;
}
if(Doc->Frame_Text1 != Input_Frame1->text()) {
Doc->Frame_Text1 = Input_Frame1->text();
encode_String(Input_Frame1->text(), t);
if(Doc->Frame_Text1 != t) {
Doc->Frame_Text1 = t;
changed = true;
}
if(Doc->Frame_Text2 != Input_Frame2->text()) {
Doc->Frame_Text2 = Input_Frame2->text();
encode_String(Input_Frame2->text(), t);
if(Doc->Frame_Text2 != t) {
Doc->Frame_Text2 = t;
changed = true;
}
if(Doc->Frame_Text3 != Input_Frame3->text()) {
Doc->Frame_Text3 = Input_Frame3->text();
encode_String(Input_Frame3->text(), t);
if(Doc->Frame_Text3 != t) {
Doc->Frame_Text3 = t;
changed = true;
}

View File

@ -339,6 +339,23 @@ void convert2Unicode(QString& Text)
Text.replace("\\\\", "\\");
}
// #########################################################################
void convert2ASCII(QString& Text)
{
Text.replace('\\', "\\\\");
Text.replace('\n', "\\n");
int i = 0;
QChar ch;
char Str[8];
while((ch=Text.at(i++)) != QChar(0)) { // convert special characters
if(ch > QChar(0x7F)) {
sprintf(Str, "\\x%04X", ch.unicode());
Text.replace(ch, Str);
}
}
}
// #########################################################################
// Takes a file name (with path) and replaces all special characters.
QString properName (const QString& Name)

View File

@ -75,6 +75,7 @@ void str2num (const QString&, double&, QString&, double&);
QString num2str (double);
QString StringNiceNum(double);
void convert2Unicode(QString&);
void convert2ASCII(QString&);
QString properName (const QString&);
bool VHDL_Time(QString&, const QString&);
bool checkVersion(QString&);

View File

@ -503,13 +503,20 @@ void MouseActions::MMovePaste(Schematic *Doc, QMouseEvent *Event)
// Moves scroll bar of diagram (e.g. tabular) according the mouse cursor.
void MouseActions::MMoveScrollBar(Schematic *Doc, QMouseEvent *Event)
{
TabDiagram *d = (TabDiagram*)focusElement;
int x = int(float(Event->pos().x())/Doc->Scale) + Doc->ViewX1;
int y = int(float(Event->pos().y())/Doc->Scale) + Doc->ViewY1;
if(((TabDiagram*)focusElement)->scrollTo(MAx2, x - MAx1, y - MAy1)) {
if(d->scrollTo(MAx2, x - MAx1, y - MAy1)) {
Doc->setChanged(true, true, 'm'); // 'm' = only the first time
Doc->viewport()->update();
drawn = false;
QPainter p(Doc->viewport());
ViewPainter Painter;
Painter.init(&p, Doc->Scale, -Doc->ViewX1, -Doc->ViewY1,
Doc->contentsX(), Doc->contentsY());
Painter.fillRect(d->cx-d->x1, d->cy-d->y2, d->x2+d->x1, d->y2+d->y1,
QucsSettings.BGColor);
d->paint(&Painter);
}
}
@ -1253,9 +1260,11 @@ void MouseActions::MPressElement(Schematic *Doc, QMouseEvent *Event, int, int)
Doc->enlargeView(x1, y1, x2, y2);
selElem = ((Painting*)selElem)->newOne();
drawn = false;
Doc->viewport()->update();
Doc->setChanged(true, true);
MMoveElement(Doc, Event); // needed before next mouse pressing
drawn = false;
}
}

View File

@ -149,12 +149,12 @@ QString GraphicLine::save()
// Checks if the resize area was clicked.
bool GraphicLine::ResizeTouched(int x, int y, int len)
{
if(x < cx+len) if(x > cx-len) if(y < cy+len) if(y > cy-len) {
if(x <= cx+len) if(x >= cx-len) if(y <= cy+len) if(y >= cy-len) {
State = 1;
return true;
}
if(x < cx+x2+len) if(x > cx+x2-len) if(y < cy+y2+len) if(y > cy+y2-len) {
if(x <= cx+x2+len) if(x >= cx+x2-len) if(y <= cy+y2+len) if(y >= cy+y2-len) {
State = 2;
return true;
}

View File

@ -15,17 +15,17 @@
* *
***************************************************************************/
#include "main.h"
#include "mnemo.h"
#include "viewpainter.h"
#include "graphictext.h"
#include "graphictextdialog.h"
#include "main.h"
#include "viewpainter.h"
#include "mnemo.h"
#include <qwidget.h>
#include <qpainter.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qtextedit.h>
#include <qpushbutton.h>
#include <math.h>
@ -169,20 +169,9 @@ bool GraphicText::load(const QString& s)
QString GraphicText::save()
{
QString t = Text;
t.replace('\\', "\\\\");
t.replace('\n', "\\n");
convert2ASCII(t);
int i = 0;
QChar ch;
char Str[8];
while((ch=t.at(i++)) != QChar(0)) { // convert special characters
if(ch > QChar(0x7F)) {
sprintf(Str, "\\x%04X", ch.unicode());
t.replace(ch, Str);
}
}
// the 'Text' property has to be the last within the line !
// The 'Text' property has to be the last within the line !
QString s = Name+QString::number(cx)+" "+QString::number(cy)+" "
+ QString::number(Font.pointSize())+" "+Color.name()+" "
+ QString::number(Angle) + " \""+t+"\"";

View File

@ -189,9 +189,9 @@ bool Rectangle::ResizeTouched(int x, int y, int len)
State = 0;
if(x < cx+len) State = 1;
else if(x <= cx+x2-len) { State = -1; return false; }
else if(x < cx+x2-len) { State = -1; return false; }
if(y < cy+len) State |= 2;
else if(y <= cy+y2-len) { State = -1; return false; }
else if(y < cy+y2-len) { State = -1; return false; }
return true;
}

View File

@ -210,13 +210,15 @@ int Schematic::saveDocument()
stream << " <OpenDisplay=" << SimOpenDpl << ">\n";
stream << " <showFrame=" << showFrame << ">\n";
QString t = Frame_Text0;
t.replace('\\', "\\\\");
t.replace('\n', "\\n");
QString t;
convert2ASCII(t = Frame_Text0);
stream << " <FrameText0=" << t << ">\n";
stream << " <FrameText1=" << Frame_Text1 << ">\n";
stream << " <FrameText2=" << Frame_Text2 << ">\n";
stream << " <FrameText3=" << Frame_Text3 << ">\n";
convert2ASCII(t = Frame_Text1);
stream << " <FrameText1=" << t << ">\n";
convert2ASCII(t = Frame_Text2);
stream << " <FrameText2=" << t << ">\n";
convert2ASCII(t = Frame_Text3);
stream << " <FrameText3=" << t << ">\n";
stream << "</Properties>\n";
Painting *pp;
@ -298,13 +300,10 @@ bool Schematic::loadProperties(QTextStream *stream)
else SimOpenDpl = true;
else if(cstr == "showFrame")
showFrame = nstr.at(0).latin1() - '0';
else if(cstr == "FrameText0") {
Frame_Text0 = nstr;
Frame_Text0.replace("\\n", "\n");
Frame_Text0.replace("\\\\", "\\"); }
else if(cstr == "FrameText1") Frame_Text1 = nstr;
else if(cstr == "FrameText2") Frame_Text2 = nstr;
else if(cstr == "FrameText3") Frame_Text3 = nstr;
else if(cstr == "FrameText0") convert2Unicode(Frame_Text0 = nstr);
else if(cstr == "FrameText1") convert2Unicode(Frame_Text1 = nstr);
else if(cstr == "FrameText2") convert2Unicode(Frame_Text2 = nstr);
else if(cstr == "FrameText3") convert2Unicode(Frame_Text3 = nstr);
else {
QMessageBox::critical(0, QObject::tr("Error"),
QObject::tr("Format Error:\nUnknown property: ")+cstr);