REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches

Data acquisition configuration. More...

#include <base.h>

Public Member Functions

 DAQConfig ()=default
 Construct a configuration using default values.
 
 DAQConfig (uint8_t num_channels, unsigned int sample_rate)
 Construct a configuration using num_channels and sample_rate.
 
uint8_t get_num_channels () const
 Get the configured number of channels.
 
unsigned int get_sample_rate () const
 Get the configured sample rate.
 
bool should_sample_op () const
 Get whether to sample during OP.
 
bool should_sample_op_end () const
 Get whether to sample at the end of OP.
 
bool is_valid () const
 Check whether the configuration is valid.
 
float index_to_time (size_t index) const
 Convert a sample index to a time in seconds.
 
 operator bool () const
 Casting to bool checks whether we actually want to do any sampling.
 

Static Public Member Functions

static DAQConfig from_json (JsonObjectConst &&json)
 Construct a configuration from a JsonObject.
 

Detailed Description

Data acquisition configuration.

This object holds configuration values used mostly for continuous acquisition and is usually accessed via the run::Run::daq_config attribute.

Definition at line 29 of file base.h.

Constructor & Destructor Documentation

◆ DAQConfig() [1/2]

daq::DAQConfig::DAQConfig ( )
default

Construct a configuration using default values.

◆ DAQConfig() [2/2]

FLASHMEM daq::DAQConfig::DAQConfig ( uint8_t num_channels,
unsigned int sample_rate )

Construct a configuration using num_channels and sample_rate.

Definition at line 7 of file base.cpp.

Member Function Documentation

◆ from_json()

FLASHMEM daq::DAQConfig daq::DAQConfig::from_json ( JsonObjectConst && json)
static

Construct a configuration from a JsonObject.

Definition at line 12 of file base.cpp.

Referenced by run::Run::from_json().

◆ get_num_channels()

uint8_t daq::DAQConfig::get_num_channels ( ) const

Get the configured number of channels.

Definition at line 33 of file base.cpp.

◆ get_sample_rate()

unsigned int daq::DAQConfig::get_sample_rate ( ) const

Get the configured sample rate.

Definition at line 35 of file base.cpp.

◆ index_to_time()

float daq::DAQConfig::index_to_time ( size_t index) const

Convert a sample index to a time in seconds.

Definition at line 51 of file base.cpp.

References index().

◆ is_valid()

FLASHMEM bool daq::DAQConfig::is_valid ( ) const

Check whether the configuration is valid.

Warning
This actually does not check all requirements (e.g. divisibility of sample_rate)

Definition at line 41 of file base.cpp.

◆ operator bool()

daq::DAQConfig::operator bool ( ) const
inlineexplicit

Casting to bool checks whether we actually want to do any sampling.

Warning
This is not quite correct any more.

Definition at line 63 of file base.h.

◆ should_sample_op()

bool daq::DAQConfig::should_sample_op ( ) const

Get whether to sample during OP.

Definition at line 37 of file base.cpp.

◆ should_sample_op_end()

bool daq::DAQConfig::should_sample_op_end ( ) const

Get whether to sample at the end of OP.

Definition at line 39 of file base.cpp.


The documentation for this class was generated from the following files: