$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/DataProcessorPlugins/OtsDataSaverConsumer.h" 00002 #include "otsdaq-core/Macros/ProcessorPluginMacros.h" 00003 00004 using namespace ots; 00005 00006 //======================================================================================================================== 00007 OtsDataSaverConsumer::OtsDataSaverConsumer( 00008 std::string supervisorApplicationUID, 00009 std::string bufferUID, 00010 std::string processorUID, 00011 const ConfigurationTree& theXDAQContextConfigTree, 00012 const std::string& configurationPath) 00013 : WorkLoop(processorUID) 00014 , RawDataSaverConsumerBase(supervisorApplicationUID, 00015 bufferUID, 00016 processorUID, 00017 theXDAQContextConfigTree, 00018 configurationPath) 00019 { 00020 } 00021 00022 //======================================================================================================================== 00023 OtsDataSaverConsumer::~OtsDataSaverConsumer(void) {} 00024 00025 //======================================================================================================================== 00026 void OtsDataSaverConsumer::writeHeader(void) {} 00027 00028 //======================================================================================================================== 00029 // add one byte quad-word count before each packet 00030 void OtsDataSaverConsumer::writePacketHeader(const std::string& data) 00031 { 00032 unsigned char quadWordsCount = (data.length() - 2) / 8; 00033 outFile_.write((char*)&quadWordsCount, 1); 00034 00035 // packetTypes is data[0] 00036 // seqId is in data[1] position 00037 00038 if(quadWordsCount) 00039 { 00040 unsigned char seqId = data[1]; 00041 if(!(lastSeqId_ + 1 == seqId || (lastSeqId_ == 255 && seqId == 0))) 00042 { 00043 __COUT__ << "?????? NOOOO Missing Packets: " << (unsigned int)lastSeqId_ 00044 << " v " << (unsigned int)seqId << __E__; 00045 } 00046 lastSeqId_ = seqId; 00047 } 00048 } 00049 00050 DEFINE_OTS_PROCESSOR(OtsDataSaverConsumer)