diff options
Diffstat (limited to 'src/frontEnd')
-rw-r--r-- | src/frontEnd/Application.py | 18 | ||||
-rw-r--r-- | src/frontEnd/TerminalUi.py | 16 |
2 files changed, 20 insertions, 14 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index b45509a7..140fd5f5 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -83,8 +83,6 @@ class Application(QtWidgets.QMainWindow): self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) - self.isFileChanged = False - def initToolBar(self): """ This function initializes Tool Bars. @@ -553,6 +551,14 @@ class Application(QtWidgets.QMainWindow): return False def checkChangeInPlotFile(self, currTime, exitStatus): + """Checks whether there is a change in the analysis files(To see if simulation was successful) + and displays the plotter where graphs can be plotted. + + :param currTime: The time stamp of the analysis file before simulation starts + :type currTime: float + :param exitStatus: The exit status of the ngspice QProcess + :type exitStatus: class:`QtCore.QProcess.ExitStatus` + """ self.enableButtons(True) if exitStatus == QtCore.QProcess.NormalExit: try: @@ -576,9 +582,7 @@ class Application(QtWidgets.QMainWindow): # return st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) - self.simulationCompleted = True if st.st_mtime >= currTime: - self.isFileChanged = True try: self.obj_Mainview.obj_dockarea.plottingEditor() @@ -604,14 +608,9 @@ class Application(QtWidgets.QMainWindow): self.closeproj.setEnabled(state) self.wrkspce.setEnabled(state) - def isSimulationSuccess(self): - return self.isFileChanged - def open_ngspice(self): """This Function execute ngspice on current project.""" self.projDir = self.obj_appconfig.current_project["ProjectName"] - self.isFileChanged = False - self.simulationCompleted = False simulationEssentials = { "enableButtons": self.enableButtons, @@ -619,7 +618,6 @@ class Application(QtWidgets.QMainWindow): } if self.projDir is not None: - self.currTime = time.time() # Edited by Sumanto Kar 25/08/2021 if self.obj_Mainview.obj_dockarea.ngspiceEditor( diff --git a/src/frontEnd/TerminalUi.py b/src/frontEnd/TerminalUi.py index 4d6e6d23..ecf93ee2 100644 --- a/src/frontEnd/TerminalUi.py +++ b/src/frontEnd/TerminalUi.py @@ -95,6 +95,12 @@ class Ui_Form(object): self.redo_simulation_button.clicked.connect(self.redoSimulation) def writeSimulationStatusToConsole(self, isSuccess): + """Writes simulation status to the console with appropriate style + to the :class:`Form_Ui` console. + + :param isSuccess: A boolean flag used to indicate whether the simulation was a success or not + :type isSuccess: bool + """ failedFormat = '<span style="color:#ff3333;">{}</span>' successFormat = '<span style="color:#00ff00;">{}</span>' @@ -103,12 +109,10 @@ class Ui_Form(object): self.simulationConsole.append(successFormat.format("Simulation Completed Successfully!")) else: self.simulationConsole.append(failedFormat.format("Simulation Failed!")) - - def showProgressCompleted(self): - self.progressBar.setMaximum(100) - self.progressBar.setProperty("value", 100) def cancelSimulation(self): + """This function cancels the ongoing ngspice simulation. + """ if (self.qProcess.state() == QtCore.QProcess.NotRunning): return cancelFormat = '<span style="color:#3385ff;">{}</span>' @@ -124,6 +128,8 @@ class Ui_Form(object): ) def redoSimulation(self): + """This function reruns the ngspice simulation + """ if (self.qProcess.state() == QtCore.QProcess.Running): return @@ -135,6 +141,8 @@ class Ui_Form(object): self.qProcess.start('ngspice', self.args) def changeColor(self): + """Toggles the :class:`Ui_Form` console between dark mode and light mode + """ if self.dark_color is True: self.simulationConsole.setStyleSheet("QTextEdit {\n" " background-color: white;\n" |