removing warnings shown from esrf debian

This commit is contained in:
Dhanya Maliakal
2017-04-11 13:31:32 +02:00
parent 17cb63a57f
commit 43efb8acfd
10 changed files with 87 additions and 74 deletions

View File

@ -1436,7 +1436,7 @@ int* multiSlsDetector::getDataFromDetector() {
int n = 0; int n = 0;
int* retval= NULL; int* retval= NULL;
int *retdet, *p=retval; int *retdet, *p=retval;
int nodata=1, nodatadet=-1; int nodatadet=-1;
int nodatadetectortype = false; int nodatadetectortype = false;
detectorType types = getDetectorsType(); detectorType types = getDetectorsType();
if(types == EIGER || types == JUNGFRAU){ if(types == EIGER || types == JUNGFRAU){
@ -1455,7 +1455,6 @@ int* multiSlsDetector::getDataFromDetector() {
if(!nodatadetectortype){ if(!nodatadetectortype){
n=detectors[id]->getDataBytes(); n=detectors[id]->getDataBytes();
if (retdet) { if (retdet) {
nodata=0;
#ifdef VERBOSE #ifdef VERBOSE
cout << "Detector " << id << " returned " << n << " bytes " << endl; cout << "Detector " << id << " returned " << n << " bytes " << endl;
#endif #endif
@ -2105,7 +2104,6 @@ slsDetectorDefs::ROI* multiSlsDetector::getROI(int &n){
n = 0; n = 0;
int num = 0,i,j; int num = 0,i,j;
int ndet = thisMultiDetector->numberOfDetectors; int ndet = thisMultiDetector->numberOfDetectors;
int nroi[ndet];
int maxroi = ndet*MAX_ROIS; int maxroi = ndet*MAX_ROIS;
ROI temproi; ROI temproi;
ROI roiLimits[maxroi]; ROI roiLimits[maxroi];
@ -2120,7 +2118,6 @@ slsDetectorDefs::ROI* multiSlsDetector::getROI(int &n){
if(detectors[i]->getErrorMask()) if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<<i)); setErrorMask(getErrorMask()|(1<<i));
nroi[i] = index;
if(temp){ if(temp){
//#ifdef VERBOSE //#ifdef VERBOSE
if(index) if(index)
@ -2604,7 +2601,7 @@ int multiSlsDetector::setRateCorrection(double t){
ret=detectors[idet]->setRateCorrection(t); ret=detectors[idet]->setRateCorrection(t);
if(detectors[idet]->getErrorMask()) if(detectors[idet]->getErrorMask())
setErrorMask(getErrorMask()|(1<<idet)); setErrorMask(getErrorMask()|(1<<idet));
if (ret1 != OK) if (ret != OK)
ret1=FAIL; ret1=FAIL;
} }
} }

View File

@ -898,8 +898,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
int slsDetector::initializeDetectorStructure() { int slsDetector::initializeDetectorStructure() {
sls_detector_module *thisMod; sls_detector_module *thisMod;
char *p2; //char *p2;
p2=(char*)thisDetector; //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 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++) { 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)); 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) { switch(t) {
case MYTHEN: case MYTHEN:
nch=128; // complete mythen system nch=128; // complete mythen system
nm=24; // nm=24;
nc=10; nc=10;
nd=6; // dacs nd=6; // dacs
break; break;
case PICASSO: case PICASSO:
nch=128; // complete mythen system nch=128; // complete mythen system
nm=24; // nm=24;
nc=12; nc=12;
nd=6; // dacs+adcs nd=6; // dacs+adcs
break; break;
case GOTTHARD: case GOTTHARD:
nch=128; nch=128;
nm=1; // nm=1;
nc=10; nc=10;
nd=8; // dacs+adcs nd=8; // dacs+adcs
na=5; na=5;
break; break;
case PROPIX: case PROPIX:
nch=22*22; nch=22*22;
nm=1; // nm=1;
nc=1; nc=1;
nd=8; // dacs+adcs nd=8; // dacs+adcs
na=5; na=5;
break; break;
case EIGER: case EIGER:
nch=256*256; // one EIGER half module nch=256*256; // one EIGER half module
nm=1; //modules/detector // nm=1; //modules/detector
nc=4*1; //chips nc=4*1; //chips
nd=16; //dacs nd=16; //dacs
na=0; na=0;
break; break;
case MOENCH: case MOENCH:
nch=160*160; nch=160*160;
nm=1; //modules/detector // nm=1; //modules/detector
nc=1; //chips nc=1; //chips
nd=8; //dacs nd=8; //dacs
na=1; na=1;
break; break;
case JUNGFRAU: case JUNGFRAU:
nch=256*256;//32; nch=256*256;//32;
nm=1; // nm=1;
nc=4*2; nc=4*2;
nd=16; // dacs+adcs nd=16; // dacs+adcs
na=0; na=0;
break; break;
case JUNGFRAUCTB: case JUNGFRAUCTB:
nch=32;//32; nch=32;//32;
nm=1; // nm=1;
nc=1; nc=1;
nd=8; // dacs+adcs nd=8; // dacs+adcs
na=1; na=1;
break; break;
default: default:
nch=0; // dum! nch=0; // dum!
nm=0; //modules/detector // nm=0; //modules/detector
nc=0; //chips nc=0; //chips
nd=0; //dacs+adcs nd=0; //dacs+adcs
na=0; na=0;
@ -1672,7 +1673,6 @@ int slsDetector::setNumberOfModules(int n, dimension d){
int ret=FAIL; int ret=FAIL;
char mess[MAX_STR_LENGTH]="dummy"; char mess[MAX_STR_LENGTH]="dummy";
int connect; int connect;
int num;
arg[0]=d; arg[0]=d;
arg[1]=n; arg[1]=n;
@ -1693,11 +1693,11 @@ int slsDetector::setNumberOfModules(int n, dimension d){
if (connect == UNDEFINED) if (connect == UNDEFINED)
printf( "no control socket? \n" ); printf( "no control socket? \n" );
else if (connect == OK){ else if (connect == OK){
num = controlSocket->SendDataOnly(&fnum,sizeof(fnum)); controlSocket->SendDataOnly(&fnum,sizeof(fnum));
num = controlSocket->SendDataOnly(&arg,sizeof(arg)); controlSocket->SendDataOnly(&arg,sizeof(arg));
num = controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret!=FAIL) { if (ret!=FAIL) {
num = controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
} else { } else {
controlSocket->ReceiveDataOnly(mess,sizeof(mess)); controlSocket->ReceiveDataOnly(mess,sizeof(mess));
printf( "Detector returned error: %s \n", mess ); printf( "Detector returned error: %s \n", mess );
@ -3728,18 +3728,18 @@ int slsDetector::updateDetectorNoWait() {
// int ret=OK; // int ret=OK;
enum detectorSettings t; enum detectorSettings t;
int thr, n, nm; int thr, n, nm = 0;
// int it; // int it;
int64_t retval;// tns=-1; int64_t retval;// tns=-1;
char lastClientIP[INET_ADDRSTRLEN]; char lastClientIP[INET_ADDRSTRLEN];
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP)); n += controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE #ifdef VERBOSE
printf( "Updating detector last modified by %s \n", lastClientIP ); printf( "Updating detector last modified by %s \n", lastClientIP );
#endif #endif
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm)); n += controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
thisDetector->nMod[X]=nm; thisDetector->nMod[X]=nm;
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm)); n += controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
/// Should be overcome at a certain point! /// Should be overcome at a certain point!
if (thisDetector->myDetectorType==MYTHEN) { if (thisDetector->myDetectorType==MYTHEN) {
@ -3761,13 +3761,13 @@ int slsDetector::updateDetectorNoWait() {
if (thisDetector->nModMax[Y]<thisDetector->nMod[Y]) if (thisDetector->nModMax[Y]<thisDetector->nMod[Y])
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; thisDetector->dynamicRange=nm;
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm)); n += controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
thisDetector->dataBytes=nm; thisDetector->dataBytes=nm;
//t=setSettings(GET_SETTINGS); //t=setSettings(GET_SETTINGS);
n = controlSocket->ReceiveDataOnly( &t,sizeof(t)); n += controlSocket->ReceiveDataOnly( &t,sizeof(t));
thisDetector->currentSettings=t; thisDetector->currentSettings=t;
if((thisDetector->myDetectorType!= GOTTHARD)&& if((thisDetector->myDetectorType!= GOTTHARD)&&
@ -3775,42 +3775,45 @@ int slsDetector::updateDetectorNoWait() {
(thisDetector->myDetectorType!= JUNGFRAU)&& (thisDetector->myDetectorType!= JUNGFRAU)&&
(thisDetector->myDetectorType!= MOENCH)){ (thisDetector->myDetectorType!= MOENCH)){
//thr=getThresholdEnergy(); //thr=getThresholdEnergy();
n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr)); n += controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
thisDetector->currentThresholdEV=thr; thisDetector->currentThresholdEV=thr;
} }
//retval=setFrames(tns); //retval=setFrames(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[FRAME_NUMBER]=retval; thisDetector->timerValue[FRAME_NUMBER]=retval;
// retval=setExposureTime(tns); // retval=setExposureTime(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[ACQUISITION_TIME]=retval; thisDetector->timerValue[ACQUISITION_TIME]=retval;
if(thisDetector->myDetectorType == EIGER){ if(thisDetector->myDetectorType == EIGER){
//retval=setSubFrameExposureTime(tns); //retval=setSubFrameExposureTime(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval; thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval;
} }
//retval=setPeriod(tns); //retval=setPeriod(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[FRAME_PERIOD]=retval; thisDetector->timerValue[FRAME_PERIOD]=retval;
//retval=setDelay(tns); //retval=setDelay(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval; thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval;
// retval=setGates(tns); // retval=setGates(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[GATES_NUMBER]=retval; thisDetector->timerValue[GATES_NUMBER]=retval;
//retval=setProbes(tns); //retval=setProbes(tns);
if (thisDetector->myDetectorType == MYTHEN){ if (thisDetector->myDetectorType == MYTHEN){
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[PROBES_NUMBER]=retval; thisDetector->timerValue[PROBES_NUMBER]=retval;
} }
//retval=setTrains(tns); //retval=setTrains(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[CYCLES_NUMBER]=retval; thisDetector->timerValue[CYCLES_NUMBER]=retval;
if (!n)
printf("n: %d\n", n);
return OK; return OK;
} }
@ -4216,7 +4219,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
int64_t retval = -1; int64_t retval = -1;
char mess[MAX_STR_LENGTH]=""; char mess[MAX_STR_LENGTH]="";
int ret=OK; int ret=OK;
int n=0;
if (index!=MEASUREMENTS_NUMBER) { if (index!=MEASUREMENTS_NUMBER) {
@ -4228,7 +4230,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
if (connectControl() == OK){ if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum)); controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&index,sizeof(index)); controlSocket->SendDataOnly(&index,sizeof(index));
n=controlSocket->SendDataOnly(&t,sizeof(t)); controlSocket->SendDataOnly(&t,sizeof(t));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL) { if (ret==FAIL) {
controlSocket->ReceiveDataOnly(mess,sizeof(mess)); controlSocket->ReceiveDataOnly(mess,sizeof(mess));
@ -4705,7 +4707,7 @@ int slsDetector::setSpeed(speedVariable sp, int value) {
int retval=-1; int retval=-1;
char mess[MAX_STR_LENGTH]=""; char mess[MAX_STR_LENGTH]="";
int ret=OK; int ret=OK;
int n=0;
#ifdef VERBOSE #ifdef VERBOSE
printf( "Setting speed variable %d to %d \n", sp, value ); printf( "Setting speed variable %d to %d \n", sp, value );
#endif #endif
@ -4713,7 +4715,7 @@ int slsDetector::setSpeed(speedVariable sp, int value) {
if (connectControl() == OK){ if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum)); controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&sp,sizeof(sp)); controlSocket->SendDataOnly(&sp,sizeof(sp));
n=controlSocket->SendDataOnly(&value,sizeof(value)); controlSocket->SendDataOnly(&value,sizeof(value));
#ifdef VERBOSE #ifdef VERBOSE
printf( "Sent %d bytes \n", n ); printf( "Sent %d bytes \n", n );
#endif #endif
@ -6477,13 +6479,17 @@ int slsDetector::readConfigurationFile(string const fname){
//char *args[1000]; //char *args[1000];
string sargname, sargval; string sargname, sargval;
int iline=0;
#ifdef VERBOSE #ifdef VERBOSE
int iline=0;
printf( "config file name %s \n", fname.c_str() ); printf( "config file name %s \n", fname.c_str() );
#endif #endif
infile.open(fname.c_str(), ios_base::in); infile.open(fname.c_str(), ios_base::in);
if (infile.is_open()) { if (infile.is_open()) {
#ifdef VERBOSE
iline=readConfigurationFile(infile); iline=readConfigurationFile(infile);
#else
readConfigurationFile(infile);
#endif
infile.close(); infile.close();
} else { } else {
printf( "Error opening configuration file %s for reading \n", fname.c_str() ); printf( "Error opening configuration file %s for reading \n", fname.c_str() );
@ -6571,11 +6577,16 @@ int slsDetector::writeConfigurationFile(string const fname){
ofstream outfile; ofstream outfile;
#ifdef VERBOSE
int ret; int ret;
#endif
outfile.open(fname.c_str(),ios_base::out); outfile.open(fname.c_str(),ios_base::out);
if (outfile.is_open()) { if (outfile.is_open()) {
ret=writeConfigurationFile(outfile); #ifdef VERBOSE
ret=writeConfigurationFile(outfile);
#else
writeConfigurationFile(outfile);
#endif
outfile.close(); outfile.close();
} }
else { 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); return writeSettingsFile(fname,thisDetector->myDetectorType, detectorModules[imod], iodelay, tau);
@ -7795,21 +7806,21 @@ string slsDetector::getReceiverLastClientIP(){
int slsDetector::updateReceiverNoWait() { int slsDetector::updateReceiverNoWait() {
int n,ind; int n,ind = 0;
char path[MAX_STR_LENGTH]; char path[MAX_STR_LENGTH];
char lastClientIP[INET_ADDRSTRLEN]; char lastClientIP[INET_ADDRSTRLEN];
n = dataSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP)); n += dataSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE #ifdef VERBOSE
printf( "Updating receiver last modified by %s \n", lastClientIP ); printf( "Updating receiver last modified by %s \n", lastClientIP );
#endif #endif
n = dataSocket->ReceiveDataOnly(&ind,sizeof(ind)); n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
pthread_mutex_lock(&ms); pthread_mutex_lock(&ms);
fileIO::setFileIndex(ind); fileIO::setFileIndex(ind);
pthread_mutex_unlock(&ms); pthread_mutex_unlock(&ms);
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH); n += dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
pthread_mutex_lock(&ms); pthread_mutex_lock(&ms);
fileIO::setFilePath(path); fileIO::setFilePath(path);
pthread_mutex_unlock(&ms); pthread_mutex_unlock(&ms);
@ -7819,6 +7830,8 @@ int slsDetector::updateReceiverNoWait() {
fileIO::setFileName(path); fileIO::setFileName(path);
pthread_mutex_unlock(&ms); pthread_mutex_unlock(&ms);
if (!n) printf("n: %d\n", n);
return OK; return OK;
} }

View File

@ -511,7 +511,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
\sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int) \sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
*/ */
using energyConversion::writeSettingsFile; using energyConversion::writeSettingsFile;
int writeSettingsFile(string fname, int imod, int& iodelay, int& tau); int writeSettingsFile(string fname, int imod, int iodelay, int tau);
/** /**

View File

@ -75,10 +75,10 @@ int slsDetectorActions::setActionScript(int iaction, string fname) {
int slsDetectorActions::setActionParameter(int iaction, string par) { int slsDetectorActions::setActionParameter(int iaction, string par) {
int am; // int am;
if (iaction>=0 && iaction<MAX_ACTIONS) { if (iaction>=0 && iaction<MAX_ACTIONS) {
am= 1& ( (*actionMask) << iaction); //am= 1& ( (*actionMask) << iaction);
if (par!="") { if (par!="") {
strcpy(actionParameter[iaction],par.c_str()); strcpy(actionParameter[iaction],par.c_str());

View File

@ -3431,7 +3431,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} }
@ -3445,7 +3445,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} else } else
return string("undefined module number"); return string("undefined module number");
@ -3455,7 +3455,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} }
if (cmd.find("modulenumber")!=string::npos) { if (cmd.find("modulenumber")!=string::npos) {
@ -3465,7 +3465,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} else } else
return string("undefined module number"); return string("undefined module number");
@ -3476,7 +3476,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} }
@ -3485,7 +3485,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} }
@ -3495,7 +3495,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
if (retval < 0) if (retval < 0)
sprintf(answer, "%d", -1); sprintf(answer, "%d", -1);
else else
sprintf(answer,"%llx", (long long unsigned int)retval); sprintf(answer,"%lx", retval);
return string(answer); return string(answer);
} }
return string("unknown id mode ")+cmd; return string("unknown id mode ")+cmd;
@ -4899,7 +4899,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
else else
return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); return string("Could not scan address (hexadecimal fomat) ")+string(args[1]);
if (sscanf(args[2],"%llx",&word)) if (sscanf(args[2],"%lx",&word))
; ;
else else
return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); 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 (action==PUT_ACTION) {
if (sscanf(args[1],"%llx",&word)) if (sscanf(args[1],"%lx",&word))
; ;
else else
return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); 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 (action==PUT_ACTION) {
if (sscanf(args[1],"%llx",&word)) if (sscanf(args[1],"%lx",&word))
; ;
else else
return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); 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 (action==PUT_ACTION) {
if (sscanf(args[1],"%lld",&t)) if (sscanf(args[1],"%ld",&t))
; ;
else else
return string("Could not scan wait time")+string(args[1]); 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 (action==PUT_ACTION) {
if (sscanf(args[1],"%lld",&t)) if (sscanf(args[1],"%ld",&t))
; ;
else else
return string("Could not scan wait time ")+string(args[1]); 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") { } else if (cmd=="patwaittime2") {
if (action==PUT_ACTION) { if (action==PUT_ACTION) {
if (sscanf(args[1],"%lld",&t)) if (sscanf(args[1],"%ld",&t))
; ;
else else
return string("Could not scan wait time ")+string(args[1]); return string("Could not scan wait time ")+string(args[1]);

View File

@ -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; ofstream outfile;
@ -537,8 +537,8 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp
printf( "tau: %d", tau); printf( "tau: %d", tau);
#endif #endif
outfile.write((char*)mod.dacs, sizeof(dacs_t)*(mod.ndac)); outfile.write((char*)mod.dacs, sizeof(dacs_t)*(mod.ndac));
outfile.write((char*)iodelay, sizeof(iodelay)); outfile.write(reinterpret_cast<char*>(&iodelay), sizeof(iodelay));
outfile.write((char*)tau, sizeof(tau)); outfile.write(reinterpret_cast<char*>(&tau), sizeof(tau));
outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan)); outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan));
outfile.close(); outfile.close();

View File

@ -119,7 +119,7 @@ class energyConversion
\sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module) \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 /** allocates the momery for a detector module structure
\param myDetectorType detector type (needed for number of channels, chips, dacs etc.) \param myDetectorType detector type (needed for number of channels, chips, dacs etc.)

View File

@ -534,9 +534,7 @@ class fileIOStatic {
static int readDataFile(int nch, string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f') { \ static int readDataFile(int nch, string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f') { \
ifstream infile; \ ifstream infile; \
int iline=0; \ int iline=0; \
int maxchans; \
string str; \ string str; \
maxchans=nch; \
infile.open(fname.c_str(), ios_base::in); \ infile.open(fname.c_str(), ios_base::in); \
if (infile.is_open()) { \ if (infile.is_open()) { \
iline=readDataFile(nch, infile, data, err, ang, dataformat, 0); \ iline=readDataFile(nch, infile, data, err, ang, dataformat, 0); \

View File

@ -879,10 +879,14 @@ void postProcessing::startThread(int delflag) {
else else
ret = pthread_create(&dataProcessingThread, &tattr,startProcessDataNoDelete, (void*)this); ret = pthread_create(&dataProcessingThread, &tattr,startProcessDataNoDelete, (void*)this);
if (ret)
printf("ret %d\n", ret);
pthread_attr_destroy(&tattr); pthread_attr_destroy(&tattr);
// scheduling parameters of target thread // scheduling parameters of target thread
ret = pthread_setschedparam(dataProcessingThread, policy, &param); ret = pthread_setschedparam(dataProcessingThread, policy, &param);
} }

View File

@ -67,12 +67,13 @@ int ThreadPool::destroy_threadpool(){
/*cout << "Broadcasting STOP signal to all threads..." << endl;*/ /*cout << "Broadcasting STOP signal to all threads..." << endl;*/
m_task_cond_var.broadcast(); // notify all threads we are shttung down 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++) { for (int i = 0; i < m_pool_size; i++) {
void* result; void* result;
sem_post(&semStart); sem_post(&semStart);
sem_post(&semDone); 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;*/ /*cout << "pthread_join() returned " << ret << ": " << strerror(errno) << endl;*/
m_task_cond_var.broadcast(); // try waking up a bunch of threads that are still waiting m_task_cond_var.broadcast(); // try waking up a bunch of threads that are still waiting
} }