size of writeConfigFile

This commit is contained in:
Erik Frojdh 2018-10-11 15:19:26 +02:00
parent a28932bb6c
commit 316ba01297
2 changed files with 4 additions and 7 deletions

View File

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

View File

@ -475,7 +475,7 @@ public:
* @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??)