summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation
diff options
context:
space:
mode:
authorPranav P2023-05-24 15:32:21 +0530
committerPranav P2023-05-24 15:32:21 +0530
commit3fc177d796b0e2591a016b153cd29e8db3364e8d (patch)
tree0329a3b67738b63dfcff0f1cc9c02ce22e436a04 /src/ngspiceSimulation
parent6ae708e34a0c38ee73acabf3af98deaac62e6cd6 (diff)
downloadeSim-3fc177d796b0e2591a016b153cd29e8db3364e8d.tar.gz
eSim-3fc177d796b0e2591a016b153cd29e8db3364e8d.tar.bz2
eSim-3fc177d796b0e2591a016b153cd29e8db3364e8d.zip
Reduced the number of methods in TerminalUi
Diffstat (limited to 'src/ngspiceSimulation')
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py19
1 files changed, 12 insertions, 7 deletions
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