DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAPHNEEthStreamFrame.hxx
Go to the documentation of this file.
1
3
4inline uint8_t
5DAPHNEEthStreamFrame::get_channel(const uint i_channel) const
6{
7 if (i_channel >= s_num_channels) {
8 throw std::out_of_range(
9 std::format("Requested channel index of {} is outside of allowed range 0-{}", i_channel, s_num_channels - 1));
10 }
11
12 return header.channel_words[i_channel].channel; // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
13}
14
15inline void
16DAPHNEEthStreamFrame::set_channel(const uint i_channel, const uint8_t new_channel_val)
17{
18 if (i_channel >= s_num_channels) {
19 throw std::out_of_range(
20 std::format("Requested channel index of {} is outside of allowed range 0-{}", i_channel, s_num_channels - 1));
21 }
22
23 header.channel_words[i_channel].channel = // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
24 new_channel_val;
25}
26
27inline uint16_t
28DAPHNEEthStreamFrame::get_adc(uint i_adc, uint i_channel) const
29{
30 return static_cast<uint16_t>(
33 static_cast<int>(i_adc), static_cast<int>(i_channel), adc_words));
34}
35
36inline void
37DAPHNEEthStreamFrame::set_adc(uint i_channel, uint i_adc, uint16_t val)
38{ // NOLINT
41 static_cast<int>(i_adc), static_cast<int>(i_channel), val, adc_words);
42}
43
44} // namespace dunedaq::fddetdataformats
void set_adc(uint i_channel, uint i_adc, uint16_t val)
Set the i_adc-th ADC value of i_channel-th channel in the frame to val.
uint16_t get_adc(uint i_adc, uint i_channel) const
Get the i_adc-th ADC value of i_channel-th channel in the frame.
uint8_t get_channel(const uint i_channel) const
Get the channel identifier of the frame.
void set_channel(const uint i_channel, const uint8_t new_channel_val)
Set the channel identifier of the frame.
WordType get_adc_2d_as_1d(const int i_adc, const int i_channel, const WordType(&adc_matrix)[NWords])
Definition Utils.hpp:40
void set_adc_2d_as_1d(const int i_adc, const int i_channel, const WordType adc_val, WordType(&adc_matrix)[NWords])
Definition Utils.hpp:94