Introduced pattern class

This commit is contained in:
Erik Frojdh
2020-11-27 10:03:15 +01:00
parent 8ca1d9c50c
commit d9b2a90651
22 changed files with 384 additions and 118 deletions

View File

@ -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)