mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
got rid of some parameters in read-write of config file
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@77 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
77d21d16f9
commit
c7d0330f55
@ -73,54 +73,6 @@ int gotthardDetector::readConfigurationFile(string const fname){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
//---------------mac address----------
|
|
||||||
getline(infile,str);
|
|
||||||
iline++;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
std::cout<< str << std::endl;
|
|
||||||
#endif
|
|
||||||
istringstream sstr(str);
|
|
||||||
sstr >> sargname >> sargname2;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
std::cout<< sargname << " is " << sargname2 << std::endl;
|
|
||||||
#endif
|
|
||||||
//getting rid of dots
|
|
||||||
pos = sargname2.find(":");
|
|
||||||
while(pos != string::npos)
|
|
||||||
{
|
|
||||||
sargname2.erase( pos, 1 );
|
|
||||||
pos = sargname2.find(":");
|
|
||||||
}
|
|
||||||
strcpy(thisDetector->clientMacAddress,sargname2.c_str());
|
|
||||||
//sprintf(thisDetector->clientMacAddress,"%0llX",atoll(sargname2.c_str()));
|
|
||||||
cout<<"macaddress:"<<thisDetector->clientMacAddress<<endl;
|
|
||||||
|
|
||||||
//---------------ip address---------------
|
|
||||||
getline(infile,str);
|
|
||||||
iline++;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
std::cout<< str << std::endl;
|
|
||||||
#endif
|
|
||||||
istringstream sssstr(str);
|
|
||||||
sssstr >> sargname >> sargname2;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
std::cout<< sargname << " is " << sargname2 << std::endl;
|
|
||||||
#endif
|
|
||||||
//getting rid of dots
|
|
||||||
pos = sargname2.find(".");
|
|
||||||
while(pos != string::npos)
|
|
||||||
{
|
|
||||||
sargname2.erase( pos, 1 );
|
|
||||||
pos = sargname2.find(".");
|
|
||||||
}
|
|
||||||
strcpy(thisDetector->clientIPAddress,sargname2.c_str());
|
|
||||||
cout<<"ipaddress:"<<thisDetector->clientIPAddress<<endl;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
iline++;
|
iline++;
|
||||||
}
|
}
|
||||||
infile.close();
|
infile.close();
|
||||||
@ -141,23 +93,12 @@ int gotthardDetector::writeConfigurationFile(string const fname){
|
|||||||
"hostname",\
|
"hostname",\
|
||||||
"caldir",\
|
"caldir",\
|
||||||
"settingsdir",\
|
"settingsdir",\
|
||||||
"trimen",\
|
|
||||||
"outdir",\
|
"outdir",\
|
||||||
"ffdir",\
|
// "nmod",
|
||||||
"headerbefore",\
|
"clientip",\
|
||||||
"headerafter",\
|
"clientmac"};
|
||||||
"headerbeforepar",\
|
|
||||||
"headerafterpar",\
|
int nvar=6;
|
||||||
"nmod",\
|
|
||||||
"badchannels",\
|
|
||||||
"angconv",\
|
|
||||||
"globaloff",\
|
|
||||||
"binsize",\
|
|
||||||
"threaded",\
|
|
||||||
"waitstates",\
|
|
||||||
"setlength",\
|
|
||||||
"clkdivider"};
|
|
||||||
int nvar=19;
|
|
||||||
ofstream outfile;
|
ofstream outfile;
|
||||||
int iv=0;
|
int iv=0;
|
||||||
char *args[100];
|
char *args[100];
|
||||||
@ -165,13 +106,12 @@ int gotthardDetector::writeConfigurationFile(string const fname){
|
|||||||
args[ia]=new char[1000];
|
args[ia]=new char[1000];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
outfile.open(fname.c_str(),ios_base::out);
|
outfile.open(fname.c_str(),ios_base::out);
|
||||||
if (outfile.is_open()) {
|
if (outfile.is_open()) {
|
||||||
for (iv=0; iv<nvar; iv++) {
|
for (iv=0; iv<nvar; iv++) {
|
||||||
strcpy(args[0],names[iv].c_str());
|
strcpy(args[0],names[iv].c_str());
|
||||||
outfile << names[iv] << " " << executeLine(1,args,GET_ACTION) << std::endl;
|
outfile << names[iv] << " " << executeLine(1,args,GET_ACTION) << std::endl;
|
||||||
}
|
}
|
||||||
outfile.close();
|
outfile.close();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user