Commit aba009ea authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Update text, not entire cell

parent 34b510d8
#!/usr/bin/env python3
import sys
import csv
import logging
......@@ -106,8 +108,9 @@ class DTObservationProgram(Ui_mainWindow):
colors = {'Completed': QtGui.QColor('green'),
'Slewing' : QtGui.QColor('yellow'),
'Measuring': QtGui.QColor('cyan')}
self.tableWidgetPointings.item(meas_num, 2).setText(status)
for column in range(3):
self.tableWidgetPointings.setItem(meas_num, 2, QTableWidgetItem(status))
self.tableWidgetPointings.item(meas_num,column).setBackground(colors[status])
self.tableWidgetPointings.resizeColumnsToContents()
......@@ -139,7 +142,8 @@ class DTObservationProgram(Ui_mainWindow):
progress_percent: integer giving the percentage complete
remaining_str: string indicating how much remaining, e.g. "1:30" or "3°"
"""
self.tableWidgetPointings.setItem(meas_num, 2, QTableWidgetItem(remaining_str))
#self.tableWidgetPointings.item(meas_num, 2).setText(remaining_str)
self.tableWidgetPointings.item(meas_num, 2).setText(str(progress_percent)+"%")
def doMeasurement(self, measnum, progressSignal=None):
......@@ -163,7 +167,7 @@ class DTObservationProgram(Ui_mainWindow):
ra = self.tableWidgetPointings.item(meas, 0).text()
dec = self.tableWidgetPointings.item(meas, 1).text()
self.tableWidgetPointings.setItem(meas, 2, QTableWidgetItem("Scheduled"))
self.tableWidgetPointings.item(meas, 2).setText("Scheduled")
self.tableWidgetPointings.resizeColumnsToContents()
setpoint = SkyCoord(ra, dec, frame='icrs')
setpoints.append(setpoint)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment