summaryrefslogtreecommitdiff
path: root/src/subcircuit/Subcircuit.py
diff options
context:
space:
mode:
authorTanay Mathur2015-06-23 11:50:52 +0530
committerTanay Mathur2015-06-23 11:50:52 +0530
commit39fecda9f1be8b1007552437d53c06bdc02f4b47 (patch)
tree3f4bffd09e28240509a215a4b00b3f8b4dda712a /src/subcircuit/Subcircuit.py
parentf47a744451fe634efb487023f073321ceed4664c (diff)
downloadeSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.tar.gz
eSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.tar.bz2
eSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.zip
Added subcircuit functionality
Diffstat (limited to 'src/subcircuit/Subcircuit.py')
-rw-r--r--src/subcircuit/Subcircuit.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py
new file mode 100644
index 00000000..94ca37e4
--- /dev/null
+++ b/src/subcircuit/Subcircuit.py
@@ -0,0 +1,62 @@
+from PyQt4 import QtCore, QtGui
+from configuration.Appconfig import Appconfig
+from projManagement.Validation import Validation
+from subcircuit.newSub import NewSub
+from subcircuit.openSub import openSub
+from subcircuit.convertSub import convertSub
+
+class Subcircuit(QtGui.QWidget):
+ """
+ This class creates Subcircuit GUI.
+ """
+ def __init__(self,parent=None):
+ super(Subcircuit, self).__init__()
+ QtGui.QWidget.__init__(self)
+ self.obj_appconfig=Appconfig()
+ self.obj_validation=Validation()
+
+ self.layout = QtGui.QVBoxLayout()
+ self.splitter= QtGui.QSplitter()
+ self.splitter.setOrientation(QtCore.Qt.Vertical)
+
+ self.newbtn = QtGui.QPushButton('New Subcircuit Schematic')
+ self.newbtn.setFixedSize(200,40)
+ self.newbtn.clicked.connect(self.newsch)
+ self.editbtn = QtGui.QPushButton('Edit Subcircuit Schematic')
+ self.editbtn.setFixedSize(200,40)
+ self.editbtn.clicked.connect(self.editsch)
+ self.convertbtn = QtGui.QPushButton('Convert Kicad to Ngspice')
+ self.convertbtn.setFixedSize(200,40)
+ self.convertbtn.clicked.connect(self.convertsch)
+
+ self.hbox = QtGui.QHBoxLayout()
+ self.hbox.addWidget(self.newbtn)
+ self.hbox.addWidget(self.editbtn)
+ self.hbox.addWidget(self.convertbtn)
+ self.hbox.addStretch(1)
+
+ self.vbox = QtGui.QVBoxLayout()
+ self.vbox.addLayout(self.hbox)
+ self.vbox.addStretch(1)
+
+ self.setLayout(self.vbox)
+ self.show()
+
+ def newsch(self):
+ text,ok = QtGui.QInputDialog.getText(self, 'New Schematic','Enter Schematic Name:')
+ if ok:
+ self.schematic_name = (str(text))
+ self.subcircuit = NewSub()
+ self.subcircuit.createSubcircuit(self.schematic_name)
+
+ else:
+ print "No subcircuit created"
+
+
+ def editsch(self):
+ self.obj_opensubcircuit = openSub()
+ self.obj_opensubcircuit.body()
+
+ def convertsch(self):
+ self.obj_convertsubcircuit = convertSub()
+ self.obj_convertsubcircuit.createSub() \ No newline at end of file