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