mirror of https://gitlab.com/pamhyr/pamhyr2
add copy AdisTS results table
parent
0a97070b90
commit
09029dc993
|
|
@ -99,8 +99,8 @@ class TableModel(PamhyrTableModel):
|
|||
v = self._lst[row].get_ts_key(
|
||||
self._timestamp, "pols")[pol_index][0]
|
||||
return f"{v:.4f}"
|
||||
if (self._headers[column] == pol + " Mass"
|
||||
and self._type_pol[pol_index] == 7):
|
||||
if self._headers[column] == pol + " Mass":
|
||||
if self._type_pol[pol_index] == 7:
|
||||
m1 = self._lst[row].get_ts_key(
|
||||
self._timestamp, "pols")[pol_index][1]
|
||||
m2 = self._lst[row].get_ts_key(
|
||||
|
|
@ -109,6 +109,8 @@ class TableModel(PamhyrTableModel):
|
|||
self._timestamp, "pols")[pol_index][3]
|
||||
v = m1 + m2 + m3
|
||||
return f"{v:.4f}"
|
||||
else:
|
||||
return ""
|
||||
|
||||
return QVariant()
|
||||
|
||||
|
|
|
|||
|
|
@ -554,15 +554,8 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self.update(pol_id=rows)
|
||||
|
||||
def _set_current_profile_raw_data(self):
|
||||
table = self.find(QTableView, f"tableView_raw_data")
|
||||
indexes = table.selectedIndexes()
|
||||
if len(indexes) == 0:
|
||||
return
|
||||
|
||||
ind = indexes[0].row()
|
||||
self.update(profile_id=ind)
|
||||
self._slider_profile.setValue(ind)
|
||||
|
||||
def _set_current_timestamp(self):
|
||||
timestamp = self._timestamps[self._slider_time.value()]
|
||||
self.update(timestamp=timestamp)
|
||||
|
|
@ -597,6 +590,25 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self._reload_slider()
|
||||
|
||||
def _copy(self):
|
||||
# focus on raw data table
|
||||
if self.find(QTabWidget, f"tabWidget").currentIndex() == 0:
|
||||
table = self.find(QTableView, f"tableView_raw_data")
|
||||
model = self._table["raw_data"]
|
||||
|
||||
coltext = []
|
||||
for index in sorted(table.selectionModel().selectedRows()):
|
||||
row = index.row()
|
||||
rowtext = []
|
||||
for column in range(model.columnCount()):
|
||||
i = model.createIndex(row, column)
|
||||
try:
|
||||
rowtext.append(str(model.data(i)))
|
||||
except AttributeError:
|
||||
rowtext.append("")
|
||||
coltext.append(rowtext)
|
||||
|
||||
self.copyTableIntoClipboard(coltext)
|
||||
else:
|
||||
logger.info("TODO: copy")
|
||||
|
||||
def _paste(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue