LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_daq.cpp
Go to the documentation of this file.
1#include "lasp_daq.h"
2#include <pybind11/numpy.h>
3#include <pybind11/stl.h>
4#include <stdint.h>
5
6using std::cerr;
7namespace py = pybind11;
8
9void init_daq(py::module &m) {
10
12 py::class_<Daq, DaqConfiguration, DeviceInfo> daq(m, "Daq");
13
15 py::class_<Daq::StreamStatus> ss(daq, "StreamStatus");
16 ss.def("error", &Daq::StreamStatus::error);
17 ss.def("runningOK", &Daq::StreamStatus::runningOK);
18 ss.def_readonly("isRunning", &Daq::StreamStatus::isRunning);
19
21 py::enum_<Daq::StreamStatus::StreamError>(ss, "StreamError")
29
30 ss.def("errorMsg", &Daq::StreamStatus::errorMsg);
31
33 daq.def("neninchannels", &Daq::neninchannels,
34 py::arg("include_monitor") = true);
35
36 daq.def("nenoutchannels", &Daq::nenoutchannels);
37 daq.def("samplerate", &Daq::samplerate);
38 daq.def("dataType", &Daq::dataType);
39 daq.def("framesPerBlock", &Daq::framesPerBlock);
40 daq.def("getStreamStatus", &Daq::getStreamStatus);
41}
bool runningOK() const
Returns true if everything is OK with a certain stream and the stream is running.
Definition lasp_daq.h:82
bool error() const
Check if stream has error.
Definition lasp_daq.h:70
std::string errorMsg() const
Definition lasp_daq.h:74
us neninchannels(bool include_monitorchannels=true) const
Returns the number of enabled input channels.
Definition lasp_daq.cpp:99
double samplerate() const
Returns current sample rate.
Definition lasp_daq.cpp:78
DataTypeDescriptor::DataType dataType() const
Returns datatype (enum) corresponding to the datatype of the samples.
Definition lasp_daq.cpp:83
virtual StreamStatus getStreamStatus() const =0
Get stream status corresponding to current DAQ.
us framesPerBlock() const
The number of frames that is send in a block of DaqData.
Definition lasp_daq.h:207
us nenoutchannels() const
Returns the number of enabled output channels.
Definition lasp_daq.cpp:104
void init_daq(py::module &m)
Definition lasp_daq.cpp:9