mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
Setting pattern from memory (#218)
* ToString accepts c-style arrays * added patternParameters to python * fixed patwait time bug in validation * moved load from file function to patterParameters * server using patternparamters structure to get pattern Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
* warning */
|
||||
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/numpy.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
@ -16,6 +17,20 @@ 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, patioctrl, patlimits, patloop, patnloop,
|
||||
patwait, patwaittime);
|
||||
|
||||
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