summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md48
-rw-r--r--kicadSchematicLibrary/eSim_Analog.lib15
-rw-r--r--kicadSchematicLibrary/eSim_Devices.lib22
-rw-r--r--kicadSchematicLibrary/eSim_Digital.lib14
-rw-r--r--kicadSchematicLibrary/eSim_Miscellaneous.dcm3
-rw-r--r--kicadSchematicLibrary/eSim_Miscellaneous.lib39
-rw-r--r--kicadSchematicLibrary/eSim_Subckt.dcm7
-rw-r--r--kicadSchematicLibrary/eSim_Subckt.lib69
-rw-r--r--kicadSchematicLibrary/eSim_User.dcm3
-rw-r--r--kicadSchematicLibrary/eSim_User.lib4
-rwxr-xr-xsrc/frontEnd/Application.py1
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py2
-rw-r--r--src/ngspiceSimulation/pythonPlotting.py24
13 files changed, 216 insertions, 35 deletions
diff --git a/README.md b/README.md
index 7f51c847..f5c617ba 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,47 @@
-# eSim
+##eSim
+
+eSim is an open source EDA tool for circuit design, simulation, analysis and PCB design, developed by FOSSEE team at IIT Bombay.
+It is an integrated tool build using open source software such as Kicad (http://www.kicad-pcd.org), Ngspice (http://ngspice.sourcefouge.net/)
+It is released under GNU GPL License. It runs on Ubuntu Linux, Windows XP and Windows.
+
+eSim has been successfully ported to low cost FOSSEE laptop (http://laptop.fossee.in)
+
+##Pre-requisites
+1. Python 2.7
+2. PyQt4
+3. Matplotlib
+4. NgSpice
+5. Kicad (Latest Version build on July-14)
+
+##Installing and setting PATH for eSim
+1. Clone this repository or download it as zip file.
+2. set PYTHONPATH
+ - For Linux :
+ Open .bashrc file and add this line.
+
+ `export PYTHONPATH=$PYTHONPATH:/path-to-your-downloaded-folder/eSim/src`
+
+ - For Window :
+ set environment variable `PYHTONPATH` with complete path to your eSim/src
+
+
+##How to run eSim ?
+1. Using command line or terminal go to location eSim/src/frontEnd
+2. Type below command to open eSim
+ - `python Application.py`
+
+
+##How to install latest version of kicad in Ubuntu ?
+1. `sudo add-apt-repository ppa:js-reynaud/ppa-kicad`
+
+2. `sudo apt-get update`
+
+3. `sudo apt-get install kicad`
+
+
+##How to install ngspice in Ubuntu?
+
+ `sudo apt-get install ngspice`
+
+
+
diff --git a/kicadSchematicLibrary/eSim_Analog.lib b/kicadSchematicLibrary/eSim_Analog.lib
index 8e44446b..66c2e3a6 100644
--- a/kicadSchematicLibrary/eSim_Analog.lib
+++ b/kicadSchematicLibrary/eSim_Analog.lib
@@ -1,6 +1,21 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#
+# aswitch
+#
+DEF aswitch U 0 40 Y Y 1 F N
+F0 "U" 450 300 60 H V C CNN
+F1 "aswitch" 450 200 60 H V C CNN
+F2 "" 450 100 60 H V C CNN
+F3 "" 450 100 60 H V C CNN
+DRAW
+S 200 250 650 100 0 1 0 N
+X ~ 2 0 150 200 R 50 50 1 1 O
+X ~ 3 850 150 200 L 50 50 1 1 O
+X ~ 1_IN 450 -100 200 U 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
# climit
#
DEF climit U 0 40 Y Y 1 F N
diff --git a/kicadSchematicLibrary/eSim_Devices.lib b/kicadSchematicLibrary/eSim_Devices.lib
index 442795e7..9c093d3a 100644
--- a/kicadSchematicLibrary/eSim_Devices.lib
+++ b/kicadSchematicLibrary/eSim_Devices.lib
@@ -153,26 +153,4 @@ X E 3 100 -200 100 U 50 50 1 1 E
ENDDRAW
ENDDEF
#
-# PORT
-#
-DEF PORT U 0 40 Y Y 8 F N
-F0 "U" 50 100 30 H V C CNN
-F1 "PORT" 0 0 30 H V C CNN
-F2 "" 0 0 60 H V C CNN
-F3 "" 0 0 60 H V C CNN
-DRAW
-A 325 225 285 -1421 -1278 0 1 0 N 100 50 150 0
-A 376 -275 356 1294 1408 0 1 0 N 150 0 100 -50
-S -100 50 100 -50 0 1 0 N
-X ~ 1 250 0 100 L 30 30 1 1 B
-X ~ 2 250 0 100 L 30 30 2 1 B
-X ~ 3 250 0 100 L 30 30 3 1 B
-X ~ 4 250 0 100 L 30 30 4 1 B
-X ~ 5 250 0 100 L 30 30 5 1 B
-X ~ 6 250 0 100 L 30 30 6 1 B
-X ~ 7 250 0 100 L 30 30 7 1 B
-X ~ 8 250 0 100 L 30 30 8 1 B
-ENDDRAW
-ENDDEF
-#
#End Library
diff --git a/kicadSchematicLibrary/eSim_Digital.lib b/kicadSchematicLibrary/eSim_Digital.lib
index c44e546c..ff53d004 100644
--- a/kicadSchematicLibrary/eSim_Digital.lib
+++ b/kicadSchematicLibrary/eSim_Digital.lib
@@ -85,14 +85,14 @@ ENDDEF
# d_inverter
#
DEF d_inverter U 0 40 Y Y 1 F N
-F0 "U" 0 -50 60 H V C CNN
-F1 "d_inverter" 0 50 60 H V C CNN
-F2 "" 0 0 60 H V C CNN
-F3 "" 0 0 60 H V C CNN
+F0 "U" 0 -100 60 H V C CNN
+F1 "d_inverter" 0 150 60 H V C CNN
+F2 "" 50 -50 60 H V C CNN
+F3 "" 50 -50 60 H V C CNN
DRAW
-P 4 0 1 0 -300 200 -300 -200 450 0 -300 200 N
-X IN 1 -500 0 200 R 50 50 1 1 I
-X OUT 2 650 0 200 L 50 50 1 1 O I
+P 4 0 1 0 -100 50 -100 -50 100 0 -100 50 N
+X ~ 1 -300 0 200 R 50 50 1 1 I
+X ~ 2 300 0 200 L 50 50 1 1 O I
ENDDRAW
ENDDEF
#
diff --git a/kicadSchematicLibrary/eSim_Miscellaneous.dcm b/kicadSchematicLibrary/eSim_Miscellaneous.dcm
new file mode 100644
index 00000000..5f3ed79b
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_Miscellaneous.dcm
@@ -0,0 +1,3 @@
+EESchema-DOCLIB Version 2.0
+#
+#End Doc Library
diff --git a/kicadSchematicLibrary/eSim_Miscellaneous.lib b/kicadSchematicLibrary/eSim_Miscellaneous.lib
new file mode 100644
index 00000000..2bd18839
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_Miscellaneous.lib
@@ -0,0 +1,39 @@
+EESchema-LIBRARY Version 2.3
+#encoding utf-8
+#
+# IC
+#
+DEF IC U 0 40 Y Y 1 F N
+F0 "U" 300 150 60 H V C CNN
+F1 "IC" 250 350 60 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+P 5 0 1 0 200 300 100 250 200 200 300 250 200 300 N
+X ~ 1 200 50 146 U 50 50 1 1 I
+ENDDRAW
+ENDDEF
+#
+# PORT
+#
+DEF PORT U 0 40 Y Y 8 F N
+F0 "U" 50 100 30 H V C CNN
+F1 "PORT" 0 0 30 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+A 325 225 285 -1421 -1278 0 1 0 N 100 50 150 0
+A 376 -275 356 1294 1408 0 1 0 N 150 0 100 -50
+S -100 50 100 -50 0 1 0 N
+X ~ 1 250 0 100 L 30 30 1 1 B
+X ~ 2 250 0 100 L 30 30 2 1 B
+X ~ 3 250 0 100 L 30 30 3 1 B
+X ~ 4 250 0 100 L 30 30 4 1 B
+X ~ 5 250 0 100 L 30 30 5 1 B
+X ~ 6 250 0 100 L 30 30 6 1 B
+X ~ 7 250 0 100 L 30 30 7 1 B
+X ~ 8 250 0 100 L 30 30 8 1 B
+ENDDRAW
+ENDDEF
+#
+#End Library
diff --git a/kicadSchematicLibrary/eSim_Subckt.dcm b/kicadSchematicLibrary/eSim_Subckt.dcm
new file mode 100644
index 00000000..1980d0d1
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_Subckt.dcm
@@ -0,0 +1,7 @@
+EESchema-DOCLIB Version 2.0
+#
+$CMP SCR
+D Thyristor
+$ENDCMP
+#
+#End Doc Library
diff --git a/kicadSchematicLibrary/eSim_Subckt.lib b/kicadSchematicLibrary/eSim_Subckt.lib
new file mode 100644
index 00000000..dab9e680
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_Subckt.lib
@@ -0,0 +1,69 @@
+EESchema-LIBRARY Version 2.3
+#encoding utf-8
+#
+# SCR
+#
+DEF SCR X 0 10 Y N 1 F N
+F0 "X" 150 200 50 H V C CNN
+F1 "SCR" 150 -350 50 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+P 2 0 0 0 -200 -150 200 -150 N
+P 2 0 1 0 0 -150 -200 -400 N
+P 3 0 1 0 -150 100 150 100 0 -150 F
+X A 1 0 400 300 D 60 60 1 1 I
+X K 2 0 -550 400 U 60 70 1 1 I
+X G 3 -350 -400 150 R 60 60 1 1 I
+ENDDRAW
+ENDDEF
+#
+# UA741
+#
+DEF UA741 X 0 40 Y Y 1 F N
+F0 "X" 150 0 60 H V C CNN
+F1 "UA741" 250 -150 60 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+P 4 0 1 0 0 150 0 -150 350 0 0 150 N
+X + 1 -200 100 200 R 50 50 1 1 I
+X - 2 -200 -100 200 R 50 50 1 1 I
+X ~ 3 550 0 200 L 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+# full_adder
+#
+DEF full_adder X 0 40 Y Y 1 F N
+F0 "X" 1400 700 60 H V C CNN
+F1 "full_adder" 1400 600 60 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+S 800 1150 1950 0 0 1 0 N
+X IN1 1 600 950 200 R 50 50 1 1 I
+X IN2 2 600 550 200 R 50 50 1 1 I
+X CIN 3 600 150 200 R 50 50 1 1 I
+X SUM 4 2150 950 200 L 50 50 1 1 O
+X COUT 5 2150 150 200 L 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+# half_adder
+#
+DEF half_adder X 0 40 Y Y 1 F N
+F0 "X" 900 500 60 H V C CNN
+F1 "half_adder" 900 400 60 H V C CNN
+F2 "" 0 0 60 H V C CNN
+F3 "" 0 0 60 H V C CNN
+DRAW
+S 500 800 1250 0 0 1 0 N
+X IN1 1 300 700 200 R 50 50 1 1 I
+X IN2 2 300 100 200 R 50 50 1 1 I
+X SUM 3 1450 700 200 L 50 50 1 1 O
+X COUT 4 1450 100 200 L 50 50 1 1 O
+ENDDRAW
+ENDDEF
+#
+#End Library
diff --git a/kicadSchematicLibrary/eSim_User.dcm b/kicadSchematicLibrary/eSim_User.dcm
new file mode 100644
index 00000000..5f3ed79b
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_User.dcm
@@ -0,0 +1,3 @@
+EESchema-DOCLIB Version 2.0
+#
+#End Doc Library
diff --git a/kicadSchematicLibrary/eSim_User.lib b/kicadSchematicLibrary/eSim_User.lib
new file mode 100644
index 00000000..2063b3ae
--- /dev/null
+++ b/kicadSchematicLibrary/eSim_User.lib
@@ -0,0 +1,4 @@
+EESchema-LIBRARY Version 2.3
+#encoding utf-8
+#
+#End Library
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 06be27ff..7ee98aa8 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -99,6 +99,7 @@ class Application(QtGui.QMainWindow):
self.logopic = QtGui.QPixmap(os.path.join(os.path.abspath('../..'),'images','fosseeLogo.png'))
self.logopic = self.logopic.scaled(QSize(150,150),QtCore.Qt.KeepAspectRatio)
self.logo.setPixmap(self.logopic)
+ self.logo.setStyleSheet("padding:0 15px 0 0;")
self.topToolbar.addWidget(self.logo)
#Left Tool bar Action Widget
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
index 2dcb4f89..f2ad973f 100644
--- a/src/ngspiceSimulation/NgspiceWidget.py
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -18,7 +18,7 @@ class NgspiceWidget(QtGui.QWidget):
if platform.system() == 'Linux':
self.command = "cd "+projPath+";ngspice "+command
#Creating argument for process
- self.args = ['-geometry','200x200','-into', str(self.terminal.winId()),'-hold','-e', self.command]
+ self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command]
self.process.start('xterm', self.args)
elif platform.system() == 'Windows':
diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py
index 1ae7bef4..7d37623d 100644
--- a/src/ngspiceSimulation/pythonPlotting.py
+++ b/src/ngspiceSimulation/pythonPlotting.py
@@ -87,11 +87,19 @@ class plotWindow(QtGui.QMainWindow):
self.chkbox[i].setStyleSheet('color')
self.chkbox[i].setToolTip('<b>Check To Plot</b>' )
self.top_grid.addWidget(self.chkbox[i],i+2,0)
+ self.colorLab = QtGui.QLabel()
+ self.colorLab.setText('____')
+ self.colorLab.setStyleSheet(self.colorName(self.color[i])+'; font-weight = bold;')
+ self.top_grid.addWidget(self.colorLab,i+2,1)
for i in range(self.a[1],self.a[0]-1):#a[0]-1
self.chkbox.append(QtGui.QCheckBox(self.obj_dataext.NBList[i]))
self.chkbox[i].setToolTip('<b>Check To Plot</b>' )
self.top_grid.addWidget(self.chkbox[i],i+3,0)
+ self.colorLab = QtGui.QLabel()
+ self.colorLab.setText('____')
+ self.colorLab.setStyleSheet(self.colorName(self.color[i])+'; font-weight = bold;')
+ self.top_grid.addWidget(self.colorLab,i+3,1)
self.clear = QtGui.QPushButton("Clear")
self.warnning = QtGui.QLabel()
@@ -375,9 +383,17 @@ class plotWindow(QtGui.QMainWindow):
if boxCheck == 0:
QtGui.QMessageBox.about(self,"Warning!!", "Please select atleast one Node OR Branch")
self.canvas.draw()
-
-
+ def colorName(self,letter):
+ return {
+ 'r':'color:red',
+ 'b':'color:blue',
+ 'g':'color:green',
+ 'y':'color:yellow',
+ 'c':'color:cyan',
+ 'm':'color:magenta',
+ 'k':'color:black'
+ }[letter]
class DataExtraction:
@@ -414,7 +430,7 @@ class DataExtraction:
#Finding totla number of voltage node
for i in self.voltData[3:]:
#it has possible names of voltage nodes in NgSpice
- if "V(" in i or "x1" in i or "u3" in i:
+ if "Index" in i:#"V(" in i or "x1" in i or "u3" in i:
vnumber+=1
#print "Voltage Number :",vnumber
@@ -536,7 +552,7 @@ class DataExtraction:
self.NBList.append(l)
self.NBList=self.NBList[2:]
len_NBList = len(self.NBList)
- #print "NBLIST",self.NBList
+ print "NBLIST",self.NBList
ivals=[]
inum = len(allv[5].split("\t"))