From 91b51ef49e77ebd8cf0f6db08b8bdee57d18293e Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Tue, 22 Feb 2022 22:34:10 +0530 Subject: [PATCH] Fix incorrect status reporting on NgVeri UI terminal --- src/maker/NgVeri.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/maker/NgVeri.py b/src/maker/NgVeri.py index cb553a31e..193c51d02 100755 --- a/src/maker/NgVeri.py +++ b/src/maker/NgVeri.py @@ -42,7 +42,6 @@ class NgVeri(QtWidgets.QWidget): # initialising the variables def __init__(self, filecount): - print(self) QtWidgets.QWidget.__init__(self) # Maker.addverilog(self) self.obj_Appconfig = Appconfig() @@ -99,7 +98,8 @@ def addverilog(self): return self.fname = Maker.verilogFile[self.filecount] - model = ModelGeneration.ModelGeneration(self.fname, self.entry_var[0]) + currentTermLogs = QtWidgets.QTextEdit() + model = ModelGeneration.ModelGeneration(self.fname, currentTermLogs) file = (os.path.basename(self.fname)).split('.')[0] if self.entry_var[1].findText(file) == -1: self.entry_var[1].addItem(file) @@ -139,35 +139,38 @@ def addverilog(self): self.nghdl_home + "/lib/ngspice/" ) except FileNotFoundError as err: - self.entry_var[0].append( + currentTermLogs.append( "Error in copying Ngveri code model: " + str(err) ) - terminalLog = self.entry_var[0].toPlainText() - if "error" not in terminalLog.lower(): - self.entry_var[0].append(''' + if "error" not in currentTermLogs.toPlainText().lower(): + currentTermLogs.append('''

Model Created Successfully!

''') - return - except BaseException as err: - self.entry_var[0].append( + currentTermLogs.append( "Error in Ngspice code model generation " + "from Verilog: " + str(err) ) - terminalLog = self.entry_var[0].toPlainText() - if "error" in terminalLog.lower(): - self.entry_var[0].append(''' + if "error" in currentTermLogs.toPlainText().lower(): + currentTermLogs.append('''

There was an error during model creation,
Please rectify the error and try again!

''') + self.entry_var[0].append(currentTermLogs.toHtml()) + + # Force scroll the terminal widget at bottom + self.entry_var[0].verticalScrollBar().setValue( + self.entry_var[0].verticalScrollBar().maximum() + ) + def addfile(self): ''' This function is used to add additional files required