mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 18:40:42 +02:00
users:double for time in ns, bugfix:readframe wen no gui, return ok for config
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@564 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
a4d99004f7
commit
df6774e2c6
@ -3898,7 +3898,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
|||||||
|
|
||||||
setNumberOfModules(-1);
|
setNumberOfModules(-1);
|
||||||
getMaxNumberOfModules();
|
getMaxNumberOfModules();
|
||||||
return iline;
|
return OK;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -3988,7 +3988,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
|
|||||||
std::cout<< "wrote " <<ret << " lines to configuration file " << std::endl;
|
std::cout<< "wrote " <<ret << " lines to configuration file " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return iv;
|
return OK;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4429,6 +4429,12 @@ int multiSlsDetector::resetFramesCaught() {
|
|||||||
|
|
||||||
int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){
|
int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){
|
||||||
int nel=(thisMultiDetector->dataBytes)/sizeof(int);
|
int nel=(thisMultiDetector->dataBytes)/sizeof(int);
|
||||||
|
if(nel <= 0){
|
||||||
|
cout << "Multislsdetector databytes not valid :" << thisMultiDetector->dataBytes << endl;
|
||||||
|
fIndex = -1;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
int* retval=new int[nel];
|
int* retval=new int[nel];
|
||||||
int *retdet, *p=retval;
|
int *retdet, *p=retval;
|
||||||
|
@ -5246,7 +5246,7 @@ int slsDetector::readConfigurationFile(string const fname){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Read configuration file of " << iline << " lines" << std::endl;
|
std::cout<< "Read configuration file of " << iline << " lines" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return iline;
|
return OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5308,7 +5308,7 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
|||||||
iline++;
|
iline++;
|
||||||
}
|
}
|
||||||
delete cmd;
|
delete cmd;
|
||||||
return iline;
|
return OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5339,7 +5339,7 @@ int slsDetector::writeConfigurationFile(string const fname){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "wrote " <<ret << " lines to configuration file " << std::endl;
|
std::cout<< "wrote " <<ret << " lines to configuration file " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return OK;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -5425,7 +5425,7 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete cmd;
|
delete cmd;
|
||||||
return iv;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,6 +163,21 @@ int64_t slsDetectorUsers::setDelayAfterTrigger(int64_t t){
|
|||||||
return myDetector->setDelayAfterTrigger(t);
|
return myDetector->setDelayAfterTrigger(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setExposureTime(double t){
|
||||||
|
int64_t tms = t * 1E+9;
|
||||||
|
return 1E-9 * (double)myDetector->setExposureTime(tms);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setExposurePeriod(double t){
|
||||||
|
int64_t tms = t * 1E+9;
|
||||||
|
return 1E-9 * (double)myDetector->setExposurePeriod(tms);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setDelayAfterTrigger(double t){
|
||||||
|
int64_t tms = t * 1E+9;
|
||||||
|
return 1E-9 * (double)(myDetector->setDelayAfterTrigger(tms));
|
||||||
|
}
|
||||||
|
|
||||||
int64_t slsDetectorUsers::setNumberOfGates(int64_t t){
|
int64_t slsDetectorUsers::setNumberOfGates(int64_t t){
|
||||||
return myDetector->setNumberOfGates(t);
|
return myDetector->setNumberOfGates(t);
|
||||||
}
|
}
|
||||||
|
@ -335,6 +335,28 @@ class slsDetectorUsers
|
|||||||
*/
|
*/
|
||||||
int64_t setDelayAfterTrigger(int64_t t=-1);
|
int64_t setDelayAfterTrigger(int64_t t=-1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@short set/get exposure time value
|
||||||
|
\param t time in s (-1 gets)
|
||||||
|
\returns timer set value in s
|
||||||
|
*/
|
||||||
|
|
||||||
|
double setExposureTime(double t=-1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@short set/get exposure period
|
||||||
|
\param t time in s (-1 gets)
|
||||||
|
\returns timer set value in s
|
||||||
|
*/
|
||||||
|
double setExposurePeriod(double t=-1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@short set/get delay after trigger
|
||||||
|
\param t time in s (-1 gets)
|
||||||
|
\returns timer set value in s
|
||||||
|
*/
|
||||||
|
double setDelayAfterTrigger(double t=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@short set/get number of gates
|
@short set/get number of gates
|
||||||
\param t number of gates (-1 gets)
|
\param t number of gates (-1 gets)
|
||||||
|
@ -726,7 +726,7 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Read " << iline << " lines" << std::endl;
|
std::cout<< "Read " << iline << " lines" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return iline;
|
return OK;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -869,7 +869,7 @@ int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
|
|||||||
std::cout<< "wrote " <<iv << " lines to "<< fname1 << std::endl;
|
std::cout<< "wrote " <<iv << " lines to "<< fname1 << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,39 +440,43 @@ void* postProcessing::processData(int delflag) {
|
|||||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
if(setReceiverOnline()==OFFLINE_FLAG)
|
||||||
caught=prevCaught;
|
caught=prevCaught;
|
||||||
incrementProgress(caught-prevCaught);
|
incrementProgress(caught-prevCaught);
|
||||||
if(caught-prevCaught) newData=true;
|
|
||||||
else newData=false;
|
|
||||||
prevCaught=caught;
|
|
||||||
|
|
||||||
if (checkJoinThread()) break;
|
if (checkJoinThread()) break;
|
||||||
|
|
||||||
//read frame if new data
|
if (dataReady){
|
||||||
if(newData){
|
|
||||||
strcpy(currentfName,"");
|
if(caught-prevCaught) newData=true;
|
||||||
pthread_mutex_lock(&mg);
|
else newData=false;
|
||||||
int* receiverData = readFrameFromReceiver(currentfName,currentfIndex);
|
prevCaught=caught;
|
||||||
pthread_mutex_unlock(&mg);
|
|
||||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
//read frame if new data
|
||||||
receiverData = NULL;
|
if (newData){
|
||||||
if(receiverData == NULL){
|
strcpy(currentfName,"");
|
||||||
currentfIndex = -1;
|
pthread_mutex_lock(&mg);
|
||||||
cout<<"****Detector Data returned is NULL***"<<endl;
|
int* receiverData = readFrameFromReceiver(currentfName,currentfIndex);
|
||||||
}
|
pthread_mutex_unlock(&mg);
|
||||||
//not garbage frame
|
if(setReceiverOnline()==OFFLINE_FLAG)
|
||||||
if(currentfIndex>=0){
|
receiverData = NULL;
|
||||||
fdata=decodeData(receiverData);
|
if(receiverData == NULL){
|
||||||
delete [] receiverData;
|
currentfIndex = -1;
|
||||||
if(fdata){
|
cout<<"****Detector Data returned is NULL***"<<endl;
|
||||||
if (dataReady) {
|
}
|
||||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
//not garbage frame
|
||||||
dataReady(thisData, currentfIndex, pCallbackArg);
|
if(currentfIndex>=0){
|
||||||
delete thisData;
|
fdata=decodeData(receiverData);
|
||||||
fdata=NULL;
|
delete [] receiverData;
|
||||||
|
if(fdata){
|
||||||
|
if (dataReady) {
|
||||||
|
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
||||||
|
dataReady(thisData, currentfIndex, pCallbackArg);
|
||||||
|
delete thisData;
|
||||||
|
fdata=NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else{
|
||||||
else{
|
;//cout<<"****Detector returned mismatched indices/garbage or acquisition is over. Trying again.***"<<endl;
|
||||||
;//cout<<"****Detector returned mismatched indices/garbage or acquisition is over. Trying again.***"<<endl;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user