mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-08 19:10:42 +02:00
moved the test function to the slsDetectorUtils class
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@154 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
145e38eac1
commit
aae550b997
@ -4610,10 +4610,10 @@ int slsDetector::loadImageToDetector(imageType index,string const fname){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(readDataFile(fname,arg)){
|
if(readDataFile(fname,arg)){
|
||||||
std::cout<< "Could not open file "<< fname << std::endl;
|
ret = sendImageToDetector(index,arg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = sendImageToDetector(index,arg);
|
std::cout<< "Could not open file "<< fname << std::endl;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5444,66 +5444,6 @@ int slsDetector::saveSettingsFile(string fname, int imod) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::testFunction(int times) {
|
|
||||||
int i,count=0;
|
|
||||||
runStatus s;
|
|
||||||
short int dataVals[thisDetector->nChans*thisDetector->nChips];
|
|
||||||
|
|
||||||
for(i=0;i<times;i++){
|
|
||||||
std::cout<<std::endl<<dec<<i+1<<": \t";
|
|
||||||
//usleep(2000000);
|
|
||||||
startAcquisition();
|
|
||||||
s = getRunStatus();
|
|
||||||
if(s==IDLE){
|
|
||||||
s = getRunStatus();
|
|
||||||
if(s==IDLE)
|
|
||||||
std::cout<<"IDLE"<<std::endl;
|
|
||||||
//exit(-1);
|
|
||||||
}
|
|
||||||
else if (s==RUNNING){
|
|
||||||
count=0;
|
|
||||||
while(s==RUNNING){
|
|
||||||
count++;
|
|
||||||
if(count==3){
|
|
||||||
std::cout<<"STUCK"<<std::endl;
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
usleep(2);
|
|
||||||
//val=readRegister(0x25);
|
|
||||||
s = getRunStatus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
std::cout<<"\nWeird Status.Exit\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
system("rm ~/wORKSPACE/scratch/run* ");
|
|
||||||
//system("more ~/wORKSPACE/scratch/run* ");
|
|
||||||
usleep(1000000);
|
|
||||||
|
|
||||||
setFileIndex(0);
|
|
||||||
readAll();
|
|
||||||
processData(1);
|
|
||||||
|
|
||||||
|
|
||||||
if(readDataFile("/home/l_maliakal_d/wORKSPACE/scratch/run_1.raw",dataVals)){
|
|
||||||
std::cout<< "Could not open file "<< std::endl;
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int j=1277;j< (thisDetector->nChans*thisDetector->nChips);j++)
|
|
||||||
cout<<"\t"<<j<<":"<<dataVals[j];
|
|
||||||
|
|
||||||
if(dataVals[1278]!=2558){
|
|
||||||
std::cout<< "DATA ERROR!! "<< std::endl;
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::cout<<std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* returns if the detector is Master, slave or nothing
|
/* returns if the detector is Master, slave or nothing
|
||||||
\param flag can be GET_MASTER, NO_MASTER, IS_MASTER, IS_SLAVE
|
\param flag can be GET_MASTER, NO_MASTER, IS_MASTER, IS_SLAVE
|
||||||
|
@ -1337,9 +1337,6 @@ typedef struct sharedSlsDetector {
|
|||||||
*/
|
*/
|
||||||
int sendImageToDetector(imageType index,short int arg[]);
|
int sendImageToDetector(imageType index,short int arg[]);
|
||||||
|
|
||||||
/** temporary test fucntion */
|
|
||||||
int testFunction(int times=0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets/gets the synchronization mode of the various detectors
|
Sets/gets the synchronization mode of the various detectors
|
||||||
\param sync syncronization mode can be GET_SYNCHRONIZATION_MODE, NONE, MASTER_GATES, MASTER_TRIGGERS, SLAVE_STARTS_WHEN_MASTER_STOPS
|
\param sync syncronization mode can be GET_SYNCHRONIZATION_MODE, NONE, MASTER_GATES, MASTER_TRIGGERS, SLAVE_STARTS_WHEN_MASTER_STOPS
|
||||||
|
@ -1244,7 +1244,7 @@ void slsDetectorUtils::acquire(int delflag){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
setTotalProgress();
|
// setTotalProgress();
|
||||||
progressIndex=0;
|
progressIndex=0;
|
||||||
*stoppedFlag=0;
|
*stoppedFlag=0;
|
||||||
|
|
||||||
@ -1625,6 +1625,7 @@ void* slsDetectorUtils::processData(int delflag) {
|
|||||||
std::cout<< " processing data - threaded mode " << *threadedProcessing << endl;
|
std::cout<< " processing data - threaded mode " << *threadedProcessing << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
setTotalProgress();
|
||||||
//cout << "thread mutex lock line 6505" << endl;
|
//cout << "thread mutex lock line 6505" << endl;
|
||||||
pthread_mutex_lock(&mp);
|
pthread_mutex_lock(&mp);
|
||||||
queuesize=dataQueue.size();
|
queuesize=dataQueue.size();
|
||||||
@ -2614,3 +2615,70 @@ float slsDetectorUtils::getCurrentProgress() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int slsDetectorUtils::testFunction(int times) {
|
||||||
|
int i,count=0;
|
||||||
|
runStatus s;
|
||||||
|
|
||||||
|
int nchans = getTotalNumberOfChannels();
|
||||||
|
short int dataVals[nchans];
|
||||||
|
|
||||||
|
for(i=0;i<times;i++){
|
||||||
|
std::cout<<std::endl<<dec<<i+1<<": \t";
|
||||||
|
startAcquisition();
|
||||||
|
s = getRunStatus();
|
||||||
|
if(s==IDLE){
|
||||||
|
s = getRunStatus();
|
||||||
|
if(s==IDLE)
|
||||||
|
std::cout<<"IDLE"<<std::endl;
|
||||||
|
}
|
||||||
|
else if (s==RUNNING){
|
||||||
|
count=0;
|
||||||
|
while(s==RUNNING){
|
||||||
|
count++;
|
||||||
|
if(count==5){
|
||||||
|
std::cout<<"STUCK"<<std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
usleep(2);
|
||||||
|
//val=readRegister(0x25);
|
||||||
|
s = getRunStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
std::cout<<"\nWeird Status.Exit\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
system("rm ~/wORKSPACE/scratch/run* ");
|
||||||
|
//system("more ~/wORKSPACE/scratch/run* ");
|
||||||
|
usleep(1000000);
|
||||||
|
|
||||||
|
setFileIndex(0);
|
||||||
|
int b;
|
||||||
|
|
||||||
|
b=setThreadedProcessing(-1);
|
||||||
|
setThreadedProcessing(0);
|
||||||
|
readAll();
|
||||||
|
processData(1);
|
||||||
|
setThreadedProcessing(b);
|
||||||
|
|
||||||
|
if(!readDataFile("/home/l_maliakal_d/wORKSPACE/scratch/run_1.raw",dataVals)){
|
||||||
|
std::cout<< "Could not open file "<< std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout<<std::endl;
|
||||||
|
for(int j=1277;j< (nchans);j++)
|
||||||
|
std::cout<<"\t"<<j<<":"<<dataVals[j];
|
||||||
|
|
||||||
|
if(dataVals[1278]!=2558){
|
||||||
|
std::cout<< "DATA ERROR!! "<< std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::cout<<std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -776,6 +776,10 @@ s
|
|||||||
int setTotalProgress();
|
int setTotalProgress();
|
||||||
float getCurrentProgress();
|
float getCurrentProgress();
|
||||||
|
|
||||||
|
|
||||||
|
/** temporary test fucntion */
|
||||||
|
int testFunction(int times=0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const int64_t thisSoftwareVersion=0x20120124;
|
static const int64_t thisSoftwareVersion=0x20120124;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user