32 std::unique_ptr<Daq> _inputStream, _outputStream;
41 std::list<InDataHandler *> _inDataHandlers;
42 mutable std::mutex _inDataHandler_mtx;
48 std::shared_ptr<Siggen> _siggen;
49 std::mutex _siggen_mtx;
54 std::vector<std::unique_ptr<SeriesBiquad>> _inputFilters;
57 mutable std::recursive_mutex _devices_mtx;
103 std::scoped_lock
lck(_devices_mtx);
105 for(
const auto& dev: _devices) {
106 d2.push_back(dev->clone());
123 std::function<
void()> callback = std::function<
void()>());
145 return bool(_inputStream);
148 return bool(_outputStream);
194 void setSiggen(std::shared_ptr<Siggen> s);
197 void inCallback(
const DaqData &data);
198 void outCallback(
DaqData &data);
222 void rescanDAQDevices_impl(std::function<
void()> callback);
225 const std::thread::id main_thread_id;
226 void checkRightThread()
const;
228 void checkRightThread()
const {}
Information regarding a stream.
bool runningOK() const
Returns true if everything is OK with a certain stream and the stream is running.
Configuration of a DAQ device.
Data coming from / going to DAQ. Non-interleaved format, which means data in buffer is ordered by cha...
Base cass for all DAQ (Data Acquisition) interfaces. A DAQ can be a custom device,...
Simple wrapper around BS::thread_pool that makes a BS::thread_pool a singleton, such that a thread po...
A set of Biquad filters in series.
Signal generation abstract base class. Implementation is required for resetImpl(),...
Stream manager. Used to manage the input and output streams. Implemented as a singleton: only one str...
static std::shared_ptr< StreamMgr > getInstance()
Get access to stream manager instance.
Daq::StreamStatus getStreamStatus(const StreamType type) const
Get the streamstatus object corresponding to a given stream.
DeviceInfoList getDeviceInfo() const
Obtain a list of devices currently available. When the StreamMgr is first created,...
void rescanDAQDevices(bool background=false, std::function< void()> callback=std::function< void()>())
Triggers a background scan of the DAQ devices, which updates the internally stored list of devices....
void startStream(const DaqConfiguration &config)
Start a stream based on given configuration.
const Daq * getDaq(StreamType type) const
Get DAQ pointer for a given stream. Gives a nullptr if stream is not running.
bool isStreamRunning(const StreamType type) const
StreamMgr & operator=(const StreamMgr &)=delete
StreamMgr(const StreamMgr &)=delete
void setSiggen(std::shared_ptr< Siggen > s)
Set active signal generator for output streams. Only one ‘Siggen’ is active at the same time....
void stopAllStreams()
Stop and delete all streams. Also called on destruction of the StreamMgr.
void stopStream(const StreamType stype)
Stop stream of given type (input / output/ duplex);.
bool isStreamRunningOK(const StreamType type) const
Check if a certain stream is running. If running with no errors, it returns true. If an error occured...
std::vector< std::unique_ptr< DeviceInfo > > DeviceInfoList
std::scoped_lock< std::mutex > lck
size_t us
We often use boolean values.