49 lines
1.3 KiB
Rust
49 lines
1.3 KiB
Rust
//! Provides stream messages that come from a running stream
|
|
use crate::config::*;
|
|
use crate::daq::Qty;
|
|
use crate::siggen::Siggen;
|
|
use anyhow::{bail, Result};
|
|
use crossbeam::channel::Sender;
|
|
use reinterpret::{reinterpret_slice, reinterpret_vec};
|
|
use std::any::TypeId;
|
|
use std::sync::{Arc, RwLock};
|
|
use std::u128::MAX;
|
|
use strum_macros::Display;
|
|
|
|
use super::*;
|
|
|
|
/// Input stream messages, to be send to handlers.
|
|
#[derive(Clone, Debug)]
|
|
pub enum InStreamMsg {
|
|
/// Raw stream data that is coming from a device. This is interleaved data. The number of channels is correct and
|
|
/// specified in the stream metadata.
|
|
StreamData(Arc<StreamData>),
|
|
|
|
/// An error has occured in the stream
|
|
StreamError(StreamError),
|
|
|
|
/// Stream data converted to floating point with sample width as
|
|
/// compiled in.
|
|
ConvertedStreamData(usize, Arc<crate::config::Dmat>),
|
|
|
|
/// new Stream metadata enters the scene. Probably a new stream started.
|
|
StreamStarted(Arc<StreamMetaData>),
|
|
|
|
/// An existing stream stopped.
|
|
StreamStopped,
|
|
}
|
|
|
|
|
|
/// Stream types that can be started
|
|
///
|
|
#[cfg_attr(feature = "python-bindings", pyclass)]
|
|
#[derive(PartialEq, Clone, Copy)]
|
|
pub enum StreamType {
|
|
/// Input-only stream
|
|
Input,
|
|
/// Output-only stream
|
|
Output,
|
|
/// Input and output at the same time
|
|
Duplex,
|
|
}
|