mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
2. Dev/add jf pedestal feature (#807)
This commit is contained in:
@ -1270,6 +1270,16 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setNumberOfFilterCells,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"getPedestalMode",
|
||||
(Result<defs::pedestalParameters>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getPedestalMode,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"setPedestalMode",
|
||||
(void (Detector::*)(const defs::pedestalParameters, sls::Positions)) &
|
||||
Detector::setPedestalMode,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getROI",
|
||||
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getROI,
|
||||
|
@ -19,6 +19,8 @@ void init_pattern(py::module &);
|
||||
void init_scan(py::module &);
|
||||
void init_source(py::module &);
|
||||
void init_duration(py::module &);
|
||||
void init_pedestal(py::module &);
|
||||
|
||||
PYBIND11_MODULE(_slsdet, m) {
|
||||
m.doc() = R"pbdoc(
|
||||
C/C++ API
|
||||
@ -37,6 +39,7 @@ PYBIND11_MODULE(_slsdet, m) {
|
||||
init_scan(m);
|
||||
init_source(m);
|
||||
init_duration(m);
|
||||
init_pedestal(m);
|
||||
// init_experimental(m);
|
||||
|
||||
py::module io = m.def_submodule("io", "Submodule for io");
|
||||
|
23
python/src/pedestal.cpp
Normal file
23
python/src/pedestal.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
#include "py_headers.h"
|
||||
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
void init_pedestal(py::module &m) {
|
||||
|
||||
using src = slsDetectorDefs::pedestalParameters;
|
||||
py::class_<src> pedestalParameters(m, "pedestalParameters");
|
||||
|
||||
pedestalParameters.def(py::init());
|
||||
pedestalParameters.def_readwrite("enable", &src::enable);
|
||||
pedestalParameters.def_readwrite("frames", &src::frames);
|
||||
pedestalParameters.def_readwrite("loops", &src::loops);
|
||||
pedestalParameters.def(pybind11::self == pybind11::self);
|
||||
|
||||
pedestalParameters.def("__repr__",
|
||||
[](const src &a) { return sls::ToString(a); });
|
||||
}
|
Reference in New Issue
Block a user