pub(crate) struct SampleConfig {Show 13 fields
pub(crate) scans_per_read: i32,
pub(crate) scan_rate_hz: f64,
pub(crate) channels: Vec<u8>,
pub(crate) asset_number: u32,
pub(crate) labjack_name: String,
pub(crate) site_id: Option<String>,
pub(crate) box_id: Option<String>,
pub(crate) source_type: Option<String>,
pub(crate) source_id: Option<String>,
pub(crate) nats_subject: String,
pub(crate) nats_stream: String,
pub(crate) rotate_secs: u64,
pub(crate) calibrations: HashMap<u8, CalibrationSpec>,
}Expand description
Normalized archiver configuration used to manage channel loggers.
This shape combines stream identity, channel list, rotation cadence, and
parsed per-channel calibrations. main compares each channel’s derived subject,
consumer name, stream, asset and rotate_secs against the running writer to decide
whether to restart it.
Fields§
§scans_per_read: i32Scans per LabJack stream read. Not used by the archiver.
scan_rate_hz: f64Requested scan rate in Hz. Not used by the archiver.
channels: Vec<u8>Channels to archive.
asset_number: u32Asset number; names the asset<NNN> output directory.
labjack_name: StringLabJack device name; fallback source ID for subjects and consumer names.
site_id: Option<String>Site identifier for the subject namespace.
box_id: Option<String>Box identifier for the subject namespace and consumer names.
source_type: Option<String>Source type for consumer names.
source_id: Option<String>Source identifier for the subject namespace and consumer names.
nats_subject: StringSubject root, for example avenabox or avenars.
nats_stream: StringJetStream stream that holds the channel subjects.
rotate_secs: u64Length of one file rotation window, in seconds.
calibrations: HashMap<u8, CalibrationSpec>Calibration per channel; channels without an entry use the default spec.
Trait Implementations§
Source§impl Clone for SampleConfig
impl Clone for SampleConfig
Source§fn clone(&self) -> SampleConfig
fn clone(&self) -> SampleConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SampleConfig
impl Debug for SampleConfig
Source§impl<'de> Deserialize<'de> for SampleConfig
impl<'de> Deserialize<'de> for SampleConfig
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 From<(SensorConfig, &SampleConfig)> for SampleConfig
impl From<(SensorConfig, &SampleConfig)> for SampleConfig
Source§fn from((raw, base): (SensorConfig, &SampleConfig)) -> Self
fn from((raw, base): (SensorConfig, &SampleConfig)) -> Self
Replaces the sensor settings of a config while keeping its identity fields.
Channels, sampling fields and calibrations come from the new sensor section.
Asset, names, subject, stream and rotate_secs are copied from base.
§Arguments
raw- New sensor settings section.base- Existing config whose identity fields are kept.