From 07e43f9abbf5e369543f090ccf89f565038241cb Mon Sep 17 00:00:00 2001 From: fahim Date: Mon, 18 May 2015 14:43:03 +0530 Subject: Subject: Make changes in openNgSpice function Description:Make changes in openNgSpice function --- src/frontEnd/Application.py | 5 +++-- src/projManagement/Kicad.py | 25 +++++++++++++++++-------- src/projManagement/Kicad.pyc | Bin 5337 -> 5551 bytes 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 7dee39a7..e15c71b1 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -134,7 +134,7 @@ class Application(QtGui.QMainWindow): directory, filelist =self.project.createProject(self.projname) self.obj_Mainview.obj_projectExplorer.addTreeNode(directory, filelist) - #self.setCentralWidget(self.obj_Mainview.obj_projectExplorer) + else: print "No project created" @@ -163,7 +163,8 @@ class Application(QtGui.QMainWindow): self.obj_Mainview.obj_dockarea.plottingEditor() else: - print "Return False" + print "Unable to open NgSpice" + def exit_project(self): diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index aa4ba8eb..a1873555 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -148,19 +148,28 @@ class Kicad: self.cmd = "xterm -e ngspice "+self.project+".cir.out" proc = subprocess.Popen(self.cmd.split()) - proc.communicate()[0] + self.obj_appconfig.procThread_list.append(proc) - #Moving plot_data_i.txt and plot_data_v.txt to project directory - shutil.copy2("plot_data_i.txt", self.projDir) - shutil.copy2("plot_data_v.txt", self.projDir) - #Deleting this file from current directory - os.remove("plot_data_i.txt") - os.remove("plot_data_v.txt") + sleep(2) #Need permanent solution + try: + #Moving plot_data_i.txt and plot_data_v.txt to project directory + shutil.copy2("plot_data_i.txt", self.projDir) + shutil.copy2("plot_data_v.txt", self.projDir) + #Deleting this file from current directory + os.remove("plot_data_i.txt") + os.remove("plot_data_v.txt") + except Exception as e: + self.msg = QtGui.QErrorMessage(None) + self.msg.showMessage('Unable to copy plot data file to project directory.') + print "Exception:",str(e) + self.msg.setWindowTitle("Error Message") + return False + return True else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage('Please select the project first. You can either create new project or open existing project') self.msg.setWindowTitle("Error Message") - return False \ No newline at end of file + #return False \ No newline at end of file diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc index f805c100..bf6ccb75 100644 Binary files a/src/projManagement/Kicad.pyc and b/src/projManagement/Kicad.pyc differ -- cgit