mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 07:17:13 +02:00
removing warnings shown from esrf debian
This commit is contained in:
@ -1436,7 +1436,7 @@ int* multiSlsDetector::getDataFromDetector() {
|
||||
int n = 0;
|
||||
int* retval= NULL;
|
||||
int *retdet, *p=retval;
|
||||
int nodata=1, nodatadet=-1;
|
||||
int nodatadet=-1;
|
||||
int nodatadetectortype = false;
|
||||
detectorType types = getDetectorsType();
|
||||
if(types == EIGER || types == JUNGFRAU){
|
||||
@ -1455,7 +1455,6 @@ int* multiSlsDetector::getDataFromDetector() {
|
||||
if(!nodatadetectortype){
|
||||
n=detectors[id]->getDataBytes();
|
||||
if (retdet) {
|
||||
nodata=0;
|
||||
#ifdef VERBOSE
|
||||
cout << "Detector " << id << " returned " << n << " bytes " << endl;
|
||||
#endif
|
||||
@ -2105,7 +2104,6 @@ slsDetectorDefs::ROI* multiSlsDetector::getROI(int &n){
|
||||
n = 0;
|
||||
int num = 0,i,j;
|
||||
int ndet = thisMultiDetector->numberOfDetectors;
|
||||
int nroi[ndet];
|
||||
int maxroi = ndet*MAX_ROIS;
|
||||
ROI temproi;
|
||||
ROI roiLimits[maxroi];
|
||||
@ -2120,7 +2118,6 @@ slsDetectorDefs::ROI* multiSlsDetector::getROI(int &n){
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
|
||||
nroi[i] = index;
|
||||
if(temp){
|
||||
//#ifdef VERBOSE
|
||||
if(index)
|
||||
@ -2604,7 +2601,7 @@ int multiSlsDetector::setRateCorrection(double t){
|
||||
ret=detectors[idet]->setRateCorrection(t);
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
if (ret1 != OK)
|
||||
if (ret != OK)
|
||||
ret1=FAIL;
|
||||
}
|
||||
}
|
||||
|
@ -898,8 +898,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
|
||||
int slsDetector::initializeDetectorStructure() {
|
||||
sls_detector_module *thisMod;
|
||||
char *p2;
|
||||
p2=(char*)thisDetector;
|
||||
//char *p2;
|
||||
//p2=(char*)thisDetector;
|
||||
|
||||
/** for each of the detector modules up to the maximum number which can be installed initlialize the sls_detector_module structure \sa ::sls_detector_module*/
|
||||
for (int imod=0; imod<thisDetector->nModsMax; imod++) {
|
||||
@ -967,66 +967,67 @@ slsDetectorDefs::sls_detector_module* slsDetector::createModule(detectorType t)
|
||||
sls_detector_module *myMod=(sls_detector_module*)malloc(sizeof(sls_detector_module));
|
||||
|
||||
|
||||
int nch, nm, nc, nd, na=0;
|
||||
int nch, nc, nd, na=0;
|
||||
//int nm = 0;
|
||||
|
||||
switch(t) {
|
||||
case MYTHEN:
|
||||
nch=128; // complete mythen system
|
||||
nm=24;
|
||||
// nm=24;
|
||||
nc=10;
|
||||
nd=6; // dacs
|
||||
break;
|
||||
case PICASSO:
|
||||
nch=128; // complete mythen system
|
||||
nm=24;
|
||||
// nm=24;
|
||||
nc=12;
|
||||
nd=6; // dacs+adcs
|
||||
break;
|
||||
case GOTTHARD:
|
||||
nch=128;
|
||||
nm=1;
|
||||
// nm=1;
|
||||
nc=10;
|
||||
nd=8; // dacs+adcs
|
||||
na=5;
|
||||
break;
|
||||
case PROPIX:
|
||||
nch=22*22;
|
||||
nm=1;
|
||||
// nm=1;
|
||||
nc=1;
|
||||
nd=8; // dacs+adcs
|
||||
na=5;
|
||||
break;
|
||||
case EIGER:
|
||||
nch=256*256; // one EIGER half module
|
||||
nm=1; //modules/detector
|
||||
// nm=1; //modules/detector
|
||||
nc=4*1; //chips
|
||||
nd=16; //dacs
|
||||
na=0;
|
||||
break;
|
||||
case MOENCH:
|
||||
nch=160*160;
|
||||
nm=1; //modules/detector
|
||||
// nm=1; //modules/detector
|
||||
nc=1; //chips
|
||||
nd=8; //dacs
|
||||
na=1;
|
||||
break;
|
||||
case JUNGFRAU:
|
||||
nch=256*256;//32;
|
||||
nm=1;
|
||||
// nm=1;
|
||||
nc=4*2;
|
||||
nd=16; // dacs+adcs
|
||||
na=0;
|
||||
break;
|
||||
case JUNGFRAUCTB:
|
||||
nch=32;//32;
|
||||
nm=1;
|
||||
// nm=1;
|
||||
nc=1;
|
||||
nd=8; // dacs+adcs
|
||||
na=1;
|
||||
break;
|
||||
default:
|
||||
nch=0; // dum!
|
||||
nm=0; //modules/detector
|
||||
// nm=0; //modules/detector
|
||||
nc=0; //chips
|
||||
nd=0; //dacs+adcs
|
||||
na=0;
|
||||
@ -1672,7 +1673,6 @@ int slsDetector::setNumberOfModules(int n, dimension d){
|
||||
int ret=FAIL;
|
||||
char mess[MAX_STR_LENGTH]="dummy";
|
||||
int connect;
|
||||
int num;
|
||||
|
||||
arg[0]=d;
|
||||
arg[1]=n;
|
||||
@ -1693,11 +1693,11 @@ int slsDetector::setNumberOfModules(int n, dimension d){
|
||||
if (connect == UNDEFINED)
|
||||
printf( "no control socket? \n" );
|
||||
else if (connect == OK){
|
||||
num = controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
num = controlSocket->SendDataOnly(&arg,sizeof(arg));
|
||||
num = controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->SendDataOnly(&arg,sizeof(arg));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret!=FAIL) {
|
||||
num = controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
} else {
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
printf( "Detector returned error: %s \n", mess );
|
||||
@ -3728,18 +3728,18 @@ int slsDetector::updateDetectorNoWait() {
|
||||
|
||||
// int ret=OK;
|
||||
enum detectorSettings t;
|
||||
int thr, n, nm;
|
||||
int thr, n, nm = 0;
|
||||
// int it;
|
||||
int64_t retval;// tns=-1;
|
||||
char lastClientIP[INET_ADDRSTRLEN];
|
||||
|
||||
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
n += controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
#ifdef VERBOSE
|
||||
printf( "Updating detector last modified by %s \n", lastClientIP );
|
||||
#endif
|
||||
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
|
||||
n += controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
|
||||
thisDetector->nMod[X]=nm;
|
||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
n += controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
/// Should be overcome at a certain point!
|
||||
|
||||
if (thisDetector->myDetectorType==MYTHEN) {
|
||||
@ -3761,13 +3761,13 @@ int slsDetector::updateDetectorNoWait() {
|
||||
if (thisDetector->nModMax[Y]<thisDetector->nMod[Y])
|
||||
thisDetector->nModMax[Y]=thisDetector->nMod[Y];
|
||||
|
||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
n += controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
thisDetector->dynamicRange=nm;
|
||||
|
||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
n += controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
thisDetector->dataBytes=nm;
|
||||
//t=setSettings(GET_SETTINGS);
|
||||
n = controlSocket->ReceiveDataOnly( &t,sizeof(t));
|
||||
n += controlSocket->ReceiveDataOnly( &t,sizeof(t));
|
||||
thisDetector->currentSettings=t;
|
||||
|
||||
if((thisDetector->myDetectorType!= GOTTHARD)&&
|
||||
@ -3775,42 +3775,45 @@ int slsDetector::updateDetectorNoWait() {
|
||||
(thisDetector->myDetectorType!= JUNGFRAU)&&
|
||||
(thisDetector->myDetectorType!= MOENCH)){
|
||||
//thr=getThresholdEnergy();
|
||||
n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
|
||||
n += controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
|
||||
thisDetector->currentThresholdEV=thr;
|
||||
}
|
||||
|
||||
//retval=setFrames(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[FRAME_NUMBER]=retval;
|
||||
// retval=setExposureTime(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[ACQUISITION_TIME]=retval;
|
||||
|
||||
if(thisDetector->myDetectorType == EIGER){
|
||||
//retval=setSubFrameExposureTime(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval;
|
||||
}
|
||||
//retval=setPeriod(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[FRAME_PERIOD]=retval;
|
||||
//retval=setDelay(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval;
|
||||
// retval=setGates(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[GATES_NUMBER]=retval;
|
||||
|
||||
//retval=setProbes(tns);
|
||||
if (thisDetector->myDetectorType == MYTHEN){
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[PROBES_NUMBER]=retval;
|
||||
}
|
||||
|
||||
//retval=setTrains(tns);
|
||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||
thisDetector->timerValue[CYCLES_NUMBER]=retval;
|
||||
|
||||
if (!n)
|
||||
printf("n: %d\n", n);
|
||||
|
||||
return OK;
|
||||
|
||||
}
|
||||
@ -4216,7 +4219,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
int64_t retval = -1;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
int ret=OK;
|
||||
int n=0;
|
||||
|
||||
if (index!=MEASUREMENTS_NUMBER) {
|
||||
|
||||
@ -4228,7 +4230,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->SendDataOnly(&index,sizeof(index));
|
||||
n=controlSocket->SendDataOnly(&t,sizeof(t));
|
||||
controlSocket->SendDataOnly(&t,sizeof(t));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL) {
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
@ -4705,7 +4707,7 @@ int slsDetector::setSpeed(speedVariable sp, int value) {
|
||||
int retval=-1;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
int ret=OK;
|
||||
int n=0;
|
||||
|
||||
#ifdef VERBOSE
|
||||
printf( "Setting speed variable %d to %d \n", sp, value );
|
||||
#endif
|
||||
@ -4713,7 +4715,7 @@ int slsDetector::setSpeed(speedVariable sp, int value) {
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->SendDataOnly(&sp,sizeof(sp));
|
||||
n=controlSocket->SendDataOnly(&value,sizeof(value));
|
||||
controlSocket->SendDataOnly(&value,sizeof(value));
|
||||
#ifdef VERBOSE
|
||||
printf( "Sent %d bytes \n", n );
|
||||
#endif
|
||||
@ -6477,13 +6479,17 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
//char *args[1000];
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
#ifdef VERBOSE
|
||||
int iline=0;
|
||||
printf( "config file name %s \n", fname.c_str() );
|
||||
#endif
|
||||
infile.open(fname.c_str(), ios_base::in);
|
||||
if (infile.is_open()) {
|
||||
#ifdef VERBOSE
|
||||
iline=readConfigurationFile(infile);
|
||||
#else
|
||||
readConfigurationFile(infile);
|
||||
#endif
|
||||
infile.close();
|
||||
} else {
|
||||
printf( "Error opening configuration file %s for reading \n", fname.c_str() );
|
||||
@ -6571,11 +6577,16 @@ int slsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
#ifdef VERBOSE
|
||||
int ret;
|
||||
|
||||
#endif
|
||||
outfile.open(fname.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
ret=writeConfigurationFile(outfile);
|
||||
#ifdef VERBOSE
|
||||
ret=writeConfigurationFile(outfile);
|
||||
#else
|
||||
writeConfigurationFile(outfile);
|
||||
#endif
|
||||
outfile.close();
|
||||
}
|
||||
else {
|
||||
@ -6691,7 +6702,7 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
||||
|
||||
|
||||
|
||||
int slsDetector::writeSettingsFile(string fname, int imod, int& iodelay, int& tau){
|
||||
int slsDetector::writeSettingsFile(string fname, int imod, int iodelay, int tau){
|
||||
|
||||
return writeSettingsFile(fname,thisDetector->myDetectorType, detectorModules[imod], iodelay, tau);
|
||||
|
||||
@ -7795,21 +7806,21 @@ string slsDetector::getReceiverLastClientIP(){
|
||||
|
||||
int slsDetector::updateReceiverNoWait() {
|
||||
|
||||
int n,ind;
|
||||
int n,ind = 0;
|
||||
char path[MAX_STR_LENGTH];
|
||||
char lastClientIP[INET_ADDRSTRLEN];
|
||||
|
||||
n = dataSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
n += dataSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
#ifdef VERBOSE
|
||||
printf( "Updating receiver last modified by %s \n", lastClientIP );
|
||||
#endif
|
||||
|
||||
n = dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||
pthread_mutex_lock(&ms);
|
||||
fileIO::setFileIndex(ind);
|
||||
pthread_mutex_unlock(&ms);
|
||||
|
||||
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
||||
n += dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
||||
pthread_mutex_lock(&ms);
|
||||
fileIO::setFilePath(path);
|
||||
pthread_mutex_unlock(&ms);
|
||||
@ -7819,6 +7830,8 @@ int slsDetector::updateReceiverNoWait() {
|
||||
fileIO::setFileName(path);
|
||||
pthread_mutex_unlock(&ms);
|
||||
|
||||
if (!n) printf("n: %d\n", n);
|
||||
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
\sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
||||
*/
|
||||
using energyConversion::writeSettingsFile;
|
||||
int writeSettingsFile(string fname, int imod, int& iodelay, int& tau);
|
||||
int writeSettingsFile(string fname, int imod, int iodelay, int tau);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -75,10 +75,10 @@ int slsDetectorActions::setActionScript(int iaction, string fname) {
|
||||
|
||||
|
||||
int slsDetectorActions::setActionParameter(int iaction, string par) {
|
||||
int am;
|
||||
// int am;
|
||||
|
||||
if (iaction>=0 && iaction<MAX_ACTIONS) {
|
||||
am= 1& ( (*actionMask) << iaction);
|
||||
//am= 1& ( (*actionMask) << iaction);
|
||||
|
||||
if (par!="") {
|
||||
strcpy(actionParameter[iaction],par.c_str());
|
||||
|
@ -3431,7 +3431,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3445,7 +3445,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
} else
|
||||
return string("undefined module number");
|
||||
@ -3455,7 +3455,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
if (cmd.find("modulenumber")!=string::npos) {
|
||||
@ -3465,7 +3465,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
} else
|
||||
return string("undefined module number");
|
||||
@ -3476,7 +3476,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3485,7 +3485,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3495,7 +3495,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%llx", (long long unsigned int)retval);
|
||||
sprintf(answer,"%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
return string("unknown id mode ")+cmd;
|
||||
@ -4899,7 +4899,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
else
|
||||
return string("Could not scan address (hexadecimal fomat) ")+string(args[1]);
|
||||
|
||||
if (sscanf(args[2],"%llx",&word))
|
||||
if (sscanf(args[2],"%lx",&word))
|
||||
;
|
||||
else
|
||||
return string("Could not scan value (hexadecimal fomat) ")+string(args[2]);
|
||||
@ -4915,7 +4915,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
|
||||
if (sscanf(args[1],"%llx",&word))
|
||||
if (sscanf(args[1],"%lx",&word))
|
||||
;
|
||||
else
|
||||
return string("Could not scan value (hexadecimal fomat) ")+string(args[1]);
|
||||
@ -4932,7 +4932,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
|
||||
if (sscanf(args[1],"%llx",&word))
|
||||
if (sscanf(args[1],"%lx",&word))
|
||||
;
|
||||
else
|
||||
return string("Could not scan value (hexadecimal fomat) ")+string(args[1]);
|
||||
@ -5203,7 +5203,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
|
||||
if (sscanf(args[1],"%lld",&t))
|
||||
if (sscanf(args[1],"%ld",&t))
|
||||
;
|
||||
else
|
||||
return string("Could not scan wait time")+string(args[1]);
|
||||
@ -5226,7 +5226,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
|
||||
if (sscanf(args[1],"%lld",&t))
|
||||
if (sscanf(args[1],"%ld",&t))
|
||||
;
|
||||
else
|
||||
return string("Could not scan wait time ")+string(args[1]);
|
||||
@ -5244,7 +5244,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
} else if (cmd=="patwaittime2") {
|
||||
if (action==PUT_ACTION) {
|
||||
|
||||
if (sscanf(args[1],"%lld",&t))
|
||||
if (sscanf(args[1],"%ld",&t))
|
||||
;
|
||||
else
|
||||
return string("Could not scan wait time ")+string(args[1]);
|
||||
|
@ -457,7 +457,7 @@ slsDetectorDefs::sls_detector_module* energyConversion::readSettingsFile(string
|
||||
};
|
||||
|
||||
|
||||
int energyConversion::writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int& iodelay, int& tau){
|
||||
int energyConversion::writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau){
|
||||
|
||||
ofstream outfile;
|
||||
|
||||
@ -537,8 +537,8 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp
|
||||
printf( "tau: %d", tau);
|
||||
#endif
|
||||
outfile.write((char*)mod.dacs, sizeof(dacs_t)*(mod.ndac));
|
||||
outfile.write((char*)iodelay, sizeof(iodelay));
|
||||
outfile.write((char*)tau, sizeof(tau));
|
||||
outfile.write(reinterpret_cast<char*>(&iodelay), sizeof(iodelay));
|
||||
outfile.write(reinterpret_cast<char*>(&tau), sizeof(tau));
|
||||
outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan));
|
||||
|
||||
outfile.close();
|
||||
|
@ -119,7 +119,7 @@ class energyConversion
|
||||
|
||||
\sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module)
|
||||
*/
|
||||
int writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int& iodelay, int& tau);
|
||||
int writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau);
|
||||
|
||||
/** allocates the momery for a detector module structure
|
||||
\param myDetectorType detector type (needed for number of channels, chips, dacs etc.)
|
||||
|
@ -534,9 +534,7 @@ class fileIOStatic {
|
||||
static int readDataFile(int nch, string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f') { \
|
||||
ifstream infile; \
|
||||
int iline=0; \
|
||||
int maxchans; \
|
||||
string str; \
|
||||
maxchans=nch; \
|
||||
infile.open(fname.c_str(), ios_base::in); \
|
||||
if (infile.is_open()) { \
|
||||
iline=readDataFile(nch, infile, data, err, ang, dataformat, 0); \
|
||||
|
@ -879,10 +879,14 @@ void postProcessing::startThread(int delflag) {
|
||||
else
|
||||
ret = pthread_create(&dataProcessingThread, &tattr,startProcessDataNoDelete, (void*)this);
|
||||
|
||||
if (ret)
|
||||
printf("ret %d\n", ret);
|
||||
|
||||
pthread_attr_destroy(&tattr);
|
||||
|
||||
// scheduling parameters of target thread
|
||||
ret = pthread_setschedparam(dataProcessingThread, policy, ¶m);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -67,12 +67,13 @@ int ThreadPool::destroy_threadpool(){
|
||||
/*cout << "Broadcasting STOP signal to all threads..." << endl;*/
|
||||
m_task_cond_var.broadcast(); // notify all threads we are shttung down
|
||||
|
||||
int ret = -1;
|
||||
//int ret = -1;
|
||||
for (int i = 0; i < m_pool_size; i++) {
|
||||
void* result;
|
||||
sem_post(&semStart);
|
||||
sem_post(&semDone);
|
||||
ret = pthread_join(m_threads[i], &result);
|
||||
//ret =
|
||||
pthread_join(m_threads[i], &result);
|
||||
/*cout << "pthread_join() returned " << ret << ": " << strerror(errno) << endl;*/
|
||||
m_task_cond_var.broadcast(); // try waking up a bunch of threads that are still waiting
|
||||
}
|
||||
|
Reference in New Issue
Block a user