mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
fixed bug that it does not display image 2
This commit is contained in:
parent
6751132466
commit
f751e060b9
@ -5083,9 +5083,9 @@ void multiSlsDetector::startReceivingDataThread(){
|
|||||||
jungfrau = true;
|
jungfrau = true;
|
||||||
int singleDatabytes = detectors[ithread/numReadoutPerDetector]->getDataBytes();
|
int singleDatabytes = detectors[ithread/numReadoutPerDetector]->getDataBytes();
|
||||||
int nel=(singleDatabytes/numReadoutPerDetector)/sizeof(int);
|
int nel=(singleDatabytes/numReadoutPerDetector)/sizeof(int);
|
||||||
singleframe[ithread]=new int[nel];
|
int* image = new int[nel];
|
||||||
int len,idet = 0;
|
int len,idet = 0;
|
||||||
|
singleframe[ithread]=NULL;
|
||||||
threadStarted = true; //let calling function know thread started and obtained current
|
threadStarted = true; //let calling function know thread started and obtained current
|
||||||
|
|
||||||
|
|
||||||
@ -5111,7 +5111,7 @@ void multiSlsDetector::startReceivingDataThread(){
|
|||||||
|
|
||||||
// error if you print it
|
// error if you print it
|
||||||
// cout << ithread << " header len:"<<len<<" value:"<< (char*)zmq_msg_data(&message)<<endl;
|
// cout << ithread << " header len:"<<len<<" value:"<< (char*)zmq_msg_data(&message)<<endl;
|
||||||
//cout << ithread << "header " << endl;
|
//cprintf(BLUE,"%d header %d\n",ithread,len);
|
||||||
rapidjson::Document d;
|
rapidjson::Document d;
|
||||||
d.Parse( (char*)zmq_msg_data(&message), zmq_msg_size(&message));
|
d.Parse( (char*)zmq_msg_data(&message), zmq_msg_size(&message));
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
@ -5142,6 +5142,7 @@ void multiSlsDetector::startReceivingDataThread(){
|
|||||||
#endif
|
#endif
|
||||||
if(currentFrameIndex ==-1) cprintf(RED,"multi frame index -1!!\n");
|
if(currentFrameIndex ==-1) cprintf(RED,"multi frame index -1!!\n");
|
||||||
}
|
}
|
||||||
|
singleframe[ithread]=image;
|
||||||
|
|
||||||
// close the message
|
// close the message
|
||||||
zmq_msg_close(&message);
|
zmq_msg_close(&message);
|
||||||
@ -5151,6 +5152,7 @@ void multiSlsDetector::startReceivingDataThread(){
|
|||||||
zmq_msg_init (&message);
|
zmq_msg_init (&message);
|
||||||
len = zmq_msg_recv(&message, zmqsocket, 0);
|
len = zmq_msg_recv(&message, zmqsocket, 0);
|
||||||
|
|
||||||
|
//cprintf(BLUE,"%d data %d\n",ithread,len);
|
||||||
//end of socket ("end")
|
//end of socket ("end")
|
||||||
if (len < 1024*256 ) {
|
if (len < 1024*256 ) {
|
||||||
if(!len) cprintf(RED,"Received no data in socket for %d\n", ithread);
|
if(!len) cprintf(RED,"Received no data in socket for %d\n", ithread);
|
||||||
@ -5161,9 +5163,9 @@ void multiSlsDetector::startReceivingDataThread(){
|
|||||||
singleframe[ithread] = NULL;
|
singleframe[ithread] = NULL;
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
if(singleframe[ithread]!= NULL){
|
else{
|
||||||
//actual data
|
//actual data
|
||||||
//cout << ithread << "data " << endl;
|
//cprintf(BLUE,"%d actual dataaa\n",ithread);
|
||||||
memcpy((char*)(singleframe[ithread]),(char*)zmq_msg_data(&message),singleDatabytes/numReadoutPerDetector);
|
memcpy((char*)(singleframe[ithread]),(char*)zmq_msg_data(&message),singleDatabytes/numReadoutPerDetector);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user