summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSumanto Kar2023-05-04 14:00:34 +0530
committerGitHub2023-05-04 14:00:34 +0530
commit3af1055898f05a44332de305d3b490954739085e (patch)
treee6c8b69d1a58d031e48258cc1cc0c5311a7daf48
parentadd82494ea6cdcc8a37609cd54aa0c5e772b2668 (diff)
parent3d3bef144fc47ac3149a09a4f6f0f04879c7d46d (diff)
downloadeSim-3af1055898f05a44332de305d3b490954739085e.tar.gz
eSim-3af1055898f05a44332de305d3b490954739085e.tar.bz2
eSim-3af1055898f05a44332de305d3b490954739085e.zip
Merge pull request #214 from dilipboidya/master
Added various Device models
-rw-r--r--library/deviceModelLibrary/Diode/1N4148.lib0
-rw-r--r--library/deviceModelLibrary/Diode/1N4148.xml1
-rw-r--r--library/deviceModelLibrary/Diode/DRB168MM200.lib1
-rw-r--r--library/deviceModelLibrary/Diode/DRB168MM200.xml1
-rw-r--r--library/deviceModelLibrary/Diode/RF Diode/DRN142S.lib1
-rw-r--r--library/deviceModelLibrary/Diode/RF Diode/DRN142S.xml1
-rw-r--r--library/deviceModelLibrary/Diode/RF Diode/README.md10
-rw-r--r--library/deviceModelLibrary/LEDs/README.md22
-rw-r--r--library/deviceModelLibrary/LEDs/eSim_BlueLED.lib3
-rw-r--r--library/deviceModelLibrary/LEDs/eSim_BlueLED.xml1
-rw-r--r--library/deviceModelLibrary/LEDs/eSim_RedLED.lib1
-rw-r--r--library/deviceModelLibrary/LEDs/eSim_RedLED.xml1
-rw-r--r--library/deviceModelLibrary/MOS/MOSFET_2N7002.lib6
-rw-r--r--library/deviceModelLibrary/MOS/MOSFET_2N7002.xml1
-rw-r--r--library/deviceModelLibrary/Switch/README.md33
-rw-r--r--library/deviceModelLibrary/Switch/switch1.lib3
-rw-r--r--library/deviceModelLibrary/Switch/switch1.xml1
-rw-r--r--library/deviceModelLibrary/Transmission Lines/README.md34
-rw-r--r--library/deviceModelLibrary/Transmission Lines/ymod.lib1
-rw-r--r--library/deviceModelLibrary/Transmission Lines/ymod.xml1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_diode.lib1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_diode.xml1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_nfet.lib1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_nfet.xml1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_pfet.lib1
-rw-r--r--library/deviceModelLibrary/User Libraries/GD_pfet.xml1
-rw-r--r--library/kicadLibrary/kicad_eSim-Library/eSim_Subckt.lib427
-rw-r--r--src/kicadtoNgspice/DeviceModel.py136
28 files changed, 688 insertions, 4 deletions
diff --git a/library/deviceModelLibrary/Diode/1N4148.lib b/library/deviceModelLibrary/Diode/1N4148.lib
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/1N4148.lib
diff --git a/library/deviceModelLibrary/Diode/1N4148.xml b/library/deviceModelLibrary/Diode/1N4148.xml
new file mode 100644
index 00000000..7c2a6799
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/1N4148.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>1N4148</ref_model><param><IS>5.4320E-9</IS><N>1.9701</N><RS>2.1233</RS><IKF>8.0154</IKF><CJO>1.9768E-12</CJO><M>.1</M><VJ>9.9900</VJ><BV>75.257</BV><IBV>10</IBV><TT>25.949E-9</TT></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/Diode/DRB168MM200.lib b/library/deviceModelLibrary/Diode/DRB168MM200.lib
new file mode 100644
index 00000000..f8e22700
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/DRB168MM200.lib
@@ -0,0 +1 @@
+.MODEL DRB168MM200 D( IS=5.6001E-9 N=1.0413 RS=90.681E-3 IKF=2.9636E-3 XTI=2.0 EG=0.74 CJO=86.088E-12 M=0.4523 VJ=0.5 ISR=9.8101E-9 NR=1.3311 BV=200 TRS1=-3.7501E-3 )
diff --git a/library/deviceModelLibrary/Diode/DRB168MM200.xml b/library/deviceModelLibrary/Diode/DRB168MM200.xml
new file mode 100644
index 00000000..3973f48f
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/DRB168MM200.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>DRB168MM200</ref_model><param><IS>5.6001E-9</IS><N>1.0413</N><RS>90.681E-3</RS><IKF>2.9636E-3</IKF><XTI>2.0</XTI><EG>0.74</EG><CJO>86.088E-12</CJO><M>0.4523</M><VJ>0.5</VJ><ISR>9.8101E-9</ISR><NR>1.3311</NR><BV>200</BV><TRS1>-3.7501E-3</TRS1></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/Diode/RF Diode/DRN142S.lib b/library/deviceModelLibrary/Diode/RF Diode/DRN142S.lib
new file mode 100644
index 00000000..2bc85454
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/RF Diode/DRN142S.lib
@@ -0,0 +1 @@
+.MODEL DRN142S D( IS=127.76E-12 N=1.7346 RS=.1581 IKF=.14089 CJO=385.59E-15 M=.11823 VJ=.78827 ISR=139.38E-12 NR=3 BV=60 TT=275.00E-9 )
diff --git a/library/deviceModelLibrary/Diode/RF Diode/DRN142S.xml b/library/deviceModelLibrary/Diode/RF Diode/DRN142S.xml
new file mode 100644
index 00000000..648e2440
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/RF Diode/DRN142S.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>DRN142S</ref_model><param><IS>127.76E-12</IS><N>1.7346</N><RS>.1581</RS><IKF>.14089</IKF><CJO>385.59E-15</CJO><M>.11823</M><VJ>.78827</VJ><ISR>139.38E-12</ISR><NR>3</NR><BV>60</BV><TT>275.00E-9</TT></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/Diode/RF Diode/README.md b/library/deviceModelLibrary/Diode/RF Diode/README.md
new file mode 100644
index 00000000..827113f9
--- /dev/null
+++ b/library/deviceModelLibrary/Diode/RF Diode/README.md
@@ -0,0 +1,10 @@
+# Radio Frequency Diode
+Diode is a pn junction device, which allows the current to flow in one direction. RF Diodes are a semiconductor device with two terminals that allows the flow of electricity in one direction and restricts the flow in the other. The devices in this family are used in radio frequency matching circuits for electronic tuning.
+## RF Diode(DRN142S)
+
+```
+* DRN142S Diode model
+.MODEL DRN142S D( IS=127.76E-12 N=1.7346 RS=.1581 IKF=.14089 CJO=385.59E-15
+M=.11823 VJ=.78827 ISR=139.38E-12 NR=3 BV=60 TT=275.00E-9 )
+
+```
diff --git a/library/deviceModelLibrary/LEDs/README.md b/library/deviceModelLibrary/LEDs/README.md
new file mode 100644
index 00000000..11973ed1
--- /dev/null
+++ b/library/deviceModelLibrary/LEDs/README.md
@@ -0,0 +1,22 @@
+# Light Emitting Diodes (LEDs)
+
+A light-emitting diode (LED) is a semiconductor device that emits light when an electric current flows through it.
+When current passes through an LED, the electrons recombine with holes emitting light in the process.
+Just like diode, the process to model blue led is also the same, it is to be noted here
+that the forward voltage of the LEDs are higher than the normal diode.
+# Red LED
+```
+.MODEL eSim_RedLED D( Is=1e-10 Rs=0.1 N=4.09 tt=4.0e-6 Cjo=3e-12 M=0.5 Vj=0.7
+Bv=5 Ibv=10e-6 Fc=0.5 Isr=0.0 Nr=2.0 Kf=0.0 Af=1.0 Ffe=1.0 Xti=3.0 Eg=1.11
+Tbv=0.0 Trs=0.0 )
+```
+**NOTE: The name of the above LED is set as eSim_Red_LED the same name of the LED must be given to the subcircuit while creating the symbol for LED. While the D is the designator for the diode.**
+
+# Blue LED
+
+```
+.MODEL eSim_BlueLED D( Is=1e-10 Rs=0.1 N=6.68 tt=4e-6 Cjo=3e-12 M=0.5 Vj=0.7 Bv=5
+Ibv=10e-6 Fc=0.5 Cp=0.0e-12 Isr=0.0 Nr=2.0 Temp=26.85 Kf=0.0 Af=1.0 Ffe=1.0
+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 )
+```
diff --git a/library/deviceModelLibrary/LEDs/eSim_BlueLED.lib b/library/deviceModelLibrary/LEDs/eSim_BlueLED.lib
new file mode 100644
index 00000000..66bee13b
--- /dev/null
+++ b/library/deviceModelLibrary/LEDs/eSim_BlueLED.lib
@@ -0,0 +1,3 @@
+.MODEL eSim_BlueLED D( Is=1e-10 Rs=0.1 N=6.68 tt=4e-6 Cjo=3e-12 M=0.5 Vj=0.7 Bv=5 Ibv=10e-6 Fc=0.5 Cp=0.0e-12 Isr=0.0 Nr=2.0 Temp=26.85 Kf=0.0 Af=1.0 Ffe=1.0 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 )
+
+
diff --git a/library/deviceModelLibrary/LEDs/eSim_BlueLED.xml b/library/deviceModelLibrary/LEDs/eSim_BlueLED.xml
new file mode 100644
index 00000000..65f54494
--- /dev/null
+++ b/library/deviceModelLibrary/LEDs/eSim_BlueLED.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>eSim_BlueLED</ref_model><param><Is>1e-10</Is><Rs>0.1</Rs><N>6.68</N><tt>4e-6</tt><Cjo>3e-12</Cjo><M>0.5</M><Vj>0.7</Vj><Bv>5</Bv><Ibv>10e-6</Ibv><Fc>0.5</Fc><Cp>0.0e-12</Cp><Isr>0.0</Isr><Nr>2.0</Nr><Temp>26.85</Temp><Kf>0.0</Kf><Af>1.0</Af><Ffe>1.0</Ffe><Xti>3.0</Xti><Eg>1.11</Eg><Tbv>0.0</Tbv><Trs>0.0</Trs><Ttt1>0.0</Ttt1><Ttt2>0.0</Ttt2><Tm1>0.0</Tm1><Tm2>0.0</Tm2><Tnom>26.85</Tnom><Area>1.0</Area></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/LEDs/eSim_RedLED.lib b/library/deviceModelLibrary/LEDs/eSim_RedLED.lib
new file mode 100644
index 00000000..1f852936
--- /dev/null
+++ b/library/deviceModelLibrary/LEDs/eSim_RedLED.lib
@@ -0,0 +1 @@
+.MODEL eSim_RedLED D( Is=1e-10 Rs=0.1 N=4.09 tt=4.0e-6 Cjo=3e-12 M=0.5 Vj=0.7 Bv=5 Ibv=10e-6 Fc=0.5 Isr=0.0 Nr=2.0 Kf=0.0 Af=1.0 Ffe=1.0 Xti=3.0 Eg=1.11 Tbv=0.0 Trs=0.0 )
diff --git a/library/deviceModelLibrary/LEDs/eSim_RedLED.xml b/library/deviceModelLibrary/LEDs/eSim_RedLED.xml
new file mode 100644
index 00000000..a8df3640
--- /dev/null
+++ b/library/deviceModelLibrary/LEDs/eSim_RedLED.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>eSim_RedLED</ref_model><param><Is>1e-10</Is><Rs>0.1</Rs><N>4.09</N><tt>4.0e-6</tt><Cjo>3e-12</Cjo><M>0.5</M><Vj>0.7</Vj><Bv>5</Bv><Ibv>10e-6</Ibv><Fc>0.5</Fc><Isr>0.0</Isr><Nr>2.0</Nr><Kf>0.0</Kf><Af>1.0</Af><Ffe>1.0</Ffe><Xti>3.0</Xti><Eg>1.11</Eg><Tbv>0.0</Tbv><Trs>0.0</Trs></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/MOS/MOSFET_2N7002.lib b/library/deviceModelLibrary/MOS/MOSFET_2N7002.lib
new file mode 100644
index 00000000..43600d05
--- /dev/null
+++ b/library/deviceModelLibrary/MOS/MOSFET_2N7002.lib
@@ -0,0 +1,6 @@
+* 115mA, 60V, N-channel Enhancement Mode MOSFET
+.MODEL 2N7002 NMOS( LEVEL=1 VTO=1.50 KP=78.1m GAMMA=1.86
++ PHI=.75 LAMBDA=97.2u RD=0.280 RS=0.280
++ IS=140f PB=0.800 MJ=0.460 CBD=9.88p
++ CBS=11.9p CGSO=60.0n CGDO=50.0n CGBO=190n )
+
diff --git a/library/deviceModelLibrary/MOS/MOSFET_2N7002.xml b/library/deviceModelLibrary/MOS/MOSFET_2N7002.xml
new file mode 100644
index 00000000..dca33a4e
--- /dev/null
+++ b/library/deviceModelLibrary/MOS/MOSFET_2N7002.xml
@@ -0,0 +1 @@
+<library><model_name>NMOS</model_name><ref_model>2N7002</ref_model><param><LEVEL>1</LEVEL><VTO>1.50</VTO><KP>78.1m</KP><GAMMA>1.86</GAMMA><PHI>.75</PHI><LAMBDA>97.2u</LAMBDA><RD>0.280</RD><RS>0.280</RS><IS>140f</IS><PB>0.800</PB><MJ>0.460</MJ><CBD>9.88p</CBD><CBS>11.9p</CBS><CGSO>60.0n</CGSO><CGDO>50.0n</CGDO><CGBO>190n</CGBO></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/Switch/README.md b/library/deviceModelLibrary/Switch/README.md
new file mode 100644
index 00000000..bfb35788
--- /dev/null
+++ b/library/deviceModelLibrary/Switch/README.md
@@ -0,0 +1,33 @@
+# Voltage Controlled Switch
+
+The Voltage Controlled Switch block represents the electrical characteristics of a
+switch whose state is controlled by the voltage across the input ports (the controlling
+voltage).
+
+![sw_edited](https://user-images.githubusercontent.com/43288153/184137917-1e6d4b0e-42a9-4a87-80f1-9d98d2a6dc39.png)
+fig: Voltage control switch
+
+This block models either a variable-resistance or a short-transition switch. For
+a variable-resistance switch, set the Switch model parameter to Smooth transition
+between Von and Voff. For a short-transition switch, set Switch model to Abrupt
+transition after delay.
+
+When the controlling voltage is less than the Threshold voltage, VT parameter
+value minus the Hysteresis voltage, VH parameter value, the switch is open and has
+a resistance equal to the Off resistance, ROFF parameter value.
+When the controlling voltage is greater than or less than the Threshold voltage,
+VT parameter value by an amount less than or equal to the Hysteresis voltage, VH
+parameter value, the voltage is in the crossover region and the state of the switch
+remains unchanged
+
+The schematic to test the proposed voltage controlled switch is shown below.
+It is a simple circuit where a pulse source is connected to the switch followed by a
+resistor.
+When the switch is turned ON, then at the Vout the source voltage can be
+obtained, however, the switch model is given some value for Ron meaning the amount
+of ron will be offered by the switch when it is turned ON.
+Similarly, when it is turned off then it will offer the resistance set in roff.
+
+```
+.model switch1 sw( vt=0.05 vh=1 ron=1 roff=1e12 )
+```
diff --git a/library/deviceModelLibrary/Switch/switch1.lib b/library/deviceModelLibrary/Switch/switch1.lib
new file mode 100644
index 00000000..3736c67f
--- /dev/null
+++ b/library/deviceModelLibrary/Switch/switch1.lib
@@ -0,0 +1,3 @@
+*****************Creation of lib file for switch****************************
+
+.model switch1 sw( vt=0.05 vh=1 ron=1 roff=1e12 )
diff --git a/library/deviceModelLibrary/Switch/switch1.xml b/library/deviceModelLibrary/Switch/switch1.xml
new file mode 100644
index 00000000..c38fe559
--- /dev/null
+++ b/library/deviceModelLibrary/Switch/switch1.xml
@@ -0,0 +1 @@
+<library><model_name>sw</model_name><ref_model>switch1</ref_model><param><vt>0.05</vt><vh>1</vh><ron>1</ron><roff>1e12</roff></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/Transmission Lines/README.md b/library/deviceModelLibrary/Transmission Lines/README.md
new file mode 100644
index 00000000..3cd6aef4
--- /dev/null
+++ b/library/deviceModelLibrary/Transmission Lines/README.md
@@ -0,0 +1,34 @@
+# Transmission Line
+
+Transmision lines are used to carry Radio Frequency(RF) power from one place to
+another, and to do this as efficiently as possible.
+In this section the lossless and lossy transmission lines will be discussed along
+with the simulation results.
+
+## Lossless transmission line
+A transmission line having no line resistance or no dielectric loss is said to be a
+lossless transmission line. It means that the conductor would behave as a super-
+conductor and dielectric would be made of perfect dielectric medium. In a lossless
+transmission line, power sent from a generating point would be equal to power re-
+ceived at the load end. There is no power dissipation in the line itself.
+
+
+![tline](https://user-images.githubusercontent.com/43288153/184139198-e25e1e59-3b3f-415c-bf7d-99ebee4eb601.png)<br/>
+ fig: Symbol of tline
+
+
+**NOTE: We have to put one space between Z0=50 and Td=3ns**<br/>
+
+ This can be done in the cir.out file after creating the circuit(s) and converting kiCad
+to NgSpice.
+
+## Single Lossy Transmission Line (SLTL)
+An appreciable value of series resistance and shunt conductance make up a lossy
+transmission line, which allows different frequencies to transmit at various speeds.
+In contrast, on a lossless transmission line, wave propagation rates are constant
+across all frequencies. As waves move towards the load end of the lossy transmission
+line, distortion is caused by a change in speed.
+The symbol for Single Lossy Transmission Lines(SLTL) is shown below-
+
+![ymod](https://user-images.githubusercontent.com/43288153/184139539-ed4eac77-934a-423c-8f7b-2cba4daf42d1.png)<br/>
+fig: Symbol of SLTL
diff --git a/library/deviceModelLibrary/Transmission Lines/ymod.lib b/library/deviceModelLibrary/Transmission Lines/ymod.lib
new file mode 100644
index 00000000..12ed776f
--- /dev/null
+++ b/library/deviceModelLibrary/Transmission Lines/ymod.lib
@@ -0,0 +1 @@
+.MODEL ymod txl( R=12.45 L=8.972e-9 G=0 C=0.468e-12 length=16 )
diff --git a/library/deviceModelLibrary/Transmission Lines/ymod.xml b/library/deviceModelLibrary/Transmission Lines/ymod.xml
new file mode 100644
index 00000000..0c9a1863
--- /dev/null
+++ b/library/deviceModelLibrary/Transmission Lines/ymod.xml
@@ -0,0 +1 @@
+<library><model_name>txl</model_name><ref_model>ymod</ref_model><param><R>12.45</R><L>8.972e-9</L><G>0</G><C>0.468e-12</C><length>16</length></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_diode.lib b/library/deviceModelLibrary/User Libraries/GD_diode.lib
new file mode 100644
index 00000000..2e728e04
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_diode.lib
@@ -0,0 +1 @@
+.model GD_diode D( rs=6 n=6 ) \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_diode.xml b/library/deviceModelLibrary/User Libraries/GD_diode.xml
new file mode 100644
index 00000000..9965d289
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_diode.xml
@@ -0,0 +1 @@
+<library><model_name>D</model_name><ref_model>GD_diode</ref_model><param><rs>6</rs><n>6</n></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_nfet.lib b/library/deviceModelLibrary/User Libraries/GD_nfet.lib
new file mode 100644
index 00000000..0dafefd6
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_nfet.lib
@@ -0,0 +1 @@
+.model GD_nfet njf( vto=-4 beta=0.07 cgs=0.05 ) \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_nfet.xml b/library/deviceModelLibrary/User Libraries/GD_nfet.xml
new file mode 100644
index 00000000..ae5413d4
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_nfet.xml
@@ -0,0 +1 @@
+<library><model_name>njf</model_name><ref_model>GD_nfet</ref_model><param><vto>-4</vto><beta>0.07</beta><cgs>0.05</cgs></param></library> \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_pfet.lib b/library/deviceModelLibrary/User Libraries/GD_pfet.lib
new file mode 100644
index 00000000..cf314100
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_pfet.lib
@@ -0,0 +1 @@
+.model GD_pfet pjf( vto=-4 beta=0.07 cgs=0.05 ) \ No newline at end of file
diff --git a/library/deviceModelLibrary/User Libraries/GD_pfet.xml b/library/deviceModelLibrary/User Libraries/GD_pfet.xml
new file mode 100644
index 00000000..8fc6456f
--- /dev/null
+++ b/library/deviceModelLibrary/User Libraries/GD_pfet.xml
@@ -0,0 +1 @@
+<library><model_name>pjf</model_name><ref_model>GD_pfet</ref_model><param><vto>-4</vto><beta>0.07</beta><cgs>0.05</cgs></param></library> \ No newline at end of file
diff --git a/library/kicadLibrary/kicad_eSim-Library/eSim_Subckt.lib b/library/kicadLibrary/kicad_eSim-Library/eSim_Subckt.lib
index c49af970..fe57167c 100644
--- a/library/kicadLibrary/kicad_eSim-Library/eSim_Subckt.lib
+++ b/library/kicadLibrary/kicad_eSim-Library/eSim_Subckt.lib
@@ -182,6 +182,26 @@ X Clkout 4 800 0 200 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
+# GunnDiode
+#
+DEF GunnDiode X 0 40 Y Y 3 F N
+F0 "X" 0 100 60 H V C CNN
+F1 "GunnDiode" 0 -125 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+P 2 0 1 0 0 0 0 0 N
+P 4 0 1 0 0 0 -150 100 -150 -100 0 0 F
+P 4 0 1 0 0 0 150 100 150 -100 0 0 F
+X P 1 -350 0 200 R 43 39 1 1 I
+X N 2 350 0 200 L 43 39 1 1 I
+X N ?? 350 0 200 L 43 39 2 1 I
+X P ?? -350 0 200 R 43 39 2 1 I
+X N ?? 350 0 200 L 43 39 3 1 I
+X P ?? -350 0 200 R 43 39 3 1 I
+ENDDRAW
+ENDDEF
+#
# IC_4002
#
DEF IC_4002 X 0 40 Y Y 1 F N
@@ -559,6 +579,91 @@ X G 3 -350 -400 150 R 60 60 1 1 I
ENDDRAW
ENDDEF
#
+# SWCH
+#
+DEF SWCH SW 0 40 Y Y 4 F N
+F0 "SW" 10 200 60 H V C CNN
+F1 "SWCH" 10 -110 60 H V C CNN
+F2 "" 20 50 60 H I C CNN
+F3 "" 20 50 60 H I C CNN
+DRAW
+P 2 0 1 0 -50 0 -50 0 N
+P 2 0 1 0 -50 50 50 80 N
+P 2 0 1 0 0 90 0 80 N
+P 2 0 1 0 0 110 0 100 N
+P 2 0 1 0 0 130 0 120 N
+P 2 0 1 0 50 -50 150 -50 N
+P 2 0 1 0 50 50 40 50 N
+P 2 0 1 0 50 50 50 -50 N
+P 2 0 1 0 50 50 150 50 N
+P 4 0 1 0 -150 50 -50 50 -50 -50 -150 -50 N
+P 4 0 1 0 -50 100 -50 150 50 150 50 100 N
+X ~ 1 -350 50 200 R 24 50 1 1 B
+X ~ 2 350 50 200 L 24 50 1 1 B
+X ~ 3 350 -50 200 L 24 50 1 1 B
+X ~ 4 -350 -50 200 R 24 50 1 1 B
+X ~ ?? -350 -50 200 R 24 50 2 1 B
+X ~ ?? -350 50 200 R 24 50 2 1 B
+X ~ ?? -35 25 200 L 24 50 2 1 B
+X ~ ?? 350 -50 200 L 24 50 2 1 B
+X ~ ?? 350 50 200 L 24 50 2 1 B
+X ~ ?? -350 -50 200 R 24 50 3 1 B
+X ~ ?? -350 50 200 R 24 50 3 1 B
+X ~ ?? -35 25 200 L 24 50 3 1 B
+X ~ ?? 350 -50 200 L 24 50 3 1 B
+X ~ ?? 350 50 200 L 24 50 3 1 B
+X ~ ?? -350 -50 200 R 24 50 4 1 B
+X ~ ?? -350 50 200 R 24 50 4 1 B
+X ~ ?? -35 25 200 L 24 50 4 1 B
+X ~ ?? 350 -50 200 L 24 50 4 1 B
+X ~ ?? 350 50 200 L 24 50 4 1 B
+ENDDRAW
+ENDDEF
+#
+# Schottky_transistor_PNP
+#
+DEF Schottky_transistor_PNP Q 0 40 Y Y 1 F N
+F0 "Q" -50 250 60 H V C CNN
+F1 "Schottky_transistor_PNP" 200 -250 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+P 2 0 1 16 -150 -150 -150 -125 N
+P 2 0 1 16 -100 -150 -150 -150 N
+P 2 0 1 0 -100 -50 50 -150 N
+P 2 0 1 0 -100 0 -200 0 N
+P 2 0 1 2 -100 50 -100 -100 N
+P 2 0 1 0 -100 50 -100 100 N
+P 2 0 1 0 -100 50 50 150 N
+P 2 0 1 16 -100 100 -100 -150 N
+P 2 0 1 16 -50 150 -50 125 N
+P 2 0 1 0 -10 -110 10 -150 N
+P 2 0 1 0 -10 -110 30 -110 N
+P 2 0 1 0 40 -110 30 -110 N
+P 2 0 1 0 50 -200 50 -150 N
+P 2 0 1 0 50 150 50 200 N
+P 3 0 1 16 -100 100 -100 150 -50 150 N
+X ~ 1 -250 0 98 R 24 24 1 1 I
+X ~ 2 50 -250 98 U 24 24 1 1 I
+X ~ 3 50 250 98 D 24 24 1 1 I
+ENDDRAW
+ENDDEF
+#
+# T1
+#
+DEF T1 U 0 40 Y Y 1 F N
+F0 "U" 0 -150 60 H V C CNN
+F1 "T1" 0 150 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+T 0 0 0 60 0 0 0 transline Normal 1 C C
+S -350 100 350 -100 0 1 0 N
+X In 1 -550 0 200 R 50 50 1 1 I
+X Out 3 550 0 200 L 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
# UJT
#
DEF UJT X 0 40 Y Y 1 F N
@@ -579,6 +684,41 @@ X B2 3 0 350 200 D 50 50 1 1 B
ENDDRAW
ENDDEF
#
+# Z0=50
+#
+DEF Z0=50 T 0 40 Y Y 1 F N
+F0 "T" 0 100 60 H V C CNN
+F1 "Z0=50" -70 -90 20 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+F4 "Td=3ns" 70 -90 20 H V C CNN
+DRAW
+T 0 -10 0 59 0 0 0 tline Normal 0 C C
+P 5 0 1 0 -150 50 -150 -50 150 -50 150 50 -150 50 N
+X ~ 1 -350 0 200 R 50 50 1 1 I
+X ~ 2 -150 -250 200 U 50 50 1 1 I
+X ~ 3 350 0 200 L 50 50 1 1 I
+X ~ 4 150 -250 200 U 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+# Z0=50Td=3ns
+#
+DEF Z0=50Td=3ns T 0 40 Y Y 1 F N
+F0 "T" 0 100 60 H V C CNN
+F1 "Z0=50Td=3ns" 0 -90 20 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+T 0 -10 0 59 0 0 0 tline Normal 0 C C
+P 5 0 1 0 -150 50 -150 -50 150 -50 150 50 -150 50 f
+X ~ 1 -350 0 200 R 50 50 1 1 I
+X ~ 2 -150 -250 200 U 50 50 1 1 I
+X ~ 3 350 0 200 L 50 50 1 1 I
+X ~ 4 150 -250 200 U 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
# eSim_74LS04
#
DEF eSim_74LS04 X 0 40 Y Y 1 F N
@@ -605,6 +745,101 @@ X VCC 14 550 450 200 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
+# eSim_BlueLED
+#
+DEF eSim_BlueLED D 0 20 Y Y 1 F N
+F0 "D" -100 100 60 H V C CNN
+F1 "eSim_BlueLED" 70 -120 60 H V C CNN
+F2 "" 450 0 60 H I C CNN
+F3 "" 450 0 60 H I C CNN
+DRAW
+P 2 0 0 0 -25 75 25 125 N
+P 2 0 0 0 25 75 75 125 N
+P 2 0 0 0 50 50 50 -50 N
+P 3 0 0 0 30 110 30 130 10 130 N
+P 3 0 0 0 60 130 80 130 80 110 N
+P 4 0 0 0 -50 50 -50 -50 50 0 -50 50 F
+X ~ A -200 0 161 R 50 20 1 1 I
+X ~ C 200 0 161 L 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
+# eSim_GreenLED
+#
+DEF eSim_GreenLED D 0 20 Y Y 1 F N
+F0 "D" -100 100 60 H V C CNN
+F1 "eSim_GreenLED" 50 -100 60 H V C CNN
+F2 "" 450 0 60 H I C CNN
+F3 "" 450 0 60 H I C CNN
+DRAW
+P 2 0 0 0 -25 75 25 125 N
+P 2 0 0 0 25 75 75 125 N
+P 2 0 0 0 50 50 50 -50 N
+P 3 0 0 0 30 110 30 130 10 130 N
+P 3 0 0 0 60 130 80 130 80 110 N
+P 4 0 0 0 -50 50 -50 -50 50 0 -50 50 F
+X ~ A -200 0 161 R 50 20 1 1 I
+X ~ C 200 0 161 L 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
+# eSim_InfraredLED
+#
+DEF eSim_InfraredLED D 0 20 Y Y 1 F N
+F0 "D" -100 100 60 H V C CNN
+F1 "eSim_InfraredLED" 50 -100 60 H V C CNN
+F2 "" 450 0 60 H I C CNN
+F3 "" 450 0 60 H I C CNN
+DRAW
+P 2 0 0 0 -25 75 25 125 N
+P 2 0 0 0 25 75 75 125 N
+P 2 0 0 0 50 50 50 -50 N
+P 3 0 0 0 30 110 30 130 10 130 N
+P 3 0 0 0 60 130 80 130 80 110 N
+P 4 0 0 0 -50 50 -50 -50 50 0 -50 50 F
+X ~ A -200 0 161 R 50 20 1 1 I
+X ~ C 200 0 161 L 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
+# eSim_RedLED
+#
+DEF eSim_RedLED D 0 20 Y Y 1 F N
+F0 "D" -100 100 60 H V C CNN
+F1 "eSim_RedLED" 50 -100 60 H V C CNN
+F2 "" 450 0 60 H I C CNN
+F3 "" 450 0 60 H I C CNN
+DRAW
+P 2 0 0 0 -25 75 25 125 N
+P 2 0 0 0 25 75 75 125 N
+P 2 0 0 0 50 50 50 -50 N
+P 3 0 0 0 30 110 30 130 10 130 N
+P 3 0 0 0 60 130 80 130 80 110 N
+P 4 0 0 0 -50 50 -50 -50 50 0 -50 50 F
+X ~ A -200 0 161 R 50 20 1 1 I
+X ~ C 200 0 161 L 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
+# eSim_YellowLED
+#
+DEF eSim_YellowLED D 0 20 Y Y 1 F N
+F0 "D" -100 100 60 H V C CNN
+F1 "eSim_YellowLED" 50 -100 60 H V C CNN
+F2 "" 450 0 60 H I C CNN
+F3 "" 450 0 60 H I C CNN
+DRAW
+P 2 0 0 0 -25 75 25 125 N
+P 2 0 0 0 25 75 75 125 N
+P 2 0 0 0 50 50 50 -50 N
+P 3 0 0 0 30 110 30 130 10 130 N
+P 3 0 0 0 60 130 80 130 80 110 N
+P 4 0 0 0 -50 50 -50 -50 50 0 -50 50 F
+X ~ A -200 0 161 R 50 20 1 1 I
+X ~ C 200 0 161 L 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
# full_adder
#
DEF full_adder X 0 40 Y Y 1 F N
@@ -691,6 +926,198 @@ X NC 8 150 -300 200 U 50 38 1 1 N
ENDDRAW
ENDDEF
#
+# schottky_transistor
+#
+DEF schottky_transistor Q 0 40 Y Y 1 F N
+F0 "Q" -20 210 60 H V C CNN
+F1 "schottky_transistor" 75 -225 60 H V C CNN
+F2 "" 25 -25 60 H I C CNN
+F3 "" 25 -25 60 H I C CNN
+DRAW
+P 2 0 1 16 -75 -125 -75 -100 N
+P 2 0 1 7 -50 0 -100 0 N
+P 2 0 1 0 -50 25 -50 25 N
+P 2 0 1 16 -50 50 -50 0 N
+P 2 0 1 16 -50 50 -50 150 N
+P 2 0 1 7 -50 50 50 100 N
+P 2 0 1 16 -50 150 -25 150 N
+P 2 0 1 16 -25 150 -25 125 N
+P 2 0 1 0 50 -110 -50 -50 N
+P 2 0 1 0 50 -110 20 -110 N
+P 2 0 1 0 50 -110 40 -80 N
+P 3 0 1 16 -50 0 -50 -125 -75 -125 N
+X ~ 1 -200 0 98 R 12 12 1 1 I
+X ~ 2 50 200 98 D 16 50 1 1 I
+X ~ 3 50 -200 87 U 12 12 1 1 I
+ENDDRAW
+ENDDEF
+#
+# switch1
+#
+DEF switch1 S 0 40 Y Y 4 F N
+F0 "S" 10 200 60 H V C CNN
+F1 "switch1" 10 -110 60 H V C CNN
+F2 "" 20 50 60 H I C CNN
+F3 "" 20 50 60 H I C CNN
+DRAW
+P 2 0 1 0 -50 0 -50 0 N
+P 2 0 1 0 -50 50 50 80 N
+P 2 0 1 0 0 90 0 80 N
+P 2 0 1 0 0 110 0 100 N
+P 2 0 1 0 0 130 0 120 N
+P 2 0 1 0 50 -50 150 -50 N
+P 2 0 1 0 50 50 40 50 N
+P 2 0 1 0 50 50 50 -50 N
+P 2 0 1 0 50 50 150 50 N
+P 4 0 1 0 -150 50 -50 50 -50 -50 -150 -50 N
+P 4 0 1 0 -50 100 -50 150 50 150 50 100 N
+X ~ 1 -350 50 200 R 24 50 1 1 B
+X ~ 2 350 50 200 L 24 50 1 1 B
+X ~ 3 350 -50 200 L 24 50 1 1 B
+X ~ 4 -350 -50 200 R 24 50 1 1 B
+X ~ ?? -350 -50 200 R 24 50 2 1 B
+X ~ ?? -350 50 200 R 24 50 2 1 B
+X ~ ?? -35 25 200 L 24 50 2 1 B
+X ~ ?? 350 -50 200 L 24 50 2 1 B
+X ~ ?? 350 50 200 L 24 50 2 1 B
+X ~ ?? -350 -50 200 R 24 50 3 1 B
+X ~ ?? -350 50 200 R 24 50 3 1 B
+X ~ ?? -35 25 200 L 24 50 3 1 B
+X ~ ?? 350 -50 200 L 24 50 3 1 B
+X ~ ?? 350 50 200 L 24 50 3 1 B
+X ~ ?? -350 -50 200 R 24 50 4 1 B
+X ~ ?? -350 50 200 R 24 50 4 1 B
+X ~ ?? -35 25 200 L 24 50 4 1 B
+X ~ ?? 350 -50 200 L 24 50 4 1 B
+X ~ ?? 350 50 200 L 24 50 4 1 B
+ENDDRAW
+ENDDEF
+#
+# tline
+#
+DEF tline T 0 40 Y Y 1 F N
+F0 "T" 0 100 60 H V C CNN
+F1 "tline" 0 0 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+T 0 60 -100 20 0 0 0 Td=3ns Normal 0 C C
+T 0 -60 -100 20 0 0 0 Z0=50 Normal 0 C C
+P 2 0 1 0 155 -25 155 -25 N
+P 2 0 1 0 155 20 155 20 N
+P 2 0 1 0 155 25 155 25 N
+P 2 0 1 0 155 25 155 25 N
+P 2 0 1 0 160 -30 160 -30 N
+P 2 0 1 0 160 10 160 10 N
+P 2 0 1 0 160 10 160 10 N
+P 2 0 1 0 160 20 160 20 N
+P 2 0 1 0 160 20 160 20 N
+P 3 0 1 0 150 -30 160 -30 160 -20 N
+P 3 0 1 0 155 -5 155 -15 155 15 N
+P 4 0 1 0 -150 30 -160 30 -160 -30 -150 -30 F
+P 4 0 1 0 150 30 160 30 160 -20 150 -20 N
+P 5 0 1 0 -150 50 -150 -50 150 -50 150 50 -150 50 f
+X ~ 1 -350 0 200 R 50 50 1 1 I
+X ~ 2 -150 -250 200 U 50 50 1 1 I
+X ~ 3 350 0 200 L 50 50 1 1 I
+X ~ 4 150 -250 200 U 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+# transline
+#
+DEF transline U 0 40 Y Y 1 F N
+F0 "U" 0 -150 60 H V C CNN
+F1 "transline" 0 150 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+T 0 0 0 60 0 0 0 transline Normal 1 C C
+S -350 100 350 -100 0 1 0 N
+X In 1 -550 0 200 R 50 50 1 1 I
+X Out 3 550 0 200 L 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+# txl
+#
+DEF txl ymod 0 40 Y Y 2 F N
+F0 "ymod" 0 175 60 H V C CNN
+F1 "txl" 0 -175 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+P 2 0 1 0 -100 -100 100 -100 N
+P 2 0 1 0 -100 100 100 100 N
+P 2 0 1 0 -50 -100 -75 -125 N
+P 2 0 1 0 0 -100 -25 -125 N
+P 2 0 1 0 50 -100 25 -125 N
+P 2 0 1 0 100 -100 75 -125 N
+X In 1 -300 100 200 R 16 20 1 1 I
+X gnd 2 -300 -100 200 R 16 20 1 1 I
+X Out 3 300 100 200 L 16 20 1 1 I
+X gnd 4 300 -100 200 L 20 20 1 1 I
+X gnd ?? -300 -100 200 R 16 20 2 1 I
+X gnd ?? 300 -100 200 L 20 20 2 1 I
+X In ?? -300 100 200 R 16 20 2 1 I
+X Out ?? 300 100 200 L 16 20 2 1 I
+ENDDRAW
+ENDDEF
+#
+# ymod
+#
+DEF ymod YTXL 0 40 Y Y 2 F N
+F0 "YTXL" 0 175 60 H V C CNN
+F1 "ymod" 0 -175 60 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+P 2 0 1 0 -100 -100 100 -100 N
+P 2 0 1 0 -100 100 100 100 N
+P 2 0 1 0 -50 -100 -75 -125 N
+P 2 0 1 0 0 -100 -25 -125 N
+P 2 0 1 0 50 -100 25 -125 N
+P 2 0 1 0 100 -100 75 -125 N
+X In 1 -300 100 200 R 16 20 1 1 I
+X gnd 2 -300 -100 200 R 16 20 1 1 I
+X Out 3 300 100 200 L 16 20 1 1 I
+X gnd 4 300 -100 200 L 20 20 1 1 I
+X gnd ?? -300 -100 200 R 16 20 2 1 I
+X gnd ?? 300 -100 200 L 20 20 2 1 I
+X In ?? -300 100 200 R 16 20 2 1 I
+X Out ?? 300 100 200 L 16 20 2 1 I
+ENDDRAW
+ENDDEF
+#
+# z0=50Td=3ns
+#
+DEF z0=50Td=3ns T 0 40 Y Y 1 F N
+F0 "T" 0 100 60 H V C CNN
+F1 "z0=50Td=3ns" 0 -100 20 H V C CNN
+F2 "" 0 0 60 H I C CNN
+F3 "" 0 0 60 H I C CNN
+DRAW
+T 0 70 0 20 0 0 0 Td=3ns Normal 0 C C
+T 0 -70 0 20 0 0 0 Z0=50 Normal 0 C C
+P 2 0 1 0 155 -25 155 -25 N
+P 2 0 1 0 155 20 155 20 N
+P 2 0 1 0 155 25 155 25 N
+P 2 0 1 0 155 25 155 25 N
+P 2 0 1 0 160 -30 160 -30 N
+P 2 0 1 0 160 10 160 10 N
+P 2 0 1 0 160 10 160 10 N
+P 2 0 1 0 160 20 160 20 N
+P 2 0 1 0 160 20 160 20 N
+P 3 0 1 0 150 -30 160 -30 160 -20 N
+P 3 0 1 0 155 -5 155 -15 155 15 N
+P 4 0 1 0 -150 30 -160 30 -160 -30 -150 -30 F
+P 4 0 1 0 150 30 160 30 160 -20 150 -20 N
+P 5 0 1 0 -150 50 -150 -50 150 -50 150 50 -150 50 f
+X ~ 1 -350 0 200 R 50 50 1 1 I
+X ~ 2 -150 -250 200 U 50 50 1 1 I
+X ~ 3 350 0 200 L 50 50 1 1 I
+X ~ 4 150 -250 200 U 50 50 1 1 O
+#
# CD_4081
#
DEF CD_4081 X 0 40 Y Y 1 F N
diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py
index c52ea2d0..d2cd0e73 100644
--- a/src/kicadtoNgspice/DeviceModel.py
+++ b/src/kicadtoNgspice/DeviceModel.py
@@ -15,6 +15,8 @@ class DeviceModel(QtWidgets.QWidget):
- d DIODE
- j JFET
- m MOSFET
+ - s SWITCH
+ - tx single lossy transmission line
- Other 2 functions same as the ones in subCircuit
- trackLibrary
- trackLibraryWithoutButton
@@ -257,6 +259,131 @@ class DeviceModel(QtWidgets.QWidget):
self.grid.addWidget(jfetbox)
# Adding Device Details #
+ # Increment row and widget count
+ self.row = self.row + 1
+ self.devicemodel_dict_end[words[0]] = self.count
+ self.count = self.count + 1
+
+ elif eachline[0] == 's':
+ # print("Device Model Switch:", words[0])
+ self.devicemodel_dict_beg[words[0]] = self.count
+ switchbox = QtWidgets.QGroupBox()
+ switchgrid = QtWidgets.QGridLayout()
+ switchbox.setTitle(
+ "Add library for Switch " +
+ words[0] +
+ " : " +
+ words[5])
+ self.entry_var[self.count] = QtWidgets.QLineEdit()
+ self.entry_var[self.count].setText("")
+ # global path_name
+ try:
+ for child in root:
+ if child.tag == words[0]:
+ # print("DEVICE MODEL MATCHING---", \
+ # child.tag, words[0])
+ try:
+ if child[0].text \
+ and os.path.exists(child[0].text):
+ path_name = child[0].text
+ self.entry_var[self.count] \
+ .setText(child[0].text)
+ else:
+ self.entry_var[self.count].setText("")
+ except BaseException as e:
+ print("Error when set text of device " +
+ "model switch :", str(e))
+ except BaseException:
+ pass
+
+ switchgrid.addWidget(self.entry_var[self.count], self.row, 1)
+ self.addbtn = QtWidgets.QPushButton("Add")
+ self.addbtn.setObjectName("%d" % self.count)
+ self.addbtn.clicked.connect(self.trackLibrary)
+ self.deviceDetail[self.count] = words[0]
+
+ if self.entry_var[self.count].text() == "":
+ pass
+ else:
+ self.trackLibraryWithoutButton(self.count, path_name)
+
+ switchgrid.addWidget(self.addbtn, self.row, 2)
+ switchbox.setLayout(switchgrid)
+
+ # CSS
+ switchbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: \
+ 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left:\
+ 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(switchbox)
+
+ # Adding Device Details #
+
+ # Increment row and widget count
+ self.row = self.row + 1
+ self.devicemodel_dict_end[words[0]] = self.count
+ self.count = self.count + 1
+
+ elif eachline[0] == 'ytxl':
+ # print("Device Model ymod:", words[0])
+ self.devicemodel_dict_beg[words[0]] = self.count
+ ymodbox = QtWidgets.QGroupBox()
+ ymodgrid = QtWidgets.QGridLayout()
+ ymodbox.setTitle(
+ "Add library for ymod " +
+ words[0] +
+ " : " +
+ words[4])
+ self.entry_var[self.count] = QtWidgets.QLineEdit()
+ self.entry_var[self.count].setText("")
+ # global path_name
+ try:
+ for child in root:
+ if child.tag == words[0]:
+ # print("DEVICE MODEL MATCHING---", \
+ # child.tag, words[0])
+ try:
+ if child[0].text \
+ and os.path.exists(child[0].text):
+ path_name = child[0].text
+ self.entry_var[self.count] \
+ .setText(child[0].text)
+ else:
+ self.entry_var[self.count].setText("")
+ except BaseException as e:
+ print("Error when set text of device " +
+ "model ymod :", str(e))
+ except BaseException:
+ pass
+
+ ymodgrid.addWidget(self.entry_var[self.count], self.row, 1)
+ self.addbtn = QtWidgets.QPushButton("Add")
+ self.addbtn.setObjectName("%d" % self.count)
+ self.addbtn.clicked.connect(self.trackLibrary)
+ self.deviceDetail[self.count] = words[0]
+
+ if self.entry_var[self.count].text() == "":
+ pass
+ else:
+ self.trackLibraryWithoutButton(self.count, path_name)
+
+ ymodgrid.addWidget(self.addbtn, self.row, 2)
+ ymodbox.setLayout(ymodgrid)
+
+ # CSS
+ ymodbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: \
+ 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left:\
+ 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(ymodbox)
+
+ # Adding Device Details #
# Increment row and widget count
self.row = self.row + 1
@@ -264,6 +391,7 @@ class DeviceModel(QtWidgets.QWidget):
self.count = self.count + 1
elif eachline[0] == 'm':
+
self.devicemodel_dict_beg[words[0]] = self.count
mosfetbox = QtWidgets.QGroupBox()
mosfetgrid = QtWidgets.QGridLayout()
@@ -273,7 +401,7 @@ class DeviceModel(QtWidgets.QWidget):
"Add library for MOSFET " +
words[0] +
" : " +
- words[5])
+ words[4])
self.entry_var[self.count] = QtWidgets.QLineEdit()
self.entry_var[self.count].setText("")
self.entry_var[self.count].setReadOnly(True)
@@ -333,12 +461,12 @@ class DeviceModel(QtWidgets.QWidget):
# print("DEVICE MODEL MATCHING---", \
# child.tag, words[0])
while i <= end:
- self.entry_var[i].setText(child[i-beg].text)
+ self.entry_var[i].setText(child[i - beg].text)
if (i - beg) == 0:
if os.path.exists(child[0].text):
self.entry_var[i] \
- .setText(child[i-beg].text)
- path_name = child[i-beg].text
+ .setText(child[i - beg].text)
+ path_name = child[i - beg].text
else:
self.entry_var[i].setText("")
i = i + 1