mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
Introduced pattern class
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "sls/Pattern.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
namespace py = pybind11;
|
||||
void init_enums(py::module &m) {
|
||||
@ -17,20 +18,6 @@ void init_enums(py::module &m) {
|
||||
xy.def_readwrite("x", &slsDetectorDefs::xy::x);
|
||||
xy.def_readwrite("y", &slsDetectorDefs::xy::y);
|
||||
|
||||
py::class_<slsDetectorDefs::patternParameters> patternParameters(
|
||||
m, "patternParameters");
|
||||
|
||||
using pat = slsDetectorDefs::patternParameters;
|
||||
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, loop, nloop, wait,
|
||||
waittime);
|
||||
|
||||
patternParameters.def(py::init());
|
||||
patternParameters.def("numpy_view", [](py::object &obj) {
|
||||
pat &o = obj.cast<pat &>();
|
||||
return py::array_t<pat>(1, &o, obj);
|
||||
});
|
||||
patternParameters.def("load", &pat::load);
|
||||
|
||||
py::enum_<slsDetectorDefs::detectorType>(Defs, "detectorType")
|
||||
.value("GENERIC", slsDetectorDefs::detectorType::GENERIC)
|
||||
.value("EIGER", slsDetectorDefs::detectorType::EIGER)
|
||||
|
Reference in New Issue
Block a user