pub struct DaqConfig {
pub api: DaqApiDescriptor,
pub device_name: String,
pub inchannel_config: Vec<DaqChannel>,
pub outchannel_config: Vec<DaqChannel>,
pub dtype: DataType,
pub digitalHighPassCutOn: Flt,
pub sampleRateIndex: usize,
pub framesPerBlockIndex: usize,
pub monitorOutput: bool,
}Expand description
Configuration of a device.
Fields§
§api: DaqApiDescriptorThe API
device_name: StringDevice name. Should match when starting a stream
inchannel_config: Vec<DaqChannel>Configuration of the input channels
outchannel_config: Vec<DaqChannel>Configuration of the output channels
dtype: DataTypeThe data type to use
digitalHighPassCutOn: FltWhether to apply a digital high pass on the input. <= 0 means disabled. > 0 means, the value specifies the cut-on frequency for the first order high pass filter.
sampleRateIndex: usizeThe index to use in the list of possible sample rates
framesPerBlockIndex: usizeThe index to use in the list of possible frames per block
monitorOutput: boolUsed when output channels should be monitored, i.e. reverse-looped back as input channels.
Implementations§
Source§impl DaqConfig
impl DaqConfig
Sourcepub fn numberEnabledInChannels(&self) -> usize
pub fn numberEnabledInChannels(&self) -> usize
Returns the total number of channels that appear in a running input stream.
Sourcepub fn numberEnabledOutChannels(&self) -> usize
pub fn numberEnabledOutChannels(&self) -> usize
Returns the total number of channels that appear in a running output stream.
Sourcepub fn sampleRate(&self, dev: &DeviceInfo) -> Flt
pub fn sampleRate(&self, dev: &DeviceInfo) -> Flt
Provide samplerate, based on device and specified sample rate index
Sourcepub fn framesPerBlock(&self, dev: &DeviceInfo) -> usize
pub fn framesPerBlock(&self, dev: &DeviceInfo) -> usize
Provide samplerate, based on device and specified sample rate index
Sourcepub fn enabledInChannels(&self) -> Vec<DaqChannel>
pub fn enabledInChannels(&self) -> Vec<DaqChannel>
Returns vec of channel configuration for enabled input channels only
Sourcepub fn enabledInchannelsList(&self) -> Vec<usize>
pub fn enabledInchannelsList(&self) -> Vec<usize>
Returns a list of enabled input channel numbers as indices in the list of all input channels (enabled and not)
Sourcepub fn enabledOutChannels(&self) -> Vec<DaqChannel>
pub fn enabledOutChannels(&self) -> Vec<DaqChannel>
Returns vec of channel configuration for enabled output channels only
Sourcepub fn highestEnabledInChannel(&self) -> Option<usize>
pub fn highestEnabledInChannel(&self) -> Option<usize>
Returns the channel number of the highest enabled input channel, if any.
Sourcepub fn highestEnabledOutChannel(&self) -> Option<usize>
pub fn highestEnabledOutChannel(&self) -> Option<usize>
Returns the channel number of the highest enabled output channel, if any.
Sourcepub fn setAllOutputEnabled(&mut self, enabled: bool)
pub fn setAllOutputEnabled(&mut self, enabled: bool)
Change state of all output channels, enables them all, or disables them all.
Source§impl DaqConfig
impl DaqConfig
Sourcepub fn newFromDeviceInfo(devinfo: &DeviceInfo) -> DaqConfig
pub fn newFromDeviceInfo(devinfo: &DeviceInfo) -> DaqConfig
Creates a new default device configuration for a given device as specified with the DeviceInfo descriptor.
Sourcepub fn serialize_TOML(&self, writer: &mut dyn Write) -> Result<()>
pub fn serialize_TOML(&self, writer: &mut dyn Write) -> Result<()>
Serialize DaqConfig object to TOML.
Args
- writer: Output writer, can be file or string, or anything that is std::io::Write
Sourcepub fn deserialize_TOML<T>(reader: &mut T) -> Result<DaqConfig>where
T: Read,
pub fn deserialize_TOML<T>(reader: &mut T) -> Result<DaqConfig>where
T: Read,
Deserialize structure from TOML data
§Args
- reader: implements the Read trait, from which we read the data.
Sourcepub fn deserialize_TOML_str(st: &str) -> Result<DaqConfig>
pub fn deserialize_TOML_str(st: &str) -> Result<DaqConfig>
Sourcepub fn serialize_TOML_file(&self, file: &PathBuf) -> Result<()>
pub fn serialize_TOML_file(&self, file: &PathBuf) -> Result<()>
Write this configuration to a TOML file.
Args
- file: Name of file to write to
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DaqConfig
impl<'de> Deserialize<'de> for DaqConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'py> IntoPyObject<'py> for DaqConfig
impl<'py> IntoPyObject<'py> for DaqConfig
Source§type Output = Bound<'py, <DaqConfig as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <DaqConfig as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for DaqConfig
impl PyClassImpl for DaqConfig
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§type ThreadChecker = SendablePyClass<DaqConfig>
type ThreadChecker = SendablePyClass<DaqConfig>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<DaqConfig> for PyClassImplCollector<DaqConfig>
impl PyMethods<DaqConfig> for PyClassImplCollector<DaqConfig>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyStubType for DaqConfig
impl PyStubType for DaqConfig
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
Source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for DaqConfig
impl PyTypeInfo for DaqConfig
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for DaqConfig
impl StructuralPartialEq for DaqConfig
Auto Trait Implementations§
impl Freeze for DaqConfig
impl RefUnwindSafe for DaqConfig
impl Send for DaqConfig
impl Sync for DaqConfig
impl Unpin for DaqConfig
impl UnwindSafe for DaqConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.