diff options
author | rahulp13 | 2023-06-07 16:20:33 +0530 |
---|---|---|
committer | rahulp13 | 2023-06-07 16:20:33 +0530 |
commit | abc410aac656e840940b2227f4d94f0780a614be (patch) | |
tree | 0ae18cfdb4e521f7be60d1aeddee793910ed7d6c /src/frontEnd/TerminalUi.py | |
parent | a16cf9dc1c365e8372335fab04d7f6c2114122ca (diff) | |
download | eSim-abc410aac656e840940b2227f4d94f0780a614be.tar.gz eSim-abc410aac656e840940b2227f4d94f0780a614be.tar.bz2 eSim-abc410aac656e840940b2227f4d94f0780a614be.zip |
sync cancel and redo simulation features
Diffstat (limited to 'src/frontEnd/TerminalUi.py')
-rw-r--r-- | src/frontEnd/TerminalUi.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/frontEnd/TerminalUi.py b/src/frontEnd/TerminalUi.py index 902b6f59..2c5a7c02 100644 --- a/src/frontEnd/TerminalUi.py +++ b/src/frontEnd/TerminalUi.py @@ -17,39 +17,42 @@ class TerminalUi(QtWidgets.QMainWindow): """ super(TerminalUi, self).__init__() -# Other variables + # Other variables self.darkColor = True self.qProcess = qProcess self.args = args self.iconDir = "../../images" -# Load the ui file + # Load the ui file uic.loadUi("TerminalUi.ui", self) -# Define Our Widgets + # Define Our Widgets self.progressBar = self.findChild( QtWidgets.QProgressBar, "progressBar" - ) + ) self.simulationConsole = self.findChild( QtWidgets.QTextEdit, "simulationConsole" - ) + ) self.lightDarkModeButton = self.findChild( QtWidgets.QPushButton, "lightDarkModeButton" - ) + ) self.cancelSimulationButton = self.findChild( QtWidgets.QPushButton, "cancelSimulationButton" - ) + ) + self.cancelSimulationButton.setEnabled(True) + self.redoSimulationButton = self.findChild( QtWidgets.QPushButton, "redoSimulationButton" - ) + ) + self.redoSimulationButton.setEnabled(False) -# Add functionalities to Widgets + # Add functionalities to Widgets self.lightDarkModeButton.setIcon( QtGui.QIcon( os.path.join( @@ -62,7 +65,6 @@ class TerminalUi(QtWidgets.QMainWindow): self.cancelSimulationButton.clicked.connect(self.cancelSimulation) self.redoSimulationButton.clicked.connect(self.redoSimulation) -# show app self.show() def cancelSimulation(self): @@ -70,10 +72,11 @@ class TerminalUi(QtWidgets.QMainWindow): """ if (self.qProcess.state() == QtCore.QProcess.NotRunning): return + cancelFormat = '<span style="color:#FF8624; font-size:26px;">{}</span>' self.qProcess.kill() -# To show progressBar completed + # To show progressBar completed self.progressBar.setMaximum(100) self.progressBar.setProperty("value", 100) @@ -83,19 +86,25 @@ class TerminalUi(QtWidgets.QMainWindow): 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): return -# To make the progressbar running + # To make the progressbar running self.progressBar.setMaximum(0) self.progressBar.setProperty("value", -1) self.simulationConsole.setText("") self.qProcess.start('ngspice', self.args) + self.cancelSimulationButton.setEnabled(True) + self.redoSimulationButton.setEnabled(False) + def changeColor(self): """Toggles the :class:`Ui_Form` console between dark mode and light mode |