Rework radar system

This commit is contained in:
Ayzen
2026-10-06 12:32:26 +03:00
parent 552cdc688a
commit 5bb86b7165
299 changed files with 13537 additions and 27763 deletions
+31
View File
@@ -0,0 +1,31 @@
"""Exclusive pipeline pause held until a synchronous or asynchronous operation ends."""
from __future__ import annotations
from collections.abc import Callable
class PipelinePause:
"""Suspend acquisition and restart intent; an explicit Stop cancels resumption."""
def __init__(self, valid: Callable[[], bool], release: Callable[[bool], None]) -> None:
self._valid = valid
self._release = release
self._finished = False
@property
def valid(self) -> bool:
return not self._finished and self._valid()
def finish(self, *, resume: bool = True) -> None:
if self._finished:
return
should_resume = resume and self.valid
self._finished = True
self._release(should_resume)
def __enter__(self) -> PipelinePause:
return self
def __exit__(self, *_exc: object) -> None:
self.finish()