keep sweeps in acquisition order through history replays
The processor appended sweeps the GUI fed back to its own history, so its next replay published them twice and out of order, and the B-scan came out with rotated columns. Fed-back sweeps now stay out of that history, results are kept in timestamp order, picking the displayed combo only redraws and only new sweeps are recorded to disk.
This commit is contained in:
@@ -305,15 +305,20 @@ class AppWindowLiveProcessingMixin:
|
||||
*,
|
||||
history_command: str = "none",
|
||||
bump_history_seq: bool = False,
|
||||
reprocess_current_result: bool = True,
|
||||
) -> None:
|
||||
"""Persist current live processing config to runtime JSON file."""
|
||||
"""Persist current live processing config to runtime JSON file.
|
||||
|
||||
Every change of the file makes the processor reprocess its retained sweeps,
|
||||
except while the GUI recomputes the B-scan itself by feeding its own, longer
|
||||
history back (AppWindowBscanReplayMixin): the processor's replay would then
|
||||
only duplicate that work and race it for the results ring.
|
||||
"""
|
||||
if bump_history_seq:
|
||||
self._history_command_seq += 1
|
||||
self._live_config_writer.write(
|
||||
self._live_processing_config(
|
||||
history_command=history_command,
|
||||
reprocess_current_result=reprocess_current_result,
|
||||
reprocess_current_result=not self._can_reprocess_history(),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -380,13 +385,15 @@ class AppWindowLiveProcessingMixin:
|
||||
|
||||
self._write_live_processing_config()
|
||||
if current_mode == "bscan":
|
||||
self._drain_results_until_quiet(timeout_s=0.25, poll_s=0.01)
|
||||
if self._can_reprocess_history():
|
||||
# Recompute every column on screen from the GUI's history. Debounced,
|
||||
# so dragging a spin box sends one burst instead of one per step.
|
||||
self._schedule_bscan_history_reprocess()
|
||||
else:
|
||||
# The processor reprocesses its own newest sweeps; take them in.
|
||||
self._drain_results_until_quiet(timeout_s=0.25, poll_s=0.01)
|
||||
self._sync_bscan_history_from_results()
|
||||
self._draw_bscan_heatmap_from_history()
|
||||
# The processor only refreshed its own newest sweeps; queue a full
|
||||
# recompute of everything on screen. Debounced, so dragging a spin box
|
||||
# sends one burst instead of one per step.
|
||||
self._schedule_bscan_history_reprocess()
|
||||
elif self._is_gpr_like_processing_mode(current_mode):
|
||||
latest = self._drain_results_until_quiet(timeout_s=0.8, poll_s=0.02)
|
||||
collection = latest
|
||||
|
||||
Reference in New Issue
Block a user