summaryrefslogtreecommitdiff
path: root/src/frontEnd/TerminalUi.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontEnd/TerminalUi.py')
-rw-r--r--src/frontEnd/TerminalUi.py20
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