DAQ: functionality for auto_exposure added using enums

This commit is contained in:
2026-01-29 16:45:48 +01:00
parent 6db8387dc9
commit 6bacf63117
+9 -3
View File
@@ -1,6 +1,12 @@
from enum import Enum
import epics
import numpy as np
class AutoEnum(Enum):
MANUAL = 0
ONCE = 1
AUTO = 2
class epicsAD(object):
def __init__(self, prefix, cam="cam1:", image="image1:"):
@@ -133,10 +139,10 @@ class epicsAD(object):
self.expo.put(expo) # 20 hz acquisition
self.acquire.put(1)
def set_auto(self):
def set_auto(self, state: AutoEnum):
self.acquire.put(0, wait=True)
self.gain_mode.put(2) # automatic gain control
self.expo_mode.put(2) # automatic exposure control
self.gain_mode.put(state.value) # automatic gain control
self.expo_mode.put(state.value) # automatic exposure control
self.acquire.put(1)
def set_auto_once(self):