receiver bug fix: function pointer not initialized as null in dataprocessor

This commit is contained in:
maliakal_d 2019-04-18 09:27:02 +02:00
parent 6b4d6084f5
commit 708975acb5
5 changed files with 17 additions and 5 deletions

2
cmk.sh
View File

@ -168,7 +168,7 @@ fi
#Debug
if [ $DEBUG -eq 1 ]; then
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
echo "Debug Option enabled"
fi

View File

@ -34,7 +34,6 @@
//parameters to calculate fifo depth
#define SAMPLE_TIME_IN_NS 100000000//100ms
#define MAX_JOBS_PER_THREAD 1000
//to differentiate between gotthard and short gotthard

View File

@ -54,7 +54,10 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
firstMeasurementIndex(0),
numTotalFramesCaught(0),
numFramesCaught(0),
currentFrameIndex(0)
currentFrameIndex(0),
rawDataReadyCallBack(nullptr),
rawDataModifyReadyCallBack(nullptr),
pRawDataReady(nullptr)
{
if(ThreadObject::CreateThread() == FAIL)
throw sls::RuntimeError("Could not create processing thread");

View File

@ -455,7 +455,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
carryOverFlag = false;
++numpackets; //number of packets in this image (each time its copied to buf)
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS)] = 1;
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS - 1)] = 1;
//writer header
if(isHeaderEmpty) {
@ -599,7 +599,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
break;
}
++numpackets; //number of packets in this image (each time its copied to buf)
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS)] = 1;
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS - 1)] = 1;
if(isHeaderEmpty) {
// -------------------------- new header ----------------------------------------------------------------------

View File

@ -708,6 +708,16 @@ int slsReceiverImplementation::setNumberofUDPInterfaces(const int n) {
// update row and column in dataprocessor
setDetectorPositionId(detID);
// update call backs
if(rawDataReadyCallBack) {
for (const auto& it : dataProcessor)
it->registerCallBackRawDataReady(rawDataReadyCallBack,pRawDataReady);
}
if(rawDataModifyReadyCallBack) {
for (const auto& it : dataProcessor)
it->registerCallBackRawDataModifyReady(rawDataModifyReadyCallBack,pRawDataReady);
}
// test socket buffer size with current set up
if (setUDPSocketBufferSize(0) == FAIL) {
return FAIL;