summaryrefslogtreecommitdiff
path: root/src/progressBar/progressBar.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/progressBar/progressBar.py')
-rw-r--r--src/progressBar/progressBar.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/progressBar/progressBar.py b/src/progressBar/progressBar.py
index bf60a64b..be705ce1 100644
--- a/src/progressBar/progressBar.py
+++ b/src/progressBar/progressBar.py
@@ -12,6 +12,10 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
+ def __init__(self, qProcess, qTimer):
+ self.qProcess = qProcess
+ self.qTimer = qTimer
+ # super().__init__()
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(1244, 644)
@@ -90,6 +94,8 @@ class Ui_Form(object):
self.light_dark_mode_button.setIcon(QtGui.QIcon("icons/light_mode.png"))
self.light_dark_mode_button.clicked.connect(self.changeColor)
+ self.cancel_simulation_button.clicked.connect(self.cancelSimulation)
+
def writeIntoConsole(self, consoleLog):
self.simulationConsole.insertPlainText(consoleLog)
@@ -97,6 +103,11 @@ class Ui_Form(object):
self.progressBar.setMaximum(100)
self.progressBar.setProperty("value", 100)
+ def cancelSimulation(self):
+ self.qTimer.stop()
+ self.qProcess.kill()
+ self.showProgressCompleted()
+
def changeColor(self):
if self.dark_color is True:
self.simulationConsole.setStyleSheet("QTextEdit {\n"