From f87ebcf83c4a2a614e79b10039021cc5a0d56889 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Fri, 7 Apr 2023 20:20:33 +0530 Subject: Added progress bar, QtTimer and removed the plots --- src/ngspiceSimulation/NgspiceWidget.py | 40 ++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 8c63a22a..651b421d 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,7 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from configparser import ConfigParser +from progressBar import progressBar import os @@ -19,6 +20,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminal = QtWidgets.QWidget(self) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) + self.errorFlag = False print("Argument to ngspice command : ", command) @@ -39,12 +41,16 @@ class NgspiceWidget(QtWidgets.QWidget): os.chdir(tempdir) else: # For Linux OS - self.command = "cd " + projPath + \ - ";ngspice -r " + command.replace(".cir.out", ".raw") + \ - " " + command + # self.command = "cd " + projPath + \ + # ";ngspice -r " + command.replace(".cir.out", ".raw") + \ + # " " + command # Creating argument for process - self.args = ['-hold', '-e', self.command] - self.process.start('xterm', self.args) + self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] + self.process.setWorkingDirectory(projPath) + self.launchProgressBar() + self.process.start('ngspice', self.args) + self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) + self.process.finished.connect(self.progressBarUi.showProgressCompleted) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) ( @@ -52,7 +58,23 @@ class NgspiceWidget(QtWidgets.QWidget): [self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) ) - self.process = QtCore.QProcess(self) - self.command = "gaw " + command.replace(".cir.out", ".raw") - self.process.start('sh', ['-c', self.command]) - print(self.command) + self.gawProcess = QtCore.QProcess(self) + self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") + self.gawProcess.start('sh', ['-c', self.gawCommand]) + print(self.gawCommand) + + @QtCore.pyqtSlot() + def readyReadAll(self): + self.progressBarUi.writeIntoConsole( + str(self.process.readAllStandardOutput().data(), encoding='utf-8') + ) + stderror = self.process.readAllStandardError() + if stderror.toUpper().contains(b"ERROR"): + self.errorFlag = True + self.progressBarUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) + + def launchProgressBar(self): + self.progressBar = QtWidgets.QWidget() + self.progressBarUi = progressBar.Ui_Dialog() + self.progressBarUi.setupUi(self.progressBar) + self.progressBar.show() -- cgit From 70b7b1968d05b1bb772be7029ca9fa460c105ed7 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Sat, 15 Apr 2023 00:36:49 +0530 Subject: Added new progressBar to dockarea --- src/ngspiceSimulation/NgspiceWidget.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 651b421d..090e681e 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -18,6 +18,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) + self.progressBarUi = progressBar.Ui_Simulation() + self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) self.errorFlag = False @@ -47,7 +49,6 @@ class NgspiceWidget(QtWidgets.QWidget): # Creating argument for process self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.process.setWorkingDirectory(projPath) - self.launchProgressBar() self.process.start('ngspice', self.args) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) self.process.finished.connect(self.progressBarUi.showProgressCompleted) @@ -73,8 +74,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.errorFlag = True self.progressBarUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) - def launchProgressBar(self): - self.progressBar = QtWidgets.QWidget() - self.progressBarUi = progressBar.Ui_Dialog() - self.progressBarUi.setupUi(self.progressBar) - self.progressBar.show() + # def launchProgressBar(self): + # self.progressBar = QtWidgets.QWidget() + # self.progressBarUi = progressBar.Ui_Dialog() + # self.progressBarUi.setupUi(self.progressBar) + # self.progressBar.show() -- cgit From c138ec3aebe4dc894600e0eabccf1659f2b5a838 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 3 May 2023 13:35:10 +0530 Subject: Changed ngspice simulation progressbar design --- src/ngspiceSimulation/NgspiceWidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 090e681e..69654933 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -18,7 +18,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) - self.progressBarUi = progressBar.Ui_Simulation() + self.progressBarUi = progressBar.Ui_Form() self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) -- cgit From 7ba6e484b01ee1e0f38a2b68c4abc8aed391b153 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 4 May 2023 09:36:47 +0530 Subject: Enabled cancel simulation button --- src/ngspiceSimulation/NgspiceWidget.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 69654933..f87ab96e 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -8,7 +8,7 @@ import os # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, projPath): + def __init__(self, command, projPath, timer): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -18,7 +18,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) - self.progressBarUi = progressBar.Ui_Form() + self.qTimer = timer + self.progressBarUi = progressBar.Ui_Form(self.process, self.qTimer) self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) -- cgit From cf6bb2edf063ba6d3415434899e8a73a42755aa0 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 4 May 2023 19:26:04 +0530 Subject: Disabled multiple simulations --- src/ngspiceSimulation/NgspiceWidget.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index f87ab96e..9909dd07 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -8,7 +8,7 @@ import os # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, projPath, timer): + def __init__(self, command, projPath, simulationEssentials): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -18,8 +18,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) - self.qTimer = timer - self.progressBarUi = progressBar.Ui_Form(self.process, self.qTimer) + self.simulationEssentials = simulationEssentials + self.progressBarUi = progressBar.Ui_Form(self.process, self.simulationEssentials) self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) @@ -52,7 +52,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.process.setWorkingDirectory(projPath) self.process.start('ngspice', self.args) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) - self.process.finished.connect(self.progressBarUi.showProgressCompleted) + self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) ( @@ -65,6 +65,12 @@ class NgspiceWidget(QtWidgets.QWidget): self.gawProcess.start('sh', ['-c', self.gawCommand]) print(self.gawCommand) + def finishSimulation(self): + self.enableButtons = self.simulationEssentials['enableButtons'] + + self.enableButtons(True) + self.progressBarUi.showProgressCompleted() + @QtCore.pyqtSlot() def readyReadAll(self): self.progressBarUi.writeIntoConsole( -- cgit From 2de5fa0604c35a1508bca8bab318724da823633a Mon Sep 17 00:00:00 2001 From: Pranav P Date: Sun, 7 May 2023 17:01:26 +0530 Subject: Mentions whether simulation successful or not --- src/ngspiceSimulation/NgspiceWidget.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 9909dd07..f7c88ba9 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -3,6 +3,7 @@ from configuration.Appconfig import Appconfig from configparser import ConfigParser from progressBar import progressBar import os +import time # This Class creates NgSpice Window @@ -19,6 +20,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) self.simulationEssentials = simulationEssentials + self.qTimer = simulationEssentials['timer'] self.progressBarUi = progressBar.Ui_Form(self.process, self.simulationEssentials) self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) @@ -71,6 +73,19 @@ class NgspiceWidget(QtWidgets.QWidget): self.enableButtons(True) self.progressBarUi.showProgressCompleted() + self.qTimer.timeout.connect(self.writeSimulationStatus) + + def writeSimulationStatus(self): + self.isSimulationSuccess = self.simulationEssentials['isSimulationSuccess'] + + if self.isSimulationSuccess(): + self.progressBarUi.writeSimulationStatusToConsole(isSuccess=True) + else: + self.progressBarUi.writeSimulationStatusToConsole(isSuccess=False) + + scrollLength = self.progressBarUi.simulationConsole.verticalScrollBar().maximum() + self.progressBarUi.simulationConsole.verticalScrollBar().setValue(scrollLength) + @QtCore.pyqtSlot() def readyReadAll(self): self.progressBarUi.writeIntoConsole( -- cgit From 5ade06b5d3559b1d01dafdfabcb71f169bfd633c Mon Sep 17 00:00:00 2001 From: Pranav P Date: Mon, 15 May 2023 19:53:05 +0530 Subject: Changed simulation status colour and dark mode icon path --- src/ngspiceSimulation/NgspiceWidget.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index f7c88ba9..9a56414b 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -83,8 +83,7 @@ class NgspiceWidget(QtWidgets.QWidget): else: self.progressBarUi.writeSimulationStatusToConsole(isSuccess=False) - scrollLength = self.progressBarUi.simulationConsole.verticalScrollBar().maximum() - self.progressBarUi.simulationConsole.verticalScrollBar().setValue(scrollLength) + self.progressBarUi.scrollConsoleToBottom() @QtCore.pyqtSlot() def readyReadAll(self): -- cgit From 1c0b9197069c12f2a9b0c35be936e97d38c6a372 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Fri, 19 May 2023 11:16:58 +0530 Subject: Added redo simulation button to progressbar window --- src/ngspiceSimulation/NgspiceWidget.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 9a56414b..cbcd381b 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -52,6 +52,7 @@ class NgspiceWidget(QtWidgets.QWidget): # Creating argument for process self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.process.setWorkingDirectory(projPath) + self.progressBarUi.setNgspiceArgs(self.args) self.process.start('ngspice', self.args) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) self.process.finished.connect(self.finishSimulation) @@ -68,6 +69,7 @@ class NgspiceWidget(QtWidgets.QWidget): print(self.gawCommand) def finishSimulation(self): + self.readyToPrintSimulationStatus = True self.enableButtons = self.simulationEssentials['enableButtons'] self.enableButtons(True) @@ -76,6 +78,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.qTimer.timeout.connect(self.writeSimulationStatus) def writeSimulationStatus(self): + if self.readyToPrintSimulationStatus is False: + return self.isSimulationSuccess = self.simulationEssentials['isSimulationSuccess'] if self.isSimulationSuccess(): @@ -84,6 +88,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.progressBarUi.writeSimulationStatusToConsole(isSuccess=False) self.progressBarUi.scrollConsoleToBottom() + self.readyToPrintSimulationStatus = False @QtCore.pyqtSlot() def readyReadAll(self): -- cgit From 7b36bfed265309672689cd6ddd04c9a24d115e9c Mon Sep 17 00:00:00 2001 From: Pranav P Date: Tue, 23 May 2023 17:11:33 +0530 Subject: Changed the polling approach to check ngspice simulation completion --- src/ngspiceSimulation/NgspiceWidget.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index cbcd381b..13a5ece9 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -20,7 +20,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) self.simulationEssentials = simulationEssentials - self.qTimer = simulationEssentials['timer'] + self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] self.progressBarUi = progressBar.Ui_Form(self.process, self.simulationEssentials) self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) @@ -50,6 +50,7 @@ class NgspiceWidget(QtWidgets.QWidget): # ";ngspice -r " + command.replace(".cir.out", ".raw") + \ # " " + command # Creating argument for process + self.currTime = time.time() self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.process.setWorkingDirectory(projPath) self.progressBarUi.setNgspiceArgs(self.args) @@ -68,14 +69,16 @@ class NgspiceWidget(QtWidgets.QWidget): self.gawProcess.start('sh', ['-c', self.gawCommand]) print(self.gawCommand) - def finishSimulation(self): + def finishSimulation(self, exitCode, exitStatus): + if exitStatus == QtCore.QProcess.NormalExit: + self.checkChangeInPlotFile(self.currTime) self.readyToPrintSimulationStatus = True self.enableButtons = self.simulationEssentials['enableButtons'] self.enableButtons(True) self.progressBarUi.showProgressCompleted() - self.qTimer.timeout.connect(self.writeSimulationStatus) + self.writeSimulationStatus() def writeSimulationStatus(self): if self.readyToPrintSimulationStatus is False: -- cgit From 22570451ec4e2a86f489125ca540b7a86d682286 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 24 May 2023 12:14:06 +0530 Subject: Reduced passage of functions between objects via simulationEssentials --- src/ngspiceSimulation/NgspiceWidget.py | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 13a5ece9..928956d5 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -9,7 +9,7 @@ import time # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, projPath, simulationEssentials): + def __init__(self, command, simulationEssentials): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -19,9 +19,10 @@ class NgspiceWidget(QtWidgets.QWidget): self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) - self.simulationEssentials = simulationEssentials + self.projDir = self.obj_appconfig.current_project["ProjectName"] self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] - self.progressBarUi = progressBar.Ui_Form(self.process, self.simulationEssentials) + self.enableButtons = simulationEssentials['enableButtons'] + self.progressBarUi = progressBar.Ui_Form(self.process) self.progressBarUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) @@ -46,15 +47,13 @@ class NgspiceWidget(QtWidgets.QWidget): os.chdir(tempdir) else: # For Linux OS - # self.command = "cd " + projPath + \ - # ";ngspice -r " + command.replace(".cir.out", ".raw") + \ - # " " + command # Creating argument for process self.currTime = time.time() self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] - self.process.setWorkingDirectory(projPath) + self.process.setWorkingDirectory(self.projDir) self.progressBarUi.setNgspiceArgs(self.args) self.process.start('ngspice', self.args) + self.process.started.connect(lambda: self.enableButtons(state=False)) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) @@ -70,22 +69,22 @@ class NgspiceWidget(QtWidgets.QWidget): print(self.gawCommand) def finishSimulation(self, exitCode, exitStatus): - if exitStatus == QtCore.QProcess.NormalExit: - self.checkChangeInPlotFile(self.currTime) + self.checkChangeInPlotFile(self.currTime, exitStatus) self.readyToPrintSimulationStatus = True - self.enableButtons = self.simulationEssentials['enableButtons'] - self.enableButtons(True) self.progressBarUi.showProgressCompleted() self.writeSimulationStatus() + #To set the current time stamp of the generated file so as for re-simulation + self.currTime = time.time() + def writeSimulationStatus(self): if self.readyToPrintSimulationStatus is False: return - self.isSimulationSuccess = self.simulationEssentials['isSimulationSuccess'] - if self.isSimulationSuccess(): + st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) + if st.st_mtime >= self.currTime: self.progressBarUi.writeSimulationStatusToConsole(isSuccess=True) else: self.progressBarUi.writeSimulationStatusToConsole(isSuccess=False) @@ -101,10 +100,4 @@ class NgspiceWidget(QtWidgets.QWidget): stderror = self.process.readAllStandardError() if stderror.toUpper().contains(b"ERROR"): self.errorFlag = True - self.progressBarUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) - - # def launchProgressBar(self): - # self.progressBar = QtWidgets.QWidget() - # self.progressBarUi = progressBar.Ui_Dialog() - # self.progressBarUi.setupUi(self.progressBar) - # self.progressBar.show() + self.progressBarUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) \ No newline at end of file -- cgit From 6ae708e34a0c38ee73acabf3af98deaac62e6cd6 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 24 May 2023 14:23:33 +0530 Subject: Changed the name progressBar to TerminalUi --- src/ngspiceSimulation/NgspiceWidget.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 928956d5..1e6aca6f 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from configparser import ConfigParser -from progressBar import progressBar +from frontEnd import TerminalUi import os import time @@ -22,8 +22,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.projDir = self.obj_appconfig.current_project["ProjectName"] self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] self.enableButtons = simulationEssentials['enableButtons'] - self.progressBarUi = progressBar.Ui_Form(self.process) - self.progressBarUi.setupUi(self.terminal) + self.terminalUi = TerminalUi.Ui_Form(self.process) + self.terminalUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) self.errorFlag = False @@ -51,7 +51,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.currTime = time.time() self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.process.setWorkingDirectory(self.projDir) - self.progressBarUi.setNgspiceArgs(self.args) + self.terminalUi.setNgspiceArgs(self.args) self.process.start('ngspice', self.args) self.process.started.connect(lambda: self.enableButtons(state=False)) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) @@ -72,7 +72,7 @@ class NgspiceWidget(QtWidgets.QWidget): self.checkChangeInPlotFile(self.currTime, exitStatus) self.readyToPrintSimulationStatus = True - self.progressBarUi.showProgressCompleted() + self.terminalUi.showProgressCompleted() self.writeSimulationStatus() @@ -85,19 +85,19 @@ class NgspiceWidget(QtWidgets.QWidget): st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) if st.st_mtime >= self.currTime: - self.progressBarUi.writeSimulationStatusToConsole(isSuccess=True) + self.terminalUi.writeSimulationStatusToConsole(isSuccess=True) else: - self.progressBarUi.writeSimulationStatusToConsole(isSuccess=False) + self.terminalUi.writeSimulationStatusToConsole(isSuccess=False) - self.progressBarUi.scrollConsoleToBottom() + self.terminalUi.scrollConsoleToBottom() self.readyToPrintSimulationStatus = False @QtCore.pyqtSlot() def readyReadAll(self): - self.progressBarUi.writeIntoConsole( + self.terminalUi.writeIntoConsole( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) stderror = self.process.readAllStandardError() if stderror.toUpper().contains(b"ERROR"): self.errorFlag = True - self.progressBarUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) \ No newline at end of file + self.terminalUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) \ No newline at end of file -- cgit From 3fc177d796b0e2591a016b153cd29e8db3364e8d Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 24 May 2023 15:32:21 +0530 Subject: Reduced the number of methods in TerminalUi --- src/ngspiceSimulation/NgspiceWidget.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 1e6aca6f..0c431470 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -22,7 +22,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.projDir = self.obj_appconfig.current_project["ProjectName"] self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] self.enableButtons = simulationEssentials['enableButtons'] - self.terminalUi = TerminalUi.Ui_Form(self.process) + self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] + self.terminalUi = TerminalUi.Ui_Form(self.process, self.args) self.terminalUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) @@ -49,9 +50,7 @@ class NgspiceWidget(QtWidgets.QWidget): else: # For Linux OS # Creating argument for process self.currTime = time.time() - self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.process.setWorkingDirectory(self.projDir) - self.terminalUi.setNgspiceArgs(self.args) self.process.start('ngspice', self.args) self.process.started.connect(lambda: self.enableButtons(state=False)) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) @@ -72,7 +71,9 @@ class NgspiceWidget(QtWidgets.QWidget): self.checkChangeInPlotFile(self.currTime, exitStatus) self.readyToPrintSimulationStatus = True - self.terminalUi.showProgressCompleted() + #To stop progressbar from running after simulation is completed + self.terminalUi.progressBar.setMaximum(100) + self.terminalUi.progressBar.setProperty("value", 100) self.writeSimulationStatus() @@ -89,15 +90,19 @@ class NgspiceWidget(QtWidgets.QWidget): else: self.terminalUi.writeSimulationStatusToConsole(isSuccess=False) - self.terminalUi.scrollConsoleToBottom() + self.terminalUi.simulationConsole.verticalScrollBar().setValue( + self.terminalUi.simulationConsole.verticalScrollBar().maximum() + ) self.readyToPrintSimulationStatus = False @QtCore.pyqtSlot() def readyReadAll(self): - self.terminalUi.writeIntoConsole( + self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) stderror = self.process.readAllStandardError() if stderror.toUpper().contains(b"ERROR"): self.errorFlag = True - self.terminalUi.writeIntoConsole(str(stderror.data(), encoding='utf-8')) \ No newline at end of file + self.terminalUi.simulationConsole.insertPlainText( + str(stderror.data(), encoding='utf-8') + ) \ No newline at end of file -- cgit From 86ddc4e9de1b957df7839be17c80643131dbd9ff Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 24 May 2023 17:34:49 +0530 Subject: Removed an unnecessary errorFlag --- src/ngspiceSimulation/NgspiceWidget.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 0c431470..2c3b00f1 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -27,7 +27,6 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) - self.errorFlag = False print("Argument to ngspice command : ", command) @@ -101,8 +100,6 @@ class NgspiceWidget(QtWidgets.QWidget): str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) stderror = self.process.readAllStandardError() - if stderror.toUpper().contains(b"ERROR"): - self.errorFlag = True self.terminalUi.simulationConsole.insertPlainText( str(stderror.data(), encoding='utf-8') ) \ No newline at end of file -- cgit From 1129cf1035c1ac520d84c04b384f758e090be0c3 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 25 May 2023 14:44:03 +0530 Subject: Added sphinx docstring documentation to newly added functions and removed some unnecessary variables --- src/ngspiceSimulation/NgspiceWidget.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 2c3b00f1..3e6882b5 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -67,6 +67,15 @@ class NgspiceWidget(QtWidgets.QWidget): print(self.gawCommand) def finishSimulation(self, exitCode, exitStatus): + """This function is intended to run when the ngspice simulation finishes. + It singals to the function that generates the plots and also writes in the + appropriate status of the simulation (Whether it was a success or not). + + :param exitCode: The exit code signal of the qprocess that runs ngspice + :type exitCode: int + :param exitStatus: The exit status signal of the qprocess that runs ngspice + :type exitStatus: class:`QtCore.QProcess.ExitStatus` + """ self.checkChangeInPlotFile(self.currTime, exitStatus) self.readyToPrintSimulationStatus = True @@ -80,6 +89,9 @@ class NgspiceWidget(QtWidgets.QWidget): self.currTime = time.time() def writeSimulationStatus(self): + """This function writes status of the simulation (Success or Failure) to the + :class:`TerminalUi.Ui_Form` console. + """ if self.readyToPrintSimulationStatus is False: return @@ -96,6 +108,8 @@ class NgspiceWidget(QtWidgets.QWidget): @QtCore.pyqtSlot() def readyReadAll(self): + """Outputs the ngspice process standard output and standard error to :class:`TerminalUi.Ui_Form` console + """ self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) -- cgit From 111e990dbfce47c53eba5cbe85fc1fbcbe5fe76d Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 25 May 2023 17:32:05 +0530 Subject: Now loads TerminalUi from ui file --- src/ngspiceSimulation/NgspiceWidget.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 3e6882b5..e828493e 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -18,15 +18,15 @@ class NgspiceWidget(QtWidgets.QWidget): QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) - self.terminal = QtWidgets.QWidget(self) + #self.terminal = QtWidgets.QWidget(self) self.projDir = self.obj_appconfig.current_project["ProjectName"] self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] self.enableButtons = simulationEssentials['enableButtons'] self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] - self.terminalUi = TerminalUi.Ui_Form(self.process, self.args) - self.terminalUi.setupUi(self.terminal) + self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) + #self.terminalUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) - self.layout.addWidget(self.terminal) + self.layout.addWidget(self.terminalUi) print("Argument to ngspice command : ", command) @@ -90,7 +90,7 @@ class NgspiceWidget(QtWidgets.QWidget): def writeSimulationStatus(self): """This function writes status of the simulation (Success or Failure) to the - :class:`TerminalUi.Ui_Form` console. + :class:`TerminalUi.TerminalUi` console. """ if self.readyToPrintSimulationStatus is False: return @@ -108,7 +108,7 @@ class NgspiceWidget(QtWidgets.QWidget): @QtCore.pyqtSlot() def readyReadAll(self): - """Outputs the ngspice process standard output and standard error to :class:`TerminalUi.Ui_Form` console + """Outputs the ngspice process standard output and standard error to :class:`TerminalUi.TerminalUi` console """ self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') -- cgit From 1e14fffaa14a1de35328ec88efd5f2a7a077fec3 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Wed, 31 May 2023 21:52:02 +0530 Subject: Removed os check on ngspice simulation call --- src/ngspiceSimulation/NgspiceWidget.py | 68 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index e828493e..9b5667ff 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -30,41 +30,41 @@ class NgspiceWidget(QtWidgets.QWidget): print("Argument to ngspice command : ", command) - if os.name == 'nt': # For Windows OS - parser_nghdl = ConfigParser() - parser_nghdl.read( - os.path.join('library', 'config', '.nghdl', 'config.ini') - ) - - msys_home = parser_nghdl.get('COMPILER', 'MSYS_HOME') - - tempdir = os.getcwd() - projPath = self.obj_appconfig.current_project["ProjectName"] - os.chdir(projPath) - self.command = 'cmd /c '+'"start /min ' + \ - msys_home + "/usr/bin/mintty.exe ngspice -p " + command + '"' - self.process.start(self.command) - os.chdir(tempdir) - - else: # For Linux OS + # if os.name == 'nt': # For Windows OS + # parser_nghdl = ConfigParser() + # parser_nghdl.read( + # os.path.join('library', 'config', '.nghdl', 'config.ini') + # ) + + # msys_home = parser_nghdl.get('COMPILER', 'MSYS_HOME') + + # tempdir = os.getcwd() + # projPath = self.obj_appconfig.current_project["ProjectName"] + # os.chdir(projPath) + # self.command = 'cmd /c '+'"start /min ' + \ + # msys_home + "/usr/bin/mintty.exe ngspice -p " + command + '"' + # self.process.start(self.command) + # os.chdir(tempdir) + + # else: # For Linux OS # Creating argument for process - self.currTime = time.time() - self.process.setWorkingDirectory(self.projDir) - self.process.start('ngspice', self.args) - self.process.started.connect(lambda: self.enableButtons(state=False)) - self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) - self.process.finished.connect(self.finishSimulation) - self.obj_appconfig.process_obj.append(self.process) - print(self.obj_appconfig.proc_dict) - ( - self.obj_appconfig.proc_dict - [self.obj_appconfig.current_project['ProjectName']].append( - self.process.pid()) - ) - self.gawProcess = QtCore.QProcess(self) - self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") - self.gawProcess.start('sh', ['-c', self.gawCommand]) - print(self.gawCommand) + self.currTime = time.time() + self.process.setWorkingDirectory(self.projDir) + self.process.start('ngspice', self.args) + self.process.started.connect(lambda: self.enableButtons(state=False)) + self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) + self.process.finished.connect(self.finishSimulation) + self.obj_appconfig.process_obj.append(self.process) + print(self.obj_appconfig.proc_dict) + ( + self.obj_appconfig.proc_dict + [self.obj_appconfig.current_project['ProjectName']].append( + self.process.pid()) + ) + self.gawProcess = QtCore.QProcess(self) + self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") + self.gawProcess.start('sh', ['-c', self.gawCommand]) + print(self.gawCommand) def finishSimulation(self, exitCode, exitStatus): """This function is intended to run when the ngspice simulation finishes. -- cgit From b0dc41fb3e6ae9fb0f29b4e44524250807d41e49 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 1 Jun 2023 11:43:06 +0530 Subject: Fixes for PR --- src/ngspiceSimulation/NgspiceWidget.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 9b5667ff..138642ca 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -9,7 +9,7 @@ import time # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, simulationEssentials): + def __init__(self, command, qprocess): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -17,14 +17,10 @@ class NgspiceWidget(QtWidgets.QWidget): """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() - self.process = QtCore.QProcess(self) - #self.terminal = QtWidgets.QWidget(self) + self.process = qprocess self.projDir = self.obj_appconfig.current_project["ProjectName"] - self.checkChangeInPlotFile = simulationEssentials['checkChangeInPlotFile'] - self.enableButtons = simulationEssentials['enableButtons'] self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) - #self.terminalUi.setupUi(self.terminal) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminalUi) @@ -48,10 +44,10 @@ class NgspiceWidget(QtWidgets.QWidget): # else: # For Linux OS # Creating argument for process + self.currTime = time.time() self.process.setWorkingDirectory(self.projDir) self.process.start('ngspice', self.args) - self.process.started.connect(lambda: self.enableButtons(state=False)) self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) @@ -76,25 +72,11 @@ class NgspiceWidget(QtWidgets.QWidget): :param exitStatus: The exit status signal of the qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` """ - self.checkChangeInPlotFile(self.currTime, exitStatus) - self.readyToPrintSimulationStatus = True #To stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) - self.writeSimulationStatus() - - #To set the current time stamp of the generated file so as for re-simulation - self.currTime = time.time() - - def writeSimulationStatus(self): - """This function writes status of the simulation (Success or Failure) to the - :class:`TerminalUi.TerminalUi` console. - """ - if self.readyToPrintSimulationStatus is False: - return - st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) if st.st_mtime >= self.currTime: self.terminalUi.writeSimulationStatusToConsole(isSuccess=True) @@ -104,7 +86,9 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.simulationConsole.verticalScrollBar().setValue( self.terminalUi.simulationConsole.verticalScrollBar().maximum() ) - self.readyToPrintSimulationStatus = False + + #To set the current time stamp of the generated file so as for re-simulation + self.currTime = time.time() @QtCore.pyqtSlot() def readyReadAll(self): -- cgit From fd3852efb732b6434a5327a056135f3444b93ba3 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 1 Jun 2023 12:10:54 +0530 Subject: Suppressed PrinterOnly error of ngspice batch mode --- src/ngspiceSimulation/NgspiceWidget.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 138642ca..b19936de 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -97,7 +97,12 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) - stderror = self.process.readAllStandardError() + + stderror = str(self.process.readAllStandardError().data(), encoding='utf-8') + #For suppressing the PrinterOnly error that batch mode throws + stderror = '\n'.join([line for line in stderror.split('\n') + if ('PrinterOnly' not in line and + 'viewport for graphics' not in line)]) self.terminalUi.simulationConsole.insertPlainText( - str(stderror.data(), encoding='utf-8') + stderror ) \ No newline at end of file -- cgit From 9a01a2606665c521c1ee10fa94394127d5decbf3 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 1 Jun 2023 12:42:10 +0530 Subject: Changed style in accordance with flake8 --- src/ngspiceSimulation/NgspiceWidget.py | 36 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index b19936de..1aa8e15d 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,6 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig -from configparser import ConfigParser +# from configparser import ConfigParser from frontEnd import TerminalUi import os import time @@ -43,12 +43,12 @@ class NgspiceWidget(QtWidgets.QWidget): # os.chdir(tempdir) # else: # For Linux OS - # Creating argument for process self.currTime = time.time() self.process.setWorkingDirectory(self.projDir) self.process.start('ngspice', self.args) - self.process.readyReadStandardOutput.connect(lambda: self.readyReadAll()) + self.process.readyReadStandardOutput.connect( + lambda: self.readyReadAll()) self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) @@ -63,17 +63,20 @@ class NgspiceWidget(QtWidgets.QWidget): print(self.gawCommand) def finishSimulation(self, exitCode, exitStatus): - """This function is intended to run when the ngspice simulation finishes. - It singals to the function that generates the plots and also writes in the - appropriate status of the simulation (Whether it was a success or not). + """This function is intended to run when the ngspice + simulation finishes. It singals to the function that generates + the plots and also writes in the appropriate status of the + simulation (Whether it was a success or not). - :param exitCode: The exit code signal of the qprocess that runs ngspice + :param exitCode: The exit code signal of the qprocess + that runs ngspice :type exitCode: int - :param exitStatus: The exit status signal of the qprocess that runs ngspice + :param exitStatus: The exit status signal of the + qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` """ - #To stop progressbar from running after simulation is completed +# To stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) @@ -87,22 +90,25 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.simulationConsole.verticalScrollBar().maximum() ) - #To set the current time stamp of the generated file so as for re-simulation +# To set the current time stamp of the generated +# file so as for re-simulation self.currTime = time.time() @QtCore.pyqtSlot() def readyReadAll(self): - """Outputs the ngspice process standard output and standard error to :class:`TerminalUi.TerminalUi` console + """Outputs the ngspice process standard output and standard error + to :class:`TerminalUi.TerminalUi` console """ self.terminalUi.simulationConsole.insertPlainText( str(self.process.readAllStandardOutput().data(), encoding='utf-8') ) - stderror = str(self.process.readAllStandardError().data(), encoding='utf-8') - #For suppressing the PrinterOnly error that batch mode throws - stderror = '\n'.join([line for line in stderror.split('\n') + stderror = str(self.process.readAllStandardError().data(), + encoding='utf-8') +# For suppressing the PrinterOnly error that batch mode throws + stderror = '\n'.join([line for line in stderror.split('\n') if ('PrinterOnly' not in line and 'viewport for graphics' not in line)]) self.terminalUi.simulationConsole.insertPlainText( stderror - ) \ No newline at end of file + ) -- cgit From d8a2de2ef6126654184a1924cd21d242bea1be18 Mon Sep 17 00:00:00 2001 From: Pranav P Date: Thu, 1 Jun 2023 17:38:18 +0530 Subject: PR fixes --- src/ngspiceSimulation/NgspiceWidget.py | 71 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 1aa8e15d..d6f75853 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,15 +1,12 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig -# from configparser import ConfigParser from frontEnd import TerminalUi -import os -import time # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, qprocess): + def __init__(self, command, simulationEssentials): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -17,34 +14,19 @@ class NgspiceWidget(QtWidgets.QWidget): """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() - self.process = qprocess + self.process = QtCore.QProcess(self) self.projDir = self.obj_appconfig.current_project["ProjectName"] self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminalUi) + self.checkChangeInPlotData = \ + simulationEssentials['checkChangeInPlotData'] + toggleToolbarButtons = simulationEssentials['toggleToolbarButtons'] print("Argument to ngspice command : ", command) - # if os.name == 'nt': # For Windows OS - # parser_nghdl = ConfigParser() - # parser_nghdl.read( - # os.path.join('library', 'config', '.nghdl', 'config.ini') - # ) - - # msys_home = parser_nghdl.get('COMPILER', 'MSYS_HOME') - - # tempdir = os.getcwd() - # projPath = self.obj_appconfig.current_project["ProjectName"] - # os.chdir(projPath) - # self.command = 'cmd /c '+'"start /min ' + \ - # msys_home + "/usr/bin/mintty.exe ngspice -p " + command + '"' - # self.process.start(self.command) - # os.chdir(tempdir) - - # else: # For Linux OS - - self.currTime = time.time() + self.process.started.connect(lambda: toggleToolbarButtons(state=False)) self.process.setWorkingDirectory(self.projDir) self.process.start('ngspice', self.args) self.process.readyReadStandardOutput.connect( @@ -80,19 +62,36 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) - st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) - if st.st_mtime >= self.currTime: - self.terminalUi.writeSimulationStatusToConsole(isSuccess=True) + # st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) + # if st.st_mtime >= self.currTime: + if exitStatus == QtCore.QProcess.NormalExit: + self.checkChangeInPlotData(exitCode) +# self.terminalUi.writeSimulationStatusToConsole() + + failedFormat = ' \ + {} \ + ' + successFormat = ' \ + {} \ + ' + if exitCode == 0: + self.terminalUi.simulationConsole.append( + successFormat.format("Simulation Completed Successfully!")) + else: + self.terminalUi.simulationConsole.append( + failedFormat.format("Simulation Failed!")) + + self.terminalUi.simulationConsole.verticalScrollBar().setValue( + self.terminalUi.simulationConsole.verticalScrollBar().maximum() + ) else: - self.terminalUi.writeSimulationStatusToConsole(isSuccess=False) - - self.terminalUi.simulationConsole.verticalScrollBar().setValue( - self.terminalUi.simulationConsole.verticalScrollBar().maximum() - ) - -# To set the current time stamp of the generated -# file so as for re-simulation - self.currTime = time.time() + self.msg = QtWidgets.QErrorMessage() + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") + self.msg.showMessage( + 'Ngspice simulation did not complete successfully.' + ) + self.msg.exec_() @QtCore.pyqtSlot() def readyReadAll(self): -- cgit From abf7ef8beebf78552d068ebeed1393fd79a81abc Mon Sep 17 00:00:00 2001 From: Pranav P Date: Sat, 3 Jun 2023 17:35:25 +0530 Subject: Got rid of simulationEssentials --- src/ngspiceSimulation/NgspiceWidget.py | 37 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index d6f75853..aa175bf6 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,12 +1,13 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from frontEnd import TerminalUi +import os # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, simulationEssentials): + def __init__(self, command, startSimulation): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and @@ -20,18 +21,21 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminalUi) - self.checkChangeInPlotData = \ - simulationEssentials['checkChangeInPlotData'] - toggleToolbarButtons = simulationEssentials['toggleToolbarButtons'] - print("Argument to ngspice command : ", command) - self.process.started.connect(lambda: toggleToolbarButtons(state=False)) +# This variable makes sure that finished.connect is called exactly once + self.process.isFinishConnected = False + + self.process.\ + started.\ + connect(lambda: + startSimulation(process=self.process, + function=self.finishSimulation)) + self.process.setWorkingDirectory(self.projDir) self.process.start('ngspice', self.args) self.process.readyReadStandardOutput.connect( lambda: self.readyReadAll()) - self.process.finished.connect(self.finishSimulation) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) ( @@ -39,12 +43,14 @@ class NgspiceWidget(QtWidgets.QWidget): [self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) ) - self.gawProcess = QtCore.QProcess(self) - self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") - self.gawProcess.start('sh', ['-c', self.gawCommand]) - print(self.gawCommand) - def finishSimulation(self, exitCode, exitStatus): + if os.name != "nt": + self.gawProcess = QtCore.QProcess(self) + self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") + self.gawProcess.start('sh', ['-c', self.gawCommand]) + print(self.gawCommand) + + def finishSimulation(self, exitCode, exitStatus, checkChangeInPlotData): """This function is intended to run when the ngspice simulation finishes. It singals to the function that generates the plots and also writes in the appropriate status of the @@ -56,6 +62,11 @@ class NgspiceWidget(QtWidgets.QWidget): :param exitStatus: The exit status signal of the qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` + :param checkChangeInPlotData: Takes the plotting function + as input and uses it to generate the plots. The reason + why this is passed in such a way is to minimize the no. + of functions passed through a chain of objects. + :type checkChangeInPlotData: function """ # To stop progressbar from running after simulation is completed @@ -65,7 +76,7 @@ class NgspiceWidget(QtWidgets.QWidget): # st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) # if st.st_mtime >= self.currTime: if exitStatus == QtCore.QProcess.NormalExit: - self.checkChangeInPlotData(exitCode) + checkChangeInPlotData(exitCode) # self.terminalUi.writeSimulationStatusToConsole() failedFormat = ' \ -- cgit From a16cf9dc1c365e8372335fab04d7f6c2114122ca Mon Sep 17 00:00:00 2001 From: Pranav P Date: Sat, 3 Jun 2023 17:55:40 +0530 Subject: Updated docstrings for sphinx documentation --- src/ngspiceSimulation/NgspiceWidget.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index aa175bf6..d0ec7337 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -7,21 +7,31 @@ import os # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, command, startSimulation): + def __init__(self, netlist, startSimulation): """ - Creates constructor for NgspiceWidget class. - - Checks whether OS is Linux or Windows and - creates Ngspice window accordingly. + - Creates NgspiceWindow and runs the process + - Calls the logs the ngspice process, returns + it's simulation status and calls the plotter + - Checks whether it is Linux and runs gaw + :param netlist: The file .cir.out file that + contains the instructions. + :type netlist: str + :param startSimulation: A function that disables + the toolbar buttons of connects the finishSimulation + function to finished.connect + :type startSimulation: function """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.projDir = self.obj_appconfig.current_project["ProjectName"] - self.args = ['-b', '-r', command.replace(".cir.out", ".raw"), command] + self.args = ['-b', '-r', netlist.replace(".cir.out", ".raw"), + netlist] self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminalUi) - print("Argument to ngspice command : ", command) +# print("Argument to ngspice command : ", netlist) # This variable makes sure that finished.connect is called exactly once self.process.isFinishConnected = False @@ -46,11 +56,12 @@ class NgspiceWidget(QtWidgets.QWidget): if os.name != "nt": self.gawProcess = QtCore.QProcess(self) - self.gawCommand = "gaw " + command.replace(".cir.out", ".raw") + self.gawCommand = "gaw " + netlist.replace(".cir.out", ".raw") self.gawProcess.start('sh', ['-c', self.gawCommand]) print(self.gawCommand) - def finishSimulation(self, exitCode, exitStatus, checkChangeInPlotData): + def finishSimulation(self, exitCode, + exitStatus, checkNgspiceProcessFinished): """This function is intended to run when the ngspice simulation finishes. It singals to the function that generates the plots and also writes in the appropriate status of the @@ -62,22 +73,19 @@ class NgspiceWidget(QtWidgets.QWidget): :param exitStatus: The exit status signal of the qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` - :param checkChangeInPlotData: Takes the plotting function + :param checkNgspiceProcessFinished: Takes the plotting function as input and uses it to generate the plots. The reason why this is passed in such a way is to minimize the no. of functions passed through a chain of objects. - :type checkChangeInPlotData: function + :type checkNgspiceProcessFinished: function """ # To stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) - # st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) - # if st.st_mtime >= self.currTime: if exitStatus == QtCore.QProcess.NormalExit: - checkChangeInPlotData(exitCode) -# self.terminalUi.writeSimulationStatusToConsole() + checkNgspiceProcessFinished(exitCode) failedFormat = ' \ {} \ -- cgit From c99a4951df139de96e80a51805a3b4d677336653 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Wed, 7 Jun 2023 16:26:35 +0530 Subject: sim. process switched to qt slot-signal mech. & report errors --- src/ngspiceSimulation/NgspiceWidget.py | 156 +++++++++++++++++++-------------- 1 file changed, 88 insertions(+), 68 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index d0ec7337..e940d995 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,13 +1,13 @@ +import os from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from frontEnd import TerminalUi -import os # This Class creates NgSpice Window class NgspiceWidget(QtWidgets.QWidget): - def __init__(self, netlist, startSimulation): + def __init__(self, netlist, simEndSignal): """ - Creates constructor for NgspiceWidget class. - Creates NgspiceWindow and runs the process @@ -17,35 +17,33 @@ class NgspiceWidget(QtWidgets.QWidget): :param netlist: The file .cir.out file that contains the instructions. :type netlist: str - :param startSimulation: A function that disables - the toolbar buttons of connects the finishSimulation - function to finished.connect - :type startSimulation: function + :param simEndSignal: A signal that will be emitted to Application class + for enabling simulation interaction and plotting data if the + simulation is successful + :type simEndSignal: PyQt Signal """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() - self.process = QtCore.QProcess(self) self.projDir = self.obj_appconfig.current_project["ProjectName"] - self.args = ['-b', '-r', netlist.replace(".cir.out", ".raw"), - netlist] + self.args = ['-b', '-r', netlist.replace(".cir.out", ".raw"), netlist] + print("Argument to ngspice: ", self.args) + + self.process = QtCore.QProcess(self) self.terminalUi = TerminalUi.TerminalUi(self.process, self.args) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminalUi) -# print("Argument to ngspice command : ", netlist) - -# This variable makes sure that finished.connect is called exactly once - self.process.isFinishConnected = False - - self.process.\ - started.\ - connect(lambda: - startSimulation(process=self.process, - function=self.finishSimulation)) self.process.setWorkingDirectory(self.projDir) + self.process.setProcessChannelMode(QtCore.QProcess.MergedChannels) + self.process.readyRead.connect(self.readyReadAll) + self.process.finished.connect( + lambda exitCode, exitStatus: + self.finishSimulation(exitCode, exitStatus, simEndSignal) + ) + self.process.errorOccurred.connect( + lambda: self.finishSimulation(None, None, simEndSignal)) self.process.start('ngspice', self.args) - self.process.readyReadStandardOutput.connect( - lambda: self.readyReadAll()) + self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) ( @@ -54,79 +52,101 @@ class NgspiceWidget(QtWidgets.QWidget): self.process.pid()) ) - if os.name != "nt": + if os.name != "nt": # Linux OS self.gawProcess = QtCore.QProcess(self) self.gawCommand = "gaw " + netlist.replace(".cir.out", ".raw") self.gawProcess.start('sh', ['-c', self.gawCommand]) print(self.gawCommand) - def finishSimulation(self, exitCode, - exitStatus, checkNgspiceProcessFinished): - """This function is intended to run when the ngspice + @QtCore.pyqtSlot() + def readyReadAll(self): + """Outputs the ngspice process standard output and standard error + to :class:`TerminalUi.TerminalUi` console + """ + self.terminalUi.simulationConsole.insertPlainText( + str(self.process.readAllStandardOutput().data(), encoding='utf-8') + ) + + stderror = str(self.process.readAllStandardError().data(), + encoding='utf-8') + + # Suppressing the Ngspice PrinterOnly error that batch mode throws + stderror = '\n'.join([errLine for errLine in stderror.split('\n') + if ('PrinterOnly' not in errLine and + 'viewport for graphics' not in errLine)]) + + self.terminalUi.simulationConsole.insertPlainText(stderror) + + def finishSimulation(self, exitCode, exitStatus, simEndSignal): + """This function is intended to run when the Ngspice simulation finishes. It singals to the function that generates the plots and also writes in the appropriate status of the simulation (Whether it was a success or not). - :param exitCode: The exit code signal of the qprocess + :param exitCode: The exit code signal of the QProcess that runs ngspice :type exitCode: int :param exitStatus: The exit status signal of the qprocess that runs ngspice :type exitStatus: class:`QtCore.QProcess.ExitStatus` - :param checkNgspiceProcessFinished: Takes the plotting function - as input and uses it to generate the plots. The reason - why this is passed in such a way is to minimize the no. - of functions passed through a chain of objects. - :type checkNgspiceProcessFinished: function + :param simEndSignal: A signal passed from constructor + for enabling simulation interaction and plotting data if the + simulation is successful + :type simEndSignal: PyQt Signal """ - -# To stop progressbar from running after simulation is completed + # Stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) + self.terminalUi.cancelSimulationButton.setEnabled(False) + self.terminalUi.redoSimulationButton.setEnabled(True) + + if exitCode is None: + exitCode = self.process.exitCode() - if exitStatus == QtCore.QProcess.NormalExit: - checkNgspiceProcessFinished(exitCode) + errorType = self.process.error() + if errorType < 3: # 0, 1, 2 ==> failed to start, crashed, timedout + exitStatus = QtCore.QProcess.CrashExit + elif exitStatus is None: + exitStatus = self.process.exitStatus() + # Redo-simulation does not set correct exit status and code. + # So, need to check the error type: + # => UnknownError along with NormalExit seems successful simulation + if exitStatus == QtCore.QProcess.NormalExit and exitCode == 0 \ + and errorType == QtCore.QProcess.UnknownError: + successFormat = '\ + {} \ + ' + self.terminalUi.simulationConsole.append( + successFormat.format("Simulation Completed Successfully!")) + + else: failedFormat = ' \ - {} \ - ' - successFormat = ' \ - {} \ - ' - if exitCode == 0: - self.terminalUi.simulationConsole.append( - successFormat.format("Simulation Completed Successfully!")) + {} \ + ' + self.terminalUi.simulationConsole.append( + failedFormat.format("Simulation Failed!")) + + errMsg = 'Simulation ' + if errorType == QtCore.QProcess.FailedToStart: + errMsg += 'failed to start. ' + \ + 'Ensure that eSim is installed correctly.' + elif errorType == QtCore.QProcess.Crashed: + errMsg += 'crashed. Try again later.' + elif errorType == QtCore.QProcess.Timedout: + errMsg += ' has timed out. Try to reduce the ' + \ + ' simulation time or the simulation step interval.' else: - self.terminalUi.simulationConsole.append( - failedFormat.format("Simulation Failed!")) + errMsg += ' could not complete. Try again later.' - self.terminalUi.simulationConsole.verticalScrollBar().setValue( - self.terminalUi.simulationConsole.verticalScrollBar().maximum() - ) - else: self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") - self.msg.showMessage( - 'Ngspice simulation did not complete successfully.' - ) + self.msg.showMessage(errMsg) self.msg.exec_() - @QtCore.pyqtSlot() - def readyReadAll(self): - """Outputs the ngspice process standard output and standard error - to :class:`TerminalUi.TerminalUi` console - """ - self.terminalUi.simulationConsole.insertPlainText( - str(self.process.readAllStandardOutput().data(), encoding='utf-8') + self.terminalUi.simulationConsole.verticalScrollBar().setValue( + self.terminalUi.simulationConsole.verticalScrollBar().maximum() ) - stderror = str(self.process.readAllStandardError().data(), - encoding='utf-8') -# For suppressing the PrinterOnly error that batch mode throws - stderror = '\n'.join([line for line in stderror.split('\n') - if ('PrinterOnly' not in line and - 'viewport for graphics' not in line)]) - self.terminalUi.simulationConsole.insertPlainText( - stderror - ) + simEndSignal.emit(exitStatus, exitCode) -- cgit From 4eea06f6fcd654c7f0919f395ff42fabbafa0171 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sun, 11 Jun 2023 16:22:29 +0530 Subject: fixed multiple signal issue with cancel sim. --- src/ngspiceSimulation/NgspiceWidget.py | 41 ++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'src/ngspiceSimulation/NgspiceWidget.py') diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index e940d995..94368cdd 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -38,10 +38,10 @@ class NgspiceWidget(QtWidgets.QWidget): self.process.readyRead.connect(self.readyReadAll) self.process.finished.connect( lambda exitCode, exitStatus: - self.finishSimulation(exitCode, exitStatus, simEndSignal) + self.finishSimulation(exitCode, exitStatus, simEndSignal, False) ) self.process.errorOccurred.connect( - lambda: self.finishSimulation(None, None, simEndSignal)) + lambda: self.finishSimulation(None, None, simEndSignal, True)) self.process.start('ngspice', self.args) self.obj_appconfig.process_obj.append(self.process) @@ -77,7 +77,8 @@ class NgspiceWidget(QtWidgets.QWidget): self.terminalUi.simulationConsole.insertPlainText(stderror) - def finishSimulation(self, exitCode, exitStatus, simEndSignal): + def finishSimulation(self, exitCode, exitStatus, + simEndSignal, hasErrorOccurred): """This function is intended to run when the Ngspice simulation finishes. It singals to the function that generates the plots and also writes in the appropriate status of the @@ -94,6 +95,12 @@ class NgspiceWidget(QtWidgets.QWidget): simulation is successful :type simEndSignal: PyQt Signal """ + + # Canceling simulation triggers both finished and + # errorOccurred signals...need to skip finished signal in this case. + if not hasErrorOccurred and self.terminalUi.simulationCancelled: + return + # Stop progressbar from running after simulation is completed self.terminalUi.progressBar.setMaximum(100) self.terminalUi.progressBar.setProperty("value", 100) @@ -109,11 +116,21 @@ class NgspiceWidget(QtWidgets.QWidget): elif exitStatus is None: exitStatus = self.process.exitStatus() - # Redo-simulation does not set correct exit status and code. - # So, need to check the error type: - # => UnknownError along with NormalExit seems successful simulation - if exitStatus == QtCore.QProcess.NormalExit and exitCode == 0 \ + if self.terminalUi.simulationCancelled: + msg = QtWidgets.QMessageBox() + msg.setModal(True) + msg.setIcon(QtWidgets.QMessageBox.Warning) + msg.setWindowTitle("Warning Message") + msg.setText("Simulation was cancelled.") + msg.setStandardButtons(QtWidgets.QMessageBox.Ok) + msg.exec() + + elif exitStatus == QtCore.QProcess.NormalExit and exitCode == 0 \ and errorType == QtCore.QProcess.UnknownError: + # Redo-simulation does not set correct exit status and code. + # So, need to check the error type ==> + # UnknownError along with NormalExit seems successful simulation + successFormat = '\ {} \ ' @@ -139,11 +156,11 @@ class NgspiceWidget(QtWidgets.QWidget): else: errMsg += ' could not complete. Try again later.' - self.msg = QtWidgets.QErrorMessage() - self.msg.setModal(True) - self.msg.setWindowTitle("Error Message") - self.msg.showMessage(errMsg) - self.msg.exec_() + msg = QtWidgets.QErrorMessage() + msg.setModal(True) + msg.setWindowTitle("Error Message") + msg.showMessage(errMsg) + msg.exec() self.terminalUi.simulationConsole.verticalScrollBar().setValue( self.terminalUi.simulationConsole.verticalScrollBar().maximum() -- cgit