Skip to content

Commit

Permalink
Merge pull request #197 from rahulp13/master
Browse files Browse the repository at this point in the history
Fix incorrect status reporting on NgVeri UI terminal
  • Loading branch information
rahulp13 committed Feb 22, 2022
2 parents 61a5e71 + 91b51ef commit d7ba0a2
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/maker/NgVeri.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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('''
<p style=\" font-size:16pt; font-weight:1000;
color:#00FF00;\"> Model Created Successfully!
</p>
''')

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('''
<p style=\" font-size:16pt; font-weight:1000;
color:#FF0000;\">There was an error during model creation,
<br/>Please rectify the error and try again!
</p>
''')

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
Expand Down

0 comments on commit d7ba0a2

Please sign in to comment.