removing more pointers

This commit is contained in:
Erik Frojdh 2018-10-11 12:14:46 +02:00
parent 6aa0029580
commit f735c86b93

View File

@ -1154,22 +1154,6 @@ int slsDetector::setTCPSocket(std::string const name, int const control_port, in
char thisName[MAX_STR_LENGTH]; char thisName[MAX_STR_LENGTH];
int thisCP, thisSP; int thisCP, thisSP;
int retval=OK; int retval=OK;
// if (strcmp(name.c_str(),"")!=0) {
// #ifdef VERBOSE
// std::cout<< "setting hostname" << std::endl;
// #endif
// strcpy(thisName,name.c_str());
// strcpy(thisDetector->hostname,thisName);
// if (controlSocket) {
// delete controlSocket;
// controlSocket=0;
// }
// if (stopSocket) {
// delete stopSocket;
// stopSocket=0;
// }
// } else
// strcpy(thisName,thisDetector->hostname);
if (name.empty()){ if (name.empty()){
strcpy(thisName,thisDetector->hostname); strcpy(thisName,thisDetector->hostname);
@ -1721,8 +1705,7 @@ int slsDetector::writeConfigurationFile(std::string const fname, multiSlsDetecto
int slsDetector::writeConfigurationFile(std::ofstream &outfile, multiSlsDetector* m) { int slsDetector::writeConfigurationFile(std::ofstream &outfile, multiSlsDetector* m) {
;
slsDetectorCommand *cmd=new slsDetectorCommand(m);
detectorType type = thisDetector->myDetectorType; detectorType type = thisDetector->myDetectorType;
std::string names[100]; std::string names[100];
int nvar=0; int nvar=0;
@ -1790,25 +1773,23 @@ int slsDetector::writeConfigurationFile(std::ofstream &outfile, multiSlsDetector
args[ia]=myargs[ia]; args[ia]=myargs[ia];
} }
auto cmd = slsDetectorCommand(m);
for (iv=0; iv<nvar; ++iv) { for (iv=0; iv<nvar; ++iv) {
std::cout << iv << " " << names[iv] << std::endl; std::cout << iv << " " << names[iv] << std::endl;
if (names[iv]=="extsig") { if (names[iv]=="extsig") {
for (int is=0; is<nsig; ++is) { for (int is=0; is<nsig; ++is) {
sprintf(args[0],"%s:%d",names[iv].c_str(),is); sprintf(args[0],"%s:%d",names[iv].c_str(),is);
outfile << detId << ":"; outfile << detId << ":";
outfile << args[0] << " " << cmd->executeLine(1,args,GET_ACTION) outfile << args[0] << " " << cmd.executeLine(1,args,GET_ACTION)
<< std::endl; << std::endl;
} }
} else { } else {
strcpy(args[0],names[iv].c_str()); strcpy(args[0],names[iv].c_str());
outfile << detId << ":"; outfile << detId << ":";
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) outfile << names[iv] << " " << cmd.executeLine(1,args,GET_ACTION)
<< std::endl; << std::endl;
} }
} }
delete cmd;
return OK; return OK;
} }