summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py13
-rw-r--r--src/progressBar/progressBarOld.py51
2 files changed, 58 insertions, 6 deletions
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()
diff --git a/src/progressBar/progressBarOld.py b/src/progressBar/progressBarOld.py
new file mode 100644
index 00000000..938b0774
--- /dev/null
+++ b/src/progressBar/progressBarOld.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'pop_up_design.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.6
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_Dialog(object):
+ def setupUi(self, Dialog):
+ Dialog.setObjectName("Dialog")
+ Dialog.resize(843, 396)
+ self.progressBar = QtWidgets.QProgressBar(Dialog)
+ self.progressBar.setGeometry(QtCore.QRect(30, 30, 781, 31))
+ self.progressBar.setStyleSheet("QProgressBar::chunk {\n"
+" background-color: rgb(38, 162, 105);\n"
+"}")
+ self.progressBar.setMaximum(0)
+ #self.progressBar.setProperty("value", 100)
+ self.progressBar.setTextDirection(QtWidgets.QProgressBar.TopToBottom)
+ self.progressBar.setFormat("")
+ self.progressBar.setObjectName("progressBar")
+ self.ngspiceConsole = QtWidgets.QPlainTextEdit(Dialog)
+ self.ngspiceConsole.setGeometry(QtCore.QRect(30, 80, 781, 281))
+ self.ngspiceConsole.setAutoFillBackground(False)
+ self.ngspiceConsole.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard | QtCore.Qt.TextSelectableByMouse)
+ self.ngspiceConsole.setStyleSheet("QPlainTextEdit {\n"
+" background-color: rgb(36, 31, 49);\n"
+" color: white;\n"
+"}")
+ self.ngspiceConsole.setObjectName("ngspiceConsole")
+
+ self.retranslateUi(Dialog)
+ QtCore.QMetaObject.connectSlotsByName(Dialog)
+
+ def retranslateUi(self, Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
+ #self.ngspiceConsole.setPlainText(_translate("Dialog", "The Ngspice simulation log will appear here."))
+
+ def writeIntoConsole(self, text):
+ self.ngspiceConsole.insertPlainText(text)
+
+ def showProgressCompleted(self):
+ self.progressBar.setMaximum(100)
+ self.progressBar.setProperty("value", 100)