254 if (bytes_received==0)
278 cout <<
"-> Dwrite " << fBoardId <<
" " << (fBufCommand[0]==
kCmdDwrite) << endl;
283 cout <<
"-> Trigger line " << fBoardId <<
" " << (fBufCommand[0]==
kCmdTriggerLine) << endl;
285 fHeader.Enable(FAD::EventHeader::kTriggerLine, fTriggerEnabled);
290 cout <<
"-> Sclk " << fBoardId << endl;
296 cout <<
"-> Srclk " << fBoardId << endl;
302 cout <<
"-> Run " << fBoardId << endl;
307 cout <<
"-> BusyOff " << fBoardId <<
" " << (fBufCommand[0]==
kCmdBusyOff) << endl;
313 cout <<
"-> BusyOn " << fBoardId <<
" " << (fBufCommand[0]==
kCmdBusyOn) << endl;
319 cout <<
"-> Socket " << fBoardId <<
" " << (fBufCommand[0]==
kCmdSocket) << endl;
321 fHeader.Enable(FAD::EventHeader::kSock17, !fCommandSocket);
331 cout <<
"-> ContTrig " << fBoardId <<
" " << (fBufCommand[0]==
kCmdContTrigger) << endl;
335 cout <<
"-> ResetId " << fBoardId << endl;
340 cout <<
"-> Trigger " << fBoardId << endl;
345 cout <<
"-> Execute " << fBoardId << endl;
382 cout <<
"Received b=" << bytes_received <<
": " << error.message() <<
" (" << error <<
")" << endl;
383 cout <<
"Hex:" << Converter::GetHex<uint16_t>(&fBufCommand[0], bytes_received) << endl;
387 fBufCommand.resize(1);
392 transform(fBufCommand.begin(), fBufCommand.begin()+bytes_received/2,
393 fBufCommand.begin(), ntohs);
398 fRam.fRunNumber &= 0xffff;
399 fRam.fRunNumber |= fBufCommand[0]<<16;
400 cout <<
"-> Set RunNumber " << fBoardId <<
" MSW" << endl;
403 fRam.fRunNumber &= 0xffff0000;
404 fRam.fRunNumber |= fBufCommand[0];
405 cout <<
"-> Set RunNumber " << fBoardId <<
" LSW" << endl;
408 cout <<
"-> Set " << fBoardId <<
" Roi[" <<
fCommand[1] <<
"]=" << fBufCommand[0] << endl;
414 cout <<
"-> Set " << fBoardId <<
" Dac[" << fCommand[1] <<
"]=" << fBufCommand[0] << endl;
415 fRam.fDac[fCommand[1]] = fBufCommand[0];
419 cout <<
"-> Set " << fBoardId <<
" Rate =" << fBufCommand[0] << endl;
420 fHeader.fTriggerGeneratorPrescaler = fBufCommand[0];
426 fBufCommand.resize(1);
vector< uint16_t > fCommand
void TriggerSendData(const boost::system::error_code &ec)
void AsyncWait(ba::deadline_timer &timer, int seconds, void(tcp_connection::*handler)(const bs::error_code &))
ba::deadline_timer fTriggerSendData
Adds some functionality to boost::posix_time::ptime for our needs.
void AsyncRead(ba::mutable_buffers_1 buffers)
FAD::ChannelHeader fChHeader[kNumChannels]
vector< uint16_t > fBufCommand
vector< uint16_t > fRamRoi