Go to the documentation of this file.
12 #ifndef RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
13 #define RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
30 constexpr
size_t NUM_SLOPES =
32 m_result.resize(NUM_SLOPES);
42 m_samples.resize(to_read);
44 m_samples_to_read = to_read;
49 m_samples[m_sample_idx++] = sample.
wfs.
slopes;
59 if (m_sample_idx != m_samples_to_read) {
74 for (
auto& slope : m_result) {
78 for (
auto const& sample : m_samples) {
80 for (
auto const& slope : sample) {
81 m_result[idx++] += slope;
85 for (
auto& slope : m_result) {
86 slope = slope / m_samples.size();
91 unsigned m_sample_idx;
92 unsigned m_samples_to_read;
94 std::vector<float> m_result;
99 #endif // RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
WfsLoopBaseTopic< N_SUBAPS > wfs
Definition: topics.hpp:30
Provides macros and utilities for exception handling.
Definition: computation.hpp:22
Algorithm
Definition: computation.hpp:26
std::vector< float > const & avg_values
Definition: computation.hpp:53
void SetDynamicConfig(unsigned to_read)
Definition: computation.hpp:40
The RtctkException class is the base class for all Rtctk exceptions.
Definition: exceptions.hpp:207
void Reset()
Definition: computation.hpp:36
std::array< float, 2 *NSUBAPS > slopes
Definition: topics.hpp:24
void OnDataAvailable(ScaoLoopTopic const &sample)
Definition: computation.hpp:48
Definition: topics.hpp:28
void ComputeMean()
Definition: computation.hpp:73
Definition: businessLogic.hpp:24
Computation()
Definition: computation.hpp:28
slopes
Definition: rtctkExampleDataTaskGenFitsData.py:9
Definition: computation.hpp:52
Result Compute(Algorithm algorithm)
Definition: computation.hpp:56
Common topic definitions used in various examples.