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