summaryrefslogtreecommitdiff
path: root/src/progressBar
diff options
context:
space:
mode:
authorPranav P2023-05-04 09:36:47 +0530
committerPranav P2023-05-04 09:36:47 +0530
commit7ba6e484b01ee1e0f38a2b68c4abc8aed391b153 (patch)
tree072a85d2acfbc1f77a2166cecbb684d3fad4af40 /src/progressBar
parentc138ec3aebe4dc894600e0eabccf1659f2b5a838 (diff)
downloadeSim-7ba6e484b01ee1e0f38a2b68c4abc8aed391b153.tar.gz
eSim-7ba6e484b01ee1e0f38a2b68c4abc8aed391b153.tar.bz2
eSim-7ba6e484b01ee1e0f38a2b68c4abc8aed391b153.zip
Enabled cancel simulation button
Diffstat (limited to 'src/progressBar')
-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"