17 #ifdef PENN_DONT_REBLOCK_USLICES 18 dune::PennMilliSlice::Header::microslice_count_t dune::PennMilliSlice::microSliceCount()
const 20 return header_()->microslice_count;
65 #ifdef PENN_DONT_REBLOCK_USLICES 68 std::unique_ptr<dune::PennMicroSlice> dune::PennMilliSlice::microSlice(uint32_t
index)
const 70 std::unique_ptr<PennMicroSlice> mslice_ptr;
71 if (index < microSliceCount()) {
72 uint8_t* ms_ptr =
data_(index);
131 data_packet_type =
type;
216 data_header = payload_header;
239 payload_header = reinterpret_cast_checked<dune::PennMicroSlice::Payload_Header*>(pl_ptr);
260 data_header =
nullptr;
267 data_header = reinterpret_cast_checked<dune::PennMicroSlice::Payload_Header*>(pl_ptr);
283 data_header = payload_header;
310 std::cerr <<
"Could not find payload with index " << index <<
" (the data buffer has overrun)" <<
std::endl;
318 size_t& payload_size)
const 326 data_packet_type =
type;
328 #ifdef __DEBUG_payload__ 329 std::cout <<
"PennMilliSlice::payload() payload " << i <<
" has type 0x" 331 <<
" " << std::bitset<3>(data_packet_type)
332 <<
" and timestamp " << short_nova_timestamp
333 <<
" " << std::bitset<28>(short_nova_timestamp)
334 <<
" payload header bits " << std::bitset<32>(*((uint32_t*)pl_ptr))
386 std::cerr <<
"Could not find payload with ID " << index <<
" (the data buffer has overrun)" <<
std::endl;
391 #ifdef ENABLE_PENNMILLISLICE_CHECKSUM 393 dune::PennMilliSlice::checksum_t dune::PennMilliSlice::calculateChecksum()
const 397 boost::crc_32_type checksum;
399 return checksum.checksum();
402 std::cout <<
"Error caught in PennMilliSlice::calculateChecksum()" <<
std::endl;
408 dune::PennMilliSlice::checksum_t dune::PennMilliSlice::checksum()
const 410 return *(
reinterpret_cast<dune::PennMilliSlice::checksum_t*
>(
buffer_ + this->
size() -
sizeof(dune::PennMilliSlice::checksum_t)));
423 for (
int idx = 0; idx <
index; ++idx) {
425 ms_ptr += tmp_ms.
size();
static microslice_size_t const payload_size_trigger
static microslice_size_t const payload_size_timestamp
Header const * header_() const
uint8_t * payload(uint32_t index, dune::PennMicroSlice::Payload_Header::data_packet_type_t &data_packet_type, dune::PennMicroSlice::Payload_Header::short_nova_timestamp_t &short_nova_timestamp, size_t &payload_size) const
uint8_t * get_next_payload(uint32_t &index, dune::PennMicroSlice::Payload_Header::data_packet_type_t &data_packet_type, dune::PennMicroSlice::Payload_Header::short_nova_timestamp_t &short_nova_timestamp, size_t &payload_size)
static const Payload_Header::data_packet_type_t DataTypeWarning
static microslice_size_t const payload_size_checksum
Header::millislice_size_t size() const
QTextStream & hex(QTextStream &s)
uint32_t current_word_id_
static const Payload_Header::data_packet_type_t DataTypeTimestamp
uint8_t * data_(int index) const
Header::timestamp_t endTimestamp() const
uint8_t * current_payload_
static microslice_size_t const payload_size_counter
Header::ticks_t overlapTicks() const
Header::version_t version() const
uint8_t * get_next_timestamp(dune::PennMicroSlice::Payload_Header *&data_header)
dune::PennMicroSlice::microslice_size_t size() const
static const Payload_Header::data_packet_type_t DataTypeChecksum
PennMilliSlice(uint8_t *address)
Header::ticks_t widthTicks() const
QTextStream & dec(QTextStream &s)
Header::sequence_id_t sequenceID() const
static const Payload_Header::data_packet_type_t DataTypeTrigger
Header::payload_count_t payloadCount() const
static microslice_size_t const payload_size_warning
static const Payload_Header::data_packet_type_t DataTypeCounter
QTextStream & endl(QTextStream &s)