42 lines
1.5 KiB
C++
42 lines
1.5 KiB
C++
#include "lasp_daq.h"
|
|
#include <pybind11/numpy.h>
|
|
#include <pybind11/stl.h>
|
|
#include <stdint.h>
|
|
|
|
using std::cerr;
|
|
namespace py = pybind11;
|
|
|
|
void init_daq(py::module &m) {
|
|
|
|
/// Daq
|
|
py::class_<Daq, DaqConfiguration, DeviceInfo> daq(m, "Daq");
|
|
|
|
/// Daq::StreamStatus
|
|
py::class_<Daq::StreamStatus> ss(daq, "StreamStatus");
|
|
ss.def("error", &Daq::StreamStatus::error);
|
|
ss.def("runningOK", &Daq::StreamStatus::runningOK);
|
|
ss.def_readonly("isRunning", &Daq::StreamStatus::isRunning);
|
|
|
|
/// Daq::StreamStatus::StreamError
|
|
py::enum_<Daq::StreamStatus::StreamError>(ss, "StreamError")
|
|
.value("noError", Daq::StreamStatus::StreamError::noError)
|
|
.value("inputXRun", Daq::StreamStatus::StreamError::inputXRun)
|
|
.value("outputXRun", Daq::StreamStatus::StreamError::outputXRun)
|
|
.value("driverError", Daq::StreamStatus::StreamError::driverError)
|
|
.value("systemError", Daq::StreamStatus::StreamError::systemError)
|
|
.value("threadError", Daq::StreamStatus::StreamError::threadError)
|
|
.value("logicError", Daq::StreamStatus::StreamError::logicError);
|
|
|
|
ss.def("errorMsg", &Daq::StreamStatus::errorMsg);
|
|
|
|
/// Daq
|
|
daq.def("neninchannels", &Daq::neninchannels,
|
|
py::arg("include_monitor") = true);
|
|
|
|
daq.def("nenoutchannels", &Daq::nenoutchannels);
|
|
daq.def("samplerate", &Daq::samplerate);
|
|
daq.def("dataType", &Daq::dataType);
|
|
daq.def("framesPerBlock", &Daq::framesPerBlock);
|
|
daq.def("getStreamStatus", &Daq::getStreamStatus);
|
|
}
|