rewrote CameraBasler as device

This commit is contained in:
2022-07-14 13:10:54 +02:00
parent af5336a375
commit 5e9caf1c0e
+31 -22
View File
@@ -1,29 +1,38 @@
from slic.core.adjustable import PVAdjustable, PVEnumAdjustable
from slic.core.device import Device, SimpleDevice
class CameraBasler:
class CameraBasler(Device):
def __init__(self, pvname, name=None):
self.pvname = pvname
self.name = name
self.initialize = PVEnumAdjustable(self.pvname + ":INIT")
self.running = PVEnumAdjustable(self.pvname + ":CAMERA")
self.board_no = PVAdjustable(self.pvname + ":BOARD")
self.serial_no = PVAdjustable(self.pvname + ":SERIALNR")
self._exposure_time = PVAdjustable(self.pvname + ":EXPOSURE")
self._acq_mode = PVEnumAdjustable(self.pvname + ":ACQMODE")
self._req_mode = PVEnumAdjustable(self.pvname + ":RECMODE")
self._store_mode = PVEnumAdjustable(self.pvname + ":STOREMODE")
self._binx = PVAdjustable(self.pvname + ":BINY")
self._biny = PVAdjustable(self.pvname + ":BINY")
self._roixmin = PVAdjustable(self.pvname + ":REGIONX_START")
self._roixmax = PVAdjustable(self.pvname + ":REGIONX_END")
self._roiymin = PVAdjustable(self.pvname + ":REGIONY_START")
self._roiymax = PVAdjustable(self.pvname + ":REGIONY_END")
self._set_parameters = PVEnumAdjustable(self.pvname + ":SET_PARAM")
self.trigger_on = PVEnumAdjustable(self.pvname + ":TRIGGER")
self.trigger_source = PVEnumAdjustable(self.pvname + ":TRIGGERSOURCE")
# self.trigger_edge = PVEnumAdjustable(self.pvname + ":TRIGGEREDGE")
def __init__(self, ID, **kwargs):
super().__init__(ID, **kwargs)
self.control = SimpleDevice(ID + "-CTRL",
initialize = PVEnumAdjustable(ID + ":INIT"),
running = PVEnumAdjustable(ID + ":CAMERA"),
board_no = PVAdjustable(ID + ":BOARD"),
serial_no = PVAdjustable(ID + ":SERIALNR")
)
self.parameters = SimpleDevice(ID + "-PARAM",
exposure = PVAdjustable(ID + ":EXPOSURE"),
bin_x = PVAdjustable(ID + ":BINY"),
bin_y = PVAdjustable(ID + ":BINY"),
roi_x_min = PVAdjustable(ID + ":REGIONX_START"),
roi_x_max = PVAdjustable(ID + ":REGIONX_END"),
roi_y_min = PVAdjustable(ID + ":REGIONY_START"),
roi_y_max = PVAdjustable(ID + ":REGIONY_END"),
acq_mode = PVEnumAdjustable(ID + ":ACQMODE"),
req_mode = PVEnumAdjustable(ID + ":RECMODE"),
store_mode = PVEnumAdjustable(ID + ":STOREMODE"),
set = PVEnumAdjustable(ID + ":SET_PARAM")
)
self.trigger = SimpleDevice(ID + "-TRIG",
on = PVEnumAdjustable(ID + ":TRIGGER"),
source = PVEnumAdjustable(ID + ":TRIGGERSOURCE"),
edge = PVEnumAdjustable(ID + ":TRIGGEREDGE")
)