diff options
Diffstat (limited to 'src/subcircuit')
-rw-r--r-- | src/subcircuit/Subcircuit.py | 11 | ||||
-rw-r--r-- | src/subcircuit/convertSub.py | 8 | ||||
-rw-r--r-- | src/subcircuit/newSub.py | 5 | ||||
-rw-r--r-- | src/subcircuit/openSub.py | 6 |
4 files changed, 22 insertions, 8 deletions
diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py index d2e7ec5a..9f161b97 100644 --- a/src/subcircuit/Subcircuit.py +++ b/src/subcircuit/Subcircuit.py @@ -4,6 +4,7 @@ from projManagement.Validation import Validation from subcircuit.newSub import NewSub from subcircuit.openSub import openSub from subcircuit.convertSub import convertSub +from subcircuit.uploadSub import UploadSub # This class creates Subcircuit GUI. @@ -41,11 +42,17 @@ class Subcircuit(QtGui.QWidget): '<b>To convert Subcircuit Kicad Netlist to Ngspice Netlist</b>') self.convertbtn.setFixedSize(200, 40) self.convertbtn.clicked.connect(self.convertsch) + self.uploadbtn = QtGui.QPushButton('Upload a Subcircuit') + self.uploadbtn.setToolTip( + '<b>To Upload a subcircuit</b>') + self.uploadbtn.setFixedSize(180, 38) + self.uploadbtn.clicked.connect(self.uploadSub) self.hbox = QtGui.QHBoxLayout() self.hbox.addWidget(self.newbtn) self.hbox.addWidget(self.editbtn) self.hbox.addWidget(self.convertbtn) + self.hbox.addWidget(self.uploadbtn) self.hbox.addStretch(1) self.vbox = QtGui.QVBoxLayout() @@ -73,3 +80,7 @@ class Subcircuit(QtGui.QWidget): def convertsch(self): self.obj_convertsubcircuit = convertSub(self.obj_dockarea) self.obj_convertsubcircuit.createSub() + + def uploadSub(self): + self.obj_uploadsubcircuit = UploadSub() + self.obj_uploadsubcircuit.upload() diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py index 49f5a54f..3e32f9b2 100644 --- a/src/subcircuit/convertSub.py +++ b/src/subcircuit/convertSub.py @@ -44,12 +44,12 @@ class convertSub(QtGui.QWidget): else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( - 'The subcircuit does not contain any Kicad netlist\ - file for conversion.') + 'The subcircuit does not contain any Kicad netlist file' + + 'for conversion.') self.msg.setWindowTitle("Error Message") else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( - 'Please select the subcircuit first. You can either create \ - new subcircuit or open existing subcircuit') + 'Please select the subcircuit first. You can either create' + + 'new subcircuit or open existing subcircuit') self.msg.setWindowTitle("Error Message") diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index 678b023d..b44e71ca 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -8,7 +8,10 @@ import os # This class is called when User create new Project. class NewSub(QtGui.QWidget): """ - Contains functions to create directory and validate file names. + Contains funstions to check : + - Name of project should not be blank. + - Name should not contain space between them. + - Name does not match with existing project. """ def __init__(self): diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index bebd28a1..dd6e31ac 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -21,9 +21,9 @@ class openSub(QtGui.QWidget): None, "Open File", "../SubcircuitLibrary")) if self.editfile: self.obj_Appconfig = Appconfig() - self.obj_Appconfig.current_subcircuit['SubcircuitName'] = ( - self.editfile - ) + self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ + = self.editfile + self.schname = os.path.basename(self.editfile) self.editfile = os.path.join(self.editfile, self.schname) self.cmd = "eeschema " + self.editfile + ".sch " |