mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 08:10:02 +02:00
updated write config and write parameters list
This commit is contained in:
parent
536203b6dc
commit
d00c837977
@ -4775,12 +4775,11 @@ int multiSlsDetector::printReceiverConfiguration(){
|
||||
|
||||
int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
|
||||
|
||||
|
||||
int nd=thisMultiDetector->numberOfDetectors;
|
||||
|
||||
|
||||
for (int i=0; i<nd; ++i) {
|
||||
// sprintf(ext,".det%d",i);
|
||||
if (detectors[i]) {
|
||||
detectors[i]->freeSharedMemory();
|
||||
}
|
||||
@ -4788,7 +4787,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
thisMultiDetector->numberOfDetectors=0;
|
||||
|
||||
multiSlsDetectorClient *cmd;
|
||||
// char ext[100];
|
||||
|
||||
|
||||
setAcquiringFlag(false);
|
||||
clearAllErrorMask();
|
||||
@ -4802,7 +4801,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
char myargs[1000][1000];
|
||||
|
||||
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
std::cout<< "config file name "<< fname << std::endl;
|
||||
@ -4898,92 +4897,93 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
int multiSlsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
string names[]={ \
|
||||
"detsizechan", \
|
||||
"hostname", \
|
||||
"master", \
|
||||
"sync", \
|
||||
"outdir", \
|
||||
"ffdir", \
|
||||
"headerbefore", \
|
||||
"headerafter", \
|
||||
"headerbeforepar", \
|
||||
"headerafterpar", \
|
||||
"badchannels", \
|
||||
"angconv", \
|
||||
"globaloff", \
|
||||
"binsize", \
|
||||
"threaded" };
|
||||
|
||||
int nvar=15;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ++ia) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
int ret=OK,ret1=OK;
|
||||
|
||||
|
||||
|
||||
string names[]={ \
|
||||
"type", \
|
||||
"master", \
|
||||
"sync", \
|
||||
"outdir", \
|
||||
"ffdir", \
|
||||
"headerbefore", \
|
||||
"headerafter", \
|
||||
"headerbeforepar", \
|
||||
"headerafterpar", \
|
||||
"badchannels", \
|
||||
"angconv", \
|
||||
"globaloff", \
|
||||
"binsize", \
|
||||
"threaded" };
|
||||
ofstream outfile;
|
||||
int iline = 0;
|
||||
|
||||
int nvar=14;
|
||||
|
||||
// char ext[100];
|
||||
|
||||
int iv=0;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ++ia) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
int ret=OK;
|
||||
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
int iline = 0;
|
||||
|
||||
outfile.open(fname.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
outfile.open(fname.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
|
||||
|
||||
|
||||
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
||||
|
||||
// detector types!!!
|
||||
cout << iv << " " << names[iv] << endl;
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
++iline;
|
||||
// single detector configuration
|
||||
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
||||
// sprintf(ext,".det%d",i);
|
||||
if (detectors[i]) {
|
||||
iv+=detectors[i]->writeConfigurationFile(outfile,i);
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
}
|
||||
}
|
||||
|
||||
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
||||
|
||||
//other configurations
|
||||
for (iv=1; iv<nvar; ++iv) {
|
||||
|
||||
cout << iv << " " << names[iv] << endl;
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
++iline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
delete cmd;
|
||||
outfile.close();
|
||||
// complete size of detector
|
||||
cout << iline << " " << names[iline] << endl;
|
||||
strcpy(args[0],names[iline].c_str());
|
||||
outfile << names[iline] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
++iline;
|
||||
|
||||
// hostname of the detectors
|
||||
cout << iline << " " << names[iline] << endl;
|
||||
strcpy(args[0],names[iline].c_str());
|
||||
outfile << names[iline] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
++iline;
|
||||
|
||||
// single detector configuration
|
||||
for (int i=0; i<thisMultiDetector->numberOfDetectors; ++i) {
|
||||
// sprintf(ext,".det%d",i);
|
||||
if (detectors[i]) {
|
||||
ret1 = detectors[i]->writeConfigurationFile(outfile,i);
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret1 == FAIL)
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//other configurations
|
||||
while (iline < nvar) {
|
||||
cout << iline << " " << names[iline] << endl;
|
||||
strcpy(args[0],names[iline].c_str());
|
||||
outfile << names[iline] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
++iline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
delete cmd;
|
||||
outfile.close();
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "wrote " <<iline << " lines to configuration file " << std::endl;
|
||||
std::cout<< "wrote " <<iline << " lines to configuration file " << std::endl;
|
||||
#endif
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
ret = FAIL;
|
||||
}
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
for (int ia=0; ia<100; ++ia) {
|
||||
delete [] args[ia];
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
};
|
||||
for (int ia=0; ia<100; ++ia) {
|
||||
delete [] args[ia];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -6964,7 +6964,6 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
||||
|
||||
int slsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
#ifdef VERBOSE
|
||||
int ret;
|
||||
@ -6992,56 +6991,78 @@ int slsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
|
||||
int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
||||
|
||||
;
|
||||
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
||||
int nvar=15;
|
||||
detectorType type = thisDetector->myDetectorType;
|
||||
string names[100];
|
||||
int nvar=0;
|
||||
|
||||
string names[20]={ \
|
||||
"hostname", \
|
||||
"port", \
|
||||
"stopport", \
|
||||
"settingsdir", \
|
||||
"outdir", \
|
||||
"angdir", \
|
||||
"moveflag", \
|
||||
"lock", \
|
||||
"caldir", \
|
||||
"ffdir", \
|
||||
"nmod", \
|
||||
"waitstates", \
|
||||
"setlength", \
|
||||
"clkdivider", \
|
||||
"extsig" };
|
||||
// common config
|
||||
names[nvar++] = "hostname";
|
||||
names[nvar++] = "port";
|
||||
names[nvar++] = "stopport";
|
||||
names[nvar++] = "settingsdir";
|
||||
names[nvar++] = "caldir";
|
||||
names[nvar++] = "ffdir";
|
||||
names[nvar++] = "outdir";
|
||||
names[nvar++] = "angdir";
|
||||
names[nvar++] = "moveflag";
|
||||
names[nvar++] = "lock";
|
||||
|
||||
// to be added in the future
|
||||
// "trimen",
|
||||
// "receiverTCPPort",
|
||||
|
||||
if ((thisDetector->myDetectorType==GOTTHARD)||
|
||||
(thisDetector->myDetectorType==PROPIX)||
|
||||
(thisDetector->myDetectorType==JUNGFRAU)||
|
||||
(thisDetector->myDetectorType==MOENCH)) {
|
||||
names[0]= "hostname";
|
||||
names[1]= "port";
|
||||
names[2]= "stopport";
|
||||
names[3]= "settingsdir";
|
||||
names[4]= "angdir";
|
||||
names[5]= "moveflag";
|
||||
names[6]= "lock";
|
||||
names[7]= "caldir";
|
||||
names[8]= "ffdir";
|
||||
names[9]= "extsig";
|
||||
names[10]="detectormac";
|
||||
names[11]="detectorip";
|
||||
names[12]= "rx_tcpport";
|
||||
names[13]= "rx_udpport";
|
||||
names[14]="rx_udpip";
|
||||
names[15]="rx_hostname";
|
||||
names[16]="outdir";
|
||||
names[17]="vhighvoltage";
|
||||
nvar=18;
|
||||
// receiver config
|
||||
if (type != MYTHEN) {
|
||||
names[nvar++] = "detectormac";
|
||||
names[nvar++] = "detectorip";
|
||||
names[nvar++] = "zmqport";
|
||||
names[nvar++] = "rx_zmqport";
|
||||
names[nvar++] = "rx_tcpport";
|
||||
names[nvar++] = "rx_udpport";
|
||||
names[nvar++] = "rx_udpport2";
|
||||
names[nvar++] = "rx_udpip";
|
||||
names[nvar++] = "rx_hostname";
|
||||
names[nvar++] = "r_readfreq";
|
||||
}
|
||||
|
||||
// detector specific config
|
||||
switch (type) {
|
||||
case MYTHEN:
|
||||
names[nvar++] = "nmod";
|
||||
names[nvar++] = "waitstates";
|
||||
names[nvar++] = "setlength";
|
||||
names[nvar++] = "clkdivider";
|
||||
names[nvar++] = "extsig";
|
||||
break;
|
||||
case GOTTHARD:
|
||||
case PROPIX:
|
||||
names[nvar++] = "extsig";
|
||||
names[nvar++] = "vhighvoltage";
|
||||
break;
|
||||
break;
|
||||
case MOENCH:
|
||||
names[nvar++] = "extsig";
|
||||
names[nvar++] = "vhighvoltage";
|
||||
break;
|
||||
case EIGER:
|
||||
names[nvar++] = "vhighvoltage";
|
||||
names[nvar++] = "trimen";
|
||||
names[nvar++] = "iodelay";
|
||||
names[nvar++] = "tengiga";
|
||||
break;
|
||||
case JUNGFRAU:
|
||||
names[nvar++] = "powerchip";
|
||||
names[nvar++] = "vhighvoltage";
|
||||
break;
|
||||
case JUNGFRAUCTB:
|
||||
names[nvar++] = "powerchip";
|
||||
names[nvar++] = "vhighvoltage";
|
||||
break;
|
||||
default:
|
||||
std::cout << "detector type " << getDetectorType(thisDetector->myDetectorType) << " not implemented in writing config file" << std::endl;
|
||||
nvar = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nsig=4;//-1;
|
||||
int iv=0;
|
||||
@ -7049,8 +7070,6 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
||||
char myargs[100][1000];
|
||||
|
||||
for (int ia=0; ia<100; ++ia) {
|
||||
//args[ia]=new char[1000];
|
||||
|
||||
args[ia]=myargs[ia];
|
||||
}
|
||||
|
||||
@ -7073,6 +7092,7 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
||||
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
delete cmd;
|
||||
return OK;
|
||||
}
|
||||
|
@ -729,37 +729,51 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
||||
|
||||
int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
|
||||
|
||||
slsDetectorCommand *cmd;
|
||||
string names[100];
|
||||
int nvar=0;
|
||||
slsDetectorCommand *cmd;
|
||||
detectorType type = getDetectorsType();
|
||||
string names[100];
|
||||
int nvar=0;
|
||||
|
||||
names[nvar++]="fname";
|
||||
names[nvar++]="index";
|
||||
names[nvar++]="dr";
|
||||
names[nvar++]="settings";
|
||||
names[nvar++]="exptime";
|
||||
names[nvar++]="period";
|
||||
names[nvar++]="frames";
|
||||
names[nvar++]="cycles";
|
||||
names[nvar++]="measurements";
|
||||
names[nvar++]="timing";
|
||||
// common config
|
||||
names[nvar++]="fname";
|
||||
names[nvar++]="index";
|
||||
names[nvar++]="enablefwrite";
|
||||
names[nvar++]="overwrite";
|
||||
names[nvar++]="dr";
|
||||
names[nvar++]="settings";
|
||||
names[nvar++]="exptime";
|
||||
names[nvar++]="period";
|
||||
names[nvar++]="frames";
|
||||
names[nvar++]="cycles";
|
||||
names[nvar++]="measurements";
|
||||
names[nvar++]="timing";
|
||||
names[nvar++]="flatfield";
|
||||
names[nvar++]="badchannels";
|
||||
|
||||
switch (getDetectorsType()) {
|
||||
case EIGER:
|
||||
names[nvar++]="flags";
|
||||
switch (type) {
|
||||
case EIGER:
|
||||
names[nvar++]="flags";
|
||||
names[nvar++]="clkdivider";
|
||||
names[nvar++]="threshold";
|
||||
names[nvar++]="ratecorr";
|
||||
names[nvar++]="trimbits";
|
||||
break;
|
||||
case GOTTHARD:
|
||||
case PROPIX:
|
||||
case JUNGFRAU:
|
||||
names[nvar++]="flags";
|
||||
case GOTTHARD:
|
||||
case PROPIX:
|
||||
names[nvar++]="flags";
|
||||
names[nvar++]="delay";
|
||||
names[nvar++]="gates";
|
||||
names[nvar++]="ratecorr";
|
||||
break;
|
||||
case MYTHEN:
|
||||
names[nvar++]="flags";
|
||||
case JUNGFRAU:
|
||||
names[nvar++]="flags";
|
||||
names[nvar++]="delay";
|
||||
names[nvar++]="gates";
|
||||
names[nvar++]="ratecorr";
|
||||
names[nvar++]="clkdivider";
|
||||
break;
|
||||
case MYTHEN:
|
||||
names[nvar++]="flags";
|
||||
names[nvar++]="threshold";
|
||||
names[nvar++]="delay";
|
||||
names[nvar++]="gates";
|
||||
@ -768,188 +782,160 @@ int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
|
||||
names[nvar++]="ratecorr";
|
||||
names[nvar++]="trimbits";
|
||||
break;
|
||||
case JUNGFRAUCTB:
|
||||
|
||||
names[nvar++]="dac:0";
|
||||
names[nvar++]="dac:1";
|
||||
names[nvar++]="dac:2";
|
||||
names[nvar++]="dac:3";
|
||||
names[nvar++]="dac:4";
|
||||
names[nvar++]="dac:5";
|
||||
names[nvar++]="dac:6";
|
||||
names[nvar++]="dac:7";
|
||||
names[nvar++]="dac:8";
|
||||
names[nvar++]="dac:9";
|
||||
names[nvar++]="dac:10";
|
||||
names[nvar++]="dac:11";
|
||||
names[nvar++]="dac:12";
|
||||
names[nvar++]="dac:13";
|
||||
names[nvar++]="dac:14";
|
||||
names[nvar++]="dac:15";
|
||||
names[nvar++]="adcvpp";
|
||||
case JUNGFRAUCTB:
|
||||
names[nvar++]="dac:0";
|
||||
names[nvar++]="dac:1";
|
||||
names[nvar++]="dac:2";
|
||||
names[nvar++]="dac:3";
|
||||
names[nvar++]="dac:4";
|
||||
names[nvar++]="dac:5";
|
||||
names[nvar++]="dac:6";
|
||||
names[nvar++]="dac:7";
|
||||
names[nvar++]="dac:8";
|
||||
names[nvar++]="dac:9";
|
||||
names[nvar++]="dac:10";
|
||||
names[nvar++]="dac:11";
|
||||
names[nvar++]="dac:12";
|
||||
names[nvar++]="dac:13";
|
||||
names[nvar++]="dac:14";
|
||||
names[nvar++]="dac:15";
|
||||
names[nvar++]="adcvpp";
|
||||
|
||||
|
||||
|
||||
names[nvar++]="adcclk";
|
||||
names[nvar++]="clkdivider";
|
||||
names[nvar++]="adcphase";
|
||||
names[nvar++]="adcpipeline";
|
||||
names[nvar++]="adcinvert"; //
|
||||
names[nvar++]="adcdisable";
|
||||
names[nvar++]="patioctrl";
|
||||
names[nvar++]="patclkctrl";
|
||||
names[nvar++]="patlimits";
|
||||
names[nvar++]="patloop0";
|
||||
names[nvar++]="patnloop0";
|
||||
names[nvar++]="patwait0";
|
||||
names[nvar++]="patwaittime0";
|
||||
names[nvar++]="patloop1";
|
||||
names[nvar++]="patnloop1";
|
||||
names[nvar++]="patwait1";
|
||||
names[nvar++]="patwaittime1";
|
||||
names[nvar++]="patloop2";
|
||||
names[nvar++]="patnloop2";
|
||||
names[nvar++]="patwait2";
|
||||
names[nvar++]="patwaittime2";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
names[nvar++]="adcclk";
|
||||
names[nvar++]="clkdivider";
|
||||
names[nvar++]="adcphase";
|
||||
names[nvar++]="adcpipeline";
|
||||
names[nvar++]="adcinvert"; //
|
||||
names[nvar++]="adcdisable";
|
||||
names[nvar++]="patioctrl";
|
||||
names[nvar++]="patclkctrl";
|
||||
names[nvar++]="patlimits";
|
||||
names[nvar++]="patloop0";
|
||||
names[nvar++]="patnloop0";
|
||||
names[nvar++]="patwait0";
|
||||
names[nvar++]="patwaittime0";
|
||||
names[nvar++]="patloop1";
|
||||
names[nvar++]="patnloop1";
|
||||
names[nvar++]="patwait1";
|
||||
names[nvar++]="patwaittime1";
|
||||
names[nvar++]="patloop2";
|
||||
names[nvar++]="patnloop2";
|
||||
names[nvar++]="patwait2";
|
||||
names[nvar++]="patwaittime2";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
names[nvar++]="startscript";
|
||||
names[nvar++]="startscriptpar";
|
||||
names[nvar++]="stopscript";
|
||||
names[nvar++]="stopscriptpar";
|
||||
names[nvar++]="scriptbefore";
|
||||
names[nvar++]="scriptbeforepar";
|
||||
names[nvar++]="scriptafter";
|
||||
names[nvar++]="scriptafterpar";
|
||||
names[nvar++]="scan0script";
|
||||
names[nvar++]="scan0par";
|
||||
names[nvar++]="scan0prec";
|
||||
names[nvar++]="scan0steps";
|
||||
names[nvar++]="scan1script";
|
||||
names[nvar++]="scan1par";
|
||||
names[nvar++]="scan1prec";
|
||||
names[nvar++]="scan1steps";
|
||||
|
||||
|
||||
int iv=0;
|
||||
string fname1;
|
||||
|
||||
|
||||
|
||||
names[nvar++]="startscript";
|
||||
names[nvar++]="startscriptpar";
|
||||
names[nvar++]="stopscript";
|
||||
names[nvar++]="stopscriptpar";
|
||||
names[nvar++]="scriptbefore";
|
||||
names[nvar++]="scriptbeforepar";
|
||||
names[nvar++]="scriptafter";
|
||||
names[nvar++]="scriptafterpar";
|
||||
names[nvar++]="scan0script";
|
||||
names[nvar++]="scan0par";
|
||||
names[nvar++]="scan0prec";
|
||||
names[nvar++]="scan0steps";
|
||||
names[nvar++]="scan1script";
|
||||
names[nvar++]="scan1par";
|
||||
names[nvar++]="scan1prec";
|
||||
names[nvar++]="scan1steps";
|
||||
ofstream outfile;
|
||||
char *args[4];
|
||||
for (int ia=0; ia<4; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
|
||||
switch (getDetectorsType()) {
|
||||
case EIGER:
|
||||
case MYTHEN:
|
||||
case GOTTHARD:
|
||||
case PROPIX:
|
||||
case JUNGFRAU:
|
||||
names[nvar++]="flatfield";
|
||||
names[nvar++]="badchannels";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (getDetectorsType()) {
|
||||
case EIGER:
|
||||
case MYTHEN:
|
||||
names[nvar++]="trimbits";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
int nargs;
|
||||
if (level==2)
|
||||
nargs=2;
|
||||
else
|
||||
nargs=1;
|
||||
|
||||
// char ext[100];
|
||||
|
||||
int iv=0;
|
||||
string fname1;
|
||||
if (level==2) {
|
||||
fname1=fname+string(".config");
|
||||
writeConfigurationFile(fname1);
|
||||
fname1=fname+string(".det");
|
||||
} else
|
||||
fname1=fname;
|
||||
|
||||
|
||||
|
||||
ofstream outfile;
|
||||
char *args[4];
|
||||
for (int ia=0; ia<4; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
outfile.open(fname1.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
cmd=new slsDetectorCommand(this);
|
||||
for (iv=0; iv<nvar-3; iv++) {
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
}
|
||||
|
||||
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
if (level==2) {
|
||||
fname1=fname+string(".ff");
|
||||
strcpy(args[1],fname1.c_str());
|
||||
}
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
if (level==2) {
|
||||
fname1=fname+string(".bad");
|
||||
strcpy(args[1],fname1.c_str());
|
||||
}
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int nargs;
|
||||
if (level==2)
|
||||
nargs=2;
|
||||
else
|
||||
nargs=1;
|
||||
|
||||
|
||||
if (level==2) {
|
||||
fname1=fname+string(".config");
|
||||
writeConfigurationFile(fname1);
|
||||
fname1=fname+string(".det");
|
||||
} else
|
||||
fname1=fname;
|
||||
|
||||
|
||||
|
||||
outfile.open(fname1.c_str(),ios_base::out);
|
||||
if (outfile.is_open()) {
|
||||
cmd=new slsDetectorCommand(this);
|
||||
for (iv=0; iv<nvar-3; iv++) {
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
outfile << names[iv] << " " << cmd->executeLine(1,args,GET_ACTION) << std::endl;
|
||||
}
|
||||
|
||||
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
if (level==2) {
|
||||
fname1=fname+string(".ff");
|
||||
strcpy(args[1],fname1.c_str());
|
||||
}
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
if (level==2) {
|
||||
fname1=fname+string(".bad");
|
||||
strcpy(args[1],fname1.c_str());
|
||||
}
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
|
||||
|
||||
if (level==2) {
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
size_t c=fname.rfind('/');
|
||||
if (c<string::npos) {
|
||||
fname1=fname.substr(0,c+1)+string("trim_")+fname.substr(c+1);
|
||||
} else {
|
||||
fname1=string("trim_")+fname;
|
||||
}
|
||||
strcpy(args[1],fname1.c_str());
|
||||
if (level==2) {
|
||||
strcpy(args[0],names[iv].c_str());
|
||||
size_t c=fname.rfind('/');
|
||||
if (c<string::npos) {
|
||||
fname1=fname.substr(0,c+1)+string("trim_")+fname.substr(c+1);
|
||||
} else {
|
||||
fname1=string("trim_")+fname;
|
||||
}
|
||||
strcpy(args[1],fname1.c_str());
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "writing to file " << fname1 << std::endl;
|
||||
std::cout<< "writing to file " << fname1 << std::endl;
|
||||
#endif
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
|
||||
iv++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
delete cmd;
|
||||
}
|
||||
|
||||
|
||||
delete cmd;
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
else {
|
||||
std::cout<< "Error opening parameters file " << fname1 << " for writing" << std::endl;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
else {
|
||||
std::cout<< "Error opening parameters file " << fname1 << " for writing" << std::endl;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "wrote " <<iv << " lines to "<< fname1 << std::endl;
|
||||
std::cout<< "wrote " <<iv << " lines to "<< fname1 << std::endl;
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user