1 #define TRACE_NAME "CommandableFragmentGenerator_t"
3 #define BOOST_TEST_MODULE CommandableFragmentGenerator_t
4 #include <boost/test/auto_unit_test.hpp>
6 #include "artdaq-core/Data/Fragment.hh"
7 #include "artdaq-core/Data/ContainerFragment.hh"
8 #include "artdaq/Application/CommandableFragmentGenerator.hh"
9 #include "artdaq/DAQrate/RequestSender.hh"
11 #define MULTICAST_MODE 0
15 class CommandableFragmentGeneratorTest;
40 bool getNext_(artdaq::FragmentPtrs& frags)
override;
51 void start()
override;
66 void pause()
override;
89 auto start_time = std::chrono::steady_clock::now();
90 while (fireCount_ > 0) { usleep(1000); }
91 TLOG(TLVL_INFO) <<
"Waited " << std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - start_time).count() <<
" us for events to be picked up by CFG" ;
94 std::atomic<size_t> fireCount_;
95 std::atomic<bool> hwFail_;
96 artdaq::Fragment::timestamp_t ts_;
97 std::atomic<bool> hw_stop_;
101 : CommandableFragmentGenerator(ps)
107 metricMan->initialize(ps);
108 metricMan->do_start();
114 while (fireCount_ > 0)
116 frags.emplace_back(
new artdaq::Fragment(ev_counter(), fragment_id(), artdaq::Fragment::FirstUserFragmentType, ++ts_));
138 BOOST_AUTO_TEST_SUITE(CommandableFragmentGenerator_t)
142 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
143 TLOG(TLVL_INFO) <<
"Simple test case BEGIN" ;
144 fhicl::ParameterSet ps;
145 ps.put<
int>(
"board_id", 1);
146 ps.put<
int>(
"fragment_id", 1);
148 artdaq::FragmentPtrs fps;
149 auto sts = testGen.getNext(fps);
150 BOOST_REQUIRE_EQUAL(sts,
true);
151 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
152 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
153 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
154 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
155 TLOG(TLVL_INFO) <<
"Simple test case END" ;
160 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
161 TLOG(TLVL_INFO) <<
"IgnoreRequests test case BEGIN" ;
162 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
163 const int DELAY_TIME = 1;
164 fhicl::ParameterSet ps;
165 ps.put<
int>(
"board_id", 1);
166 ps.put<
int>(
"fragment_id", 1);
167 ps.put<
int>(
"request_port", REQUEST_PORT);
169 ps.put<std::string>(
"request_address",
"227.18.12.29");
171 ps.put<std::string>(
"request_address",
"localhost");
173 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
174 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 0);
175 ps.put<
bool>(
"separate_data_thread",
true);
176 ps.put<
bool>(
"separate_monitoring_thread",
false);
177 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
178 ps.put<std::string>(
"request_mode",
"ignored");
179 ps.put(
"request_delay_ms", DELAY_TIME);
180 ps.put(
"send_requests",
true);
187 artdaq::FragmentPtrs fps;
189 BOOST_REQUIRE_EQUAL(sts,
true);
190 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
191 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
192 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
193 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
196 TLOG(TLVL_INFO) <<
"IgnoreRequests test case END" ;
201 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
202 TLOG(TLVL_INFO) <<
"SingleMode test case BEGIN" ;
203 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
204 const int DELAY_TIME = 100;
205 fhicl::ParameterSet ps;
206 ps.put<
int>(
"board_id", 1);
207 ps.put<
int>(
"fragment_id", 1);
208 ps.put<
int>(
"request_port", REQUEST_PORT);
210 ps.put<std::string>(
"request_address",
"227.18.12.30");
212 ps.put<std::string>(
"request_address",
"localhost");
214 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
215 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 0);
216 ps.put<
bool>(
"separate_data_thread",
true);
217 ps.put<
bool>(
"separate_monitoring_thread",
false);
218 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
219 ps.put<std::string>(
"request_mode",
"single");
220 ps.put(
"request_delay_ms", DELAY_TIME);
221 ps.put(
"send_requests",
true);
232 artdaq::FragmentPtrs fps;
234 auto type = artdaq::Fragment::FirstUserFragmentType;
235 BOOST_REQUIRE_EQUAL(sts,
true);
236 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
237 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
238 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
239 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
240 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
246 BOOST_REQUIRE_EQUAL(sts,
true);
247 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
248 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
249 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 5);
250 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
251 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
260 BOOST_REQUIRE_EQUAL(sts,
true);
261 BOOST_REQUIRE_EQUAL(fps.size(), 2);
262 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
263 auto ts = artdaq::Fragment::InvalidTimestamp;
264 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), ts);
265 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 3);
266 auto emptyType = artdaq::Fragment::EmptyFragmentType;
267 BOOST_REQUIRE_EQUAL(fps.front()->type(), emptyType);
269 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
270 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 7);
271 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 4);
272 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
277 TLOG(TLVL_INFO) <<
"SingleMode test case END" ;
282 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
283 TLOG(TLVL_INFO) <<
"BufferMode test case BEGIN" ;
284 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
285 const int DELAY_TIME = 100;
286 fhicl::ParameterSet ps;
287 ps.put<
int>(
"board_id", 1);
288 ps.put<
int>(
"fragment_id", 1);
289 ps.put<
int>(
"request_port", REQUEST_PORT);
291 ps.put<std::string>(
"request_address",
"227.18.12.31");
293 ps.put<std::string>(
"request_address",
"localhost");
295 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
296 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 0);
297 ps.put<
bool>(
"separate_data_thread",
true);
298 ps.put<
bool>(
"separate_monitoring_thread",
false);
299 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
300 ps.put<std::string>(
"request_mode",
"buffer");
301 ps.put(
"request_delay_ms", DELAY_TIME);
302 ps.put(
"send_requests",
true);
313 artdaq::FragmentPtrs fps;
315 BOOST_REQUIRE_EQUAL(sts,
true);
316 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
317 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
318 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
319 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
320 auto type = artdaq::Fragment::ContainerFragmentType;
321 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
322 BOOST_REQUIRE_GE(fps.front()->sizeBytes(), 2 *
sizeof(artdaq::detail::RawFragmentHeader) +
sizeof(artdaq::ContainerFragment::Metadata));
323 auto cf = artdaq::ContainerFragment(*fps.front());
324 BOOST_REQUIRE_EQUAL(cf.block_count(), 1);
325 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
326 type = artdaq::Fragment::FirstUserFragmentType;
327 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
333 BOOST_REQUIRE_EQUAL(sts,
true);
334 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
335 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
336 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 5);
337 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
338 type = artdaq::Fragment::ContainerFragmentType;
339 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
340 auto cf2 = artdaq::ContainerFragment(*fps.front());
341 BOOST_REQUIRE_EQUAL(cf2.block_count(), 0);
342 BOOST_REQUIRE_EQUAL(cf2.missing_data(),
false);
343 type = artdaq::Fragment::EmptyFragmentType;
344 BOOST_REQUIRE_EQUAL(cf2.fragment_type(), type);
352 BOOST_REQUIRE_EQUAL(sts,
true);
353 BOOST_REQUIRE_EQUAL(fps.size(), 2);
355 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
356 auto ts = artdaq::Fragment::InvalidTimestamp;
357 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), ts);
358 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 3);
359 auto emptyType = artdaq::Fragment::EmptyFragmentType;
360 BOOST_REQUIRE_EQUAL(fps.front()->type(), emptyType);
361 BOOST_REQUIRE_EQUAL(fps.front()->size(), artdaq::detail::RawFragmentHeader::num_words());
363 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
364 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 7);
365 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 4);
366 type = artdaq::Fragment::ContainerFragmentType;
367 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
368 auto cf3 = artdaq::ContainerFragment(*fps.front());
369 BOOST_REQUIRE_EQUAL(cf3.block_count(), 2);
370 BOOST_REQUIRE_EQUAL(cf3.missing_data(),
false);
371 type = artdaq::Fragment::FirstUserFragmentType;
372 BOOST_REQUIRE_EQUAL(cf3.fragment_type(), type);
381 TLOG(TLVL_INFO) <<
"BufferMode test case END" ;
386 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
387 TLOG(TLVL_INFO) <<
"CircularBufferMode test case BEGIN";
388 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
389 const int DELAY_TIME = 100;
390 fhicl::ParameterSet ps;
391 ps.put<
int>(
"board_id", 1);
392 ps.put<
int>(
"fragment_id", 1);
393 ps.put<
int>(
"request_port", REQUEST_PORT);
395 ps.put<std::string>(
"request_address",
"227.18.12.31");
397 ps.put<std::string>(
"request_address",
"localhost");
399 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
400 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 0);
401 ps.put<
bool>(
"separate_data_thread",
true);
402 ps.put<
bool>(
"circular_buffer_mode",
true);
403 ps.put<
int>(
"data_buffer_depth_fragments", 3);
404 ps.put<
bool>(
"separate_monitoring_thread",
false);
405 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
406 ps.put<std::string>(
"request_mode",
"buffer");
407 ps.put(
"request_delay_ms", DELAY_TIME);
408 ps.put(
"send_requests",
true);
419 artdaq::FragmentPtrs fps;
421 BOOST_REQUIRE_EQUAL(sts,
true);
422 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
423 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
424 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
425 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
426 auto type = artdaq::Fragment::ContainerFragmentType;
427 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
428 BOOST_REQUIRE_GE(fps.front()->sizeBytes(), 2 *
sizeof(artdaq::detail::RawFragmentHeader) +
sizeof(artdaq::ContainerFragment::Metadata));
429 auto cf = artdaq::ContainerFragment(*fps.front());
430 BOOST_REQUIRE_EQUAL(cf.block_count(), 1);
431 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
432 type = artdaq::Fragment::FirstUserFragmentType;
433 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
439 BOOST_REQUIRE_EQUAL(sts,
true);
440 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
441 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
442 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 5);
443 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
444 type = artdaq::Fragment::ContainerFragmentType;
445 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
446 auto cf2 = artdaq::ContainerFragment(*fps.front());
447 BOOST_REQUIRE_EQUAL(cf2.block_count(), 0);
448 BOOST_REQUIRE_EQUAL(cf2.missing_data(),
false);
449 type = artdaq::Fragment::EmptyFragmentType;
450 BOOST_REQUIRE_EQUAL(cf2.fragment_type(), type);
458 BOOST_REQUIRE_EQUAL(sts,
true);
459 BOOST_REQUIRE_EQUAL(fps.size(), 2);
461 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
462 auto ts = artdaq::Fragment::InvalidTimestamp;
463 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), ts);
464 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 3);
465 auto emptyType = artdaq::Fragment::EmptyFragmentType;
466 BOOST_REQUIRE_EQUAL(fps.front()->type(), emptyType);
467 BOOST_REQUIRE_EQUAL(fps.front()->size(), artdaq::detail::RawFragmentHeader::num_words());
469 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
470 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 7);
471 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 4);
472 type = artdaq::Fragment::ContainerFragmentType;
473 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
474 auto cf3 = artdaq::ContainerFragment(*fps.front());
475 BOOST_REQUIRE_EQUAL(cf3.block_count(), 3);
476 BOOST_REQUIRE_EQUAL(cf3.missing_data(),
false);
477 type = artdaq::Fragment::FirstUserFragmentType;
478 BOOST_REQUIRE_EQUAL(cf3.fragment_type(), type);
488 BOOST_REQUIRE_EQUAL(sts,
true);
489 BOOST_REQUIRE_EQUAL(fps.size(), 1);
491 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
492 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 8);
493 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 5);
494 type = artdaq::Fragment::ContainerFragmentType;
495 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
496 auto cf4 = artdaq::ContainerFragment(*fps.front());
497 BOOST_REQUIRE_EQUAL(cf4.block_count(), 3);
498 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
false);
499 type = artdaq::Fragment::FirstUserFragmentType;
500 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
501 BOOST_REQUIRE_EQUAL(cf4.at(0)->timestamp(), 7);
502 BOOST_REQUIRE_EQUAL(cf4.at(1)->timestamp(), 8);
503 BOOST_REQUIRE_EQUAL(cf4.at(2)->timestamp(), 9);
512 TLOG(TLVL_INFO) <<
"CircularBufferMode test case END";
517 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
518 TLOG(TLVL_INFO) <<
"WindowMode_Function test case BEGIN" ;
519 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
520 const int DELAY_TIME = 100;
521 fhicl::ParameterSet ps;
522 ps.put<
int>(
"board_id", 1);
523 ps.put<
int>(
"fragment_id", 1);
524 ps.put<
int>(
"request_port", REQUEST_PORT);
526 ps.put<std::string>(
"request_address",
"227.18.12.32");
528 ps.put<std::string>(
"request_address",
"localhost");
530 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
531 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 0);
532 ps.put<
bool>(
"separate_data_thread",
true);
533 ps.put<
bool>(
"separate_monitoring_thread",
false);
534 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
535 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
536 ps.put<std::string>(
"request_mode",
"window");
537 ps.put<
size_t>(
"missing_request_window_timeout_us", 500000);
538 ps.put<
size_t>(
"window_close_timeout_us", 500000);
539 ps.put(
"request_delay_ms", DELAY_TIME);
540 ps.put(
"send_requests",
true);
550 artdaq::FragmentPtrs fps;
553 BOOST_REQUIRE_EQUAL(sts,
true);
554 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
555 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
556 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
557 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
558 auto type = artdaq::Fragment::ContainerFragmentType;
559 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
560 BOOST_REQUIRE_GE(fps.front()->sizeBytes(), 2 *
sizeof(artdaq::detail::RawFragmentHeader) +
sizeof(artdaq::ContainerFragment::Metadata));
561 auto cf = artdaq::ContainerFragment(*fps.front());
562 BOOST_REQUIRE_EQUAL(cf.block_count(), 1);
563 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
564 type = artdaq::Fragment::FirstUserFragmentType;
565 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
572 BOOST_REQUIRE_EQUAL(sts,
true);
573 BOOST_REQUIRE_EQUAL(fps.size(), 0);
579 BOOST_REQUIRE_EQUAL(sts,
true);
580 BOOST_REQUIRE_EQUAL(fps.size(), 1);
581 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
582 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 2);
583 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
584 type = artdaq::Fragment::ContainerFragmentType;
585 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
586 auto cf2 = artdaq::ContainerFragment(*fps.front());
587 BOOST_REQUIRE_EQUAL(cf2.block_count(), 1);
588 BOOST_REQUIRE_EQUAL(cf2.missing_data(),
false);
589 type = artdaq::Fragment::FirstUserFragmentType;
590 BOOST_REQUIRE_EQUAL(cf2.fragment_type(), type);
596 BOOST_REQUIRE_EQUAL(sts,
true);
597 BOOST_REQUIRE_EQUAL(fps.size(), 0);
603 BOOST_REQUIRE_EQUAL(sts,
true);
604 BOOST_REQUIRE_EQUAL(fps.size(), 1);
608 BOOST_REQUIRE_EQUAL(list.size(), 1);
609 BOOST_REQUIRE_EQUAL(list.begin()->first, 4);
615 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
616 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 3);
617 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 4);
618 type = artdaq::Fragment::ContainerFragmentType;
619 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
620 auto cf3 = artdaq::ContainerFragment(*fps.front());
621 BOOST_REQUIRE_EQUAL(cf3.block_count(), 0);
622 BOOST_REQUIRE_EQUAL(cf3.missing_data(),
true);
623 type = artdaq::Fragment::EmptyFragmentType;
624 BOOST_REQUIRE_EQUAL(cf3.fragment_type(), type);
633 BOOST_REQUIRE_EQUAL(list.size(), 1);
637 BOOST_REQUIRE_EQUAL(list.size(), 0);
638 BOOST_REQUIRE_EQUAL(sts,
true);
639 BOOST_REQUIRE_EQUAL(fps.size(), 1);
640 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
641 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 4);
642 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 5);
643 type = artdaq::Fragment::ContainerFragmentType;
644 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
645 auto cf4 = artdaq::ContainerFragment(*fps.front());
646 BOOST_REQUIRE_EQUAL(cf4.block_count(), 0);
647 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
648 type = artdaq::Fragment::EmptyFragmentType;
649 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
656 BOOST_REQUIRE_EQUAL(sts,
true);
657 BOOST_REQUIRE_EQUAL(fps.size(), 1);
658 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
659 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 13);
660 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 7);
661 type = artdaq::Fragment::ContainerFragmentType;
662 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
663 auto cf5 = artdaq::ContainerFragment(*fps.front());
664 BOOST_REQUIRE_EQUAL(cf5.block_count(), 1);
665 BOOST_REQUIRE_EQUAL(cf5.missing_data(),
false);
666 type = artdaq::Fragment::FirstUserFragmentType;
667 BOOST_REQUIRE_EQUAL(cf5.fragment_type(), type);
672 BOOST_REQUIRE_EQUAL(list.size(), 1);
673 BOOST_REQUIRE_EQUAL(list.begin()->first, 7);
677 BOOST_REQUIRE_EQUAL(sts,
true);
678 BOOST_REQUIRE_EQUAL(fps.size(), 1);
679 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
680 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 12);
681 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 6);
682 type = artdaq::Fragment::ContainerFragmentType;
683 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
684 auto cf6 = artdaq::ContainerFragment(*fps.front());
685 BOOST_REQUIRE_EQUAL(cf6.block_count(), 1);
686 BOOST_REQUIRE_EQUAL(cf6.missing_data(),
false);
687 type = artdaq::Fragment::FirstUserFragmentType;
688 BOOST_REQUIRE_EQUAL(cf6.fragment_type(), type);
693 BOOST_REQUIRE_EQUAL(list.size(), 0);
698 TLOG(TLVL_INFO) <<
"WindowMode_Function test case END" ;
711 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
712 TLOG(TLVL_INFO) <<
"WindowMode_RequestBeforeBuffer test case BEGIN" ;
713 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
714 const int DELAY_TIME = 100;
715 fhicl::ParameterSet ps;
716 ps.put<
int>(
"board_id", 1);
717 ps.put<
int>(
"fragment_id", 1);
718 ps.put<
int>(
"request_port", REQUEST_PORT);
720 ps.put<std::string>(
"request_address",
"227.18.12.32");
722 ps.put<std::string>(
"request_address",
"localhost");
724 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
725 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 3);
726 ps.put<
bool>(
"separate_data_thread",
true);
727 ps.put<
bool>(
"separate_monitoring_thread",
false);
728 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
729 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
730 ps.put<std::string>(
"request_mode",
"window");
731 ps.put(
"request_delay_ms", DELAY_TIME);
732 ps.put(
"send_requests",
true);
740 artdaq::FragmentPtrs fps;
742 artdaq::Fragment::type_t type;
751 BOOST_REQUIRE_EQUAL(sts,
true);
752 BOOST_REQUIRE_EQUAL(fps.size(), 1);
753 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
754 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
755 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
756 type = artdaq::Fragment::ContainerFragmentType;
757 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
758 auto cf4 = artdaq::ContainerFragment(*fps.front());
759 BOOST_REQUIRE_EQUAL(cf4.block_count(), 0);
760 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
761 type = artdaq::Fragment::EmptyFragmentType;
762 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
765 TLOG(TLVL_INFO) <<
"WindowMode_RequestBeforeBuffer test case END" ;
770 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
771 TLOG(TLVL_INFO) <<
"WindowMode_RequestStartsBeforeBuffer test case BEGIN" ;
772 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
773 const int DELAY_TIME = 100;
774 fhicl::ParameterSet ps;
775 ps.put<
int>(
"board_id", 1);
776 ps.put<
int>(
"fragment_id", 1);
777 ps.put<
int>(
"request_port", REQUEST_PORT);
779 ps.put<std::string>(
"request_address",
"227.18.12.32");
781 ps.put<std::string>(
"request_address",
"localhost");
783 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
784 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 3);
785 ps.put<
bool>(
"separate_data_thread",
true);
786 ps.put<
bool>(
"separate_monitoring_thread",
false);
787 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
788 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
789 ps.put<std::string>(
"request_mode",
"window");
790 ps.put(
"request_delay_ms", DELAY_TIME);
791 ps.put(
"send_requests",
true);
799 artdaq::FragmentPtrs fps;
801 artdaq::Fragment::type_t type;
812 BOOST_REQUIRE_EQUAL(sts,
true);
813 BOOST_REQUIRE_EQUAL(fps.size(), 1);
814 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
815 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 4);
816 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
817 type = artdaq::Fragment::ContainerFragmentType;
818 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
819 auto cf4 = artdaq::ContainerFragment(*fps.front());
820 BOOST_REQUIRE_EQUAL(cf4.block_count(), 1);
821 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
822 type = artdaq::Fragment::FirstUserFragmentType;
823 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
827 TLOG(TLVL_INFO) <<
"WindowMode_RequestStartsBeforeBuffer test case END" ;
832 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
833 TLOG(TLVL_INFO) <<
"WindowMode_RequestOutsideBuffer test case BEGIN" ;
834 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
835 const int DELAY_TIME = 100;
836 fhicl::ParameterSet ps;
837 ps.put<
int>(
"board_id", 1);
838 ps.put<
int>(
"fragment_id", 1);
839 ps.put<
int>(
"request_port", REQUEST_PORT);
841 ps.put<std::string>(
"request_address",
"227.18.12.32");
843 ps.put<std::string>(
"request_address",
"localhost");
845 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
846 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 4);
847 ps.put<
size_t>(
"window_close_timeout_us", 500000);
848 ps.put<
bool>(
"separate_data_thread",
true);
849 ps.put<
bool>(
"separate_monitoring_thread",
false);
850 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
851 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
852 ps.put<std::string>(
"request_mode",
"window");
853 ps.put(
"request_delay_ms", DELAY_TIME);
854 ps.put(
"send_requests",
true);
862 artdaq::FragmentPtrs fps;
864 artdaq::Fragment::type_t type;
875 BOOST_REQUIRE_EQUAL(sts,
true);
876 BOOST_REQUIRE_EQUAL(fps.size(), 1);
877 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
878 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 6);
879 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
880 type = artdaq::Fragment::ContainerFragmentType;
881 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
882 auto cf = artdaq::ContainerFragment(*fps.front());
883 BOOST_REQUIRE_EQUAL(cf.block_count(), 4);
884 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
885 type = artdaq::Fragment::FirstUserFragmentType;
886 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
891 BOOST_REQUIRE_EQUAL(sts,
true);
892 BOOST_REQUIRE_EQUAL(fps.size(), 0);
898 BOOST_REQUIRE_EQUAL(sts,
true);
899 BOOST_REQUIRE_EQUAL(fps.size(), 1);
900 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
901 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 9);
902 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
903 type = artdaq::Fragment::ContainerFragmentType;
904 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
905 auto cf2 = artdaq::ContainerFragment(*fps.front());
906 BOOST_REQUIRE_EQUAL(cf2.block_count(), 3);
907 BOOST_REQUIRE_EQUAL(cf2.missing_data(),
true);
908 type = artdaq::Fragment::FirstUserFragmentType;
909 BOOST_REQUIRE_EQUAL(cf2.fragment_type(), type);
917 BOOST_REQUIRE_EQUAL(sts,
true);
918 BOOST_REQUIRE_EQUAL(fps.size(), 0);
923 BOOST_REQUIRE_EQUAL(sts,
true);
924 BOOST_REQUIRE_EQUAL(fps.size(), 1);
925 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
926 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 12);
927 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 3);
928 type = artdaq::Fragment::ContainerFragmentType;
929 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
930 auto cf4 = artdaq::ContainerFragment(*fps.front());
931 BOOST_REQUIRE_EQUAL(cf4.block_count(), 1);
932 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
933 type = artdaq::Fragment::FirstUserFragmentType;
934 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
938 TLOG(TLVL_INFO) <<
"WindowMode_RequestOutsideBuffer test case END" ;
943 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
944 TLOG(TLVL_INFO) <<
"WindowMode_RequestInBuffer test case BEGIN" ;
945 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
946 const int DELAY_TIME = 100;
947 fhicl::ParameterSet ps;
948 ps.put<
int>(
"board_id", 1);
949 ps.put<
int>(
"fragment_id", 1);
950 ps.put<
int>(
"request_port", REQUEST_PORT);
952 ps.put<std::string>(
"request_address",
"227.18.12.32");
954 ps.put<std::string>(
"request_address",
"localhost");
956 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
957 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 3);
958 ps.put<
bool>(
"separate_data_thread",
true);
959 ps.put<
bool>(
"separate_monitoring_thread",
false);
960 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
961 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
962 ps.put<std::string>(
"request_mode",
"window");
963 ps.put(
"request_delay_ms", DELAY_TIME);
964 ps.put(
"send_requests",
true);
972 artdaq::FragmentPtrs fps;
974 artdaq::Fragment::type_t type;
984 BOOST_REQUIRE_EQUAL(sts,
true);
985 BOOST_REQUIRE_EQUAL(fps.size(), 1);
986 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
987 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 3);
988 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
989 type = artdaq::Fragment::ContainerFragmentType;
990 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
991 auto cf4 = artdaq::ContainerFragment(*fps.front());
992 BOOST_REQUIRE_EQUAL(cf4.block_count(), 3);
993 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
false);
994 type = artdaq::Fragment::FirstUserFragmentType;
995 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
998 TLOG(TLVL_INFO) <<
"WindowMode_RequestInBuffer test case END" ;
1003 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
1004 TLOG(TLVL_INFO) <<
"WindowMode_RequestEndsAfterBuffer test case BEGIN" ;
1005 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
1006 const int DELAY_TIME = 100;
1007 fhicl::ParameterSet ps;
1008 ps.put<
int>(
"board_id", 1);
1009 ps.put<
int>(
"fragment_id", 1);
1010 ps.put<
int>(
"request_port", REQUEST_PORT);
1012 ps.put<std::string>(
"request_address",
"227.18.12.32");
1014 ps.put<std::string>(
"request_address",
"localhost");
1016 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
1017 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 3);
1018 ps.put<
size_t>(
"window_close_timeout_us", 500000);
1019 ps.put<
bool>(
"separate_data_thread",
true);
1020 ps.put<
bool>(
"separate_monitoring_thread",
false);
1021 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
1022 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
1023 ps.put<std::string>(
"request_mode",
"window");
1024 ps.put(
"request_delay_ms", DELAY_TIME);
1025 ps.put(
"send_requests",
true);
1033 artdaq::FragmentPtrs fps;
1035 artdaq::Fragment::type_t type;
1044 BOOST_REQUIRE_EQUAL(sts,
true);
1045 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1050 BOOST_REQUIRE_EQUAL(sts,
true);
1051 BOOST_REQUIRE_EQUAL(fps.size(), 1);
1052 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1053 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 5);
1054 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
1055 type = artdaq::Fragment::ContainerFragmentType;
1056 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
1057 auto cf = artdaq::ContainerFragment(*fps.front());
1058 BOOST_REQUIRE_EQUAL(cf.block_count(), 3);
1059 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
1060 type = artdaq::Fragment::FirstUserFragmentType;
1061 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
1067 BOOST_REQUIRE_EQUAL(sts,
true);
1068 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1073 BOOST_REQUIRE_EQUAL(sts,
true);
1074 BOOST_REQUIRE_EQUAL(fps.size(), 1);
1075 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1076 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 8);
1077 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
1078 type = artdaq::Fragment::ContainerFragmentType;
1079 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
1080 auto cf4 = artdaq::ContainerFragment(*fps.front());
1081 BOOST_REQUIRE_EQUAL(cf4.block_count(), 1);
1082 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
1083 type = artdaq::Fragment::FirstUserFragmentType;
1084 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
1088 TLOG(TLVL_INFO) <<
"WindowMode_RequestEndsAfterBuffer test case END" ;
1093 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
1094 TLOG(TLVL_INFO) <<
"WindowMode_RequestAfterBuffer test case BEGIN" ;
1095 const int REQUEST_PORT = (seedAndRandom() % (32768 - 1024)) + 1024;
1096 const int DELAY_TIME = 100;
1097 fhicl::ParameterSet ps;
1098 ps.put<
int>(
"board_id", 1);
1099 ps.put<
int>(
"fragment_id", 1);
1100 ps.put<
int>(
"request_port", REQUEST_PORT);
1102 ps.put<std::string>(
"request_address",
"227.18.12.32");
1104 ps.put<std::string>(
"request_address",
"localhost");
1106 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_offset", 0);
1107 ps.put<artdaq::Fragment::timestamp_t>(
"request_window_width", 3);
1108 ps.put<
size_t>(
"window_close_timeout_us", 500000);
1109 ps.put<
bool>(
"separate_data_thread",
true);
1110 ps.put<
bool>(
"separate_monitoring_thread",
false);
1111 ps.put<int64_t>(
"hardware_poll_interval_us", 0);
1112 ps.put<
size_t>(
"data_buffer_depth_fragments", 5);
1113 ps.put<std::string>(
"request_mode",
"window");
1114 ps.put(
"request_delay_ms", DELAY_TIME);
1115 ps.put(
"send_requests",
true);
1123 artdaq::FragmentPtrs fps;
1125 artdaq::Fragment::type_t type;
1135 BOOST_REQUIRE_EQUAL(sts,
true);
1136 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1140 BOOST_REQUIRE_EQUAL(sts,
true);
1141 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1146 BOOST_REQUIRE_EQUAL(sts,
true);
1147 BOOST_REQUIRE_EQUAL(fps.size(), 1);
1148 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1149 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 11);
1150 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
1151 type = artdaq::Fragment::ContainerFragmentType;
1152 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
1153 auto cf = artdaq::ContainerFragment(*fps.front());
1154 BOOST_REQUIRE_EQUAL(cf.block_count(), 3);
1155 BOOST_REQUIRE_EQUAL(cf.missing_data(),
false);
1156 type = artdaq::Fragment::FirstUserFragmentType;
1157 BOOST_REQUIRE_EQUAL(cf.fragment_type(), type);
1162 BOOST_REQUIRE_EQUAL(sts,
true);
1163 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1168 BOOST_REQUIRE_EQUAL(sts,
true);
1169 BOOST_REQUIRE_EQUAL(fps.size(), 1);
1170 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1171 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 16);
1172 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 2);
1173 type = artdaq::Fragment::ContainerFragmentType;
1174 BOOST_REQUIRE_EQUAL(fps.front()->type(), type);
1175 auto cf4 = artdaq::ContainerFragment(*fps.front());
1176 BOOST_REQUIRE_EQUAL(cf4.block_count(), 0);
1177 BOOST_REQUIRE_EQUAL(cf4.missing_data(),
true);
1178 type = artdaq::Fragment::EmptyFragmentType;
1179 BOOST_REQUIRE_EQUAL(cf4.fragment_type(), type);
1183 TLOG(TLVL_INFO) <<
"WindowMode_RequestAfterBuffer test case END" ;
1189 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
1190 TLOG(TLVL_INFO) <<
"HardwareFailure_NonThreaded test case BEGIN" ;
1191 fhicl::ParameterSet ps;
1192 ps.put<
int>(
"board_id", 1);
1193 ps.put<
int>(
"fragment_id", 1);
1194 ps.put<
bool>(
"separate_data_thread",
false);
1195 ps.put<
bool>(
"separate_monitoring_thread",
false);
1196 ps.put<int64_t>(
"hardware_poll_interval_us", 10);
1199 gen.StartCmd(1, 0xFFFFFFFF, 1);
1201 artdaq::FragmentPtrs fps;
1202 auto sts = gen.getNext(fps);
1203 BOOST_REQUIRE_EQUAL(sts,
true);
1204 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
1205 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1206 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
1207 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
1210 gen.setFireCount(1);
1213 sts = gen.getNext(fps);
1214 BOOST_REQUIRE_EQUAL(sts,
false);
1215 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1217 gen.StopCmd(0xFFFFFFFF, 1);
1219 TLOG(TLVL_INFO) <<
"HardwareFailure_NonThreaded test case END" ;
1224 artdaq::configureMessageFacility(
"CommandableFragmentGenerator_t");
1225 TLOG(TLVL_INFO) <<
"HardwareFailure_Threaded test case BEGIN" ;
1226 fhicl::ParameterSet ps;
1227 ps.put<
int>(
"board_id", 1);
1228 ps.put<
int>(
"fragment_id", 1);
1229 ps.put<
bool>(
"separate_data_thread",
true);
1230 ps.put<
bool>(
"separate_monitoring_thread",
true);
1231 ps.put<int64_t>(
"hardware_poll_interval_us", 750000);
1234 gen.StartCmd(1, 0xFFFFFFFF, 1);
1238 artdaq::FragmentPtrs fps;
1239 auto sts = gen.getNext(fps);
1240 BOOST_REQUIRE_EQUAL(sts,
true);
1241 BOOST_REQUIRE_EQUAL(fps.size(), 1u);
1242 BOOST_REQUIRE_EQUAL(fps.front()->fragmentID(), 1);
1243 BOOST_REQUIRE_EQUAL(fps.front()->timestamp(), 1);
1244 BOOST_REQUIRE_EQUAL(fps.front()->sequenceID(), 1);
1259 gen.setFireCount(1);
1260 sts = gen.getNext(fps);
1261 BOOST_REQUIRE_EQUAL(sts,
false);
1262 BOOST_REQUIRE_EQUAL(fps.size(), 0);
1264 gen.StopCmd(0xFFFFFFFF, 1);
1266 TLOG(TLVL_INFO) <<
"HardwareFailure_Threaded test case END" ;
1269 BOOST_AUTO_TEST_SUITE_END()
bool getNext_(artdaq::FragmentPtrs &frags) override
Generate data and return it to CommandableFragmentGenerator.
CommandableFragmentGenerator derived class for testing.
The RequestSender contains methods used to send data requests and Routing tokens. ...
void StopCmd(uint64_t timeout, uint64_t timestamp)
Stop the CommandableFragmentGenerator.
CommandableFragmentGeneratorTest(const fhicl::ParameterSet &ps)
CommandableFragmentGeneratorTest Constructor.
void StartCmd(int run, uint64_t timeout, uint64_t timestamp)
Start the CommandableFragmentGenerator.
bool getNext(FragmentPtrs &output) overridefinal
getNext calls either applyRequests or getNext_ to get any data that is ready to be sent to the EventB...
bool checkHWStatus_() override
Returns whether the hwFail flag has not been set.
void stopNoMutex() override
Perform immediate stop actions. No-Op.
void SetRunNumber(uint32_t run)
Set the run number to be used in request messages.
void start() override
Perform start actions. No-Op.
CommandableFragmentGenerator is a FragmentGenerator-derived abstract class that defines the interface...
void resume() override
Perform resume actions. No-Op.
void pause() override
Perform pause actions. No-Op.
size_t ev_counter() const
Get the current value of the event counter.
std::map< Fragment::sequence_id_t, std::chrono::steady_clock::time_point > getOutOfOrderWindowList() const
Access the windows_sent_ooo_ map.
void setHwFail()
Set the hwFail flag.
void stop() override
Perform stop actions. No-Op.
void AddRequest(Fragment::sequence_id_t seqID, Fragment::timestamp_t timestamp)
Add a request to the request list.
void waitForFrags()
Wait for all fragments generated to be read by the CommandableFragmentGenerator
void joinThreads()
Join any data-taking threads. Should be called when destructing CommandableFragmentGenerator.
void setFireCount(size_t count)
Have getNext_ generate count fragments.