30 #define HEADER_LENGTH 7U
44 unsigned int payload_len = buffer[1] & 0xffff;
46 _bx_count = ((buffer[4] & 0xffff) << 4) | (buffer[5] & 0xf);
48 for (
int i = 0; i < recv_length; i += (payload_len+1))
50 payload_len = (buffer[i+1] & 0xffff);
51 unsigned int channel = buffer[i+3] & 0x1f;
52 unsigned int sampa_addr = (buffer[i+3] >> 5) & 0xf;
86 if ( sample >= (
int)
_nsamples || sample < 0
89 return array[ch][sample];
94 if ( sample >= (
int)
_nsamples || sample < 0
95 || chip >= (
int)
_nchips || chip < 0
96 || ch >= (
int)
_nchannels || ch < 0 )
return 0;
98 return iValue(chip*32 + ch, sample);
107 if ( strcmp(what,
"SAMPLES") == 0 )
112 if ( strcmp(what,
"CHANNELS") == 0 )
117 if ( strcmp(what,
"CHIPS") == 0 )
122 if ( strcmp(what,
"BROKEN") == 0 )
127 if ( strcmp(what,
"BCTR") == 0 )
140 os <<
"Chips: " <<
iValue(0,
"CHIPS") << std::endl;
141 os <<
"Channels: " <<
iValue(0,
"CHANNELS") << std::endl;
142 os <<
"Samples: " <<
iValue(0,
"SAMPLES") << std::endl;
143 os <<
"Beam Crossing: " <<
iValue(0,
"BCTR") << std::endl;
146 for (
int chip = 0; chip <
iValue(0,
"CHIPS"); chip++)
148 cout <<
" chip sample +++++++++++++++ Chip " << chip <<
" ++++++++" << endl;
149 for (
int s = 0;
s <
iValue(0,
"SAMPLES");
s++)
152 os << setw(3) << chip << setw(5) <<
s <<
" | ";
154 for (
int c = 0;
c <
iValue(0,
"CHANNELS");
c++)
156 os << setw(4) <<
iValue(chip,
c, s) <<
" ";