mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 08:39:21 +01:00
warnings fixed
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@343 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -52,7 +52,6 @@ class angCalLogClass {
|
||||
nmod=0; chanspermod=0; globaloff=0; fineoff=0; angdir=1; \
|
||||
strcpy(angconvfile,"none"); strcpy(ffdir,"none"); strcpy(fffile,"none"); strcpy(badfile,"none"); \
|
||||
char line[1000], myvar[100], myarg[100]; \
|
||||
int dum; \
|
||||
float v; \
|
||||
for (int iv=0; iv<nvars; iv++) { \
|
||||
infile.getline(line,1000); \
|
||||
|
||||
@@ -60,7 +60,7 @@ int angularConversion::deleteMerging() {
|
||||
|
||||
if (mergingErrors)
|
||||
delete [] mergingErrors;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ double angularConversion::setAngularConversionParameter(angleConversionParameter
|
||||
case BIN_SIZE:
|
||||
if (v>0) {
|
||||
*binSize=v;
|
||||
nBins=360./(*binSize);
|
||||
nBins=(int)(360./(*binSize))+1;
|
||||
}
|
||||
return *binSize;
|
||||
case MOVE_FLAG:
|
||||
@@ -226,7 +226,7 @@ double angularConversion::getAngularConversionParameter(angleConversionParameter
|
||||
return *fineOffset;
|
||||
case BIN_SIZE:
|
||||
if (*binSize>0)
|
||||
nBins=360./(*binSize);
|
||||
nBins=(int)(360./(*binSize))+1;
|
||||
else
|
||||
nBins=0;
|
||||
return *binSize;
|
||||
|
||||
@@ -152,7 +152,7 @@ class angularConversion : public virtual slsDetectorBase, public angularConversi
|
||||
\param bs bin size to be set
|
||||
\returns actual bin size
|
||||
*/
|
||||
double setBinSize(double bs){if (bs>0) nBins=360/bs; return setAngularConversionParameter(BIN_SIZE,bs);};
|
||||
double setBinSize(double bs){if (bs>0) nBins=(int)(360./bs); return setAngularConversionParameter(BIN_SIZE,bs);};
|
||||
|
||||
/**
|
||||
get detector bin size
|
||||
|
||||
@@ -136,7 +136,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerM
|
||||
|
||||
int imod=0;
|
||||
double ang;
|
||||
double enc=0, trans=0;
|
||||
// double enc=0, trans=0;
|
||||
angleConversionConstant *p=NULL;
|
||||
|
||||
int ch0=0;
|
||||
|
||||
@@ -69,31 +69,18 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
|
||||
return ang;
|
||||
}
|
||||
|
||||
double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) {
|
||||
|
||||
int imod=0;
|
||||
double ang;
|
||||
|
||||
|
||||
|
||||
|
||||
double angularConversionStatic::convertAngle(double pos, int ich, angleConversionConstant *p, int mF, double fo, double go, int angdir) {
|
||||
|
||||
|
||||
double enc=0, trans=0;
|
||||
angleConversionConstant *p=NULL;
|
||||
|
||||
int ch0=0;
|
||||
int chlast=chansPerMod[0]-1;
|
||||
int nchmod=chansPerMod[0];
|
||||
double ang;
|
||||
|
||||
|
||||
|
||||
while (ich>chlast) {
|
||||
imod++;
|
||||
ch0=chlast+1;
|
||||
nchmod=chansPerMod[imod];
|
||||
chlast=ch0+nchmod-1;
|
||||
}
|
||||
|
||||
p=angOff[imod];
|
||||
|
||||
|
||||
|
||||
switch (mF[imod]) {
|
||||
switch (mF) {
|
||||
case 0:
|
||||
enc=0;
|
||||
trans=0;
|
||||
@@ -118,11 +105,9 @@ double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerM
|
||||
enc=0;
|
||||
trans=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (p)
|
||||
ang=angle(ich-ch0, \
|
||||
ang=angle(ich, \
|
||||
enc, \
|
||||
fo+go, \
|
||||
p->r_conversion, \
|
||||
@@ -133,6 +118,47 @@ double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerM
|
||||
|
||||
return ang;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) {
|
||||
|
||||
int imod=0;
|
||||
double ang;
|
||||
double enc=0, trans=0;
|
||||
angleConversionConstant *p=NULL;
|
||||
|
||||
int ch0=0;
|
||||
int chlast=chansPerMod[0]-1;
|
||||
int nchmod=chansPerMod[0];
|
||||
|
||||
|
||||
|
||||
while (ich>chlast) {
|
||||
imod++;
|
||||
ch0=chlast+1;
|
||||
nchmod=chansPerMod[imod];
|
||||
chlast=ch0+nchmod-1;
|
||||
}
|
||||
|
||||
p=angOff[imod];
|
||||
|
||||
|
||||
ang=convertAngle(pos, ich-ch0, p, mF[imod], fo, go, angdir);
|
||||
|
||||
return ang;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -162,12 +188,13 @@ int angularConversionStatic::readAngularConversion(string fname, int nmod, angle
|
||||
int angularConversionStatic::readAngularConversion( ifstream& infile, int nmod, angleConversionConstant *angOff) {
|
||||
string str;
|
||||
int mod;
|
||||
double center, ecenter;
|
||||
double center, ecenter, pitch, epitch;
|
||||
double r_conv, er_conv;
|
||||
double off, eoff;
|
||||
string ss;
|
||||
int interrupt=0;
|
||||
int nm=0;
|
||||
int newangconv=0;
|
||||
//" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n"
|
||||
while (infile.good() and interrupt==0) {
|
||||
getline(infile,str);
|
||||
@@ -178,18 +205,31 @@ int angularConversionStatic::readAngularConversion( ifstream& infile, int nmod,
|
||||
istringstream ssstr(str);
|
||||
ssstr >> ss >> mod;
|
||||
ssstr >> ss >> center;
|
||||
if (ss==string("center"))
|
||||
newangconv=1;
|
||||
ssstr >> ss >> ecenter;
|
||||
if (newangconv) {
|
||||
ssstr >> ss >> pitch;
|
||||
ssstr >> ss >> epitch;
|
||||
}
|
||||
ssstr >> ss >> r_conv;
|
||||
ssstr >> ss >> er_conv;
|
||||
ssstr >> ss >> off;
|
||||
ssstr >> ss >> eoff;
|
||||
if (nm<nmod && nm>=0 ) {
|
||||
angOff[nm].center=center;
|
||||
angOff[nm].r_conversion=r_conv;
|
||||
angOff[nm].offset=off;
|
||||
angOff[nm].ecenter=ecenter;
|
||||
angOff[nm].er_conversion=er_conv;
|
||||
angOff[nm].eoffset=eoff;
|
||||
if (newangconv==0) {
|
||||
angOff[nm].center=center;
|
||||
angOff[nm].r_conversion=r_conv;
|
||||
angOff[nm].offset=off;
|
||||
angOff[nm].ecenter=ecenter;
|
||||
angOff[nm].er_conversion=er_conv;
|
||||
angOff[nm].eoffset=eoff;
|
||||
} else {
|
||||
|
||||
angOff[nm].tilt=pitch;
|
||||
angOff[nm].etilt=epitch;
|
||||
|
||||
}
|
||||
} else
|
||||
break;
|
||||
//cout << nm<<" " << angOff[nm].offset << endl;
|
||||
|
||||
@@ -65,7 +65,7 @@ class enCalLogClass {
|
||||
|
||||
int readHeader(ifstream &infile, char *settings, int &nmod, int &chanspermod, int *mods ) { \
|
||||
nmod=0; strcpy(settings,"unknown"); chanspermod=0; \
|
||||
char line[1000], myvar[100], myarg[100]; \
|
||||
char line[1000],myarg[100]; \
|
||||
int dum; \
|
||||
for (int iv=0; iv<3; iv++) { \
|
||||
infile.getline(line,1000); \
|
||||
|
||||
@@ -621,11 +621,11 @@ class fileIOStatic {
|
||||
} else { \
|
||||
interrupt=1; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
return iline; \
|
||||
}; \
|
||||
};
|
||||
|
||||
return iline; \
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,21 @@
|
||||
#endif
|
||||
|
||||
|
||||
static void* startProcessData(void *n){\
|
||||
postProcessing *myDet=(postProcessing*)n;\
|
||||
myDet->processData(1);\
|
||||
pthread_exit(NULL);\
|
||||
|
||||
};
|
||||
|
||||
static void* startProcessDataNoDelete(void *n){\
|
||||
postProcessing *myDet=(postProcessing*)n;\
|
||||
myDet->processData(0);\
|
||||
pthread_exit(NULL);\
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
postProcessing::postProcessing(): expTime(NULL), ang(NULL), val(NULL), err(NULL), numberOfChannels(0){
|
||||
pthread_mutex_t mp1 = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -120,11 +135,6 @@ void postProcessing::processFrame(int *myData, int delflag) {
|
||||
delete thisData;
|
||||
fdata=NULL;
|
||||
}
|
||||
// #ifdef VERBOSE
|
||||
// cout << "findex incremented " << endl;
|
||||
// #endif
|
||||
// if(*correctionMask&(1<<WRITE_FILE))
|
||||
// IncrementFileIndex();
|
||||
}
|
||||
|
||||
if (getFrameIndex()>=0)
|
||||
|
||||
@@ -248,7 +248,7 @@ s
|
||||
int positionFinished(int v=-1){pthread_mutex_lock(&mp); if (v>=0) posfinished=v; int retval=posfinished; pthread_mutex_unlock(&mp); return retval;};
|
||||
|
||||
double getCurrentPosition() {double p; pthread_mutex_lock(&mp); p=currentPosition; pthread_mutex_unlock(&mp); return p;};
|
||||
int setCurrentPosition(double v) { pthread_mutex_lock(&mp); currentPosition=v; pthread_mutex_unlock(&mp); return currentPosition;};
|
||||
double setCurrentPosition(double v) { pthread_mutex_lock(&mp); currentPosition=v; pthread_mutex_unlock(&mp); return currentPosition;};
|
||||
|
||||
|
||||
|
||||
@@ -353,19 +353,19 @@ s
|
||||
};
|
||||
|
||||
|
||||
static void* startProcessData(void *n){\
|
||||
postProcessing *myDet=(postProcessing*)n;\
|
||||
myDet->processData(1);\
|
||||
pthread_exit(NULL);\
|
||||
/* static void* startProcessData(void *n){\ */
|
||||
/* postProcessing *myDet=(postProcessing*)n;\ */
|
||||
/* myDet->processData(1);\ */
|
||||
/* pthread_exit(NULL);\ */
|
||||
|
||||
};
|
||||
/* }; */
|
||||
|
||||
static void* startProcessDataNoDelete(void *n){\
|
||||
postProcessing *myDet=(postProcessing*)n;\
|
||||
myDet->processData(0);\
|
||||
pthread_exit(NULL);\
|
||||
/* static void* startProcessDataNoDelete(void *n){\ */
|
||||
/* postProcessing *myDet=(postProcessing*)n;\ */
|
||||
/* myDet->processData(0);\ */
|
||||
/* pthread_exit(NULL);\ */
|
||||
|
||||
};
|
||||
/* }; */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
|
||||
me[ich]+=eout*eout;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
||||
nBins=0;
|
||||
if (angRadius && angOffset && angCenter && (binSize>0)) {
|
||||
angConv=new angleConversionConstant*[nMods];
|
||||
nBins=360./binSize+1;
|
||||
nBins=(int)(360./binSize)+1;
|
||||
}
|
||||
|
||||
for (int im=0; im<nMods; im++) {
|
||||
|
||||
Reference in New Issue
Block a user