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:
bergamaschi
2012-11-14 11:37:06 +00:00
parent 09982d84f2
commit e0a1e4ab36
24 changed files with 219 additions and 124 deletions

View File

@ -723,13 +723,13 @@ int slsDetector::initializeDetectorStructure() {
/** initializes the dacs values to 0 */
for (int idac=0; idac<thisDetector->nDacs; idac++) {
*(dacs+idac+thisDetector->nDacs*imod)=0.;
*(dacs+idac+thisDetector->nDacs*imod)=0;
}
/** initializes the adc values to 0 */
for (int iadc=0; iadc<thisDetector->nAdcs; 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;

View File

@ -11,7 +11,7 @@
#include "angleConversionConstant.h"
#include "MySocketTCP.h"
#include "angleConversionConstant.h";
#include "angleConversionConstant.h"
#include "receiverInterface.h"

View File

@ -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", \

View File

@ -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();

View File

@ -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 {
};

View File

@ -72,7 +72,7 @@ class slsDetectorUsers
/** @short virtual destructor */
~slsDetectorUsers();
virtual ~slsDetectorUsers();

View File

@ -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;
}
}