mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
solved problem reading config files
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@191 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
dfcd8f749e
commit
042b71b403
@ -3076,6 +3076,22 @@ 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();
|
||||
}
|
||||
}
|
||||
thisMultiDetector->numberOfDetectors=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
multiSlsDetectorClient *cmd;
|
||||
char ext[100];
|
||||
|
||||
@ -3086,10 +3102,9 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
ifstream infile;
|
||||
int iargval;
|
||||
int interrupt=0;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
char *args[1000];
|
||||
|
||||
char myargs[1000][1000];
|
||||
|
||||
|
||||
string sargname, sargval;
|
||||
@ -3127,10 +3142,23 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
#ifdef VERBOSE
|
||||
std::cout<< iargval << " " << sargname << std::endl;
|
||||
#endif
|
||||
strcpy(args[iargval],sargname.c_str());
|
||||
|
||||
strcpy(myargs[iargval], sargname.c_str());
|
||||
args[iargval]=myargs[iargval];
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "--" << iargval << " " << args[iargval] << std::endl;
|
||||
#endif
|
||||
|
||||
iargval++;
|
||||
//}
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << endl;
|
||||
for (int ia=0; ia<iargval; ia++) cout << args[ia] << " ??????? ";
|
||||
cout << endl;
|
||||
#endif
|
||||
cmd=new multiSlsDetectorClient(iargval, args, PUT_ACTION, this);
|
||||
delete cmd;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ class multiSlsDetectorClient {
|
||||
if (action==slsDetectorDefs::GET_ACTION && argc<1) { \
|
||||
cout << "Wrong usage - should be: "<< argv[0] << "[id-][pos:]channel arg" << endl; \
|
||||
cout << endl; \
|
||||
|
||||
return; \
|
||||
}; \
|
||||
if (myDetector==NULL) {
|
||||
|
@ -4792,11 +4792,10 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
ifstream infile;
|
||||
// int iargval;
|
||||
// int interrupt=0;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
|
||||
char *args[1000];
|
||||
// for (int ia=0; ia<100; ia++) {
|
||||
// args[ia]=new char[1000];
|
||||
// }
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
@ -4831,10 +4830,7 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
||||
int iargval;
|
||||
int interrupt=0;
|
||||
char *args[100];
|
||||
for (int ia=0; ia<100; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
|
||||
char myargs[1000][1000];
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
@ -4866,7 +4862,8 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
||||
#ifdef VERBOSE
|
||||
std::cout<< iargval << " " << sargname << std::endl;
|
||||
#endif
|
||||
strcpy(args[iargval],sargname.c_str());
|
||||
strcpy(myargs[iargval],sargname.c_str());
|
||||
args[iargval]=myargs[iargval];
|
||||
iargval++;
|
||||
//}
|
||||
}
|
||||
|
@ -605,9 +605,9 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
|
||||
numberOfCommands=i;
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "Number of commands is " << numberOfCommands << endl;
|
||||
#endif
|
||||
// #ifdef VERBOSE
|
||||
// cout << "Number of commands is " << numberOfCommands << endl;
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -523,9 +523,11 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
||||
int iargval;
|
||||
int interrupt=0;
|
||||
char *args[2];
|
||||
for (int ia=0; ia<2; ia++) {
|
||||
args[ia]=new char[1000];
|
||||
}
|
||||
|
||||
char myargs[2][1000];
|
||||
args[0]=myargs[0];
|
||||
args[1]=myargs[1];
|
||||
|
||||
string sargname, sargval;
|
||||
int iline=0;
|
||||
|
||||
@ -562,7 +564,7 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
||||
while (ssstr.good()) {
|
||||
ssstr >> sargname;
|
||||
// if (ssstr.good()) {
|
||||
strcpy(args[iargval],sargname.c_str());
|
||||
strcpy(myargs[iargval],sargname.c_str());
|
||||
#ifdef VERBOSE
|
||||
std::cout<< args[iargval] << std::endl;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user