diff options
author | fahim | 2015-05-15 12:06:14 +0530 |
---|---|---|
committer | fahim | 2015-05-15 12:06:14 +0530 |
commit | 657794c3c482f8b8d8964a0b81d5d5c1e43ee346 (patch) | |
tree | 76e8df7c6edd0d46c3fd42d24fc2321ed780e4d4 /src/projManagement | |
parent | 9469147242465102059e0703b9532e17d63983bc (diff) | |
download | eSim-657794c3c482f8b8d8964a0b81d5d5c1e43ee346.tar.gz eSim-657794c3c482f8b8d8964a0b81d5d5c1e43ee346.tar.bz2 eSim-657794c3c482f8b8d8964a0b81d5d5c1e43ee346.zip |
Subject: Updated openNgspice function
Description: updated openNgspice function. Added return value which will
be used to call python plotting function
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Kicad.py | 35 | ||||
-rw-r--r-- | src/projManagement/Kicad.pyc | bin | 5358 -> 5337 bytes |
2 files changed, 15 insertions, 20 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index dd7fdf1a..aa4ba8eb 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -20,9 +20,10 @@ import os import Validation from configuration.Appconfig import Appconfig import Worker -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore import shutil from gevent.hub import sleep +import subprocess class Kicad: """ @@ -143,29 +144,23 @@ class Kicad: if self.obj_validation.validateKicad(self.projDir): self.projName = os.path.basename(self.projDir) self.project = os.path.join(self.projDir,self.projName) - print "Validated" #Creating ngspice command self.cmd = "xterm -e ngspice "+self.project+".cir.out" - self.obj_workThread = Worker.WorkerThread(self.cmd) - self.obj_workThread.start() - while 1: - if self.obj_workThread.isFinished(): - print "Finished" - sleep(1) - #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") - break - else: - pass - print "After While Loop" - + proc = subprocess.Popen(self.cmd.split()) + proc.communicate()[0] + + #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") + + 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") -
\ 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 Binary files differindex 3c0772e0..f805c100 100644 --- a/src/projManagement/Kicad.pyc +++ b/src/projManagement/Kicad.pyc |