working version
This commit is contained in:
@@ -480,10 +480,10 @@ class AppWindowPreprocessMixin:
|
||||
|
||||
try:
|
||||
capture_result = session.capture_current_combo()
|
||||
self._record_preprocess_capture(session, capture_result)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
self._show_exception("Failed to capture preprocess combo", exc)
|
||||
self._abort_capture_sequence()
|
||||
self._on_capture_combo_failed(session, exc)
|
||||
return
|
||||
self._record_preprocess_capture(session, capture_result)
|
||||
|
||||
def _capture_all_remaining(self) -> None:
|
||||
"""Capture all remaining combos for the active preprocess session."""
|
||||
@@ -505,13 +505,36 @@ class AppWindowPreprocessMixin:
|
||||
f"{display_name} batch capture started: remaining="
|
||||
f"{session.state().total_count - session.state().captured_count}"
|
||||
)
|
||||
try:
|
||||
while not session.is_complete():
|
||||
while not session.is_complete():
|
||||
try:
|
||||
capture_result = session.capture_current_combo()
|
||||
self._record_preprocess_capture(session, capture_result)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
self._show_exception("Failed to capture preprocess combo", exc)
|
||||
self._abort_capture_sequence()
|
||||
except Exception as exc: # noqa: BLE001
|
||||
self._on_capture_combo_failed(session, exc)
|
||||
return
|
||||
self._record_preprocess_capture(session, capture_result)
|
||||
|
||||
def _on_capture_combo_failed(
|
||||
self,
|
||||
session: SequentialCaptureSession | MultiRadarSequentialCaptureSession,
|
||||
exc: BaseException,
|
||||
) -> None:
|
||||
"""Report a failed combo capture while preserving the session and prior captures."""
|
||||
state = session.state()
|
||||
combo = state.current_combo
|
||||
combo_text = (
|
||||
f"input={combo.input}, output={combo.output}" if combo is not None else "<unknown>"
|
||||
)
|
||||
self._show_exception(
|
||||
f"Failed to capture combo {combo_text}; previous captures kept, retry when ready",
|
||||
exc,
|
||||
)
|
||||
display_name = preprocess_asset_display_name(session.kind)
|
||||
dialog = self._ensure_preprocess_dialog()
|
||||
dialog.set_status(
|
||||
f"{display_name} capture failed at {combo_text}: "
|
||||
f"{state.captured_count}/{state.total_count} kept, ready to retry"
|
||||
)
|
||||
self._update_capture_dialog_state()
|
||||
|
||||
def _record_preprocess_capture(
|
||||
self,
|
||||
@@ -696,7 +719,11 @@ class AppWindowPreprocessMixin:
|
||||
next_output=next_output,
|
||||
can_undo=state.can_undo,
|
||||
can_finalize=state.is_complete,
|
||||
can_capture_all=(not state.is_complete and state.current_combo is not None),
|
||||
can_capture_all=(
|
||||
state.supports_batch_capture
|
||||
and not state.is_complete
|
||||
and state.current_combo is not None
|
||||
),
|
||||
variant_count=state.variant_count,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user