summaryrefslogtreecommitdiff
path: root/src/subcircuit
diff options
context:
space:
mode:
authoranjalijaiswal082019-06-21 16:15:02 +0530
committeranjalijaiswal082019-06-26 02:49:20 +0530
commit71851a2df657bd166d6ee81eb00dae0fda2ef3a4 (patch)
treeb2ba852d1f3132e54be25029ae708b8e4404ad16 /src/subcircuit
parentb9957bac0e86410007b0b728e58edeca5aa52d85 (diff)
downloadeSim-71851a2df657bd166d6ee81eb00dae0fda2ef3a4.tar.gz
eSim-71851a2df657bd166d6ee81eb00dae0fda2ef3a4.tar.bz2
eSim-71851a2df657bd166d6ee81eb00dae0fda2ef3a4.zip
Issue #82 solved: Renaming project added
Diffstat (limited to 'src/subcircuit')
-rw-r--r--src/subcircuit/Subcircuit.py11
-rw-r--r--src/subcircuit/convertSub.py8
-rw-r--r--src/subcircuit/newSub.py5
-rw-r--r--src/subcircuit/openSub.py6
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 "