mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
- 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
21 lines
643 B
Python
Executable File
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') |