Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef INC_TECH_CHANNEL_MER_DETECTOR_H_
- #define INC_TECH_CHANNEL_MER_DETECTOR_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "tech_channel.h"
- class MER_Detector : public Tech_Channel {
- public:
- MER_Detector(const MER_Detector& rhs) = delete;
- MER_Detector(MER_Detector&& rhs) = delete;
- MER_Detector& operator =(const MER_Detector& rhs) = delete;
- MER_Detector& operator =(MER_Detector&& rhs) = delete;
- MER_Detector(int adc_freq, int adc_ch_mask);
- virtual void push_to_calc(int64_t data1_, int64_t data2_, int64_t data3_) override;
- virtual const int get_triggered() const override;
- virtual const int get_trigglvl() const override;
- #if DEBUG
- void show_triggered();
- #endif
- private:
- void calc_trigger();
- static constexpr int mer_factor = 4;
- static constexpr int trigg_lvl = 40;
- const int top_freq = 5;
- const int estimate_denominator = 100;
- bool is_filled = false;
- size_t position = 0;
- int num_of_adcs = 0;
- size_t mer_length;
- size_t arr_length;
- size_t step;
- int64_t left_mer_accum = 0;
- int64_t right_mer_accum = 0;
- int trigg_fraction = 0;
- int trigg_to_show = 0;
- int mer_ratio[2];
- int cur_pos = 1;
- int prev_pos = 0;
- };
- inline
- const int MER_Detector::get_triggered() const {
- return trigg_to_show;
- }
- inline
- const int MER_Detector::get_trigglvl() const {
- return trigg_lvl;
- }
- #ifdef __cplusplus
- }
- #endif
- #endif /* INC_TECH_CHANNEL_MER_DETECTOR_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement