Fix pellicule compte à rebours + auto-détection DSLR
- draw_compte() pellicule : suppression de l'overlay global qui masquait la bande film pendant le compte à rebours - _cam_loop() : ne quitte plus en mode simulation, tente une reconnexion automatique toutes les 8s si le DSLR est branché après démarrage - _reconnect_cam() : fonctionne aussi depuis le mode simulation (bouton admin) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -713,9 +713,22 @@ class PB:
|
||||
|
||||
# ── Thread caméra ────────────────────────────────────────────────────────
|
||||
def _cam_loop(self):
|
||||
if self.sim: return
|
||||
errs = 0
|
||||
while True:
|
||||
# En simulation : tentative de connexion automatique toutes les 8s
|
||||
if self.sim:
|
||||
time.sleep(8)
|
||||
for _ in range(2):
|
||||
try:
|
||||
c = gp.Camera(); c.init()
|
||||
if self.cam:
|
||||
try: self.cam.exit()
|
||||
except: pass
|
||||
self.cam = c; self.sim = False; self.prev_actif = True
|
||||
print("DSLR détecté automatiquement")
|
||||
break
|
||||
except: time.sleep(1)
|
||||
continue
|
||||
if self.prev_actif:
|
||||
try:
|
||||
if self.cam is None:
|
||||
@@ -1245,7 +1258,7 @@ class PB:
|
||||
T = self.T
|
||||
if self._is_pell():
|
||||
self._draw_pellicule(show_live=True)
|
||||
self._overlay(90)
|
||||
# Pas d'overlay global : le halo coloré suffit pour la lisibilité
|
||||
else:
|
||||
self._lv(); self._overlay(110)
|
||||
ch=str(self.chiffre)
|
||||
@@ -2056,7 +2069,6 @@ class PB:
|
||||
c[section][key]=max(mini,min(maxi,v+delta)); cfg_save(c); self.cfg=c
|
||||
|
||||
def _reconnect_cam(self):
|
||||
if self.sim: return
|
||||
self.prev_actif=False; time.sleep(0.5)
|
||||
try:
|
||||
if self.cam: self.cam.exit()
|
||||
|
||||
Reference in New Issue
Block a user