diff --git a/slsDetectorSoftware/MySocketTCP/genericSocket.h b/slsDetectorSoftware/MySocketTCP/genericSocket.h index 0cee554ec..bfcc75166 100644 --- a/slsDetectorSoftware/MySocketTCP/genericSocket.h +++ b/slsDetectorSoftware/MySocketTCP/genericSocket.h @@ -428,7 +428,7 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(DEFA static string nameToMac(string inf) { struct ifreq ifr; int sock, j, k; - char *p, addr[32], mask[32], mac[32]; + char mac[32]; sock=getSock(inf,&ifr); @@ -450,8 +450,8 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(DEFA static string nameToIp(string inf){ struct ifreq ifr; - int sock, j, k; - char *p, addr[32], mask[32], mac[32]; + int sock; + char *p, addr[32]; sock=getSock(inf,&ifr); @@ -469,8 +469,7 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(DEFA static int getSock(string inf, struct ifreq *ifr) { - int sock, j, k; - char *p, addr[32], mask[32], mac[32]; + int sock; sock=socket(PF_INET, SOCK_STREAM, 0); if (-1==sock) { perror("socket() "); diff --git a/slsDetectorSoftware/commonFiles/communication_funcs.c b/slsDetectorSoftware/commonFiles/communication_funcs.c index 1e7b0cb3e..d5098bd05 100755 --- a/slsDetectorSoftware/commonFiles/communication_funcs.c +++ b/slsDetectorSoftware/commonFiles/communication_funcs.c @@ -432,7 +432,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) { int nChans, nchanold=myMod->nchan, nchandiff; int nDacs, ndold=myMod->ndac, ndacdiff; int nAdcs, naold=myMod->nadc, nadcdiff; - int id=0; + // int id=0; ts+= receiveDataOnly(file_des,myMod,sizeof(sls_detector_module)); diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 927ac8c2c..d1d2161b5 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -605,6 +605,7 @@ int multiSlsDetector::addSlsDetector(detectorType t, int pos) { cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl; #endif slsDetector *s=new slsDetector(t, id, this); + s=NULL; #ifdef VERBOSE cout << "Adding it to the multi detector structure" << endl; #endif @@ -862,7 +863,7 @@ slsDetectorDefs::synchronizationMode multiSlsDetector::setSynchronization(synchr int multiSlsDetector::setOnline(int off) { - int retdet; + // int retdet; if (off!=GET_ONLINE_FLAG) { thisMultiDetector->onlineFlag=off; @@ -1641,13 +1642,13 @@ double* multiSlsDetector::decodeData(int *datain, double *fdata) { int multiSlsDetector::setFlatFieldCorrection(string fname){ - double data[thisMultiDetector->numberOfChannels], xmed[thisMultiDetector->numberOfChannels]; + double data[thisMultiDetector->numberOfChannels];//, xmed[thisMultiDetector->numberOfChannels]; double ffcoefficients[thisMultiDetector->numberOfChannels], fferrors[thisMultiDetector->numberOfChannels]; - int nmed=0; - int idet=0, ichdet=-1; + // int nmed=0; + // int idet=0, ichdet=-1; char ffffname[MAX_STR_LENGTH*2]; - int nbad=0, nch; - int badlist[MAX_BADCHANS]; + int nch;//nbad=0, + //int badlist[MAX_BADCHANS]; int im=0; if (fname=="default") { @@ -1920,7 +1921,7 @@ int multiSlsDetector::getRateCorrection(double &t){ double multiSlsDetector::getRateCorrectionTau(){ - int ret1=-100,ret; + double ret1=-100,ret; if (thisMultiDetector->correctionMask&(1<tDead << std::endl; @@ -2892,7 +2893,7 @@ int multiSlsDetector::setNumberOfModules(int p, dimension d) { for (int idet=0; idetnumberOfDetectors; idet++) { - cout << "detector " << idet << endl; + // cout << "detector " << idet << endl; if (detectors[idet]) { if (p<0) nm=p; @@ -3152,7 +3153,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){ thisMultiDetector->numberOfDetectors=0; multiSlsDetectorClient *cmd; - char ext[100]; + // char ext[100]; @@ -3272,7 +3273,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){ int nvar=14; - char ext[100]; + // char ext[100]; int iv=0; char *args[100]; @@ -3355,7 +3356,7 @@ int multiSlsDetector::writeDataFile(string fname, double *data, double *err, dou ofstream outfile; int choff=0, off=0; //idata, double *pe=err, *pa=ang; - int nch_left=nch, n, nd; + int nch_left=nch, n;//, nd; if (nch_left<=0) nch_left=getTotalNumberOfChannels(); diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h index 3639126c8..fd70c21c3 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h @@ -31,7 +31,6 @@ class multiSlsDetectorClient { return; \ }; \ int id=-1, iv=0, pos=-1; \ - char *c; \ char cmd[100]; \ if (action==slsDetectorDefs::PUT_ACTION && argc<2) { \ cout << "Wrong usage - should be: "<< argv[0] << \ diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 502ef9ac2..4f3960ee7 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -723,13 +723,13 @@ int slsDetector::initializeDetectorStructure() { /** initializes the dacs values to 0 */ for (int idac=0; idacnDacs; idac++) { - *(dacs+idac+thisDetector->nDacs*imod)=0.; + *(dacs+idac+thisDetector->nDacs*imod)=0; } /** initializes the adc values to 0 */ for (int iadc=0; iadcnAdcs; iadc++) { - *(adcs+iadc+thisDetector->nAdcs*imod)=0.; + *(adcs+iadc+thisDetector->nAdcs*imod)=0; } @@ -1276,7 +1276,7 @@ int slsDetector::setNumberOfModules(int n, dimension d){ #endif if (thisDetector->onlineFlag==ONLINE_FLAG) { if (controlSocket) { - cout << "connected" << endl; + // cout << "connected" << endl; if (controlSocket->Connect()>=0) { controlSocket->SendDataOnly(&fnum,sizeof(fnum)); controlSocket->SendDataOnly(&arg,sizeof(arg)); @@ -1292,7 +1292,7 @@ int slsDetector::setNumberOfModules(int n, dimension d){ updateDetector(); } } else - cout << "no control socket?!??!?" << endl; + cout << "no control socket?" << endl; } else { cout << "offline" << endl; ret=OK; @@ -5297,7 +5297,7 @@ slsDetectorDefs::synchronizationMode slsDetector::setSynchronization(synchroniza /*receiver*/ int slsDetector::setReceiverOnline(int off) { - int prev = thisDetector->receiverOnlineFlag; + // int prev = thisDetector->receiverOnlineFlag; if (off!=GET_ONLINE_FLAG) { if(strcmp(thisDetector->receiverIP,"none")){ thisDetector->receiverOnlineFlag=off; diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index c00a66e57..de3bbe5c0 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -11,7 +11,7 @@ #include "angleConversionConstant.h" #include "MySocketTCP.h" -#include "angleConversionConstant.h"; +#include "angleConversionConstant.h" #include "receiverInterface.h" diff --git a/slsDetectorSoftware/slsDetector/slsDetectorActions.cpp b/slsDetectorSoftware/slsDetector/slsDetectorActions.cpp index ef4d0d365..a161765e0 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorActions.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorActions.cpp @@ -470,22 +470,7 @@ int slsDetectorActions::executeAction(int level) { fName=getCurrentFileName(); nowIndex=getFileIndexFromFileName(getCurrentFileName()); case headerAfter: -// sprintf(cmd,"%s nrun=%d fn=%s acqtime=%f gainmode=%d threshold=%d badfile=%s angfile=%s bloffset=%f fineoffset=%f fffile=%s/%s tau=%f par=%s", \ -// getActionScript(level).c_str(), \ -// getFileIndexFromFileName(currentFileName), \ -// currentFileName.c_str(), \ -// ((double)timerValue[ACQUISITION_TIME])*1E-9, \ -// *currentSettings, \ -// *currentThresholdEV, \ -// getBadChannelCorrectionFile().c_str(), \ -// angularConversion::getAngularConversionFile().c_str(), \ -// *globalOffset, \ -// *fineOffset, \ -// getFlatFieldCorrectionDir().c_str(), \ -// getFlatFieldCorrectionFile().c_str(), \ -// getRateCorrectionTau(), \ -// getActionParameter(level).c_str()); - + // all other parameters should be taken using text client calls in the header scripts! sprintf(cmd,"%s nrun=%d fn=%s par=%s", \ diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index 8e6aa8614..1ac6bc268 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -40,6 +40,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { /* Detector structure configuration and debugging commands */ + descrToFuncMap[i].m_pFuncName="free";//OK descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFree; i++; @@ -83,6 +84,8 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { i++; /* data processing commands */ + + descrToFuncMap[i].m_pFuncName="flatfield"; // descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFlatField; i++; @@ -1964,11 +1967,31 @@ string slsDetectorCommand::cmdScripts(int narg, char *args[], int action) { string slsDetectorCommand::helpScripts(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) - os << "positions np [pos0 pos1...posnp] \t sets the number of positions at which the detector is moved during the acquisition and their values"<< std::endl; - if (action==GET_ACTION || action==HELP_ACTION) - os << "positions \t returns the number of positions at which the detector is moved during the acquisition and their values"<< std::endl; + ostringstream os; + + if (narg>0) { + if ((string(args[0]).find("start")!=string::npos) || (string(args[0]).find("stop")!=string::npos) || (string(args[0]).find("scriptbefore")!=string::npos) || \ + (string(args[0]).find("scriptafter")!=string::npos) || (string(args[0]).find("headerafter")!=string::npos) || (string(args[0]).find("headerbefore")!=string::npos)) { + + + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " script \t sets the script to execute for the corresponding action"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the script to execute for the corresponding action"<< std::endl; + + } + + + if ((string(args[0]).find("encallog")!=string::npos) || (string(args[0]).find("angcallog")!=string::npos)) { + + + + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " i \t enables (1) or disables (0) the logging for the calibration"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the calibration log mode"<< std::endl; + } + } return os.str(); } @@ -2119,10 +2142,46 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) { string slsDetectorCommand::helpScans(int narg, char *args[], int action) { ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) - os << "positions np [pos0 pos1...posnp] \t sets the number of positions at which the detector is moved during the acquisition and their values"<< std::endl; - if (action==GET_ACTION || action==HELP_ACTION) - os << "positions \t returns the number of positions at which the detector is moved during the acquisition and their values"<< std::endl; + + if ((string(args[0])).find("script")!=string::npos) { + + + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " script \t sets the script to execute for the corresponding scan level (threshold, energy, trimbits or positions are internally defined)"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the script to execute for the corresponding scan level (threshold, energy, trimbits or positions are internally defined)"<< std::endl; + + } + + + if ((string(args[0])).find("prec")!=string::npos) { + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " i \t sets the number of decimals for the scan variable in the file name"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the number of decimals for the scan variable in the file name"<< std::endl; + + } + + if ((string(args[0])).find("steps")!=string::npos) { + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " n [st0...stn] \t sets the number of steps and steps value for the corresponding scan level"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the the number of steps and steps value for the corresponding scan level"<< std::endl; + + } + + if ((string(args[0])).find("range")!=string::npos) { + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " min max step \t sets the minimum, maximum and step size for the corresponding scan level"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the the number of steps and steps value for the corresponding scan level"<< std::endl; + + } + + + + + return os.str(); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.h b/slsDetectorSoftware/slsDetector/slsDetectorCommand.h index 9e7a57d52..54d994350 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.h @@ -17,7 +17,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs { slsDetectorCommand(slsDetectorUtils *det); - + virtual ~slsDetectorCommand(){}; /* /\** */ /* executes a set of string arguments according to a given format. It is used to read/write configuration file, dump and retrieve detector settings and for the command line interface command parsing */ @@ -175,8 +175,6 @@ class slsDetectorCommand : public virtual slsDetectorDefs { - - }; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h index 8b5191e83..a2c139b3b 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h @@ -72,7 +72,7 @@ class slsDetectorUsers /** @short virtual destructor */ - ~slsDetectorUsers(); + virtual ~slsDetectorUsers(); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index d7c7eaf8c..e073e272b 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -213,7 +213,7 @@ void slsDetectorUtils::acquire(int delflag){ executeAction(headerBefore); - if (*correctionMask&(1<< ANGULAR_CONVERSION) || aclog || eclog) { + if (*correctionMask&(1<< ANGULAR_CONVERSION) || aclog){// || eclog) { positionFinished(0); setCurrentPosition(getDetectorPosition()); } @@ -431,9 +431,11 @@ void slsDetectorUtils::acquire(int delflag){ if (eclog) delete eclog; - if (acquisition_finished) + if (acquisition_finished) { + cout << "Acquisition " << endl; acquisition_finished(getCurrentProgress(),getDetectorStatus(),acqFinished_p); - + cout << "finished " << endl; + } } diff --git a/slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h b/slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h index ebc12618d..b652434b7 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h @@ -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; iv0) { *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; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/angularConversion.h b/slsDetectorSoftware/slsDetectorAnalysis/angularConversion.h index 9eab9c895..1a5c34e78 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/angularConversion.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/angularConversion.h @@ -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 diff --git a/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp b/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp index e359b426d..659769ec9 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp @@ -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; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp~ b/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp~ index 92dafb4aa..e359b426d 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp~ +++ b/slsDetectorSoftware/slsDetectorAnalysis/angularConversionStatic.cpp~ @@ -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=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; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h b/slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h index 6bbcd1617..054263687 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h @@ -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); \ diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h index 556577979..793be6ebf 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h @@ -621,11 +621,11 @@ class fileIOStatic { } else { \ interrupt=1; \ break; \ - } \ + } \ return iline; \ }; \ - }; - + return iline; \ + }; }; #endif diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index e08a888b7..898227c3e 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -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<=0) diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h index 8e55622be..9570ff0e3 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h @@ -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);\ */ -}; +/* }; */ diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessingFuncs.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessingFuncs.cpp index a63e555ff..8ad7028ca 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessingFuncs.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessingFuncs.cpp @@ -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