Dhanya Thattil 2dc0963c56
Dev/reg bit change no validate (#970)
- do not validate write reg, setbit and clearbit by default anymore
- --validate will force validation on the bitmask or entire reg
- remove return value for write reg (across server to client, but thankfully not in the Detector class)
- extend validation into writereg, setbit and clearbit for Eiger (always special)
-  need to check python (TODO)
- missed the rx_zmqip implementations in detector.h and python bindings
2024-09-30 16:54:12 +02:00

21 lines
643 B
Python
Executable File

# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
class Register:
def __init__(self, detector):
self._detector = detector
def __getitem__(self, key):
return self._detector.readRegister(key)
def __setitem__(self, key, value):
self._detector.writeRegister(key, value, False)
class Adc_register:
def __init__(self, detector):
self._detector = detector
def __setitem__(self, key, value):
self._detector.writeAdcRegister(key, value)
def __getitem__(self, key):
raise ValueError('Adc registers cannot be read back')