mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00

* initital implementation * datetime replaces with sls::Duration in Python C bindings * using custom type caster * fix for conversion to seconds * added set_count in python * common header for pybind11 includes authored-by: Erik Frojdh <erik.frojdh@psi.ch>
25 lines
859 B
C++
25 lines
859 B
C++
// 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_source(py::module &m) {
|
|
|
|
using src = slsDetectorDefs::currentSrcParameters;
|
|
py::class_<src> currentSrcParameters(m, "currentSrcParameters");
|
|
|
|
currentSrcParameters.def(py::init());
|
|
currentSrcParameters.def_readwrite("enable", &src::enable);
|
|
currentSrcParameters.def_readwrite("fix", &src::fix);
|
|
currentSrcParameters.def_readwrite("normal", &src::normal);
|
|
currentSrcParameters.def_readwrite("select", &src::select);
|
|
currentSrcParameters.def(pybind11::self == pybind11::self);
|
|
|
|
currentSrcParameters.def("__repr__",
|
|
[](const src &a) { return sls::ToString(a); });
|
|
}
|