Skip to content

Commit 308efaa

Browse files
committed
qtvcp -machine_log: fix writing out of text from the table
The newer table version of the log did not write out the text.
1 parent 6f658cf commit 308efaa

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

lib/python/qtvcp/widgets/machine_log.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,30 @@ def hideCursor(self):
220220
self.logText.setCursorWidth(0)
221221

222222
def getLogText(self):
223-
return self.logText.toPlainText()
223+
if self._machine_log_severity:
224+
return self.readTableData()
225+
else:
226+
return self.logText.toPlainText()
224227

225228
def clear(self):
226229
self.logTable.clearContents()
227230
self.logTable.setRowCount(0)
228231
self.logText.setPlainText('')
229232

233+
def readTableData(self):
234+
data = ''
235+
for row in range(self.logTable.rowCount()):
236+
row_data = []
237+
for col in range(self.logTable.columnCount()):
238+
item = self.logTable.item(row, col).text()
239+
if col == 1:
240+
# pad the severity column for ease of reading
241+
row_data.append("{:^10}".format(item))
242+
elif item != '':
243+
row_data.append(item)
244+
data += ' '.join(row_data)
245+
data +='\n'
246+
return data
230247

231248
################## properties ###################
232249

0 commit comments

Comments
 (0)