diff options
author | rahulp13 | 2023-06-11 16:22:29 +0530 |
---|---|---|
committer | rahulp13 | 2023-06-11 16:22:29 +0530 |
commit | 4eea06f6fcd654c7f0919f395ff42fabbafa0171 (patch) | |
tree | afc4cf7c8d461576f03393445f3741eecfa650ee /src/frontEnd/TerminalUi.py | |
parent | c99a4951df139de96e80a51805a3b4d677336653 (diff) | |
download | eSim-4eea06f6fcd654c7f0919f395ff42fabbafa0171.tar.gz eSim-4eea06f6fcd654c7f0919f395ff42fabbafa0171.tar.bz2 eSim-4eea06f6fcd654c7f0919f395ff42fabbafa0171.zip |
fixed multiple signal issue with cancel sim.
Diffstat (limited to 'src/frontEnd/TerminalUi.py')
-rw-r--r-- | src/frontEnd/TerminalUi.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/frontEnd/TerminalUi.py b/src/frontEnd/TerminalUi.py index 2c5a7c02..4c53548f 100644 --- a/src/frontEnd/TerminalUi.py +++ b/src/frontEnd/TerminalUi.py @@ -65,34 +65,39 @@ class TerminalUi(QtWidgets.QMainWindow): self.cancelSimulationButton.clicked.connect(self.cancelSimulation) self.redoSimulationButton.clicked.connect(self.redoSimulation) + self.simulationCancelled = False self.show() def cancelSimulation(self): """This function cancels the ongoing ngspice simulation. """ + self.cancelSimulationButton.setEnabled(False) + self.redoSimulationButton.setEnabled(True) + if (self.qProcess.state() == QtCore.QProcess.NotRunning): return - cancelFormat = '<span style="color:#FF8624; font-size:26px;">{}</span>' + self.simulationCancelled = True self.qProcess.kill() # To show progressBar completed self.progressBar.setMaximum(100) self.progressBar.setProperty("value", 100) + cancelFormat = '<span style="color:#FF8624; font-size:26px;">{}</span>' self.simulationConsole.append( cancelFormat.format("Simulation Cancelled!")) self.simulationConsole.verticalScrollBar().setValue( self.simulationConsole.verticalScrollBar().maximum() ) - self.cancelSimulationButton.setEnabled(False) - self.redoSimulationButton.setEnabled(True) - def redoSimulation(self): """This function reruns the ngspice simulation """ - if (self.qProcess.state() == QtCore.QProcess.Running): + self.cancelSimulationButton.setEnabled(True) + self.redoSimulationButton.setEnabled(False) + + if (self.qProcess.state() != QtCore.QProcess.NotRunning): return # To make the progressbar running @@ -100,10 +105,9 @@ class TerminalUi(QtWidgets.QMainWindow): self.progressBar.setProperty("value", -1) self.simulationConsole.setText("") - self.qProcess.start('ngspice', self.args) + self.simulationCancelled = False - self.cancelSimulationButton.setEnabled(True) - self.redoSimulationButton.setEnabled(False) + self.qProcess.start('ngspice', self.args) def changeColor(self): """Toggles the :class:`Ui_Form` console between dark mode |