qr timeout
This commit is contained in:
parent
efa8995887
commit
6768852636
@ -114,6 +114,7 @@ class Fotobox:
|
|||||||
self._choice: Photo | None = None
|
self._choice: Photo | None = None
|
||||||
self._countdown_timer: Timer = Timer("countdown", 0, 1, COUNTDOWN_COUNT + 1, self._countdown_callback)
|
self._countdown_timer: Timer = Timer("countdown", 0, 1, COUNTDOWN_COUNT + 1, self._countdown_callback)
|
||||||
self._shooting_timer: Timer = Timer("shooting", 0, SHOOTING_INTERVAL, SHOOTING_COUNT, self._shooting_callback)
|
self._shooting_timer: Timer = Timer("shooting", 0, SHOOTING_INTERVAL, SHOOTING_COUNT, self._shooting_callback)
|
||||||
|
self._qr_timer: Timer = Timer("qr", 0, QR_TIMEOUT, 1, self._qr_callback)
|
||||||
|
|
||||||
self._fotobox_uuid = read("./data/fotobox.uuid")
|
self._fotobox_uuid = read("./data/fotobox.uuid")
|
||||||
print("Starting fotobox: F-%s" % self._fotobox_uuid)
|
print("Starting fotobox: F-%s" % self._fotobox_uuid)
|
||||||
@ -164,6 +165,9 @@ class Fotobox:
|
|||||||
self._draw_live_frame()
|
self._draw_live_frame()
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
|
|
||||||
|
def _qr_callback(self):
|
||||||
|
self._set_state(State.IDLE)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
self._set_state(State.SHOOTING)
|
self._set_state(State.SHOOTING)
|
||||||
|
|||||||
@ -20,6 +20,7 @@ PHOTO_HEIGHT = 1944
|
|||||||
SHOOTING_COUNT: int = 1 if DEBUG else 2
|
SHOOTING_COUNT: int = 1 if DEBUG else 2
|
||||||
SHOOTING_INTERVAL: float = 0 if DEBUG else 1.75
|
SHOOTING_INTERVAL: float = 0 if DEBUG else 1.75
|
||||||
COUNTDOWN_COUNT: int = 0 if DEBUG else 3
|
COUNTDOWN_COUNT: int = 0 if DEBUG else 3
|
||||||
|
QR_TIMEOUT: int = 3
|
||||||
|
|
||||||
CHOICE_BORDER: int = 5
|
CHOICE_BORDER: int = 5
|
||||||
|
|
||||||
|
|||||||
2
timer.py
2
timer.py
@ -22,7 +22,7 @@ class Timer:
|
|||||||
self._rest = self._initial
|
self._rest = self._initial
|
||||||
|
|
||||||
def tick(self, dt: float):
|
def tick(self, dt: float):
|
||||||
if not self._enabled or self._current >= self._count:
|
if not self._enabled or self._seconds == 0 or self._current >= self._count:
|
||||||
return
|
return
|
||||||
|
|
||||||
self._rest -= dt
|
self._rest -= dt
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user