mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
switched
This commit is contained in:
parent
208c12b72c
commit
de5037ae2b
@ -5090,7 +5090,9 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
int* image = new int[nel];
|
||||
int len,idet = 0;
|
||||
singleframe[ithread]=NULL;
|
||||
/* int datavalue = 2;*/
|
||||
///*
|
||||
int datavalue = 2;
|
||||
// */
|
||||
threadStarted = true; //let calling function know thread started and obtained current
|
||||
|
||||
|
||||
@ -5108,6 +5110,7 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
//scan header-------------------------------------------------------------------
|
||||
zmq_msg_init (&message);
|
||||
|
||||
/*
|
||||
//---- with end
|
||||
len = zmq_msg_recv(&message, zmqsocket, 0);
|
||||
if (len == -1) {
|
||||
@ -5116,8 +5119,10 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
continue;
|
||||
}
|
||||
//----
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
while(1){
|
||||
|
||||
len = zmq_msg_recv(&message, zmqsocket, ZMQ_DONTWAIT);
|
||||
@ -5150,16 +5155,16 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
usleep(4000);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/*if(datavalue){
|
||||
|
||||
if(datavalue){
|
||||
//len = zmq_msg_recv(&message, zmqsocket, 0);
|
||||
if (len == -1) {
|
||||
zmq_msg_close(&message);
|
||||
cprintf(RED, "%d message null\n",ithread);
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
|
||||
// error if you print it
|
||||
// cout << ithread << " header len:"<<len<<" value:"<< (char*)zmq_msg_data(&message)<<endl;
|
||||
//cprintf(BLUE,"%d header %d\n",ithread,len);
|
||||
@ -5206,6 +5211,8 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
//cprintf(BLUE,"%d data %d\n",ithread,len);
|
||||
//end of socket ("end")
|
||||
if (len < 1024*256 ) {
|
||||
/*
|
||||
}
|
||||
if(!len) cprintf(RED,"Received no data in socket for %d\n", ithread);
|
||||
//#ifdef VERYVERBOSE
|
||||
cprintf(RED,"End of socket for %d\n", ithread);
|
||||
@ -5213,12 +5220,12 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
zmq_msg_close(&message);
|
||||
singleframe[ithread] = NULL;
|
||||
//break;
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
cprintf(RED,"Received weird packet size %d in socket for %d\n", len, ithread);
|
||||
memset((char*)(singleframe[ithread]),0xFF,singleDatabytes/numReadoutPerDetector);
|
||||
*/
|
||||
|
||||
}
|
||||
else{
|
||||
//actual data
|
||||
@ -5235,10 +5242,14 @@ void multiSlsDetector::startReceivingDataThread(){
|
||||
}
|
||||
|
||||
|
||||
/* }*/
|
||||
///*
|
||||
}
|
||||
// */
|
||||
sem_post(&sem_singledone[ithread]);//let multi know is ready
|
||||
zmq_msg_close(&message); // close the message
|
||||
/* datavalue = 2;*/
|
||||
///*
|
||||
datavalue = 2;
|
||||
// */
|
||||
}
|
||||
|
||||
cprintf(RED,"%d Closing socket\n",ithread);
|
||||
|
@ -58,7 +58,9 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
if(!receiver){
|
||||
setDetectorIndex(-1);
|
||||
}else{
|
||||
/*receiverStoppedFlag = 0;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
//put receiver read frequency to random if no gui
|
||||
int ret = setReadReceiverFrequency(0);
|
||||
if(ret>0 && (dataReady == NULL)){
|
||||
@ -151,18 +153,24 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
stopReceiver();
|
||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||
*stoppedFlag=1;
|
||||
/*receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
}
|
||||
//multi detectors shouldnt have different receiver read frequencies enabled/disabled
|
||||
if(setReadReceiverFrequency(0) < 0){
|
||||
std::cout << "Error: The receiver read frequency is invalid:" << setReadReceiverFrequency(0) << std::endl;
|
||||
*stoppedFlag=1;
|
||||
/*receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
}
|
||||
|
||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||
*stoppedFlag=1;
|
||||
/*receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,7 +304,9 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||
stopReceiver();
|
||||
*stoppedFlag=1;
|
||||
/*receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
pthread_mutex_unlock(&mg);
|
||||
break;
|
||||
}
|
||||
@ -304,7 +314,9 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
if(startReceiver() == FAIL) {
|
||||
stopReceiver();
|
||||
*stoppedFlag=1;
|
||||
/*receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
pthread_mutex_unlock(&mg);
|
||||
break;
|
||||
}
|
||||
@ -351,7 +363,9 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
pthread_mutex_lock(&mg);
|
||||
//offline
|
||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||
/* receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
if ((getDetectorsType()==GOTTHARD) || (getDetectorsType()==MOENCH) || (getDetectorsType()==JUNGFRAU) ){
|
||||
if((*correctionMask)&(1<<WRITE_FILE))
|
||||
closeDataFile();
|
||||
@ -360,7 +374,9 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
//online
|
||||
else{
|
||||
stopReceiver();
|
||||
/* receiverStoppedFlag = 1;*/
|
||||
///*
|
||||
receiverStoppedFlag = 0;
|
||||
//*/
|
||||
// cout<<"***********receiver stopped"<<endl;
|
||||
}
|
||||
pthread_mutex_unlock(&mg);
|
||||
|
@ -837,7 +837,9 @@ virtual int setReceiverFifoDepth(int i = -1)=0;
|
||||
|
||||
//protected:
|
||||
int *stoppedFlag;
|
||||
/* int receiverStoppedFlag;*/
|
||||
///*
|
||||
int receiverStoppedFlag;
|
||||
// */
|
||||
|
||||
int64_t *timerValue;
|
||||
detectorSettings *currentSettings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user