ctb adc names (#757)

* first draft of adc names

* fixed tests

* formatting

* added python functions in src

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
2023-05-31 21:07:07 +02:00
committed by GitHub
parent 225e5490d2
commit b9a346a396
12 changed files with 564 additions and 50 deletions

View File

@ -1766,7 +1766,7 @@ class Detector(CppDetectorApi):
@property
def daclist(self):
"""
List of enums for every dac for this detector.
List of enums/names for every dac for this detector.
:setter: Only implemented for Chiptestboard
"""
@ -1776,6 +1776,20 @@ class Detector(CppDetectorApi):
def daclist(self, value):
self.setDacNames(value)
@property
def adclist(self):
"""
List of names for every adc for this detector.
:setter: Only implemented for Chiptestboard
"""
return self.getAdcNames()
@adclist.setter
def adclist(self, value):
self.setAdcNames(value)
@property
def dacvalues(self):
"""Gets the dac values for every dac for this detector."""

View File

@ -1647,10 +1647,33 @@ void init_det(py::module &m) {
(defs::dacIndex(Detector::*)(const std::string &)) &
Detector::getDacIndex,
py::arg());
CppDetectorApi.def(
"setDacName",
(void (Detector::*)(defs::dacIndex, const std::string &)) &
Detector::setDacName,
py::arg(), py::arg());
CppDetectorApi.def("getDacName",
(std::string(Detector::*)(defs::dacIndex)) &
Detector::getDacName,
py::arg());
CppDetectorApi.def("setAdcNames",
(void (Detector::*)(const std::vector<std::string>)) &
Detector::setAdcNames,
py::arg());
CppDetectorApi.def("getAdcNames",
(std::vector<std::string>(Detector::*)() const) &
Detector::getAdcNames);
CppDetectorApi.def("getAdcIndex",
(int (Detector::*)(const std::string &)) &
Detector::getAdcIndex,
py::arg());
CppDetectorApi.def("setAdcName",
(void (Detector::*)(const int, const std::string &)) &
Detector::setAdcName,
py::arg(), py::arg());
CppDetectorApi.def("getAdcName",
(std::string(Detector::*)(int)) & Detector::getAdcName,
py::arg());
CppDetectorApi.def(
"setPattern",
(void (Detector::*)(const std::string &, sls::Positions)) &