39 if (rdo_it!=rdo_it_end) {
41 const RDO * rdo_element;
42 unsigned int offlineId = 99;
43 unsigned int prev_offlineId = 99;
44 unsigned int dataword_position;
45 unsigned int Pulse1Position[8] = {0};
46 unsigned int Pulse1Width[8] = {0};
47 unsigned int Pulse2Position[8] = {0};
48 unsigned int Pulse2Width[8] = {0};
49 unsigned int BCID = 0;
50 unsigned int Error = 0;
52 for(; rdo_it!=rdo_it_end; ++rdo_it) {
53 rdo_element = (*rdo_it);
56 if (offlineId != prev_offlineId) {
57 prev_offlineId = offlineId;
73 unsigned int BCM_RodEncoder::encode_data_block(std::vector<uint32_t>& data_block,
unsigned int BCID,
unsigned int Pulse1Position[8],
unsigned int Pulse1Width[8],
unsigned int Pulse2Position[8],
unsigned int Pulse2Width[8],
unsigned int Error){
75 data_word += (
BCID & 0xfff) << 20;
76 data_word += (Pulse1Position[0] & 0x3f) << 14;
77 data_word += (Pulse1Width[0] & 0x1f) << 9;
78 data_word += (Pulse2Position[0] & 0x3f) << 3;
79 data_word += (Pulse2Width[0] & 0x1c) >> 2;
80 data_block.push_back(data_word);
82 data_word += (Pulse2Width[0] & 0x3) << 30;
83 data_word += (Pulse1Position[1] & 0x3f) << 24;
84 data_word += (Pulse1Width[1] & 0x1f) << 19;
85 data_word += (Pulse2Position[1] & 0x3f) << 13;
86 data_word += (Pulse2Width[1] & 0x1f) << 8;
87 data_word += (Pulse1Position[2] & 0x3f) << 2;
88 data_word += (Pulse1Width[2] & 0x18) >> 3;
89 data_block.push_back(data_word);
91 data_word += (Pulse1Width[2] & 0x7) << 29;
92 data_word += (Pulse2Position[2] & 0x3f) << 23;
93 data_word += (Pulse2Width[2] & 0x1f) << 18;
94 data_word += (Pulse1Position[3] & 0x3f) << 12;
95 data_word += (Pulse1Width[3] & 0x1f) << 7;
96 data_word += (Pulse2Position[3] & 0x3f) << 1;
97 data_word += (Pulse2Width[3] & 0x10) >> 4;
98 data_block.push_back(data_word);
100 data_word += (Pulse2Width[3] & 0xf) << 28;
101 data_word += (Pulse1Position[4] & 0x3f) << 22;
102 data_word += (Pulse1Width[4] & 0x1f) << 17;
103 data_word += (Pulse2Position[4] & 0x3f) << 11;
104 data_word += (Pulse2Width[4] & 0x1f) << 6;
105 data_word += (Pulse1Position[5] & 0x3f) << 0;
106 data_block.push_back(data_word);
108 data_word += (Pulse1Width[5] & 0x1f) << 27;
109 data_word += (Pulse2Position[5] & 0x3f) << 21;
110 data_word += (Pulse2Width[5] & 0x1f) << 16;
111 data_word += (Pulse1Position[6] & 0x3f) << 10;
112 data_word += (Pulse1Width[6] & 0x1f) << 5;
113 data_word += (Pulse2Position[6] & 0x3e) >> 1;
114 data_block.push_back(data_word);
116 data_word += (Pulse2Position[6] & 0x1) << 31;
117 data_word += (Pulse2Width[6] & 0x1f) << 26;
118 data_word += (Pulse1Position[7] & 0x3f) << 20;
119 data_word += (Pulse1Width[7] & 0x1f) << 15;
120 data_word += (Pulse2Position[7] & 0x3f) << 9;
121 data_word += (Pulse2Width[7] & 0x1f) << 4;
122 data_word += (
Error & 0xf) << 0;
123 data_block.push_back(data_word);