summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation
diff options
context:
space:
mode:
authorPranav P2023-05-23 17:11:33 +0530
committerPranav P2023-05-23 17:11:33 +0530
commit7b36bfed265309672689cd6ddd04c9a24d115e9c (patch)
treea865782fcc37447fec610a6383c133a48f7d7f41 /src/ngspiceSimulation
parent1c0b9197069c12f2a9b0c35be936e97d38c6a372 (diff)
downloadeSim-7b36bfed265309672689cd6ddd04c9a24d115e9c.tar.gz
eSim-7b36bfed265309672689cd6ddd04c9a24d115e9c.tar.bz2
eSim-7b36bfed265309672689cd6ddd04c9a24d115e9c.zip
Changed the polling approach to check ngspice simulation completion
Diffstat (limited to 'src/ngspiceSimulation')
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
index cbcd381b..13a5ece9 100644
--- a/src/ngspiceSimulation/NgspiceWidget.py
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -20,7 +20,7 @@ class NgspiceWidget(QtWidgets.QWidget):
self.process = QtCore.QProcess(self)
self.terminal = QtWidgets.QWidget(self)
self.simulationEssentials = simulationEssentials
- self.qTimer = simulationEssentials['timer']
+ self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile']
self.progressBarUi = progressBar.Ui_Form(self.process, self.simulationEssentials)
self.progressBarUi.setupUi(self.terminal)
self.layout = QtWidgets.QVBoxLayout(self)
@@ -50,6 +50,7 @@ class NgspiceWidget(QtWidgets.QWidget):
# ";ngspice -r " + command.replace(".cir.out", ".raw") + \
# " " + command
# Creating argument for process
+ self.currTime = time.time()
self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command]
self.process.setWorkingDirectory(projPath)
self.progressBarUi.setNgspiceArgs(self.args)
@@ -68,14 +69,16 @@ class NgspiceWidget(QtWidgets.QWidget):
self.gawProcess.start('sh', ['-c', self.gawCommand])
print(self.gawCommand)
- def finishSimulation(self):
+ def finishSimulation(self, exitCode, exitStatus):
+ if exitStatus == QtCore.QProcess.NormalExit:
+ self.checkChangeInPlotFile(self.currTime)
self.readyToPrintSimulationStatus = True
self.enableButtons = self.simulationEssentials['enableButtons']
self.enableButtons(True)
self.progressBarUi.showProgressCompleted()
- self.qTimer.timeout.connect(self.writeSimulationStatus)
+ self.writeSimulationStatus()
def writeSimulationStatus(self):
if self.readyToPrintSimulationStatus is False: