finished removing using namespace std

This commit is contained in:
Erik Frojdh 2018-05-24 15:24:01 +02:00
parent 212218396a
commit 1dfdcfcb7e
29 changed files with 261 additions and 260 deletions

View File

@ -16,7 +16,7 @@
#include <math.h> #include <math.h>
using namespace std;

View File

@ -258,7 +258,7 @@ class multiSlsDetector : public slsDetectorUtils {
*/ */
multiSlsDetector(int id=0); multiSlsDetector(int id=0);
//slsDetector(string const fname); //slsDetector(std::string const fname);
/** destructor */ /** destructor */
virtual ~multiSlsDetector(); virtual ~multiSlsDetector();
@ -311,20 +311,20 @@ class multiSlsDetector : public slsDetectorUtils {
string setHostname(const char*, int pos=-1); std::string setHostname(const char*, int pos=-1);
string getHostname(int pos=-1); std::string getHostname(int pos=-1);
using slsDetectorBase::getDetectorType; using slsDetectorBase::getDetectorType;
string getDetectorType(){return sgetDetectorsType();}; std::string getDetectorType(){return sgetDetectorsType();};
detectorType getDetectorsType(int pos=-1); detectorType getDetectorsType(int pos=-1);
detectorType setDetectorsType(detectorType type=GET_DETECTOR_TYPE, int pos=-1){addSlsDetector(type, pos); return getDetectorsType(pos);}; detectorType setDetectorsType(detectorType type=GET_DETECTOR_TYPE, int pos=-1){addSlsDetector(type, pos); return getDetectorsType(pos);};
string sgetDetectorsType(int pos=-1); std::string sgetDetectorsType(int pos=-1);
string ssetDetectorsType(detectorType type=GET_DETECTOR_TYPE, int pos=-1){return getDetectorType(setDetectorsType(type, pos));}; // std::string ssetDetectorsType(detectorType type=GET_DETECTOR_TYPE, int pos=-1){return getDetectorType(setDetectorsType(type, pos));}; //
string ssetDetectorsType(string s, int pos=-1);//{return getDetectorType(setDetectorsType(getDetectorType(s),pos));}; // should decode detector type std::string ssetDetectorsType(std::string s, int pos=-1);//{return getDetectorType(setDetectorsType(getDetectorType(s),pos));}; // should decode detector type
/** adds a detector by id in position pos /** adds a detector by id in position pos
@ -440,7 +440,7 @@ class multiSlsDetector : public slsDetectorUtils {
/** checks if each of the detectors are online /** checks if each of the detectors are online
\returns online/offline status and -1 if any of the detector's online status is different from the other \returns online/offline status and -1 if any of the detector's online status is different from the other
*/ */
string checkOnline(); std::string checkOnline();
/** @short activates the detector (detector specific) /** @short activates the detector (detector specific)
\param enable can be: -1 returns wether the detector is in active (1) or inactive (0) state \param enable can be: -1 returns wether the detector is in active (1) or inactive (0) state
@ -465,13 +465,13 @@ class multiSlsDetector : public slsDetectorUtils {
/sa mythenDetector::readConfigurationFile /sa mythenDetector::readConfigurationFile
*/ */
int readConfigurationFile(string const fname); int readConfigurationFile(std::string const fname);
/** /**
Purely virtual function Purely virtual function
Should be implemented in the specific detector class Should be implemented in the specific detector class
/sa mythenDetector::writeConfigurationFile /sa mythenDetector::writeConfigurationFile
*/ */
int writeConfigurationFile(string const fname); int writeConfigurationFile(std::string const fname);
@ -532,7 +532,7 @@ class multiSlsDetector : public slsDetectorUtils {
int64_t getId(idMode mode, int imod=0); int64_t getId(idMode mode, int imod=0);
int digitalTest(digitalTestMode mode, int imod=0); int digitalTest(digitalTestMode mode, int imod=0);
int executeTrimming(trimMode mode, int par1, int par2, int imod=-1); int executeTrimming(trimMode mode, int par1, int par2, int imod=-1);
string getSettingsFile(); std::string getSettingsFile();
int decodeNMod(int i, int &idet, int &imod); int decodeNMod(int i, int &idet, int &imod);
@ -541,7 +541,7 @@ class multiSlsDetector : public slsDetectorUtils {
\param fname file name \param fname file name
\returns OK or FAIL \returns OK or FAIL
*/ */
int programFPGA(string fname); int programFPGA(std::string fname);
/** resets FPGA /** resets FPGA
\returns OK or FAIL \returns OK or FAIL
@ -561,10 +561,10 @@ class multiSlsDetector : public slsDetectorUtils {
int setAutoComparatorDisableMode(int ival= -1); int setAutoComparatorDisableMode(int ival= -1);
/** loads the modules settings/trimbits reading from a file - file name extension is automatically generated! */ /** loads the modules settings/trimbits reading from a file - file name extension is automatically generated! */
int loadSettingsFile(string fname, int nmod=-1); int loadSettingsFile(std::string fname, int nmod=-1);
/** gets the modules settings/trimbits and writes them to file - file name extension is automatically generated! */ /** gets the modules settings/trimbits and writes them to file - file name extension is automatically generated! */
int saveSettingsFile(string fname, int nmod=-1); int saveSettingsFile(std::string fname, int nmod=-1);
/** sets all the trimbits to a particular value /** sets all the trimbits to a particular value
@ -576,10 +576,10 @@ class multiSlsDetector : public slsDetectorUtils {
/** loads the modules calibration data reading from a file - file name extension is automatically generated! */ /** loads the modules calibration data reading from a file - file name extension is automatically generated! */
int loadCalibrationFile(string fname, int nmod=-1); int loadCalibrationFile(std::string fname, int nmod=-1);
/** gets the modules calibration data and writes them to file - file name extension is automatically generated! */ /** gets the modules calibration data and writes them to file - file name extension is automatically generated! */
int saveCalibrationFile(string fname, int nmod=-1); int saveCalibrationFile(std::string fname, int nmod=-1);
@ -796,7 +796,7 @@ class multiSlsDetector : public slsDetectorUtils {
\param fname name of the flat field file (or "" if disable) \param fname name of the flat field file (or "" if disable)
\returns 0 if disable (or file could not be read), >0 otherwise \returns 0 if disable (or file could not be read), >0 otherwise
*/ */
int setFlatFieldCorrection(string fname=""); int setFlatFieldCorrection(std::string fname="");
/** /**
set flat field corrections set flat field corrections
@ -853,7 +853,7 @@ class multiSlsDetector : public slsDetectorUtils {
\param fname file with bad channel list ("" disable) \param fname file with bad channel list ("" disable)
\returns 0 if bad channel disabled, >0 otherwise \returns 0 if bad channel disabled, >0 otherwise
*/ */
int setBadChannelCorrection(string fname=""); int setBadChannelCorrection(std::string fname="");
int setBadChannelCorrection(int nch, int *chs, int ff); int setBadChannelCorrection(int nch, int *chs, int ff);
@ -881,9 +881,9 @@ class multiSlsDetector : public slsDetectorUtils {
int readAngularConversionFile(string fname); int readAngularConversionFile(std::string fname);
int writeAngularConversion(string fname); int writeAngularConversion(std::string fname);
// double* convertAngles(double pos); // double* convertAngles(double pos);
@ -1049,7 +1049,7 @@ class multiSlsDetector : public slsDetectorUtils {
/** returns the detector trimbit/settings directory \sa sharedSlsDetector */ /** returns the detector trimbit/settings directory \sa sharedSlsDetector */
char* getSettingsDir(); char* getSettingsDir();
/** sets the detector trimbit/settings directory \sa sharedSlsDetector */ /** sets the detector trimbit/settings directory \sa sharedSlsDetector */
char* setSettingsDir(string s); char* setSettingsDir(std::string s);
/** /**
returns the location of the calibration files returns the location of the calibration files
\sa sharedSlsDetector \sa sharedSlsDetector
@ -1059,10 +1059,10 @@ class multiSlsDetector : public slsDetectorUtils {
sets the location of the calibration files sets the location of the calibration files
\sa sharedSlsDetector \sa sharedSlsDetector
*/ */
char* setCalDir(string s); char* setCalDir(std::string s);
string getNetworkParameter(networkParameter); std::string getNetworkParameter(networkParameter);
/** /**
sets the network parameters sets the network parameters
@ -1072,11 +1072,11 @@ class multiSlsDetector : public slsDetectorUtils {
\returns parameter \returns parameter
*/ */
string setNetworkParameter(networkParameter, std::string); std::string setNetworkParameter(networkParameter, std::string);
int setPort(portType, int); int setPort(portType, int);
int lockServer(int); int lockServer(int);
string getLastClientIP(); std::string getLastClientIP();
/** /**
configures mac for gotthard readout configures mac for gotthard readout
@ -1154,7 +1154,7 @@ class multiSlsDetector : public slsDetectorUtils {
\fname file name to load data from \fname file name to load data from
\returns OK or FAIL \returns OK or FAIL
*/ */
int loadImageToDetector(imageType index,string const fname); int loadImageToDetector(imageType index,std::string const fname);
/** /**
sets the value of s angular conversion parameter sets the value of s angular conversion parameter
@ -1179,7 +1179,7 @@ class multiSlsDetector : public slsDetectorUtils {
\sa mythenDetector::writeDataFile \sa mythenDetector::writeDataFile
*/ */
int writeDataFile(string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f', int nch=-1); int writeDataFile(std::string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f', int nch=-1);
/** /**
@ -1190,7 +1190,7 @@ class multiSlsDetector : public slsDetectorUtils {
\returns OK or FAIL if it could not write the file or data=NULL \returns OK or FAIL if it could not write the file or data=NULL
\sa mythenDetector::writeDataFile \sa mythenDetector::writeDataFile
*/ */
int writeDataFile(string fname, int *data); int writeDataFile(std::string fname, int *data);
/** /**
@ -1206,7 +1206,7 @@ class multiSlsDetector : public slsDetectorUtils {
\sa mythenDetector::readDataFile \sa mythenDetector::readDataFile
*/ */
int readDataFile(string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f'); int readDataFile(std::string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f');
/** /**
@ -1217,7 +1217,7 @@ class multiSlsDetector : public slsDetectorUtils {
\returns OK or FAIL if it could not read the file or data=NULL \returns OK or FAIL if it could not read the file or data=NULL
\sa mythenDetector::readDataFile \sa mythenDetector::readDataFile
*/ */
int readDataFile(string fname, int *data); int readDataFile(std::string fname, int *data);
/** /**
@ -1226,7 +1226,7 @@ class multiSlsDetector : public slsDetectorUtils {
\param fname file name to load data from \param fname file name to load data from
\returns OK or FAIL \returns OK or FAIL
*/ */
int writeCounterBlockFile(string const fname,int startACQ=0); int writeCounterBlockFile(std::string const fname,int startACQ=0);
/** /**
@ -1262,7 +1262,7 @@ class multiSlsDetector : public slsDetectorUtils {
/** /**
Checks if the receiver is really online Checks if the receiver is really online
*/ */
string checkReceiverOnline(); std::string checkReceiverOnline();
/** /**
@ -1270,14 +1270,14 @@ class multiSlsDetector : public slsDetectorUtils {
@param s file directory @param s file directory
\returns file dir \returns file dir
*/ */
string setFilePath(string s=""); std::string setFilePath(std::string s="");
/** /**
Sets up the file name Sets up the file name
@param s file name @param s file name
\returns file name \returns file name
*/ */
string setFileName(string s=""); std::string setFileName(std::string s="");
/** /**
Sets the max frames per file in receiver Sets the max frames per file in receiver
@ -1303,12 +1303,12 @@ class multiSlsDetector : public slsDetectorUtils {
/** /**
\returns file dir \returns file dir
*/ */
string getFilePath(){return setFilePath();}; std::string getFilePath(){return setFilePath();};
/** /**
\returns file name \returns file name
*/ */
string getFileName(){return setFileName();}; std::string getFileName(){return setFileName();};
/** /**
\returns file name \returns file name
@ -1385,7 +1385,7 @@ class multiSlsDetector : public slsDetectorUtils {
/** /**
Returns the IP of the last client connecting to the receiver Returns the IP of the last client connecting to the receiver
*/ */
string getReceiverLastClientIP(); std::string getReceiverLastClientIP();
/** /**
Turns off the receiver server! Turns off the receiver server!
@ -1411,9 +1411,9 @@ class multiSlsDetector : public slsDetectorUtils {
/**checks error mask and returns error message if it exists /**checks error mask and returns error message if it exists
* @param myDet is the multidetector object * @param myDet is the multidetector object
* @param critical is 1 if any of the messages is critical * @param critical is 1 if any of the messages is critical
/returns error message else an empty string /returns error message else an empty std::string
*/ */
string getErrorMessage(int &critical); std::string getErrorMessage(int &critical);
/** Clears error mask of both multi and sls /** Clears error mask of both multi and sls
/returns error mask /returns error mask
@ -1491,7 +1491,7 @@ class multiSlsDetector : public slsDetectorUtils {
@param fname pattern file to open @param fname pattern file to open
@returns OK/FAIL @returns OK/FAIL
*/ */
int setCTBPattern(string fname); int setCTBPattern(std::string fname);
/** Writes a pattern word to the CTB /** Writes a pattern word to the CTB

View File

@ -11,6 +11,7 @@
#include <math.h> #include <math.h>
#include "gitInfoLib.h" #include "gitInfoLib.h"
using namespace std;
int slsDetector::initSharedMemory(detectorType type, int id) { int slsDetector::initSharedMemory(detectorType type, int id) {

View File

@ -6,6 +6,8 @@
#include <cstdlib> #include <cstdlib>
#include <iomanip> #include <iomanip>
using namespace std;
/*! \mainpage Introduction /*! \mainpage Introduction
This program is intended to control the SLS detectors via command line interface. This program is intended to control the SLS detectors via command line interface.

View File

@ -26,68 +26,68 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
/* \param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition) */ /* \param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition) */
/* \returns answer string */ /* \returns answer string */
/* *\/ */ /* *\/ */
virtual string executeLine(int narg, char *args[], int action); virtual std::string executeLine(int narg, char *args[], int action);
/* /\** */ /* /\** */
/* returns the help for the executeLine command */ /* returns the help for the executeLine command */
/* \param os output stream to return the help to */ /* \param os output stream to return the help to */
/* \param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition) */ /* \param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition) */
/* *\/ */ /* *\/ */
string helpLine(int narg, char *args[], int action=HELP_ACTION); std::string helpLine(int narg, char *args[], int action=HELP_ACTION);
static string helpAcquire(int narg, char *args[], int action); static std::string helpAcquire(int narg, char *args[], int action);
static string helpData(int narg, char *args[], int action); static std::string helpData(int narg, char *args[], int action);
static string helpFrame(int narg, char *args[], int action); static std::string helpFrame(int narg, char *args[], int action);
static string helpStatus(int narg, char *args[], int action); static std::string helpStatus(int narg, char *args[], int action);
static string helpDataStream(int narg, char *args[], int action); static std::string helpDataStream(int narg, char *args[], int action);
static string helpFree(int narg, char *args[], int action); static std::string helpFree(int narg, char *args[], int action);
static string helpAdd(int narg, char *args[], int action); static std::string helpAdd(int narg, char *args[], int action);
static string helpRemove(int narg, char *args[], int action); static std::string helpRemove(int narg, char *args[], int action);
static string helpHostname(int narg, char *args[], int action); static std::string helpHostname(int narg, char *args[], int action);
static string helpId(int narg, char *args[], int action); static std::string helpId(int narg, char *args[], int action);
static string helpMaster(int narg, char *args[], int action); static std::string helpMaster(int narg, char *args[], int action);
static string helpSync(int narg, char *args[], int action); static std::string helpSync(int narg, char *args[], int action);
static string helpExitServer(int narg, char *args[], int action); static std::string helpExitServer(int narg, char *args[], int action);
static string helpSettingsDir(int narg, char *args[], int action); static std::string helpSettingsDir(int narg, char *args[], int action);
static string helpCalDir(int narg, char *args[], int action); static std::string helpCalDir(int narg, char *args[], int action);
static string helpTrimEn(int narg, char *args[], int action); static std::string helpTrimEn(int narg, char *args[], int action);
static string helpOutDir(int narg, char *args[], int action); static std::string helpOutDir(int narg, char *args[], int action);
static string helpFileName(int narg, char *args[], int action); static std::string helpFileName(int narg, char *args[], int action);
static string helpFileIndex(int narg, char *args[], int action); static std::string helpFileIndex(int narg, char *args[], int action);
static string helpFlatField(int narg, char *args[], int action); static std::string helpFlatField(int narg, char *args[], int action);
static string helpRateCorr(int narg, char *args[], int action); static std::string helpRateCorr(int narg, char *args[], int action);
static string helpBadChannels(int narg, char *args[], int action); static std::string helpBadChannels(int narg, char *args[], int action);
static string helpAngConv(int narg, char *args[], int action); static std::string helpAngConv(int narg, char *args[], int action);
static string helpThreaded(int narg, char *args[], int action); static std::string helpThreaded(int narg, char *args[], int action);
static string helpPositions(int narg, char *args[], int action); static std::string helpPositions(int narg, char *args[], int action);
static string helpScripts(int narg, char *args[], int action); static std::string helpScripts(int narg, char *args[], int action);
static string helpScans(int narg, char *args[], int action); static std::string helpScans(int narg, char *args[], int action);
static string helpNetworkParameter(int narg, char *args[], int action); static std::string helpNetworkParameter(int narg, char *args[], int action);
static string helpPort(int narg, char *args[], int action); static std::string helpPort(int narg, char *args[], int action);
static string helpLock(int narg, char *args[], int action); static std::string helpLock(int narg, char *args[], int action);
static string helpLastClient(int narg, char *args[], int action); static std::string helpLastClient(int narg, char *args[], int action);
static string helpOnline(int narg, char *args[], int action); static std::string helpOnline(int narg, char *args[], int action);
static string helpConfigureMac(int narg, char *args[], int action); static std::string helpConfigureMac(int narg, char *args[], int action);
static string helpDetectorSize(int narg, char *args[], int action); static std::string helpDetectorSize(int narg, char *args[], int action);
static string helpSettings(int narg, char *args[], int action); static std::string helpSettings(int narg, char *args[], int action);
static string helpSN(int narg, char *args[], int action); static std::string helpSN(int narg, char *args[], int action);
static string helpDigiTest(int narg, char *args[], int action); static std::string helpDigiTest(int narg, char *args[], int action);
static string helpRegister(int narg, char *args[], int action); static std::string helpRegister(int narg, char *args[], int action);
static string helpDAC(int narg, char *args[], int action); static std::string helpDAC(int narg, char *args[], int action);
static string helpTimer(int narg, char *args[], int action); static std::string helpTimer(int narg, char *args[], int action);
static string helpTiming(int narg, char *args[], int action); static std::string helpTiming(int narg, char *args[], int action);
static string helpTimeLeft(int narg, char *args[], int action); static std::string helpTimeLeft(int narg, char *args[], int action);
static string helpSpeed(int narg, char *args[], int action); static std::string helpSpeed(int narg, char *args[], int action);
static string helpAdvanced(int narg, char *args[], int action); static std::string helpAdvanced(int narg, char *args[], int action);
static string helpConfiguration(int narg, char *args[], int action); static std::string helpConfiguration(int narg, char *args[], int action);
static string helpImage(int narg, char *args[], int action); static std::string helpImage(int narg, char *args[], int action);
static string helpCounter(int narg, char *args[], int action); static std::string helpCounter(int narg, char *args[], int action);
static string helpADC(int narg, char *args[], int action); static std::string helpADC(int narg, char *args[], int action);
static string helpTempControl(int narg, char *args[], int action); static std::string helpTempControl(int narg, char *args[], int action);
static string helpEnablefwrite(int narg, char *args[], int action); static std::string helpEnablefwrite(int narg, char *args[], int action);
static string helpOverwrite(int narg, char *args[], int action); static std::string helpOverwrite(int narg, char *args[], int action);
static string helpReceiver(int narg, char *args[], int action); static std::string helpReceiver(int narg, char *args[], int action);
static string helpPattern(int narg, char *args[], int action); static std::string helpPattern(int narg, char *args[], int action);
static string helpPulse(int narg, char *args[], int action); static std::string helpPulse(int narg, char *args[], int action);
@ -105,74 +105,74 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
slsDetectorUtils *myDet; slsDetectorUtils *myDet;
string cmdUnderDevelopment(int narg, char *args[], int action); std::string cmdUnderDevelopment(int narg, char *args[], int action);
string cmdUnknown(int narg, char *args[], int action); std::string cmdUnknown(int narg, char *args[], int action);
string cmdAcquire(int narg, char *args[], int action); std::string cmdAcquire(int narg, char *args[], int action);
string cmdData(int narg, char *args[], int action); std::string cmdData(int narg, char *args[], int action);
string cmdFrame(int narg, char *args[], int action); std::string cmdFrame(int narg, char *args[], int action);
string cmdStatus(int narg, char *args[], int action); std::string cmdStatus(int narg, char *args[], int action);
string cmdDataStream(int narg, char *args[], int action); std::string cmdDataStream(int narg, char *args[], int action);
string cmdFree(int narg, char *args[], int action); std::string cmdFree(int narg, char *args[], int action);
string cmdAdd(int narg, char *args[], int action); std::string cmdAdd(int narg, char *args[], int action);
string cmdRemove(int narg, char *args[], int action); std::string cmdRemove(int narg, char *args[], int action);
string cmdHostname(int narg, char *args[], int action); std::string cmdHostname(int narg, char *args[], int action);
string cmdId(int narg, char *args[], int action); std::string cmdId(int narg, char *args[], int action);
string cmdMaster(int narg, char *args[], int action); std::string cmdMaster(int narg, char *args[], int action);
string cmdSync(int narg, char *args[], int action); std::string cmdSync(int narg, char *args[], int action);
string cmdHelp(int narg, char *args[], int action); std::string cmdHelp(int narg, char *args[], int action);
string cmdExitServer(int narg, char *args[], int action); std::string cmdExitServer(int narg, char *args[], int action);
string cmdSettingsDir(int narg, char *args[], int action); std::string cmdSettingsDir(int narg, char *args[], int action);
string cmdCalDir(int narg, char *args[], int action); std::string cmdCalDir(int narg, char *args[], int action);
string cmdTrimEn(int narg, char *args[], int action); std::string cmdTrimEn(int narg, char *args[], int action);
string cmdOutDir(int narg, char *args[], int action); std::string cmdOutDir(int narg, char *args[], int action);
string cmdFileName(int narg, char *args[], int action); std::string cmdFileName(int narg, char *args[], int action);
string cmdFileIndex(int narg, char *args[], int action); std::string cmdFileIndex(int narg, char *args[], int action);
string cmdFlatField(int narg, char *args[], int action); std::string cmdFlatField(int narg, char *args[], int action);
string cmdRateCorr(int narg, char *args[], int action); std::string cmdRateCorr(int narg, char *args[], int action);
string cmdBadChannels(int narg, char *args[], int action); std::string cmdBadChannels(int narg, char *args[], int action);
string cmdAngConv(int narg, char *args[], int action); std::string cmdAngConv(int narg, char *args[], int action);
string cmdThreaded(int narg, char *args[], int action); std::string cmdThreaded(int narg, char *args[], int action);
string cmdPositions(int narg, char *args[], int action); std::string cmdPositions(int narg, char *args[], int action);
string cmdScripts(int narg, char *args[], int action); std::string cmdScripts(int narg, char *args[], int action);
string cmdScans(int narg, char *args[], int action); std::string cmdScans(int narg, char *args[], int action);
string cmdNetworkParameter(int narg, char *args[], int action); std::string cmdNetworkParameter(int narg, char *args[], int action);
string cmdPort(int narg, char *args[], int action); std::string cmdPort(int narg, char *args[], int action);
string cmdLock(int narg, char *args[], int action); std::string cmdLock(int narg, char *args[], int action);
string cmdLastClient(int narg, char *args[], int action); std::string cmdLastClient(int narg, char *args[], int action);
string cmdOnline(int narg, char *args[], int action); std::string cmdOnline(int narg, char *args[], int action);
string cmdConfigureMac(int narg, char *args[], int action); std::string cmdConfigureMac(int narg, char *args[], int action);
string cmdDetectorSize(int narg, char *args[], int action); std::string cmdDetectorSize(int narg, char *args[], int action);
string cmdSettings(int narg, char *args[], int action); std::string cmdSettings(int narg, char *args[], int action);
string cmdSN(int narg, char *args[], int action); std::string cmdSN(int narg, char *args[], int action);
string cmdDigiTest(int narg, char *args[], int action); std::string cmdDigiTest(int narg, char *args[], int action);
string cmdRegister(int narg, char *args[], int action); std::string cmdRegister(int narg, char *args[], int action);
string cmdDAC(int narg, char *args[], int action); std::string cmdDAC(int narg, char *args[], int action);
string cmdTiming(int narg, char *args[], int action); std::string cmdTiming(int narg, char *args[], int action);
string cmdTimer(int narg, char *args[], int action); std::string cmdTimer(int narg, char *args[], int action);
string cmdTimeLeft(int narg, char *args[], int action); std::string cmdTimeLeft(int narg, char *args[], int action);
string cmdSpeed(int narg, char *args[], int action); std::string cmdSpeed(int narg, char *args[], int action);
string cmdAdvanced(int narg, char *args[], int action); std::string cmdAdvanced(int narg, char *args[], int action);
string cmdConfiguration(int narg, char *args[], int action); std::string cmdConfiguration(int narg, char *args[], int action);
string cmdImage(int narg, char *args[], int action); std::string cmdImage(int narg, char *args[], int action);
string cmdCounter(int narg, char *args[], int action); std::string cmdCounter(int narg, char *args[], int action);
string cmdADC(int narg, char *args[], int action); std::string cmdADC(int narg, char *args[], int action);
string cmdTempControl(int narg, char *args[], int action); std::string cmdTempControl(int narg, char *args[], int action);
string cmdEnablefwrite(int narg, char *args[], int action); std::string cmdEnablefwrite(int narg, char *args[], int action);
string cmdOverwrite(int narg, char *args[], int action); std::string cmdOverwrite(int narg, char *args[], int action);
string cmdReceiver(int narg, char *args[], int action); std::string cmdReceiver(int narg, char *args[], int action);
string cmdPattern(int narg, char *args[], int action); std::string cmdPattern(int narg, char *args[], int action);
string cmdPulse(int narg, char *args[], int action); std::string cmdPulse(int narg, char *args[], int action);
int numberOfCommands; int numberOfCommands;
string cmd; std::string cmd;
typedef string (slsDetectorCommand::*MemFuncGetter)(int narg, char *args[], int action); typedef std::string (slsDetectorCommand::*MemFuncGetter)(int narg, char *args[], int action);
struct FuncTable struct FuncTable
{ {
string m_pFuncName; std::string m_pFuncName;
//const char* m_pFuncName; //const char* m_pFuncName;
MemFuncGetter m_pFuncPtr; MemFuncGetter m_pFuncPtr;
}; };

View File

@ -9,7 +9,9 @@
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/shm.h> #include <sys/shm.h>
#include <time.h> //clock() #include <time.h> //clock()
#include <string>
using namespace std; using namespace std;
slsDetectorUtils::slsDetectorUtils() { slsDetectorUtils::slsDetectorUtils() {

View File

@ -110,7 +110,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
*/ */
int setReceiverDataStreamingOutPort(int i) { \ int setReceiverDataStreamingOutPort(int i) { \
if (i >= 0) { \ if (i >= 0) { \
ostringstream ss; ss << i; string s = ss.str(); \ std::ostringstream ss; ss << i; std::string s = ss.str(); \
int prev_streaming = enableDataStreamingFromReceiver(); \ int prev_streaming = enableDataStreamingFromReceiver(); \
setNetworkParameter(RECEIVER_STREAMING_PORT, s); \ setNetworkParameter(RECEIVER_STREAMING_PORT, s); \
if (prev_streaming) { \ if (prev_streaming) { \
@ -126,7 +126,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
*/ */
int setClientDataStreamingInPort(int i){ \ int setClientDataStreamingInPort(int i){ \
if (i >= 0) { \ if (i >= 0) { \
ostringstream ss; ss << i; string s = ss.str(); \ std::ostringstream ss; ss << i; std::string s = ss.str(); \
int prev_streaming = enableDataStreamingToClient(); \ int prev_streaming = enableDataStreamingToClient(); \
setNetworkParameter(CLIENT_STREAMING_PORT, s); \ setNetworkParameter(CLIENT_STREAMING_PORT, s); \
if (prev_streaming) { \ if (prev_streaming) { \
@ -140,7 +140,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
* @param i sets, -1 gets * @param i sets, -1 gets
* @returns receiver streaming out ZMQ port * @returns receiver streaming out ZMQ port
*/ */
string setReceiverDataStreamingOutIP(string ip) { \ std::string setReceiverDataStreamingOutIP(std::string ip) { \
if (ip.length()) { \ if (ip.length()) { \
int prev_streaming = enableDataStreamingFromReceiver(); \ int prev_streaming = enableDataStreamingFromReceiver(); \
setNetworkParameter(RECEIVER_STREAMING_SRC_IP, ip); \ setNetworkParameter(RECEIVER_STREAMING_SRC_IP, ip); \
@ -155,7 +155,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
* @param i sets, -1 gets * @param i sets, -1 gets
* @returns client streaming in ZMQ port * @returns client streaming in ZMQ port
*/ */
string setClientDataStreamingInIP(string ip){ \ std::string setClientDataStreamingInIP(std::string ip){ \
if (ip.length()) { \ if (ip.length()) { \
int prev_streaming = enableDataStreamingToClient(); \ int prev_streaming = enableDataStreamingToClient(); \
setNetworkParameter(CLIENT_STREAMING_SRC_IP, ip); \ setNetworkParameter(CLIENT_STREAMING_SRC_IP, ip); \
@ -199,7 +199,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\param pos position in the multi detector structure (is -1 returns concatenated hostnames divided by a +) \param pos position in the multi detector structure (is -1 returns concatenated hostnames divided by a +)
\returns hostname \returns hostname
*/ */
virtual string getHostname(int pos=-1)=0; virtual std::string getHostname(int pos=-1)=0;
/** sets the detector hostname /** sets the detector hostname
@ -207,22 +207,22 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\param pos position in the multi detector structure (is -1 expects concatenated hostnames divided by a +) \param pos position in the multi detector structure (is -1 expects concatenated hostnames divided by a +)
\returns hostname \returns hostname
*/ */
virtual string setHostname(const char* name, int pos=-1)=0; virtual std::string setHostname(const char* name, int pos=-1)=0;
/** returns the detector type /** returns the detector type
\param pos position in the multi detector structure (is -1 returns type of detector with id -1) \param pos position in the multi detector structure (is -1 returns type of detector with id -1)
\returns type \returns type
*/ */
virtual string sgetDetectorsType(int pos=-1)=0; virtual std::string sgetDetectorsType(int pos=-1)=0;
/** returns the detector type /** returns the detector type
\param pos position in the multi detector structure (is -1 returns type of detector with id -1) \param pos position in the multi detector structure (is -1 returns type of detector with id -1)
\returns type \returns type
*/ */
virtual detectorType setDetectorsType(detectorType t=GET_DETECTOR_TYPE, int pos=-1)=0; virtual detectorType setDetectorsType(detectorType t=GET_DETECTOR_TYPE, int pos=-1)=0;
virtual string ssetDetectorsType(detectorType t=GET_DETECTOR_TYPE, int pos=-1)=0; virtual std::string ssetDetectorsType(detectorType t=GET_DETECTOR_TYPE, int pos=-1)=0;
virtual string ssetDetectorsType(string s, int pos=-1)=0; virtual std::string ssetDetectorsType(std::string s, int pos=-1)=0;
@ -247,7 +247,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\returns parameter \returns parameter
*/ */
virtual string getNetworkParameter(networkParameter i)=0; virtual std::string getNetworkParameter(networkParameter i)=0;
/** /**
sets the network parameters sets the network parameters
@ -257,14 +257,14 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\returns parameter \returns parameter
*/ */
virtual string setNetworkParameter(networkParameter i, string s)=0; virtual std::string setNetworkParameter(networkParameter i, std::string s)=0;
int setFlowControl10G(int i = -1) { int setFlowControl10G(int i = -1) {
string sret=""; std::string sret="";
if (i != -1) { if (i != -1) {
ostringstream o; std::ostringstream o;
o << ((i >= 1) ? 1 : 0); o << ((i >= 1) ? 1 : 0);
string sval = o.str(); std::string sval = o.str();
sret = setNetworkParameter(FLOW_CONTROL_10G, sval); sret = setNetworkParameter(FLOW_CONTROL_10G, sval);
} else } else
sret = getNetworkParameter(FLOW_CONTROL_10G); sret = getNetworkParameter(FLOW_CONTROL_10G);
@ -284,7 +284,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
checks if the detector(s) are online/offline checks if the detector(s) are online/offline
\returns hostname if offline \returns hostname if offline
*/ */
virtual string checkOnline()=0; virtual std::string checkOnline()=0;
/** /**
Digital test of the modules Digital test of the modules
@ -308,7 +308,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/** /**
returns currently the loaded trimfile/settingsfile name returns currently the loaded trimfile/settingsfile name
*/ */
virtual string getSettingsFile()=0; virtual std::string getSettingsFile()=0;
/** /**
@ -382,7 +382,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
int setBadChannelCorrection(string fname, int &nbadtot, int *badchanlist, int off=0); int setBadChannelCorrection(std::string fname, int &nbadtot, int *badchanlist, int off=0);
@ -408,7 +408,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
virtual char* getSettingsDir()=0; virtual char* getSettingsDir()=0;
/** sets the detector trimbit/settings directory */ /** sets the detector trimbit/settings directory */
virtual char* setSettingsDir(string s)=0; virtual char* setSettingsDir(std::string s)=0;
/** /**
returns the location of the calibration files returns the location of the calibration files
@ -418,7 +418,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/** /**
sets the location of the calibration files sets the location of the calibration files
*/ */
virtual char* setCalDir(string s)=0; virtual char* setCalDir(std::string s)=0;
/** Frees the shared memory - should not be used except for debugging*/ /** Frees the shared memory - should not be used except for debugging*/
virtual int freeSharedMemory()=0; virtual int freeSharedMemory()=0;
@ -467,7 +467,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\fname file name to load data from \fname file name to load data from
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int loadImageToDetector(imageType index,string const fname)=0; virtual int loadImageToDetector(imageType index,std::string const fname)=0;
/** /**
@ -476,7 +476,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\fname file fname to load data from \fname file fname to load data from
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int writeCounterBlockFile(string const fname,int startACQ=0)=0; virtual int writeCounterBlockFile(std::string const fname,int startACQ=0)=0;
/** /**
@ -606,7 +606,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/** /**
Returns the IP of the last client connecting to the detector Returns the IP of the last client connecting to the detector
*/ */
virtual string getLastClientIP()=0; virtual std::string getLastClientIP()=0;
@ -623,13 +623,13 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\param imod module number, -1 means all modules \param imod module number, -1 means all modules
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int loadSettingsFile(string fname, int imod=-1)=0; virtual int loadSettingsFile(std::string fname, int imod=-1)=0;
/** programs FPGA with pof file /** programs FPGA with pof file
\param fname file name \param fname file name
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int programFPGA(string fname)=0; virtual int programFPGA(std::string fname)=0;
/** resets FPGA /** resets FPGA
\returns OK or FAIL \returns OK or FAIL
@ -653,7 +653,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\param imod module number, -1 means all modules \param imod module number, -1 means all modules
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int saveSettingsFile(string fname, int imod=-1)=0; virtual int saveSettingsFile(std::string fname, int imod=-1)=0;
/** sets all the trimbits to a particular value /** sets all the trimbits to a particular value
\param val trimbit value \param val trimbit value
@ -723,7 +723,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\param fname file name \param fname file name
\returns OK or FAIL \returns OK or FAIL
*/ */
virtual int writeConfigurationFile(string const fname)=0; virtual int writeConfigurationFile(std::string const fname)=0;
void registerGetPositionCallback( double (*func)(void*),void *arg){get_position=func; POarg=arg;}; void registerGetPositionCallback( double (*func)(void*),void *arg){get_position=func; POarg=arg;};
@ -747,7 +747,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\returns OK or FAIL \returns OK or FAIL
*/ */
int dumpDetectorSetup(string const fname, int level=0); int dumpDetectorSetup(std::string const fname, int level=0);
/** /**
@ -757,7 +757,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
\returns OK or FAIL \returns OK or FAIL
*/ */
int retrieveDetectorSetup(string const fname, int level=0); int retrieveDetectorSetup(std::string const fname, int level=0);
static int dummyAcquisitionFinished(double prog,int status,void* p){cout <<"Acquisition finished callback! " << prog << " " << status << endl; return 0;} static int dummyAcquisitionFinished(double prog,int status,void* p){cout <<"Acquisition finished callback! " << prog << " " << status << endl; return 0;}
static int dummyMeasurementFinished(int im,int findex,void* p){cout <<"Measurement finished callback! " << im << " " << findex << endl; return 0;} static int dummyMeasurementFinished(int im,int findex,void* p){cout <<"Measurement finished callback! " << im << " " << findex << endl; return 0;}
@ -771,12 +771,12 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/** /**
Checks if the receiver is really online Checks if the receiver is really online
*/ */
virtual string checkReceiverOnline()=0; virtual std::string checkReceiverOnline()=0;
/** /**
Returns the IP of the last client connecting to the receiver Returns the IP of the last client connecting to the receiver
*/ */
virtual string getReceiverLastClientIP()=0; virtual std::string getReceiverLastClientIP()=0;
/** /**
@ -784,14 +784,14 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
@param fileName fileDir file directory @param fileName fileDir file directory
\returns file dir \returns file dir
*/ */
virtual string setFilePath(string s="")=0; virtual std::string setFilePath(std::string s="")=0;
/** /**
Sets up the file name Sets up the file name
@param fileName file name @param fileName file name
\returns file name \returns file name
*/ */
virtual string setFileName(string s="")=0; virtual std::string setFileName(std::string s="")=0;
/** /**
Sets the max frames per file in receiver Sets the max frames per file in receiver
@ -811,12 +811,12 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/** /**
\returns file dir \returns file dir
*/ */
virtual string getFilePath()=0; virtual std::string getFilePath()=0;
/** /**
\returns file name \returns file name
*/ */
virtual string getFileName()=0; virtual std::string getFileName()=0;
/** /**
\returns file name \returns file name
@ -950,7 +950,7 @@ virtual int setReceiverSilentMode(int i = -1)=0;
@param fname pattern file to open @param fname pattern file to open
@returns OK/FAIL @returns OK/FAIL
*/ */
virtual int setCTBPattern(string fname)=0; virtual int setCTBPattern(std::string fname)=0;
/** Writes a pattern word to the CTB /** Writes a pattern word to the CTB

View File

@ -12,7 +12,7 @@
#include <queue> #include <queue>
#include <math.h> #include <math.h>
using namespace std; ;
/** /**
@short class handling the data file I/O flags @short class handling the data file I/O flags
*/ */

View File

@ -13,7 +13,7 @@
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#endif #endif
using namespace std; ;
class angCalLogClass { class angCalLogClass {
@ -27,7 +27,7 @@ class angCalLogClass {
char *argv[2]; \ char *argv[2]; \
argv[0]=cmd; \ argv[0]=cmd; \
sprintf(cmd,"_%d.angcal",det->getFileIndex()); \ sprintf(cmd,"_%d.angcal",det->getFileIndex()); \
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \ outfile.open( std::string(det->getFilePath()+ std::string("/")+det->getFileName()+ std::string(cmd)).c_str()); \
outfile.precision(8); outfile.precision(8);
myDet=new slsDetectorCommand(det); \ myDet=new slsDetectorCommand(det); \
if (outfile.is_open()) { \ if (outfile.is_open()) { \
@ -44,12 +44,12 @@ class angCalLogClass {
#endif #endif
int addStep(double pos, string fname) {std::cout.precision(5); outfile << pos << " " << fname << endl; return 0;}; int addStep(double pos, std::string fname) {std::cout.precision(5); outfile << pos << " " << fname << endl; return 0;};
// //
int readHeader(ifstream &infile, int &maxmod, int &nmod, int &chanspermod, char *angconvfile, double &globaloff, double &fineoff, int &angdir, char *ffdir, char *fffile, char *badfile ) { \ int readHeader(std::ifstream &infile, int &maxmod, int &nmod, int &chanspermod, char *angconvfile, double &globaloff, double &fineoff, int &angdir, char *ffdir, char *fffile, char *badfile ) { \
nmod=0; chanspermod=0; globaloff=0; fineoff=0; angdir=1; \ nmod=0; chanspermod=0; globaloff=0; fineoff=0; angdir=1; \
strcpy(angconvfile,"none"); strcpy(ffdir,"none"); strcpy(fffile,"none"); strcpy(badfile,"none"); \ strcpy(angconvfile,"none"); strcpy(ffdir,"none"); strcpy(fffile,"none"); strcpy(badfile,"none"); \
char line[1000], myvar[100], myarg[100]; \ char line[1000], myvar[100], myarg[100]; \
@ -57,14 +57,14 @@ class angCalLogClass {
for (int iv=0; iv<nvars; iv++) { \ for (int iv=0; iv<nvars; iv++) { \
infile.getline(line,1000); \ infile.getline(line,1000); \
sscanf(line,"%s %s", myvar, myarg); \ sscanf(line,"%s %s", myvar, myarg); \
if (string(myvar)!=string(vars[iv])) if ( std::string(myvar)!= std::string(vars[iv]))
cout << "Found variable " << myvar << " instead of " << vars[iv] << endl; cout << "Found variable " << myvar << " instead of " << vars[iv] << endl;
else else
switch (iv) { \ switch (iv) { \
case 0: \ case 0: \
if (string(myarg).find("Mythen")!=string::npos) \ if ( std::string(myarg).find("Mythen")!= std::string::npos) \
chanspermod=1280; \ chanspermod=1280; \
else if (string(myarg).find("Gotthard")!=string::npos) \ else if ( std::string(myarg).find("Gotthard")!= std::string::npos) \
chanspermod=1280; \ chanspermod=1280; \
else \ else \
chanspermod=65535; \ chanspermod=65535; \
@ -106,7 +106,7 @@ class angCalLogClass {
return 0; \ return 0; \
}; };
int getStep(ifstream &infile, double &threshold, char *datafname){ \ int getStep(std::ifstream &infile, double &threshold, char *datafname){ \
char line[1000]; \ char line[1000]; \
float v; float v;
infile.getline(line,1000); \ infile.getline(line,1000); \
@ -140,7 +140,7 @@ class angCalLogClass {
#ifndef MYROOT #ifndef MYROOT
slsDetectorCommand *myDet; slsDetectorCommand *myDet;
#endif #endif
ofstream outfile; std::ofstream outfile;
char vars[100][100]; char vars[100][100];
int nvars; int nvars;

View File

@ -19,7 +19,7 @@
//double angle(int ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) //double angle(int ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction)
// using namespace std; //
/** /**
@short Angular conversion constants needed for a detector module @short Angular conversion constants needed for a detector module
@ -256,7 +256,7 @@ class angularConversion : public virtual slsDetectorBase, public angularConversi
/** /**
returns the angular conversion file returns the angular conversion file
*/ */
std::string getAngularConversionFile(){if (setAngularCorrectionMask()) return string(angConvFile); else return string("none");}; std::string getAngularConversionFile(){if (setAngularCorrectionMask()) return std::string(angConvFile); else return std::string("none");};
/** /**

View File

@ -19,7 +19,7 @@
class angleConversionConstant; class angleConversionConstant;
using namespace std; ;
/** /**
@short Angular conversion constants needed for a detector module @short Angular conversion constants needed for a detector module
@ -47,7 +47,7 @@ class angularConversionStatic
//virtual int readAngularConversion(string fname)=0; //virtual int readAngularConversion(std::string fname)=0;
@ -60,7 +60,7 @@ class angularConversionStatic
\param angOff pointer to array of angleConversionConstants \param angOff pointer to array of angleConversionConstants
\returns OK or FAIL \returns OK or FAIL
*/ */
static int readAngularConversion(string fname, int nmod, angleConversionConstant *angOff); static int readAngularConversion(std::string fname, int nmod, angleConversionConstant *angOff);
/** /**
reads an angular conversion file reads an angular conversion file
@ -70,7 +70,7 @@ class angularConversionStatic
\returns OK or FAIL \returns OK or FAIL
*/ */
static int readAngularConversion(ifstream& ifs, int nmod, angleConversionConstant *angOff); static int readAngularConversion(std::ifstream& ifs, int nmod, angleConversionConstant *angOff);
/** /**
writes an angular conversion file writes an angular conversion file
\param fname file to be written \param fname file to be written
@ -78,7 +78,7 @@ class angularConversionStatic
\param angOff pointer to array of angleConversionConstants \param angOff pointer to array of angleConversionConstants
\returns OK or FAIL \returns OK or FAIL
*/ */
static int writeAngularConversion(string fname, int nmod, angleConversionConstant *angOff); static int writeAngularConversion(std::string fname, int nmod, angleConversionConstant *angOff);
/** /**
writes an angular conversion file writes an angular conversion file
@ -87,7 +87,7 @@ class angularConversionStatic
\param angOff pointer to array of angleConversionConstants \param angOff pointer to array of angleConversionConstants
\returns OK or FAIL \returns OK or FAIL
*/ */
static int writeAngularConversion(ofstream& ofs, int nmod, angleConversionConstant *angOff); static int writeAngularConversion(std::ofstream& ofs, int nmod, angleConversionConstant *angOff);
/** /**
sets the arrays of the merged data to 0. NB The array should be created with size nbins >= 360./getBinSize(); sets the arrays of the merged data to 0. NB The array should be created with size nbins >= 360./getBinSize();

View File

@ -7,16 +7,16 @@
#include <sstream> #include <sstream>
#include <string.h> #include <string.h>
// using namespace std; //
class badChannelCorrections{ class badChannelCorrections{
public: public:
static int readBadChannelCorrectionFile(std::string fname, int &nbad, int *badlist){ ifstream infile(fname.c_str()); int nb=-1; if (infile.is_open()) {nb=readBadChannelCorrectionFile(infile,nbad,badlist); infile.close();}; return nb;}; static int readBadChannelCorrectionFile(std::string fname, int &nbad, int *badlist){ std::ifstream infile(fname.c_str()); int nb=-1; if (infile.is_open()) {nb=readBadChannelCorrectionFile(infile,nbad,badlist); infile.close();}; return nb;};
static int readBadChannelCorrectionFile(ifstream &infile, int &nbad, int *badlist, int moff=0){ \ static int readBadChannelCorrectionFile(std::ifstream &infile, int &nbad, int *badlist, int moff=0){ \
int interrupt=0; \ int interrupt=0; \
int ich; \ int ich; \
int chmin,chmax; \ int chmin,chmax; \
@ -30,7 +30,7 @@ class badChannelCorrections{
interrupt=1; \ interrupt=1; \
break; \ break; \
} \ } \
if (str.find('-')!=string::npos) { \ if (str.find('-')!=std::string::npos) { \
ssstr >> chmin ; \ ssstr >> chmin ; \
ssstr.str(str.substr(str.find('-')+1,str.size())); \ ssstr.str(str.substr(str.find('-')+1,str.size())); \
ssstr >> chmax; \ ssstr >> chmax; \
@ -47,7 +47,7 @@ class badChannelCorrections{
return nbad; }; return nbad; };
static int setBadChannelCorrection(ifstream &infile, int &nbad, int *badlist, int moff){ \ static int setBadChannelCorrection(std::ifstream &infile, int &nbad, int *badlist, int moff){ \
int retval=readBadChannelCorrectionFile(infile,nbad,badlist); \ int retval=readBadChannelCorrectionFile(infile,nbad,badlist); \
for (int ich=0; ich<nbad; ich++) { badlist[ich]=badlist[ich]+moff; }; \ for (int ich=0; ich<nbad; ich++) { badlist[ich]=badlist[ich]+moff; }; \
return retval; \ return retval; \

View File

@ -15,7 +15,7 @@
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#endif #endif
using namespace std; ;
class enCalLogClass { class enCalLogClass {
@ -32,7 +32,7 @@ class enCalLogClass {
strcpy(vars[3],"modulenumber"); \ strcpy(vars[3],"modulenumber"); \
argv[0]=cmd; \ argv[0]=cmd; \
sprintf(cmd,"_%d.encal",det->getFileIndex()); \ sprintf(cmd,"_%d.encal",det->getFileIndex()); \
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \ outfile.open(std::string(det->getFilePath()+std::string("/")+det->getFileName()+std::string(cmd)).c_str()); \
myDet=new slsDetectorCommand(det); \ myDet=new slsDetectorCommand(det); \
strcpy(cmd,vars[0]); \ strcpy(cmd,vars[0]); \
outfile << cmd << " " << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \ outfile << cmd << " " << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
@ -58,12 +58,12 @@ class enCalLogClass {
#endif #endif
int addStep(double threshold, string fname) {outfile << threshold << " " << fname << endl; return 0;}; int addStep(double threshold, std::string fname) {outfile << threshold << " " << fname << endl; return 0;};
// //
int readHeader(ifstream &infile, char *settings, int &nmod, int &chanspermod, int *mods ) { \ int readHeader(std::ifstream &infile, char *settings, int &nmod, int &chanspermod, int *mods ) { \
nmod=0; strcpy(settings,"unknown"); chanspermod=0; \ nmod=0; strcpy(settings,"unknown"); chanspermod=0; \
char line[1000],myarg[100]; \ char line[1000],myarg[100]; \
int dum; \ int dum; \
@ -75,9 +75,9 @@ class enCalLogClass {
break; \ break; \
case 1: \ case 1: \
sscanf(line,"type %s", myarg); \ sscanf(line,"type %s", myarg); \
if (string(myarg).find("Mythen")!=string::npos) \ if (std::string(myarg).find("Mythen")!=std::string::npos) \
chanspermod=1280; \ chanspermod=1280; \
else if (string(myarg).find("Gotthard")!=string::npos) \ else if (std::string(myarg).find("Gotthard")!=std::string::npos) \
chanspermod=1280; \ chanspermod=1280; \
else \ else \
chanspermod=65535; \ chanspermod=65535; \
@ -101,7 +101,7 @@ class enCalLogClass {
return 0; \ return 0; \
}; };
int getStep(ifstream &infile, double &threshold, char *datafname){ \ int getStep(std::ifstream &infile, double &threshold, char *datafname){ \
char line[1000]; \ char line[1000]; \
float v; float v;
infile.getline(line,1000); \ infile.getline(line,1000); \
@ -122,7 +122,7 @@ class enCalLogClass {
#ifndef MYROOT #ifndef MYROOT
slsDetectorCommand *myDet; slsDetectorCommand *myDet;
#endif #endif
ofstream outfile; std::ofstream outfile;
char vars[4][100]; char vars[4][100];
}; };

View File

@ -16,7 +16,7 @@ class TGraphErrors;
#endif #endif
using namespace std;

View File

@ -13,7 +13,7 @@
#include <cmath> #include <cmath>
#include <string> #include <string>
using namespace std;
/** /**
@short class handling the energy calibration and trim files IO @short class handling the energy calibration and trim files IO
*/ */
@ -39,7 +39,7 @@ class energyConversion
\returns OK if successful, else FAIL or -1 \returns OK if successful, else FAIL or -1
*/ */
static int readCalibrationFile(string fname, double &gain, double &offset); static int readCalibrationFile(std::string fname, double &gain, double &offset);
/** /**
writes a calibration file writes a calibration file
@ -48,7 +48,7 @@ class energyConversion
\param offset \param offset
\returns OK if successful, else FAIL or -1 \returns OK if successful, else FAIL or -1
*/ */
static int writeCalibrationFile(string fname, double gain, double offset); static int writeCalibrationFile(std::string fname, double gain, double offset);
/** /**
reads a calibration file reads a calibration file
@ -57,7 +57,7 @@ class energyConversion
\param offset reference to the offset variable \param offset reference to the offset variable
\returns OK if successful, else FAIL or -1 \returns OK if successful, else FAIL or -1
*/ */
static int readCalibrationFile(string fname, int *gain, int *offset); static int readCalibrationFile(std::string fname, int *gain, int *offset);
/** /**
writes a calibration file writes a calibration file
@ -66,7 +66,7 @@ class energyConversion
\param offset reference to the offset variable \param offset reference to the offset variable
\returns OK if successful, else FAIL or -1 \returns OK if successful, else FAIL or -1
*/ */
static int writeCalibrationFile(string fname, int *gain, int *offset); static int writeCalibrationFile(std::string fname, int *gain, int *offset);
@ -108,7 +108,7 @@ class energyConversion
\returns the pointer to myMod or NULL if reading the file failed \returns the pointer to myMod or NULL if reading the file failed
*/ */
sls_detector_module* readSettingsFile(string fname, detectorType myDetectorType, int& iodelay, int& tau, sls_detector_module* myMod=NULL, int tb=1); sls_detector_module* readSettingsFile(std::string fname, detectorType myDetectorType, int& iodelay, int& tau, sls_detector_module* myMod=NULL, int tb=1);
/** /**
writes a trim/settings file writes a trim/settings file
@ -121,7 +121,7 @@ class energyConversion
\sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module) \sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module)
*/ */
int writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau); int writeSettingsFile(std::string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau);
/** allocates the momery for a detector module structure /** allocates the momery for a detector module structure
\param myDetectorType detector type (needed for number of channels, chips, dacs etc.) \param myDetectorType detector type (needed for number of channels, chips, dacs etc.)

View File

@ -14,7 +14,7 @@
#include <math.h> #include <math.h>
#include <semaphore.h> #include <semaphore.h>
// using namespace std; //
/** /**
@short class handling the data file I/O flags @short class handling the data file I/O flags
*/ */

View File

@ -18,7 +18,7 @@ using std::endl;
using std::cout; using std::cout;
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
// using namespace std; //
/** /**
@short class handling the data file I/O flags @short class handling the data file I/O flags
*/ */

View File

@ -16,7 +16,7 @@
#include <queue> #include <queue>
#include <math.h> #include <math.h>
using namespace std; ;
typedef double double32_t; typedef double double32_t;

View File

@ -8,7 +8,7 @@
#endif #endif
#include <time.h> #include <time.h>
using namespace std;
//#define VERBOSE //#define VERBOSE
static void* startProcessData(void *n){ static void* startProcessData(void *n){

View File

@ -21,7 +21,7 @@
class postProcessingFuncs; class postProcessingFuncs;
// using namespace std; //
#define MAX_BADCHANS 20000 #define MAX_BADCHANS 20000
@ -75,7 +75,7 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
\param fname file with bad channel list ("" disable) \param fname file with bad channel list ("" disable)
\returns 0 if bad channel disabled, >0 otherwise \returns 0 if bad channel disabled, >0 otherwise
*/ */
virtual int setBadChannelCorrection(string fname="")=0; virtual int setBadChannelCorrection(std::string fname="")=0;
/** /**
@ -85,7 +85,7 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
\param badlist array of badchannels \param badlist array of badchannels
\returns 0 if bad channel disabled, >0 otherwise \returns 0 if bad channel disabled, >0 otherwise
*/ */
virtual int setBadChannelCorrection(string fname, int &nbad, int *badlist, int off=0)=0; virtual int setBadChannelCorrection(std::string fname, int &nbad, int *badlist, int off=0)=0;
using badChannelCorrections::setBadChannelCorrection; using badChannelCorrections::setBadChannelCorrection;
/** /**
@ -116,26 +116,26 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
/** returns the bad channel list file */ /** returns the bad channel list file */
string getBadChannelCorrectionFile() {if ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS)) return string(badChanFile); else return string("none");}; std::string getBadChannelCorrectionFile() {if ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS)) return std::string(badChanFile); else return std::string("none");};
/** /**
get flat field corrections file directory get flat field corrections file directory
\returns flat field correction file directory \returns flat field correction file directory
*/ */
string getFlatFieldCorrectionDir(){return string(flatFieldDir);}; std::string getFlatFieldCorrectionDir(){return std::string(flatFieldDir);};
/** /**
set flat field corrections file directory set flat field corrections file directory
\param flat field correction file directory \param flat field correction file directory
\returns flat field correction file directory \returns flat field correction file directory
*/ */
string setFlatFieldCorrectionDir(string dir){strcpy(flatFieldDir,dir.c_str()); return string(flatFieldDir);}; std::string setFlatFieldCorrectionDir(std::string dir){strcpy(flatFieldDir,dir.c_str()); return std::string(flatFieldDir);};
/** /**
get flat field corrections file name get flat field corrections file name
\returns flat field correction file name \returns flat field correction file name
*/ */
string getFlatFieldCorrectionFile(){ if ((*correctionMask)&(1<<FLAT_FIELD_CORRECTION)) return string(flatFieldFile); else return string("none");}; std::string getFlatFieldCorrectionFile(){ if ((*correctionMask)&(1<<FLAT_FIELD_CORRECTION)) return std::string(flatFieldFile); else return std::string("none");};
@ -170,7 +170,7 @@ s
\returns nothing \returns nothing
*/ */
void doProcessing(double* myData, int delflag, string fname); void doProcessing(double* myData, int delflag, std::string fname);
/** /**
@ -258,7 +258,7 @@ s
void initDataset(int refresh); void initDataset(int refresh);
void addFrame(double *data, double pos, double i0, double t, string fname, double var); void addFrame(double *data, double pos, double i0, double t, std::string fname, double var);
void finalizeDataset(double *a, double *v, double *e, int &np); void finalizeDataset(double *a, double *v, double *e, int &np);
virtual detectorType getDetectorsType(int pos=-1)=0; virtual detectorType getDetectorsType(int pos=-1)=0;
@ -293,11 +293,11 @@ s
/** /**
data queue data queue
*/ */
queue<int*> dataQueue; std::queue<int*> dataQueue;
/** /**
queue containing the postprocessed data queue containing the postprocessed data
*/ */
queue<detectorData*> finalDataQueue; std::queue<detectorData*> finalDataQueue;
/** data queue size */ /** data queue size */
int queuesize; int queuesize;

View File

@ -25,7 +25,7 @@
class angularConversion; class angularConversion;
class fileIO; class fileIO;
using namespace std; ;
#define MAX_BADCHANS 2000 #define MAX_BADCHANS 2000

View File

@ -1,6 +1,6 @@
#include "postProcessingFuncs.h" #include "postProcessingFuncs.h"
#include "angleConversionConstant.h" #include "angleConversionConstant.h"
using namespace std;
//#define VERBOSE //#define VERBOSE
postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCentre[], double* to, double* bs, double *sX, double *sY): postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCentre[], double* to, double* bs, double *sX, double *sY):

View File

@ -17,7 +17,7 @@
#include "angularConversionStatic.h" #include "angularConversionStatic.h"
class angleConversionConstant; class angleConversionConstant;
using namespace std;
class postProcessingFuncs : public virtual angularConversionStatic class postProcessingFuncs : public virtual angularConversionStatic

View File

@ -18,7 +18,7 @@
class angularConversion; class angularConversion;
using namespace std; ;
#define MAX_BADCHANS 2000 #define MAX_BADCHANS 2000

View File

@ -34,7 +34,7 @@
#include "runningStat.h" #include "runningStat.h"
#include "movingStat.h" #include "movingStat.h"
#include "single_photon_hit.h" #include "single_photon_hit.h"
using namespace std;
typedef double double32_t; typedef double double32_t;

View File

@ -10,7 +10,7 @@
#include "Global.h" #include "Global.h"
// using namespace std; //
class Mutex class Mutex
{ {

View File

@ -3,7 +3,7 @@
#include "Multi.h" #include "Multi.h"
#include <string> #include <string>
// using namespace std; //
class Single { class Single {
public: public:

View File

@ -6,16 +6,12 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string>
#include <stdio.h>
#include "Global.h" #include "Global.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#include <iostream>
#include <stdio.h>
// using namespace std;
class slsDetector; class slsDetector;
template<typename _Ret> template<typename _Ret>

View File

@ -14,7 +14,7 @@
#include "CondVar.h" #include "CondVar.h"
#include "Global.h" #include "Global.h"
#include <semaphore.h> #include <semaphore.h>
// using namespace std; //
class ThreadPool class ThreadPool