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