GUI: Attempted fix to prevent skip of first sample, skip was inconsistent so may need lots of runs to confirm it does not happen

This commit is contained in:
2025-11-10 10:56:31 +01:00
parent 74430d213f
commit 070a26c53d
+13 -2
View File
@@ -17,6 +17,8 @@ class SampleQueuePanel(QFrame):
super().__init__(parent)
self.__pause = True
self.__set_to_pause = False
self._current_db_id: int | None = None
self.setFrameShape(QFrame.Shape.StyledPanel)
self.setFrameShadow(QFrame.Shadow.Raised)
@@ -92,7 +94,9 @@ class SampleQueuePanel(QFrame):
self.__set_to_pause = False
self.__pause = False
self.play_button.setText("⏸ Pause")
self.auto_scan.emit(self.table_model.samples[0])
current = self.table_model.samples[0]
self._current_db_id = current.db_id
self.auto_scan.emit(current)
self.viewer_track_online.emit()
else:
self.__set_to_pause = True
@@ -104,10 +108,16 @@ class SampleQueuePanel(QFrame):
@Slot(int, bool)
def automated_scan_done(self, db_id: int, success: bool):
if self._current_db_id is not None and db_id != self._current_db_id:
return
if success:
self.table_model.remove_sample(db_id)
self._current_db_id = None
if not self.__pause and len(self.table_model.samples) > 0:
self.auto_scan.emit(self.table_model.samples[0])
next_item = self.table_model.samples[0]
self._current_db_id = next_item.db_id
self.auto_scan.emit(next_item)
else:
self.table_model.set_running(False)
self.__pause = True
@@ -117,3 +127,4 @@ class SampleQueuePanel(QFrame):
self.table_model.set_running(False)
self.__pause = True
self.play_button.setText("▶ Run")
self._current_db_id = None