mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
Merge branch 'refactor' of github.com:slsdetectorgroup/slsDetectorPackage into refactor
This commit is contained in:
@ -14,6 +14,9 @@ else ()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
|
||||
endif ()
|
||||
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||
|
||||
find_package(Qt4)
|
||||
find_package(Qwt 6)
|
||||
find_package(CBF)
|
||||
|
@ -936,7 +936,7 @@ int multiSlsDetector::execCommand(std::string cmd, int detPos) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::readConfigurationFile(std::string const fname) {
|
||||
int multiSlsDetector::readConfigurationFile(const std::string& fname) {
|
||||
freeSharedMemory();
|
||||
setupMultiDetector();
|
||||
|
||||
@ -1019,27 +1019,24 @@ int multiSlsDetector::readConfigurationFile(std::string const fname) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::writeConfigurationFile(std::string const fname) {
|
||||
std::string names[] = {
|
||||
int multiSlsDetector::writeConfigurationFile(const std::string& fname) {
|
||||
const std::vector<std::string> names = {
|
||||
"detsizechan",
|
||||
"hostname",
|
||||
"outdir",
|
||||
"threaded"
|
||||
};
|
||||
|
||||
int nvar = 15;
|
||||
char* args[100];
|
||||
for (int ia = 0; ia < 100; ++ia) {
|
||||
args[ia] = new char[1000];
|
||||
}
|
||||
int ret = OK, ret1 = OK;
|
||||
|
||||
std::ofstream outfile;
|
||||
int iline = 0;
|
||||
|
||||
outfile.open(fname.c_str(), std::ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
|
||||
auto cmd = slsDetectorCommand(this);
|
||||
|
||||
// complete size of detector
|
||||
@ -1066,7 +1063,7 @@ int multiSlsDetector::writeConfigurationFile(std::string const fname) {
|
||||
|
||||
outfile << std::endl;
|
||||
//other configurations
|
||||
while (iline < nvar) {
|
||||
while (iline < names.size()) {
|
||||
std::cout << iline << " " << names[iline] << std::endl;
|
||||
strcpy(args[0], names[iline].c_str());
|
||||
outfile << names[iline] << " " << cmd.executeLine(1, args, GET_ACTION) << std::endl;
|
||||
@ -1905,7 +1902,7 @@ int multiSlsDetector::digitalTest(digitalTestMode mode, int ival, int detPos) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::loadImageToDetector(imageType index, std::string const fname, int detPos) {
|
||||
int multiSlsDetector::loadImageToDetector(imageType index, const std::string& fname, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->loadImageToDetector(index, fname);
|
||||
@ -1933,7 +1930,7 @@ int multiSlsDetector::loadImageToDetector(imageType index, std::string const fna
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::writeCounterBlockFile(std::string const fname, int startACQ, int detPos) {
|
||||
int multiSlsDetector::writeCounterBlockFile(const std::string& fname, int startACQ, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->writeCounterBlockFile(fname, startACQ);
|
||||
@ -3514,7 +3511,7 @@ int multiSlsDetector::setCTBPatWaitTime(int level, uint64_t t, int detPos) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::retrieveDetectorSetup(std::string const fname1, int level){
|
||||
int multiSlsDetector::retrieveDetectorSetup(const std::string& fname1, int level){
|
||||
|
||||
int skip=0;
|
||||
std::string fname;
|
||||
@ -3597,7 +3594,7 @@ int multiSlsDetector::retrieveDetectorSetup(std::string const fname1, int level)
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::dumpDetectorSetup(std::string const fname, int level){
|
||||
int multiSlsDetector::dumpDetectorSetup(const std::string& fname, int level){
|
||||
detectorType type = getDetectorsType();
|
||||
std::string names[100];
|
||||
int nvar=0;
|
||||
|
@ -468,14 +468,14 @@ public:
|
||||
* @param fname configuration file name
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int readConfigurationFile(std::string const fname);
|
||||
int readConfigurationFile(const std::string& fname);
|
||||
|
||||
/**
|
||||
* Write current configuration to a file
|
||||
* @param fname configuration file name
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int writeConfigurationFile(std::string const fname);
|
||||
int writeConfigurationFile(const std::string& fname);
|
||||
|
||||
/**
|
||||
* Returns the trimfile or settings file name (Useless??)
|
||||
@ -929,7 +929,7 @@ public:
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int loadImageToDetector(imageType index,std::string const fname, int detPos = -1);
|
||||
int loadImageToDetector(imageType index, const std::string& fname, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Writes the counter memory block from the detector (Gotthard)
|
||||
@ -938,7 +938,7 @@ public:
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int writeCounterBlockFile(std::string const fname,int startACQ=0, int detPos = -1);
|
||||
int writeCounterBlockFile(const std::string& fname,int startACQ=0, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Resets counter in detector (Gotthard)
|
||||
@ -1516,7 +1516,7 @@ public:
|
||||
* from files with default extensions as generated by dumpDetectorSetup
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int retrieveDetectorSetup(std::string const fname, int level=0);
|
||||
int retrieveDetectorSetup(const std::string& fname, int level=0);
|
||||
|
||||
/**
|
||||
* Saves the detector setup to file
|
||||
@ -1525,7 +1525,7 @@ public:
|
||||
* and writes them to files with automatically added extension
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int dumpDetectorSetup(std::string const fname, int level=0);
|
||||
int dumpDetectorSetup(const std::string& fname, int level=0);
|
||||
|
||||
/**
|
||||
* register callback for accessing acquisition final data
|
||||
|
@ -1076,7 +1076,7 @@ int slsDetector::setOnline(int off) {
|
||||
|
||||
|
||||
std::string slsDetector::checkOnline() {
|
||||
std::string retval="";
|
||||
std::string retval;
|
||||
if(!controlSocket){
|
||||
//this already sets the online/offline flag
|
||||
setTCPSocket();
|
||||
|
Reference in New Issue
Block a user