Get trimbits (#462)

* added the possibility to save settings file for m3 and eiger

* added save trimbits to gui

* update release notes

* python wip

* moved location of trimbits save option in gui

* python works

* updating getModule with all its parameters in the server side

* updating binaries
This commit is contained in:
Dhanya Thattil
2022-05-24 11:08:08 +02:00
committed by GitHub
parent d61741c28b
commit 365ac835eb
27 changed files with 528 additions and 244 deletions

View File

@ -1442,20 +1442,21 @@ class Detector(CppDetectorApi):
@property
def trimbits(self):
"""
[Eiger][Mythen3] Loads custom trimbit file to detector.
[Eiger][Mythen3] Loads/Saves custom trimbit file to detector.
Note
-----
If no extension specified, serial number of each module is attached.
:getter: Not implemented
:setter: Loads the trimbit file to detector
:getter: Saves the trimbits from the detector to file. Not implemented with 'trimbits'. Use saveTrimbits().
Example
-------
>>> d.trimbits = '/path_to_file/noise'
- 14:53:27.931 INFO: Settings file loaded: /path_to_file/noise.sn000
"""
return NotImplementedError("trimbits are set only")
raise NotImplementedError('trimbits is set only. Use saveTrimbits()')
@trimbits.setter
def trimbits(self, fname):
@ -2617,7 +2618,7 @@ class Detector(CppDetectorApi):
-------
>>> d.vetophoton = (2, 24, 2560, '/tmp/bla.txt')
"""
raise NotImplementedError('vetofile is set only')
raise NotImplementedError('vetophoton is set only')
@vetophoton.setter
def vetophoton(self, args):

View File

@ -144,6 +144,10 @@ void init_det(py::module &m) {
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::loadTrimbits,
py::arg(), py::arg() = Positions{})
.def("saveTrimbits",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::saveTrimbits,
py::arg(), py::arg() = Positions{})
.def("getAllTrimbits",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getAllTrimbits,
@ -187,12 +191,12 @@ void init_det(py::module &m) {
(void (Detector::*)(void (*)(double, int, void *), void *)) &
Detector::registerAcquisitionFinishedCallback,
py::arg(), py::arg())
.def(
"registerDataCallback",
(void (Detector::*)(
void (*)(detectorData *, uint64_t, uint32_t, void *), void *)) &
Detector::registerDataCallback,
py::arg(), py::arg())
.def("registerDataCallback",
(void (Detector::*)(
void (*)(sls::detectorData *, uint64_t, uint32_t, void *),
void *)) &
Detector::registerDataCallback,
py::arg(), py::arg())
.def("getNumberOfFrames",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getNumberOfFrames,