-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfofb_processing.h
More file actions
65 lines (47 loc) · 1.63 KB
/
fofb_processing.h
File metadata and controls
65 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef FOFB_PROCESSING_H
#define FOFB_PROCESSING_H
#include <memory>
#include <vector>
#include "controllers.h"
#include "decoders.h"
namespace fofb_processing {
/* forward declaration */
struct wb_fofb_processing_regs;
class Core: public RegisterDecoder {
std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
struct wb_fofb_processing_regs ®s;
void decode() override;
void read_monitors() override;
void print(FILE *, bool) const override;
public:
Core(struct pcie_bars &);
~Core() override;
std::vector<int32_t> ref_orb_x, ref_orb_y;
std::vector<std::vector<double>> coefficients_x, coefficients_y;
};
class Controller: public RegisterController {
protected:
std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
struct wb_fofb_processing_regs ®s;
void set_devinfo_callback() override;
void encode_params() override;
unsigned fixed_point_coeff, fixed_point_gains;
public:
Controller(struct pcie_bars &);
~Controller();
bool intlk_sta_clr = false, intlk_en_orb_distort = false, intlk_en_packet_loss = false;
unsigned orb_distort_limit = 0, min_num_packets = 0;
std::vector<int32_t> ref_orb_x, ref_orb_y;
struct parameters {
std::vector<double> coefficients_x, coefficients_y;
bool acc_clear = false, acc_freeze = false;
double acc_gain = 0;
uint32_t sp_limit_max = 0, sp_limit_min = 0;
/** Decimation ratio must be at least 1 */
uint32_t sp_decim_ratio = 1;
};
std::vector<struct parameters> parameters;
void write_params() override;
};
} /* namespace fofb_processing */
#endif