mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
including subframe index from receiver to client and also sending this to gui
This commit is contained in:
@ -4584,7 +4584,7 @@ int multiSlsDetector::resetFramesCaught() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex){
|
int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex){
|
||||||
int nel=(thisMultiDetector->dataBytes)/sizeof(int);
|
int nel=(thisMultiDetector->dataBytes)/sizeof(int);
|
||||||
if(nel <= 0){
|
if(nel <= 0){
|
||||||
cout << "Multislsdetector databytes not valid :" << thisMultiDetector->dataBytes << endl;
|
cout << "Multislsdetector databytes not valid :" << thisMultiDetector->dataBytes << endl;
|
||||||
@ -4610,7 +4610,7 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex
|
|||||||
for (int id=0; id<thisMultiDetector->numberOfDetectors; id++) {
|
for (int id=0; id<thisMultiDetector->numberOfDetectors; id++) {
|
||||||
if (detectors[id]) {
|
if (detectors[id]) {
|
||||||
n=detectors[id]->getDataBytes();
|
n=detectors[id]->getDataBytes();
|
||||||
retdet=detectors[id]->readFrameFromReceiver(fName, acquisitionIndex, frameIndex);
|
retdet=detectors[id]->readFrameFromReceiver(fName, acquisitionIndex, frameIndex, subFrameIndex);
|
||||||
if(detectors[id]->getErrorMask())
|
if(detectors[id]->getErrorMask())
|
||||||
setErrorMask(getErrorMask()|(1<<id));
|
setErrorMask(getErrorMask()|(1<<id));
|
||||||
if (retdet){
|
if (retdet){
|
||||||
|
@ -1160,9 +1160,10 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
* @param fName file name of current frame()
|
* @param fName file name of current frame()
|
||||||
* @param acquisitionIndex current acquisition index
|
* @param acquisitionIndex current acquisition index
|
||||||
* @param frameIndex current frame index (for each scan)
|
* @param frameIndex current frame index (for each scan)
|
||||||
|
* @param subFrameIndex current sub frame index (for 32 bit mode for eiger)
|
||||||
/returns a frame read from recever
|
/returns a frame read from recever
|
||||||
*/
|
*/
|
||||||
int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex);
|
int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex);
|
||||||
|
|
||||||
/** Locks/Unlocks the connection to the receiver
|
/** Locks/Unlocks the connection to the receiver
|
||||||
/param lock sets (1), usets (0), gets (-1) the lock
|
/param lock sets (1), usets (0), gets (-1) the lock
|
||||||
|
@ -6705,7 +6705,7 @@ int slsDetector::resetFramesCaught(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int* slsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex){
|
int* slsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex){
|
||||||
int fnum=F_READ_RECEIVER_FRAME;
|
int fnum=F_READ_RECEIVER_FRAME;
|
||||||
int nel=thisDetector->dataBytes/sizeof(int);
|
int nel=thisDetector->dataBytes/sizeof(int);
|
||||||
int* retval=new int[nel];
|
int* retval=new int[nel];
|
||||||
@ -6732,6 +6732,8 @@ int* slsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int
|
|||||||
n=dataSocket->ReceiveDataOnly(fName,MAX_STR_LENGTH);
|
n=dataSocket->ReceiveDataOnly(fName,MAX_STR_LENGTH);
|
||||||
n=dataSocket->ReceiveDataOnly(&acquisitionIndex,sizeof(acquisitionIndex));
|
n=dataSocket->ReceiveDataOnly(&acquisitionIndex,sizeof(acquisitionIndex));
|
||||||
n=dataSocket->ReceiveDataOnly(&frameIndex,sizeof(frameIndex));
|
n=dataSocket->ReceiveDataOnly(&frameIndex,sizeof(frameIndex));
|
||||||
|
if(thisDetector->myDetectorType == EIGER)
|
||||||
|
n=dataSocket->ReceiveDataOnly(&subFrameIndex,sizeof(subFrameIndex));
|
||||||
n=dataSocket->ReceiveDataOnly(retval,thisDetector->dataBytes);
|
n=dataSocket->ReceiveDataOnly(retval,thisDetector->dataBytes);
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
@ -1554,9 +1554,10 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
* @param fName file name of current frame()
|
* @param fName file name of current frame()
|
||||||
* @param acquisitionIndex current acquisition index
|
* @param acquisitionIndex current acquisition index
|
||||||
* @param frameIndex current frame index (for each scan)
|
* @param frameIndex current frame index (for each scan)
|
||||||
|
* @param subFrameIndex current sub frame index (for 32 bit mode for eiger)
|
||||||
/returns a frame read from recever
|
/returns a frame read from recever
|
||||||
*/
|
*/
|
||||||
int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex);
|
int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex);
|
||||||
|
|
||||||
/** Locks/Unlocks the connection to the receiver
|
/** Locks/Unlocks the connection to the receiver
|
||||||
/param lock sets (1), usets (0), gets (-1) the lock
|
/param lock sets (1), usets (0), gets (-1) the lock
|
||||||
|
@ -499,9 +499,10 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
|||||||
* @param fName file name of current frame()
|
* @param fName file name of current frame()
|
||||||
* @param acquisitionIndex current acquisition index
|
* @param acquisitionIndex current acquisition index
|
||||||
* @param frameIndex current frame index (for each scan)
|
* @param frameIndex current frame index (for each scan)
|
||||||
|
* @param subFrameIndex current sub frame index (for 32 bit mode for eiger)
|
||||||
/returns a frame read from recever
|
/returns a frame read from recever
|
||||||
*/
|
*/
|
||||||
virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex)=0;
|
virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex)=0;
|
||||||
|
|
||||||
|
|
||||||
/** Sets the read receiver frequency
|
/** Sets the read receiver frequency
|
||||||
|
@ -268,7 +268,7 @@ int64_t slsDetectorUsers::getThisSoftwareVersion(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, void*), void *pArg){
|
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg){
|
||||||
myDetector->registerDataCallback(userCallback,pArg);
|
myDetector->registerDataCallback(userCallback,pArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,10 +408,10 @@ class slsDetectorUsers
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@short register calbback for accessing detector final data
|
@short register calbback for accessing detector final data
|
||||||
\param userCallback function for plotting/analyzing the data. Its arguments are the data structure d and the frame number f.
|
\param userCallback function for plotting/analyzing the data. Its arguments are the data structure d and the frame number f, s is for subframe number for eiger for 32 bit mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void registerDataCallback(int( *userCallback)(detectorData* d, int f, void*), void *pArg);
|
void registerDataCallback(int( *userCallback)(detectorData* d, int f, int s, void*), void *pArg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@short register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software
|
@short register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software
|
||||||
|
@ -641,9 +641,10 @@ virtual int resetFramesCaught()=0;
|
|||||||
* @param fName file name of current frame()
|
* @param fName file name of current frame()
|
||||||
* @param acquisitionIndex current acquisition index
|
* @param acquisitionIndex current acquisition index
|
||||||
* @param frameIndex current frame index (for each scan)
|
* @param frameIndex current frame index (for each scan)
|
||||||
|
* @param subFrameIndex current sub frame index (for 32 bit mode for eiger)
|
||||||
/returns a frame read from recever
|
/returns a frame read from recever
|
||||||
*/
|
*/
|
||||||
virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex)=0;
|
virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex)=0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,7 +138,7 @@ void postProcessing::processFrame(int *myData, int delflag, int jctb) {
|
|||||||
// cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl;
|
// cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl;
|
||||||
// cout << "DATAREADY 1" <<endl;
|
// cout << "DATAREADY 1" <<endl;
|
||||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels());
|
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels());
|
||||||
dataReady(thisData, currentFrameIndex, pCallbackArg);
|
dataReady(thisData, currentFrameIndex, -1, pCallbackArg);
|
||||||
delete thisData;
|
delete thisData;
|
||||||
fdata=NULL;
|
fdata=NULL;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ data queue size unlock
|
|||||||
// cout << "callback arg "<< getCurrentProgress()<< " " << (fname+ext).c_str() << " " << np << endl;
|
// cout << "callback arg "<< getCurrentProgress()<< " " << (fname+ext).c_str() << " " << np << endl;
|
||||||
//cout << "ADATREADY 2 " << endl;
|
//cout << "ADATREADY 2 " << endl;
|
||||||
thisData=new detectorData(val,err,ang,getCurrentProgress(),(fname+ext).c_str(),np);
|
thisData=new detectorData(val,err,ang,getCurrentProgress(),(fname+ext).c_str(),np);
|
||||||
dataReady(thisData, currentFrameIndex, pCallbackArg);
|
dataReady(thisData, currentFrameIndex, -1, pCallbackArg);
|
||||||
delete thisData;
|
delete thisData;
|
||||||
ang=NULL;
|
ang=NULL;
|
||||||
val=NULL;
|
val=NULL;
|
||||||
@ -500,6 +500,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
int caught = -1;
|
int caught = -1;
|
||||||
int currentAcquisitionIndex = -1;
|
int currentAcquisitionIndex = -1;
|
||||||
int currentFrameIndex = -1;
|
int currentFrameIndex = -1;
|
||||||
|
int currentSubFrameIndex = -1;
|
||||||
bool newData = false;
|
bool newData = false;
|
||||||
int nthframe = setReadReceiverFrequency(0);
|
int nthframe = setReadReceiverFrequency(0);
|
||||||
|
|
||||||
@ -633,7 +634,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
strcpy(currentfName,"");
|
strcpy(currentfName,"");
|
||||||
pthread_mutex_lock(&mg);
|
pthread_mutex_lock(&mg);
|
||||||
//int* receiverData = new int [getTotalNumberOfChannels()];
|
//int* receiverData = new int [getTotalNumberOfChannels()];
|
||||||
int* receiverData = readFrameFromReceiver(currentfName,currentAcquisitionIndex,currentFrameIndex);
|
int* receiverData = readFrameFromReceiver(currentfName,currentAcquisitionIndex,currentFrameIndex,currentSubFrameIndex);
|
||||||
pthread_mutex_unlock(&mg);
|
pthread_mutex_unlock(&mg);
|
||||||
|
|
||||||
//if detector returned null
|
//if detector returned null
|
||||||
@ -664,7 +665,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
if ((fdata) && (dataReady)){
|
if ((fdata) && (dataReady)){
|
||||||
// cout << "DATAREADY 3" << endl;
|
// cout << "DATAREADY 3" << endl;
|
||||||
thisData = new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
thisData = new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
||||||
dataReady(thisData, currentFrameIndex, pCallbackArg);
|
dataReady(thisData, currentFrameIndex, currentSubFrameIndex, pCallbackArg);
|
||||||
delete thisData;
|
delete thisData;
|
||||||
fdata = NULL;
|
fdata = NULL;
|
||||||
progress = caught;
|
progress = caught;
|
||||||
|
@ -238,7 +238,7 @@ s
|
|||||||
void ResetPositionIndex(){pthread_mutex_lock(&mp); resetPositionIndex(); pthread_mutex_unlock(&mp);};
|
void ResetPositionIndex(){pthread_mutex_lock(&mp); resetPositionIndex(); pthread_mutex_unlock(&mp);};
|
||||||
|
|
||||||
|
|
||||||
void registerDataCallback(int( *userCallback)(detectorData*, int, void*), void *pArg) {dataReady = userCallback; pCallbackArg = pArg;};
|
void registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {dataReady = userCallback; pCallbackArg = pArg;};
|
||||||
|
|
||||||
|
|
||||||
void registerRawDataCallback(int( *userCallback)(double*, int, void*), void *pArg) {rawDataReady = userCallback; pRawDataArg = pArg;};
|
void registerRawDataCallback(int( *userCallback)(double*, int, void*), void *pArg) {rawDataReady = userCallback; pRawDataArg = pArg;};
|
||||||
@ -335,7 +335,7 @@ s
|
|||||||
private:
|
private:
|
||||||
double *fdata;
|
double *fdata;
|
||||||
|
|
||||||
int (*dataReady)(detectorData*,int, void*);
|
int (*dataReady)(detectorData*,int, int,void*);
|
||||||
void *pCallbackArg;
|
void *pCallbackArg;
|
||||||
|
|
||||||
int (*rawDataReady)(double*,int,void*);
|
int (*rawDataReady)(double*,int,void*);
|
||||||
|
Reference in New Issue
Block a user