fix(curve_tree): fetching scan numbers directly from the bec client

This commit is contained in:
2025-10-08 13:40:48 +02:00
committed by Jan Wyzula
parent 962ab774e6
commit 8111a4a21b
2 changed files with 5 additions and 4 deletions
@@ -127,13 +127,13 @@ class CurveRow(QTreeWidgetItem):
# Populate 'live' and all available history scan indices
self.scan_index_combo.addItem("live")
history = getattr(self.curve_tree.client, "history", None)
num_scans = len(history) if history is not None else 0
scan_number_list = history._scan_numbers # len(history) if history is not None else 0
# Restrict input to 'live' or valid scan numbers
validator = ScanIndexValidator(num_scans, self.scan_index_combo)
validator = ScanIndexValidator(len(scan_number_list), self.scan_index_combo)
self.scan_index_combo.lineEdit().setValidator(validator)
for idx in range(num_scans):
for idx in scan_number_list:
# Display scan numbers starting at 1
self.scan_index_combo.addItem(str(idx + 1))
self.scan_index_combo.addItem(str(idx))
# Select current scan number if set, otherwise default to 'live'
if getattr(self.config, "scan_number", None) is not None:
self.scan_index_combo.setCurrentText(str(self.config.scan_number))
+1
View File
@@ -418,6 +418,7 @@ def test_export_data_history_curve(curve_tree_fixture, scan_history_factory):
for m in msgs:
wf.client.history._scan_data[m.scan_id] = m
wf.client.history._scan_ids.append(m.scan_id)
wf.client.history._scan_numbers.append(m.scan_number)
wf.client.queue.scan_storage.current_scan = None
# Create a device row and select scan index "2"