mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
compilation warnings (unused variables, no return value for non void functions etc.) removed
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@142 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
584e99b1b7
commit
d58ccf9c1e
@ -22,6 +22,7 @@ ID: $Id$
|
||||
using namespace std;
|
||||
|
||||
|
||||
char ans[MAX_STR_LENGTH];
|
||||
|
||||
int multiSlsDetector::freeSharedMemory() {
|
||||
// Detach Memory address
|
||||
@ -316,7 +317,7 @@ int multiSlsDetector::addSlsDetector(int id, int pos) {
|
||||
|
||||
string multiSlsDetector::setHostname(char* name, int pos){
|
||||
|
||||
int id=0;
|
||||
// int id=0;
|
||||
string s;
|
||||
if (pos>=0) {
|
||||
addSlsDetector(name, pos);
|
||||
@ -327,12 +328,17 @@ string multiSlsDetector::setHostname(char* name, int pos){
|
||||
s=string(name);
|
||||
size_t p2=s.find('+',p1);
|
||||
char hn[1000];
|
||||
while (p2!=string::npos) {
|
||||
|
||||
strcpy(hn,s.substr(p1,p2-p1).c_str());
|
||||
if (p2==string::npos) {
|
||||
strcpy(hn,s.c_str());
|
||||
addSlsDetector(hn, pos);
|
||||
s=s.substr(p2+1);
|
||||
p2=s.find('+');
|
||||
} else {
|
||||
while (p2!=string::npos) {
|
||||
|
||||
strcpy(hn,s.substr(p1,p2-p1).c_str());
|
||||
addSlsDetector(hn, pos);
|
||||
s=s.substr(p2+1);
|
||||
p2=s.find('+');
|
||||
}
|
||||
}
|
||||
}
|
||||
return getHostname(pos);
|
||||
@ -341,6 +347,7 @@ string multiSlsDetector::setHostname(char* name, int pos){
|
||||
|
||||
string multiSlsDetector::getHostname(int pos) {
|
||||
|
||||
string s=string("");
|
||||
#ifdef VERBOSE
|
||||
cout << "returning hostname" << pos << endl;
|
||||
#endif
|
||||
@ -348,7 +355,6 @@ string multiSlsDetector::getHostname(int pos) {
|
||||
if (detectors[pos])
|
||||
return detectors[pos]->getHostname();
|
||||
} else {
|
||||
string s=string("");
|
||||
for (int ip=0; ip<thisMultiDetector->numberOfDetectors; ip++) {
|
||||
#ifdef VERBOSE
|
||||
cout << "detector " << ip << endl;
|
||||
@ -361,8 +367,9 @@ string multiSlsDetector::getHostname(int pos) {
|
||||
cout << "hostname " << s << endl;
|
||||
#endif
|
||||
}
|
||||
return s;
|
||||
}
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
int multiSlsDetector::getDetectorId(int pos) {
|
||||
@ -389,7 +396,7 @@ int multiSlsDetector::setDetectorId(int ival, int pos){
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
@ -417,7 +424,9 @@ int multiSlsDetector::addSlsDetector(char *name, int pos) {
|
||||
//checking that the detector doesn't already exists
|
||||
|
||||
for (id=0; id<MAXDET; id++) {
|
||||
#ifdef VERBOSE
|
||||
cout << id << endl;
|
||||
#endif
|
||||
if (slsDetector::exists(id)>0) {
|
||||
s=new slsDetector(id);
|
||||
if (s->getHostname()==string(name))
|
||||
@ -434,10 +443,10 @@ int multiSlsDetector::addSlsDetector(char *name, int pos) {
|
||||
cout << "Detector " << name << "does not exist in shared memory and could not connect to it to determine the type!" << endl;
|
||||
return -1;
|
||||
}
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
else
|
||||
cout << "Detector type is " << t << endl;
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
for (id=0; id<MAXDET; id++) {
|
||||
if (slsDetector::exists(id)==0) {
|
||||
@ -979,7 +988,9 @@ int* multiSlsDetector::getDataFromDetector() {
|
||||
delete [] retdet;
|
||||
} else {
|
||||
nodatadet=id;
|
||||
#ifdef VERBOSE
|
||||
cout << "Detector " << id << " does not have data left " << endl;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
p+=n/sizeof(int);
|
||||
@ -1065,7 +1076,9 @@ int* multiSlsDetector::readAll(){
|
||||
while ((retval=getDataFromDetector())){
|
||||
i++;
|
||||
#ifdef VERBOSE
|
||||
// std::cout<< i << std::endl;
|
||||
std::cout<< i << std::endl;
|
||||
#else
|
||||
std::cout << "-" << flush;
|
||||
#endif
|
||||
dataQueue.push(retval);
|
||||
}
|
||||
@ -1079,6 +1092,8 @@ int* multiSlsDetector::readAll(){
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "received "<< i<< " frames" << std::endl;
|
||||
#else
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
return dataQueue.front(); // check what we return!
|
||||
|
||||
@ -1102,6 +1117,8 @@ int* multiSlsDetector::startAndReadAll(){
|
||||
i++;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< i << std::endl;
|
||||
#else
|
||||
std::cout << "-" << flush;
|
||||
#endif
|
||||
dataQueue.push(retval);
|
||||
}
|
||||
@ -1116,6 +1133,8 @@ int* multiSlsDetector::startAndReadAll(){
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "MMMM recieved "<< i<< " frames" << std::endl;
|
||||
#else
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
return dataQueue.front(); // check what we return!
|
||||
|
||||
@ -1610,7 +1629,7 @@ int multiSlsDetector::getFlatFieldCorrection(float *corr, float *ecorr) {
|
||||
int multiSlsDetector::flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout){
|
||||
|
||||
int ichdet=0;
|
||||
float *pdata, *perr=errin;
|
||||
float *perr=errin;//*pdata,
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
#ifdef VERBOSE
|
||||
@ -1631,7 +1650,7 @@ int multiSlsDetector::flatFieldCorrect(float* datain, float *errin, float* datao
|
||||
|
||||
|
||||
int multiSlsDetector::setRateCorrection(float t){
|
||||
float tdead[]=defaultTDead;
|
||||
// float tdead[]=defaultTDead;
|
||||
|
||||
if (t==0) {
|
||||
thisMultiDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||
@ -1718,8 +1737,8 @@ int multiSlsDetector::rateCorrect(float* datain, float *errin, float* dataout, f
|
||||
|
||||
int multiSlsDetector::setBadChannelCorrection(string fname){
|
||||
|
||||
int badlist[MAX_BADCHANS], badlistdet[MAX_BADCHANS];
|
||||
int nbad=0, nbaddet=0, choff=0, idet=0;
|
||||
int badlist[MAX_BADCHANS];// badlistdet[MAX_BADCHANS];
|
||||
int nbad=0;//, nbaddet=0, choff=0, idet=0;
|
||||
|
||||
if (fname=="default")
|
||||
fname=string(thisMultiDetector->badChanFile);
|
||||
@ -1766,7 +1785,9 @@ int multiSlsDetector::setBadChannelCorrection(int nbad, int *badlist, int ff) {
|
||||
}
|
||||
badlistdet[nbaddet]=(badlist[ich]-choff);
|
||||
nbaddet++;
|
||||
#ifdef VERBOSE
|
||||
cout << nbaddet << " " << badlist[ich] << " " << badlistdet[nbaddet-1] << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (nbaddet>0) {
|
||||
@ -1815,17 +1836,17 @@ int multiSlsDetector::setAngularConversion(string fname) {
|
||||
if (fname=="") {
|
||||
thisMultiDetector->correctionMask&=~(1<< ANGULAR_CONVERSION);
|
||||
//strcpy(thisDetector->angConvFile,"none");
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Unsetting angular conversion" << std::endl;
|
||||
//#endif
|
||||
#endif
|
||||
} else {
|
||||
if (fname=="default") {
|
||||
fname=string(thisMultiDetector->angConvFile);
|
||||
}
|
||||
|
||||
//#ifdef VERBOSE
|
||||
std::cout << "Setting angular conversion to" << fname << std:: endl;
|
||||
//#endif
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Setting angular conversion to " << fname << std:: endl;
|
||||
#endif
|
||||
if (readAngularConversion(fname)>=0) {
|
||||
thisMultiDetector->correctionMask|=(1<< ANGULAR_CONVERSION);
|
||||
strcpy(thisMultiDetector->angConvFile,fname.c_str());
|
||||
@ -1838,7 +1859,7 @@ int multiSlsDetector::readAngularConversion(string fname) {
|
||||
|
||||
|
||||
ifstream infile;
|
||||
int nm=0;
|
||||
//int nm=0;
|
||||
infile.open(fname.c_str(), ios_base::in);
|
||||
if (infile.is_open()) {
|
||||
|
||||
@ -1864,7 +1885,7 @@ int multiSlsDetector::writeAngularConversion(string fname) {
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
int nm=0;
|
||||
// int nm=0;
|
||||
outfile.open(fname.c_str(), ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
|
||||
@ -2024,7 +2045,7 @@ float* multiSlsDetector::convertAngles(float pos) {
|
||||
|
||||
|
||||
int multiSlsDetector::getBadChannelCorrection(int *bad) {
|
||||
int ichan;
|
||||
//int ichan;
|
||||
int *bd, nd, ntot=0, choff=0;;
|
||||
|
||||
|
||||
@ -2062,12 +2083,12 @@ int multiSlsDetector::exitServer() {
|
||||
}
|
||||
|
||||
|
||||
/** returns the detector trimbit/settings directory \sa sharedSlsDetector */
|
||||
/** returns the detector trimbit/settings directory */
|
||||
char* multiSlsDetector::getSettingsDir() {
|
||||
string s0="", s1="", s;
|
||||
|
||||
|
||||
char ans[1000];
|
||||
//char ans[1000];
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
s=detectors[idet]->getSettingsDir();
|
||||
@ -2175,7 +2196,7 @@ int multiSlsDetector::getTrimEn(int *ene) {
|
||||
*/
|
||||
char* multiSlsDetector::getCalDir() {
|
||||
string s0="", s1="", s;
|
||||
char ans[1000];
|
||||
//char ans[1000];
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
s=detectors[idet]->getCalDir();
|
||||
@ -2238,7 +2259,7 @@ char* multiSlsDetector::setCalDir(string s){
|
||||
char* multiSlsDetector::getNetworkParameter(networkParameter p) {
|
||||
string s0="", s1="",s ;
|
||||
|
||||
char ans[1000];
|
||||
//char ans[1000];
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
s=detectors[idet]->getNetworkParameter(p);
|
||||
@ -2518,7 +2539,7 @@ int multiSlsDetector::getMaxNumberOfModules(dimension d) {
|
||||
|
||||
int multiSlsDetector::setNumberOfModules(int p, dimension d) {
|
||||
|
||||
int ret=0, ret1;
|
||||
int ret=0;//, ret1;
|
||||
int nm, mm, nt=p;
|
||||
|
||||
thisMultiDetector->dataBytes=0;
|
||||
@ -2685,7 +2706,7 @@ int multiSlsDetector::saveSettingsFile(string fname, int imod) {
|
||||
|
||||
int multiSlsDetector::writeRegister(int addr, int val){
|
||||
|
||||
int imi, ima, i;
|
||||
int i;//imi, ima,
|
||||
int ret, ret1=-100;
|
||||
|
||||
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
|
||||
@ -2704,7 +2725,7 @@ int multiSlsDetector::writeRegister(int addr, int val){
|
||||
|
||||
int multiSlsDetector::readRegister(int addr){
|
||||
|
||||
int imi, ima, i;
|
||||
int i;//imi, ima,
|
||||
int ret, ret1=-100;
|
||||
|
||||
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
|
||||
@ -2866,7 +2887,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
int ret;
|
||||
// int ret;
|
||||
|
||||
outfile.open(fname.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
@ -3075,7 +3096,9 @@ int multiSlsDetector::retrieveDetectorSetup(string const fname1, int level){
|
||||
if (level==2) {
|
||||
fname=fname1+string(".config");
|
||||
readConfigurationFile(fname);
|
||||
//cout << "config file read" << endl;
|
||||
#ifdef VERBOSE
|
||||
cout << "config file read" << endl;
|
||||
#endif
|
||||
fname=fname1+string(".det");
|
||||
} else
|
||||
fname=fname1;
|
||||
@ -3156,10 +3179,11 @@ int multiSlsDetector::retrieveDetectorSetup(string const fname1, int level){
|
||||
|
||||
|
||||
int multiSlsDetector::loadImageToDetector(imageType t, string s) {
|
||||
return OK;
|
||||
|
||||
}
|
||||
int multiSlsDetector::testFunction(int times) {
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@ -3171,7 +3195,7 @@ int multiSlsDetector::writeDataFile(string fname, float *data, float *err, float
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
int idata, choff=0, off=0;
|
||||
int choff=0, off=0; //idata,
|
||||
float *pe=err, *pa=ang;
|
||||
int nch_left=nch, n;
|
||||
|
||||
@ -3252,8 +3276,8 @@ int multiSlsDetector::readDataFile(string fname, float *data, float *err, float
|
||||
#endif
|
||||
|
||||
ifstream infile;
|
||||
int ichan, iline=0;
|
||||
int interrupt=0;
|
||||
int iline=0;//ichan,
|
||||
//int interrupt=0;
|
||||
string str;
|
||||
int choff=0, off=0;
|
||||
float *pe=err, *pa=ang;
|
||||
@ -3293,8 +3317,8 @@ int multiSlsDetector::readDataFile(string fname, int *data) {
|
||||
#endif
|
||||
|
||||
ifstream infile;
|
||||
int ichan, iline=0;
|
||||
int interrupt=0;
|
||||
int iline=0;//ichan,
|
||||
//int interrupt=0;
|
||||
string str;
|
||||
int choff=0, off=0;
|
||||
|
||||
|
@ -2629,9 +2629,9 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
|
||||
} else{
|
||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
thisDetector->currentSettings=(detectorSettings)retval;
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Settings are "<< retval << std::endl;
|
||||
//#endif
|
||||
#endif
|
||||
}
|
||||
controlSocket->Disconnect();
|
||||
if (ret==FORCE_UPDATE)
|
||||
@ -2774,22 +2774,25 @@ detectorSettings slsDetector::setSettings( detectorSettings isettings, int imod)
|
||||
|
||||
int slsDetector::updateDetectorNoWait() {
|
||||
|
||||
int ret=OK;
|
||||
// int ret=OK;
|
||||
enum detectorSettings t;
|
||||
int thr, n, nm;
|
||||
int it;
|
||||
int64_t retval, tns=-1;
|
||||
// int it;
|
||||
int64_t retval;// tns=-1;
|
||||
char lastClientIP[INET_ADDRSTRLEN];
|
||||
|
||||
switch(thisDetector->myDetectorType){
|
||||
case GOTTHARD:
|
||||
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
//cout << "Updating detector last modified by " << lastClientIP << endl; commented out by dhanya for now
|
||||
#ifdef VERBOSE
|
||||
cout << "Updating detector last modified by " << lastClientIP << endl;// commented out by dhanya for now
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
||||
cout << "Updating detector last modified by " << lastClientIP << endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "Updating detector last modified by " << lastClientIP << endl;
|
||||
#endif
|
||||
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
|
||||
thisDetector->nMod[X]=nm;
|
||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||
@ -3021,32 +3024,33 @@ int* slsDetector::getDataFromDetector(){
|
||||
#ifdef VERBOSE
|
||||
cout << "ret=" << ret << endl;
|
||||
#endif
|
||||
if (ret!=OK) {
|
||||
n= controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
if (ret==FAIL) {
|
||||
thisDetector->stoppedFlag=1;
|
||||
std::cout<< "Detector returned: " << mess << " " << n << std::endl;
|
||||
} else {
|
||||
;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Detector successfully returned: " << mess << " " << n << std::endl;
|
||||
#endif
|
||||
}
|
||||
delete [] retval;
|
||||
retval=NULL;
|
||||
} else {
|
||||
n=controlSocket->ReceiveDataOnly(retval,thisDetector->dataBytes);
|
||||
|
||||
if (ret!=OK) {
|
||||
n= controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
if (ret==FAIL) {
|
||||
thisDetector->stoppedFlag=1;
|
||||
std::cout<< "Detector returned: " << mess << " " << n << std::endl;
|
||||
} else {
|
||||
;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Received "<< n << " data bytes" << std::endl;
|
||||
std::cout<< "Detector successfully returned: " << mess << " " << n << std::endl;
|
||||
#endif
|
||||
}
|
||||
delete [] retval;
|
||||
retval=NULL;
|
||||
} else {
|
||||
n=controlSocket->ReceiveDataOnly(retval,thisDetector->dataBytes);
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Received "<< n << " data bytes" << std::endl;
|
||||
#endif
|
||||
if (n!=thisDetector->dataBytes) {
|
||||
std::cout<< "wrong data size received: received " << n << " but expected " << thisDetector->dataBytes << std::endl;
|
||||
thisDetector->stoppedFlag=1;
|
||||
ret=FAIL;
|
||||
delete [] retval;
|
||||
retval=NULL;
|
||||
}
|
||||
if (n!=thisDetector->dataBytes) {
|
||||
std::cout<< "wrong data size received: received " << n << " but expected " << thisDetector->dataBytes << std::endl;
|
||||
thisDetector->stoppedFlag=1;
|
||||
ret=FAIL;
|
||||
delete [] retval;
|
||||
retval=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
@ -3077,7 +3081,7 @@ int* slsDetector::readAll(){
|
||||
#ifdef VERBOSE
|
||||
std::cout<< i << std::endl;
|
||||
#else
|
||||
std::cout << "-" ;
|
||||
std::cout << "-" << flush ;
|
||||
#endif
|
||||
dataQueue.push(retval);
|
||||
}
|
||||
@ -3138,7 +3142,7 @@ int* slsDetector::startAndReadAll(){
|
||||
#ifdef VERBOSE
|
||||
std::cout<< i << std::endl;
|
||||
#else
|
||||
std::cout<< "-" ;
|
||||
std::cout<< "-" << flush;
|
||||
#endif
|
||||
dataQueue.push(retval);
|
||||
}
|
||||
@ -3345,7 +3349,7 @@ int slsDetector::setPort(portType index, int num){
|
||||
|
||||
int fnum=F_SET_PORT;
|
||||
int retval;
|
||||
uint64_t ut;
|
||||
// uint64_t ut;
|
||||
char mess[100];
|
||||
int ret=FAIL;
|
||||
int n=0;
|
||||
@ -3808,7 +3812,9 @@ int slsDetector::executeTrimming(trimMode mode, int par1, int par2, int imod){
|
||||
if (controlSocket) {
|
||||
if (controlSocket->Connect()>=0) {
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "sending mode bytes= "<< controlSocket->SendDataOnly(&mode,sizeof(mode)) << std::endl;
|
||||
#endif
|
||||
controlSocket->SendDataOnly(arg,sizeof(arg));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL) {
|
||||
@ -4485,17 +4491,17 @@ int slsDetector::setAngularConversion(string fname) {
|
||||
if (fname=="") {
|
||||
thisDetector->correctionMask&=~(1<< ANGULAR_CONVERSION);
|
||||
//strcpy(thisDetector->angConvFile,"none");
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Unsetting angular conversion" << std::endl;
|
||||
//#endif
|
||||
#endif
|
||||
} else {
|
||||
if (fname=="default") {
|
||||
fname=string(thisDetector->angConvFile);
|
||||
}
|
||||
|
||||
//#ifdef VERBOSE
|
||||
std::cout << "Setting angular conversion to" << fname << std:: endl;
|
||||
//#endif
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Setting angular conversion to" << fname << std:: endl;
|
||||
#endif
|
||||
if (readAngularConversion(fname)>=0) {
|
||||
thisDetector->correctionMask|=(1<< ANGULAR_CONVERSION);
|
||||
strcpy(thisDetector->angConvFile,fname.c_str());
|
||||
@ -4673,8 +4679,8 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
string ans;
|
||||
string str;
|
||||
ifstream infile;
|
||||
int iargval;
|
||||
int interrupt=0;
|
||||
// int iargval;
|
||||
// int interrupt=0;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
@ -4683,7 +4689,9 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "config file name "<< fname << std::endl;
|
||||
#endif
|
||||
infile.open(fname.c_str(), ios_base::in);
|
||||
if (infile.is_open()) {
|
||||
iline=readConfigurationFile(infile);
|
||||
|
@ -868,7 +868,7 @@ string slsDetectorCommand::cmdRemove(int narg, char *args[], int action){
|
||||
|
||||
|
||||
ostringstream os;
|
||||
int ivar, ival;
|
||||
int ival;//ivar,
|
||||
string var=string(args[0]);
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
@ -901,7 +901,7 @@ string slsDetectorCommand::cmdHostname(int narg, char *args[], int action){
|
||||
}
|
||||
|
||||
ostringstream os;
|
||||
int ivar, ival;
|
||||
int ivar;//, ival;
|
||||
string var=string(args[0]);
|
||||
char hostname[1000];
|
||||
|
||||
@ -960,7 +960,7 @@ string slsDetectorCommand::cmdId(int narg, char *args[], int action){
|
||||
ostringstream os;
|
||||
int ivar, ival;
|
||||
string var=string(args[0]);
|
||||
char answer[1000];
|
||||
// char answer[1000];
|
||||
|
||||
|
||||
size_t p=string(args[0]).find(':');
|
||||
@ -1274,6 +1274,9 @@ string slsDetectorCommand::helpFileIndex(int narg, char *args[], int action){
|
||||
|
||||
string slsDetectorCommand::cmdFlatField(int narg, char *args[], int action){
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
return helpFlatField(narg, args, action);
|
||||
}
|
||||
string sval;
|
||||
|
||||
if (string(args[0])==string("ffdir")) {
|
||||
@ -1294,7 +1297,7 @@ string slsDetectorCommand::cmdFlatField(int narg, char *args[], int action){
|
||||
myDet->setFlatFieldCorrection(sval);
|
||||
return string(myDet->getFlatFieldCorrectionFile());
|
||||
|
||||
} else if (action==GET_ACTION) {
|
||||
} else {// if (action==GET_ACTION) {
|
||||
if (narg>1)
|
||||
sval=string(args[1]);
|
||||
else
|
||||
@ -1310,8 +1313,8 @@ string slsDetectorCommand::cmdFlatField(int narg, char *args[], int action){
|
||||
return string("none");
|
||||
}
|
||||
}
|
||||
} else
|
||||
return string("could not decode flat field action ")+cmd;
|
||||
}
|
||||
return string("could not decode flat field action ")+cmd;
|
||||
|
||||
}
|
||||
|
||||
@ -1349,6 +1352,9 @@ string slsDetectorCommand::helpFlatField(int narg, char *args[], int action){
|
||||
|
||||
string slsDetectorCommand::cmdRateCorr(int narg, char *args[], int action){
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
return helpRateCorr(narg, args, action);
|
||||
}
|
||||
float fval;
|
||||
char answer[1000];
|
||||
|
||||
@ -1383,7 +1389,9 @@ string slsDetectorCommand::cmdBadChannels(int narg, char *args[], int action){
|
||||
|
||||
string sval;
|
||||
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
return helpBadChannels(narg, args, action);
|
||||
}
|
||||
if (action==PUT_ACTION) {
|
||||
sval=string(args[1]);
|
||||
if (sval=="none")
|
||||
@ -1429,6 +1437,9 @@ string slsDetectorCommand::helpBadChannels(int narg, char *args[], int action){
|
||||
|
||||
string slsDetectorCommand::cmdAngConv(int narg, char *args[], int action){
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
return helpAngConv(narg, args, action);
|
||||
}
|
||||
string sval;
|
||||
char answer[1000];
|
||||
float fval;
|
||||
@ -1796,7 +1807,7 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
cout << fmin << " " << fmax << " " << fstep << endl;
|
||||
#endif
|
||||
|
||||
ns=(fmax-fmin)/fstep;
|
||||
ns=(int)((fmax-fmin)/fstep);
|
||||
if (ns<0)
|
||||
ns=-1*ns;
|
||||
|
||||
@ -1897,7 +1908,7 @@ string slsDetectorCommand::cmdPort(int narg, char *args[], int action) {
|
||||
|
||||
if (action==HELP_ACTION)
|
||||
return helpPort(narg,args,action);
|
||||
int ret, val;
|
||||
int val; //ret,
|
||||
char ans[1000];
|
||||
portType index;
|
||||
|
||||
@ -1954,7 +1965,7 @@ string slsDetectorCommand::cmdLock(int narg, char *args[], int action) {
|
||||
if (action==HELP_ACTION)
|
||||
return helpLock(narg,args,action);
|
||||
|
||||
int val, ret;
|
||||
int val;//, ret;
|
||||
char ans[1000];
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
@ -2092,7 +2103,7 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
return helpDetectorSize(narg,args,action);
|
||||
int ret, val=-1;
|
||||
char ans[1000];
|
||||
portType index;
|
||||
// portType index;
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
if (cmd=="maxmod")
|
||||
@ -2146,9 +2157,9 @@ string slsDetectorCommand::cmdSettings(int narg, char *args[], int action) {
|
||||
|
||||
if (action==HELP_ACTION)
|
||||
return helpSettings(narg,args,action);
|
||||
int ret, val=-1;
|
||||
int val=-1;//ret,
|
||||
char ans[1000];
|
||||
portType index;
|
||||
// portType index;
|
||||
|
||||
|
||||
|
||||
@ -2628,7 +2639,7 @@ string slsDetectorCommand::helpDAC(int narg, char *args[], int action) {
|
||||
string slsDetectorCommand::cmdADC(int narg, char *args[], int action) {
|
||||
|
||||
dacIndex adc;
|
||||
float val=-1;
|
||||
// float val=-1;
|
||||
char answer[1000];
|
||||
|
||||
if (action==HELP_ACTION)
|
||||
@ -2727,8 +2738,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
|
||||
else
|
||||
return string("cannot scan timer value ")+string(args[1]);
|
||||
if (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER)
|
||||
t=val*1E+9;
|
||||
else t=val;
|
||||
t=(int64_t)(val*1E+9);
|
||||
else t=(int64_t)val;
|
||||
}
|
||||
|
||||
|
||||
|
@ -215,10 +215,10 @@ int slsDetectorUtils::getVariablesFromFileName(string fname, int &index, int &p_
|
||||
//return i;
|
||||
s=fname.substr(0,uscore);
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
else
|
||||
cout << "******************************** cannot parse file index" << endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << s << endl;
|
||||
#endif
|
||||
|
||||
@ -235,13 +235,11 @@ int slsDetectorUtils::getVariablesFromFileName(string fname, int &index, int &p_
|
||||
#endif
|
||||
s=fname.substr(0,uscore);
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
else
|
||||
cout << "******************************** cannot parse position index" << endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << s << endl;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -259,10 +257,10 @@ int slsDetectorUtils::getVariablesFromFileName(string fname, int &index, int &p_
|
||||
#endif
|
||||
s=fname.substr(0,uscore);
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
else
|
||||
cout << "******************************** cannot parse scan varable 1" << endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << s << endl;
|
||||
|
||||
|
||||
@ -279,10 +277,10 @@ int slsDetectorUtils::getVariablesFromFileName(string fname, int &index, int &p_
|
||||
cout << "******************************** scan variable 0 is " << sv0 << endl;
|
||||
#endif
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
else
|
||||
cout << "******************************** cannot parse scan varable 0" << endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
#endif
|
||||
|
||||
|
||||
@ -482,12 +480,12 @@ float slsDetectorUtils::getAngularConversionParameter(angleConversionParameter c
|
||||
int slsDetectorUtils::readAngularConversion(string fname, int nmod, angleConversionConstant *angOff) {
|
||||
|
||||
ifstream infile;
|
||||
int mod;
|
||||
float center, ecenter;
|
||||
float r_conv, er_conv;
|
||||
float off, eoff;
|
||||
// int mod;
|
||||
// float center, ecenter;
|
||||
// float r_conv, er_conv;
|
||||
// float off, eoff;
|
||||
string ss;
|
||||
int interrupt=0;
|
||||
// int interrupt=0;
|
||||
|
||||
//" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n"
|
||||
#ifdef VERBOSE
|
||||
@ -621,7 +619,7 @@ int slsDetectorUtils::addToMerging(float *p1, float *v1, float *e1, float *mp,
|
||||
|
||||
float binmi=-180., binma;
|
||||
int ibin=0;
|
||||
int imod;
|
||||
// int imod;
|
||||
float ang=0;
|
||||
|
||||
|
||||
@ -725,8 +723,8 @@ int slsDetectorUtils::addToMerging(float *p1, float *v1, float *e1, float *mp,
|
||||
|
||||
|
||||
|
||||
int ibin=0;
|
||||
int imod;
|
||||
// int ibin=0;
|
||||
// int imod;
|
||||
|
||||
int del=0;
|
||||
|
||||
@ -759,7 +757,7 @@ int slsDetectorUtils::writeDataFile(string fname, int nch, float *data, float *e
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
int idata;
|
||||
// int idata;
|
||||
if (data==NULL)
|
||||
return FAIL;
|
||||
|
||||
@ -873,11 +871,11 @@ int slsDetectorUtils::readDataFile(int nch, string fname, float *data, float *er
|
||||
|
||||
|
||||
ifstream infile;
|
||||
int ichan, iline=0;
|
||||
int interrupt=0;
|
||||
float fdata, ferr, fang;
|
||||
int iline=0;//ichan,
|
||||
//int interrupt=0;
|
||||
//float fdata, ferr, fang;
|
||||
int maxchans;
|
||||
int ich;
|
||||
//int ich;
|
||||
string str;
|
||||
|
||||
|
||||
@ -901,7 +899,7 @@ int slsDetectorUtils::readDataFile(int nch, string fname, float *data, float *er
|
||||
int slsDetectorUtils::readDataFile(int nch, ifstream &infile, float *data, float *err, float *ang, char dataformat, int offset){
|
||||
|
||||
|
||||
int ichan, iline=0;
|
||||
int ichan,iline=0;
|
||||
int interrupt=0;
|
||||
float fdata, ferr, fang;
|
||||
int maxchans;
|
||||
@ -970,8 +968,8 @@ int slsDetectorUtils::readDataFile(int nch, ifstream &infile, float *data, float
|
||||
int slsDetectorUtils::readDataFile(string fname, int *data, int nch){
|
||||
|
||||
ifstream infile;
|
||||
int ichan, idata, iline=0;
|
||||
int interrupt=0;
|
||||
int iline=0;//ichan, idata,
|
||||
//int interrupt=0;
|
||||
string str;
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -1029,8 +1027,8 @@ int slsDetectorUtils::readDataFile(ifstream &infile, int *data, int nch, int off
|
||||
int slsDetectorUtils::readDataFile(string fname, short int *data, int nch){
|
||||
|
||||
ifstream infile;
|
||||
int ichan, iline=0;
|
||||
int interrupt=0;
|
||||
int iline=0;//ichan,
|
||||
//int interrupt=0;
|
||||
string str;
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -1639,7 +1637,7 @@ void* slsDetectorUtils::processData(int delflag) {
|
||||
float *ffcdata=NULL, *ffcerr=NULL;
|
||||
float *ang=NULL;
|
||||
float bs=0.004;
|
||||
int imod;
|
||||
// int imod;
|
||||
int nb;
|
||||
int np;
|
||||
detectorData *thisData;
|
||||
@ -1793,7 +1791,7 @@ void* slsDetectorUtils::processData(int delflag) {
|
||||
|
||||
|
||||
pthread_mutex_lock(&mp);
|
||||
if (currentPositionIndex==(*numberOfPositions) && posfinished==1 && queuesize==1) {
|
||||
if (currentPositionIndex>=(*numberOfPositions) && posfinished==1 && queuesize==1) {
|
||||
|
||||
|
||||
// if ((currentPositionIndex>=(*numberOfPositions)) || (currentPositionIndex==0)) {
|
||||
@ -1808,7 +1806,7 @@ void* slsDetectorUtils::processData(int delflag) {
|
||||
// pthread_mutex_lock(&mp);
|
||||
// if (currentPositionIndex==(*numberOfPositions) && posfinished==1 && queuesize==1) {
|
||||
|
||||
cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP Incrementing positon index " << endl;
|
||||
//cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP Incrementing positon index " << endl;
|
||||
|
||||
|
||||
|
||||
|
@ -184,7 +184,7 @@ int go_to_position(float p) {
|
||||
//"caputq X04SA-ES2-TH2:RO p"
|
||||
//cawait -nounit -timeout 3600 X04SA-ES2-TH2:RO.DMOV '==1'
|
||||
|
||||
return p;
|
||||
return (int)p;
|
||||
}
|
||||
|
||||
/* moves the encoder to position p without waiting */
|
||||
@ -211,13 +211,13 @@ int go_to_position_no_wait(float p) {
|
||||
#endif
|
||||
//"caputq X04SA-ES2-TH2:RO p"
|
||||
|
||||
return p;
|
||||
return (int)p;
|
||||
|
||||
|
||||
|
||||
|
||||
pos=p;
|
||||
return pos;
|
||||
return (int)pos;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user