mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
sls_receiver_header* in callbacks (#425)
* char* to sls_receiver_header* in receiver data call backs * uint32_t to size_t in callbacks * string to const std::string & for callbacks
This commit is contained in:
parent
95ed9551c0
commit
62418c1316
@ -59,6 +59,9 @@ This document describes the differences between v7.0.0 and v6.x.x
|
||||
- gotthard 25 um image reconstructed in gui and virtual hdf5 (firmware updated for slave to reverse channels)
|
||||
- master binary file in json format now
|
||||
- fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile
|
||||
- registerCallBackRawDataReady and registerCallBackRawDataModifyReady now gives a sls_receiver_header* instead of a char*, and uint32_t to size_t
|
||||
- registerCallBackStartAcquisition gave incorrect imagesize (+120 bytes). corrected.
|
||||
- registerCallBackStartAcquisition parameter is a const string reference
|
||||
|
||||
2. Resolved Issues
|
||||
==================
|
||||
|
@ -39,52 +39,50 @@ class Receiver : private virtual slsDetectorDefs {
|
||||
int64_t getReceiverVersion();
|
||||
|
||||
/**
|
||||
* Call back for start acquisition
|
||||
* callback arguments are
|
||||
* filepath
|
||||
* filename
|
||||
* fileindex
|
||||
* datasize
|
||||
*
|
||||
* return value is undefined at the moment
|
||||
* we write depending on file write enable
|
||||
* users get data to write depending on call backs registered
|
||||
* Start Acquisition Call back (slsMultiReceiver writes data if file write enabled)
|
||||
* if registerCallBackRawDataReady or registerCallBackRawDataModifyReady registered,
|
||||
* users get data
|
||||
* callback arguments are:
|
||||
* - file path
|
||||
* - file name prefix
|
||||
* - file index
|
||||
* - image size in bytes
|
||||
*/
|
||||
void registerCallBackStartAcquisition(int (*func)(std::string, std::string,
|
||||
uint64_t, uint32_t,
|
||||
void *),
|
||||
void registerCallBackStartAcquisition(int (*func)(const std::string &, const std::string &,
|
||||
uint64_t, size_t, void *),
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Call back for acquisition finished
|
||||
* callback argument is
|
||||
* total frames caught
|
||||
* callback argument is:
|
||||
* - total frames caught
|
||||
*/
|
||||
void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void *),
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Call back for raw data
|
||||
* args to raw data ready callback are
|
||||
* sls_receiver_header frame metadata,
|
||||
* dataPointer is the pointer to the data,
|
||||
* dataSize in bytes is the size of the data in bytes.
|
||||
* args to raw data ready callback are:
|
||||
* - sls_receiver_header frame metadata,
|
||||
* - pointer to data
|
||||
* - image size in bytes
|
||||
*/
|
||||
void registerCallBackRawDataReady(void (*func)(char *, char *, uint32_t,
|
||||
void *),
|
||||
void registerCallBackRawDataReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t, void *),
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Call back for raw data (modified)
|
||||
* args to raw data ready callback are
|
||||
* sls_receiver_header frame metadata,
|
||||
* dataPointer is the pointer to the data,
|
||||
* revDatasize is the reference of data size in bytes.
|
||||
* args to raw data ready callback are:
|
||||
* - sls_receiver_header frame metadata,
|
||||
* - pointer to data
|
||||
* - revDatasize is the reference of data size in bytes.
|
||||
* Can be modified to the new size to be written/streamed. (only smaller
|
||||
* value).
|
||||
* value allowed).
|
||||
*/
|
||||
void registerCallBackRawDataModifyReady(void (*func)(char *, char *,
|
||||
uint32_t &, void *),
|
||||
void registerCallBackRawDataModifyReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t &,
|
||||
void *),
|
||||
void *arg);
|
||||
|
||||
private:
|
||||
|
@ -55,7 +55,7 @@ int64_t ClientInterface::getReceiverVersion() { return APIRECEIVER; }
|
||||
|
||||
/***callback functions***/
|
||||
void ClientInterface::registerCallBackStartAcquisition(
|
||||
int (*func)(std::string, std::string, uint64_t, uint32_t, void *),
|
||||
int (*func)(const std::string &, const std::string &, uint64_t, size_t, void *),
|
||||
void *arg) {
|
||||
startAcquisitionCallBack = func;
|
||||
pStartAcquisition = arg;
|
||||
@ -69,13 +69,13 @@ void ClientInterface::registerCallBackAcquisitionFinished(void (*func)(uint64_t,
|
||||
}
|
||||
|
||||
void ClientInterface::registerCallBackRawDataReady(
|
||||
void (*func)(char *, char *, uint32_t, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t, void *), void *arg) {
|
||||
rawDataReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
}
|
||||
|
||||
void ClientInterface::registerCallBackRawDataModifyReady(
|
||||
void (*func)(char *, char *, uint32_t &, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t &, void *), void *arg) {
|
||||
rawDataModifyReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
}
|
||||
|
@ -30,25 +30,24 @@ class ClientInterface : private virtual slsDetectorDefs {
|
||||
int64_t getReceiverVersion();
|
||||
|
||||
//***callback functions***
|
||||
/** params: filepath, filename, fileindex, datasize */
|
||||
void registerCallBackStartAcquisition(int (*func)(std::string, std::string,
|
||||
uint64_t, uint32_t,
|
||||
void *),
|
||||
/** params: file path, file name, file index, image size */
|
||||
void registerCallBackStartAcquisition(int (*func)(const std::string &, const std::string &,
|
||||
uint64_t, size_t, void *),
|
||||
void *arg);
|
||||
|
||||
/** params: total frames caught */
|
||||
void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void *),
|
||||
void *arg);
|
||||
|
||||
/** params: sls_receiver_header frame metadata, dataPointer, dataSize */
|
||||
void registerCallBackRawDataReady(void (*func)(char *, char *, uint32_t,
|
||||
void *),
|
||||
/** params: sls_receiver_header pointer, pointer to data, image size */
|
||||
void registerCallBackRawDataReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t, void *),
|
||||
void *arg);
|
||||
|
||||
/** params: sls_receiver_header frame metadata, dataPointer, modified size
|
||||
*/
|
||||
void registerCallBackRawDataModifyReady(void (*func)(char *, char *,
|
||||
uint32_t &, void *),
|
||||
/** params: sls_receiver_header pointer, pointer to data, reference to image size */
|
||||
void registerCallBackRawDataModifyReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t &,
|
||||
void *),
|
||||
void *arg);
|
||||
|
||||
private:
|
||||
@ -180,13 +179,14 @@ class ClientInterface : private virtual slsDetectorDefs {
|
||||
|
||||
//***callback parameters***
|
||||
|
||||
int (*startAcquisitionCallBack)(std::string, std::string, uint64_t,
|
||||
uint32_t, void *) = nullptr;
|
||||
int (*startAcquisitionCallBack)(const std::string &, const std::string &, uint64_t, size_t,
|
||||
void *) = nullptr;
|
||||
void *pStartAcquisition{nullptr};
|
||||
void (*acquisitionFinishedCallBack)(uint64_t, void *) = nullptr;
|
||||
void *pAcquisitionFinished{nullptr};
|
||||
void (*rawDataReadyCallBack)(char *, char *, uint32_t, void *) = nullptr;
|
||||
void (*rawDataModifyReadyCallBack)(char *, char *, uint32_t &,
|
||||
void (*rawDataReadyCallBack)(sls_receiver_header *, char *, size_t,
|
||||
void *) = nullptr;
|
||||
void (*rawDataModifyReadyCallBack)(sls_receiver_header *, char *, size_t &,
|
||||
void *) = nullptr;
|
||||
void *pRawDataReady{nullptr};
|
||||
|
||||
|
@ -316,16 +316,17 @@ uint64_t DataProcessor::ProcessAnImage(char *buf) {
|
||||
try {
|
||||
// normal call back
|
||||
if (rawDataReadyCallBack != nullptr) {
|
||||
rawDataReadyCallBack((char *)rheader,
|
||||
std::size_t dsize = *reinterpret_cast<uint32_t*>(buf);
|
||||
rawDataReadyCallBack(rheader,
|
||||
buf + FIFO_HEADER_NUMBYTES +
|
||||
sizeof(sls_receiver_header),
|
||||
(uint32_t)(*((uint32_t *)buf)), pRawDataReady);
|
||||
dsize, pRawDataReady);
|
||||
}
|
||||
|
||||
// call back with modified size
|
||||
else if (rawDataModifyReadyCallBack != nullptr) {
|
||||
auto revsize = (uint32_t)(*((uint32_t *)buf));
|
||||
rawDataModifyReadyCallBack((char *)rheader,
|
||||
std::size_t revsize = *reinterpret_cast<uint32_t*>(buf);
|
||||
rawDataModifyReadyCallBack(rheader,
|
||||
buf + FIFO_HEADER_NUMBYTES +
|
||||
sizeof(sls_receiver_header),
|
||||
revsize, pRawDataReady);
|
||||
@ -393,15 +394,14 @@ bool DataProcessor::CheckCount() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void DataProcessor::registerCallBackRawDataReady(void (*func)(char *, char *,
|
||||
uint32_t, void *),
|
||||
void *arg) {
|
||||
void DataProcessor::registerCallBackRawDataReady(
|
||||
void (*func)(sls_receiver_header *, char *, size_t, void *), void *arg) {
|
||||
rawDataReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
}
|
||||
|
||||
void DataProcessor::registerCallBackRawDataModifyReady(
|
||||
void (*func)(char *, char *, uint32_t &, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t &, void *), void *arg) {
|
||||
rawDataModifyReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
}
|
||||
|
@ -79,28 +79,16 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
const fileFormat fileFormatType,
|
||||
MasterAttributes *attr,
|
||||
std::mutex *hdf5LibMutex);
|
||||
/**
|
||||
* Call back for raw data
|
||||
* args to raw data ready callback are
|
||||
* sls_receiver_header frame metadata
|
||||
* dataPointer is the pointer to the data
|
||||
* dataSize in bytes is the size of the data in bytes.
|
||||
*/
|
||||
void registerCallBackRawDataReady(void (*func)(char *, char *, uint32_t,
|
||||
void *),
|
||||
|
||||
/** params: sls_receiver_header pointer, pointer to data, image size */
|
||||
void registerCallBackRawDataReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t, void *),
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* Call back for raw data (modified)
|
||||
* args to raw data ready callback are
|
||||
* sls_receiver_header frame metadata
|
||||
* dataPointer is the pointer to the data
|
||||
* revDatasize is the reference of data size in bytes.
|
||||
* Can be modified to the new size to be written/streamed. (only smaller
|
||||
* value).
|
||||
*/
|
||||
void registerCallBackRawDataModifyReady(void (*func)(char *, char *,
|
||||
uint32_t &, void *),
|
||||
/** params: sls_receiver_header pointer, pointer to data, reference to image size */
|
||||
void registerCallBackRawDataModifyReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t &,
|
||||
void *),
|
||||
void *arg);
|
||||
|
||||
private:
|
||||
@ -195,7 +183,8 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* dataPointer is the pointer to the data
|
||||
* dataSize in bytes is the size of the data in bytes.
|
||||
*/
|
||||
void (*rawDataReadyCallBack)(char *, char *, uint32_t, void *) = nullptr;
|
||||
void (*rawDataReadyCallBack)(sls_receiver_header *, char *, size_t,
|
||||
void *) = nullptr;
|
||||
|
||||
/**
|
||||
* Call back for raw data (modified)
|
||||
@ -205,7 +194,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* revDatasize is the reference of data size in bytes. Can be modified to
|
||||
* the new size to be written/streamed. (only smaller value).
|
||||
*/
|
||||
void (*rawDataModifyReadyCallBack)(char *, char *, uint32_t &,
|
||||
void (*rawDataModifyReadyCallBack)(sls_receiver_header *, char *, size_t &,
|
||||
void *) = nullptr;
|
||||
|
||||
void *pRawDataReady{nullptr};
|
||||
|
@ -523,10 +523,10 @@ void Implementation::startReceiver() {
|
||||
// callbacks
|
||||
if (startAcquisitionCallBack) {
|
||||
try {
|
||||
startAcquisitionCallBack(filePath, fileName, fileIndex,
|
||||
(generalData->imageSize) +
|
||||
(generalData->fifoBufferHeaderSize),
|
||||
pStartAcquisition);
|
||||
std::size_t imageSize = static_cast<uint32_t>(generalData->imageSize);
|
||||
startAcquisitionCallBack(
|
||||
filePath, fileName, fileIndex, imageSize,
|
||||
pStartAcquisition);
|
||||
} catch (const std::exception &e) {
|
||||
throw sls::RuntimeError("Start Acquisition Callback Error: " +
|
||||
std::string(e.what()));
|
||||
@ -1627,7 +1627,7 @@ void Implementation::setDbitOffset(const int s) { ctbDbitOffset = s; }
|
||||
* *
|
||||
* ************************************************/
|
||||
void Implementation::registerCallBackStartAcquisition(
|
||||
int (*func)(std::string, std::string, uint64_t, uint32_t, void *),
|
||||
int (*func)(const std::string &, const std::string &, uint64_t, size_t, void *),
|
||||
void *arg) {
|
||||
startAcquisitionCallBack = func;
|
||||
pStartAcquisition = arg;
|
||||
@ -1641,7 +1641,7 @@ void Implementation::registerCallBackAcquisitionFinished(void (*func)(uint64_t,
|
||||
}
|
||||
|
||||
void Implementation::registerCallBackRawDataReady(
|
||||
void (*func)(char *, char *, uint32_t, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t, void *), void *arg) {
|
||||
rawDataReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
for (const auto &it : dataProcessor)
|
||||
@ -1649,7 +1649,7 @@ void Implementation::registerCallBackRawDataReady(
|
||||
}
|
||||
|
||||
void Implementation::registerCallBackRawDataModifyReady(
|
||||
void (*func)(char *, char *, uint32_t &, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t &, void *), void *arg) {
|
||||
rawDataModifyReadyCallBack = func;
|
||||
pRawDataReady = arg;
|
||||
for (const auto &it : dataProcessor)
|
||||
|
@ -252,17 +252,21 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
* Callbacks *
|
||||
* *
|
||||
* ************************************************/
|
||||
void registerCallBackStartAcquisition(int (*func)(std::string, std::string,
|
||||
uint64_t, uint32_t,
|
||||
void *),
|
||||
/** params: file path, file name, file index, image size */
|
||||
void registerCallBackStartAcquisition(int (*func)(const std::string &, const std::string &,
|
||||
uint64_t, size_t, void *),
|
||||
void *arg);
|
||||
/** params: total frames caught */
|
||||
void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void *),
|
||||
void *arg);
|
||||
void registerCallBackRawDataReady(void (*func)(char *, char *, uint32_t,
|
||||
void *),
|
||||
/** params: sls_receiver_header pointer, pointer to data, image size */
|
||||
void registerCallBackRawDataReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t, void *),
|
||||
void *arg);
|
||||
void registerCallBackRawDataModifyReady(void (*func)(char *, char *,
|
||||
uint32_t &, void *),
|
||||
/** params: sls_receiver_header pointer, pointer to data, reference to image size */
|
||||
void registerCallBackRawDataModifyReady(void (*func)(sls_receiver_header *,
|
||||
char *, size_t &,
|
||||
void *),
|
||||
void *arg);
|
||||
|
||||
private:
|
||||
@ -369,13 +373,14 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
int ctbDbitOffset{0};
|
||||
|
||||
// callbacks
|
||||
int (*startAcquisitionCallBack)(std::string, std::string, uint64_t,
|
||||
uint32_t, void *){nullptr};
|
||||
int (*startAcquisitionCallBack)(const std::string &, const std::string &, uint64_t, size_t,
|
||||
void *){nullptr};
|
||||
void *pStartAcquisition{nullptr};
|
||||
void (*acquisitionFinishedCallBack)(uint64_t, void *){nullptr};
|
||||
void *pAcquisitionFinished{nullptr};
|
||||
void (*rawDataReadyCallBack)(char *, char *, uint32_t, void *){nullptr};
|
||||
void (*rawDataModifyReadyCallBack)(char *, char *, uint32_t &,
|
||||
void (*rawDataReadyCallBack)(sls_receiver_header *, char *, size_t,
|
||||
void *){nullptr};
|
||||
void (*rawDataModifyReadyCallBack)(sls_receiver_header *, char *, size_t &,
|
||||
void *){nullptr};
|
||||
void *pRawDataReady{nullptr};
|
||||
|
||||
|
@ -47,32 +47,21 @@ void printHelp() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start Acquisition Call back
|
||||
* slsReceiver writes data if file write enabled.
|
||||
* Users get data to write using call back if registerCallBackRawDataReady is
|
||||
* registered.
|
||||
* @param filepath file path
|
||||
* @param filename file name
|
||||
* @param fileindex file index
|
||||
* @param datasize data size in bytes
|
||||
* @param p pointer to object
|
||||
* \returns ignored
|
||||
* Start Acquisition Call back (slsMultiReceiver writes data if file write enabled)
|
||||
* if registerCallBackRawDataReady or registerCallBackRawDataModifyReady registered,
|
||||
* users get data
|
||||
*/
|
||||
int StartAcq(std::string filepath, std::string filename, uint64_t fileindex,
|
||||
uint32_t datasize, void *p) {
|
||||
LOG(logINFOBLUE) << "#### StartAcq: filepath:" << filepath
|
||||
<< " filename:" << filename << " fileindex:" << fileindex
|
||||
<< " datasize:" << datasize << " ####";
|
||||
int StartAcq(const std::string & filePath, const std::string & fileName, uint64_t fileIndex,
|
||||
size_t imageSize, void *objectPointer) {
|
||||
LOG(logINFOBLUE) << "#### StartAcq: filePath:" << filePath
|
||||
<< " fileName:" << fileName << " fileIndex:" << fileIndex
|
||||
<< " imageSize:" << imageSize << " ####";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquisition Finished Call back
|
||||
* @param frames Number of frames caught
|
||||
* @param p pointer to object
|
||||
*/
|
||||
void AcquisitionFinished(uint64_t frames, void *p) {
|
||||
LOG(logINFOBLUE) << "#### AcquisitionFinished: frames:" << frames
|
||||
/** Acquisition Finished Call back */
|
||||
void AcquisitionFinished(uint64_t framesCaught, void *objectPointer) {
|
||||
LOG(logINFOBLUE) << "#### AcquisitionFinished: framesCaught:" << framesCaught
|
||||
<< " ####";
|
||||
}
|
||||
|
||||
@ -80,14 +69,9 @@ void AcquisitionFinished(uint64_t frames, void *p) {
|
||||
* Get Receiver Data Call back
|
||||
* Prints in different colors(for each receiver process) the different headers
|
||||
* for each image call back.
|
||||
* @param metadata sls_receiver_header metadata
|
||||
* @param datapointer pointer to data
|
||||
* @param datasize data size in bytes.
|
||||
* @param p pointer to object
|
||||
*/
|
||||
void GetData(char *metadata, char *datapointer, uint32_t datasize, void *p) {
|
||||
slsDetectorDefs::sls_receiver_header *header =
|
||||
(slsDetectorDefs::sls_receiver_header *)metadata;
|
||||
void GetData(slsDetectorDefs::sls_receiver_header *header, char *dataPointer,
|
||||
size_t imageSize, void *objectPointer) {
|
||||
slsDetectorDefs::sls_detector_header detectorHeader = header->detHeader;
|
||||
|
||||
PRINT_IN_COLOR(
|
||||
@ -98,7 +82,7 @@ void GetData(char *metadata, char *datapointer, uint32_t datasize, void *p) {
|
||||
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
|
||||
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
|
||||
//"\t\tpacketsMask:%s"
|
||||
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
|
||||
"\t\tfirstbytedata: 0x%x\t\tdatsize: %zu\n\n",
|
||||
detectorHeader.row, (long unsigned int)detectorHeader.frameNumber,
|
||||
detectorHeader.expLength, detectorHeader.packetNumber,
|
||||
(long unsigned int)detectorHeader.bunchId,
|
||||
@ -107,23 +91,18 @@ void GetData(char *metadata, char *datapointer, uint32_t datasize, void *p) {
|
||||
detectorHeader.debug, detectorHeader.roundRNumber,
|
||||
detectorHeader.detType, detectorHeader.version,
|
||||
// header->packetsMask.to_string().c_str(),
|
||||
((uint8_t)(*((uint8_t *)(datapointer)))), datasize);
|
||||
((uint8_t)(*((uint8_t *)(dataPointer)))), imageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Receiver Data Call back (modified)
|
||||
* Prints in different colors(for each receiver process) the different headers
|
||||
* for each image call back.
|
||||
* @param metadata sls_receiver_header metadata
|
||||
* @param datapointer pointer to data
|
||||
* @param revDatasize new data size in bytes after the callback.
|
||||
* @param modifiedImageSize new data size in bytes after the callback.
|
||||
* This will be the size written/streamed. (only smaller value is allowed).
|
||||
* @param p pointer to object
|
||||
*/
|
||||
void GetData(char *metadata, char *datapointer, uint32_t &revDatasize,
|
||||
void *p) {
|
||||
slsDetectorDefs::sls_receiver_header *header =
|
||||
(slsDetectorDefs::sls_receiver_header *)metadata;
|
||||
void GetData(slsDetectorDefs::sls_receiver_header *header, char *dataPointer,
|
||||
size_t &modifiedImageSize, void *objectPointer) {
|
||||
slsDetectorDefs::sls_detector_header detectorHeader = header->detHeader;
|
||||
|
||||
PRINT_IN_COLOR(
|
||||
@ -135,7 +114,7 @@ void GetData(char *metadata, char *datapointer, uint32_t &revDatasize,
|
||||
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
|
||||
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
|
||||
//"\t\tpacketsMask:%s"
|
||||
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
|
||||
"\t\tfirstbytedata: 0x%x\t\tdatsize: %zu\n\n",
|
||||
detectorHeader.row, (long long unsigned int)detectorHeader.frameNumber,
|
||||
detectorHeader.expLength, detectorHeader.packetNumber,
|
||||
(long long unsigned int)detectorHeader.bunchId,
|
||||
@ -144,10 +123,10 @@ void GetData(char *metadata, char *datapointer, uint32_t &revDatasize,
|
||||
detectorHeader.debug, detectorHeader.roundRNumber,
|
||||
detectorHeader.detType, detectorHeader.version,
|
||||
// header->packetsMask.to_string().c_str(),
|
||||
((uint8_t)(*((uint8_t *)(datapointer)))), revDatasize);
|
||||
((uint8_t)(*((uint8_t *)(dataPointer)))), modifiedImageSize);
|
||||
|
||||
// if data is modified, eg ROI and size is reduced
|
||||
revDatasize = 26000;
|
||||
modifiedImageSize = 26000;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +129,7 @@ int64_t Receiver::getReceiverVersion() {
|
||||
}
|
||||
|
||||
void Receiver::registerCallBackStartAcquisition(
|
||||
int (*func)(std::string, std::string, uint64_t, uint32_t, void *),
|
||||
int (*func)(const std::string &, const std::string &, uint64_t, size_t, void *),
|
||||
void *arg) {
|
||||
tcpipInterface->registerCallBackStartAcquisition(func, arg);
|
||||
}
|
||||
@ -140,14 +140,13 @@ void Receiver::registerCallBackAcquisitionFinished(void (*func)(uint64_t,
|
||||
tcpipInterface->registerCallBackAcquisitionFinished(func, arg);
|
||||
}
|
||||
|
||||
void Receiver::registerCallBackRawDataReady(void (*func)(char *, char *,
|
||||
uint32_t, void *),
|
||||
void *arg) {
|
||||
void Receiver::registerCallBackRawDataReady(
|
||||
void (*func)(sls_receiver_header *, char *, size_t, void *), void *arg) {
|
||||
tcpipInterface->registerCallBackRawDataReady(func, arg);
|
||||
}
|
||||
|
||||
void Receiver::registerCallBackRawDataModifyReady(
|
||||
void (*func)(char *, char *, uint32_t &, void *), void *arg) {
|
||||
void (*func)(sls_receiver_header *, char *, size_t &, void *), void *arg) {
|
||||
tcpipInterface->registerCallBackRawDataModifyReady(func, arg);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user