mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 23:07:13 +02:00
range based loops
This commit is contained in:
@ -360,8 +360,8 @@ void multiSlsDetector::initializeDetectorStructure() {
|
|||||||
thisMultiDetector->numberOfChannelInclGapPixels[Y] = 0;
|
thisMultiDetector->numberOfChannelInclGapPixels[Y] = 0;
|
||||||
thisMultiDetector->maxNumberOfChannelsPerDetector[X] = 0;
|
thisMultiDetector->maxNumberOfChannelsPerDetector[X] = 0;
|
||||||
thisMultiDetector->maxNumberOfChannelsPerDetector[Y] = 0;
|
thisMultiDetector->maxNumberOfChannelsPerDetector[Y] = 0;
|
||||||
for (int i = 0; i < MAX_TIMERS; ++i) {
|
for (long & i : thisMultiDetector->timerValue) {
|
||||||
thisMultiDetector->timerValue[i] = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
thisMultiDetector->acquiringFlag = false;
|
thisMultiDetector->acquiringFlag = false;
|
||||||
@ -854,8 +854,8 @@ int multiSlsDetector::writeConfigurationFile(const std::string &fname) {
|
|||||||
"threaded"};
|
"threaded"};
|
||||||
|
|
||||||
char *args[100];
|
char *args[100];
|
||||||
for (int ia = 0; ia < 100; ++ia) {
|
for (auto & arg : args) {
|
||||||
args[ia] = new char[1000];
|
arg = new char[1000];
|
||||||
}
|
}
|
||||||
int ret = OK, ret1 = OK;
|
int ret = OK, ret1 = OK;
|
||||||
std::ofstream outfile;
|
std::ofstream outfile;
|
||||||
@ -906,8 +906,8 @@ int multiSlsDetector::writeConfigurationFile(const std::string &fname) {
|
|||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int ia = 0; ia < 100; ++ia) {
|
for (auto & arg : args) {
|
||||||
delete[] args[ia];
|
delete[] arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -3345,9 +3345,9 @@ int multiSlsDetector::dumpDetectorSetup(const std::string &fname, int level) {
|
|||||||
outfile.open(outfname.c_str(), std::ios_base::out);
|
outfile.open(outfname.c_str(), std::ios_base::out);
|
||||||
if (outfile.is_open()) {
|
if (outfile.is_open()) {
|
||||||
auto cmd = slsDetectorCommand(this);
|
auto cmd = slsDetectorCommand(this);
|
||||||
for (int iv = 0; iv < names.size(); ++iv) {
|
for (auto & name : names) {
|
||||||
sls::strcpy_safe(buffer, names[iv].c_str()); //this is...
|
sls::strcpy_safe(buffer, name.c_str()); //this is...
|
||||||
outfile << names[iv] << " " << cmd.executeLine(n_arguments, args, GET_ACTION)
|
outfile << name << " " << cmd.executeLine(n_arguments, args, GET_ACTION)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
outfile.close();
|
outfile.close();
|
||||||
|
Reference in New Issue
Block a user