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;
|
multiSlsDetectorClient *cmd;
|
||||||
char ext[100];
|
char ext[100];
|
||||||
|
|
||||||
@ -3086,11 +3102,10 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
|||||||
ifstream infile;
|
ifstream infile;
|
||||||
int iargval;
|
int iargval;
|
||||||
int interrupt=0;
|
int interrupt=0;
|
||||||
char *args[100];
|
char *args[1000];
|
||||||
for (int ia=0; ia<100; ia++) {
|
|
||||||
args[ia]=new char[1000];
|
char myargs[1000][1000];
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string sargname, sargval;
|
string sargname, sargval;
|
||||||
int iline=0;
|
int iline=0;
|
||||||
@ -3127,10 +3142,23 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< iargval << " " << sargname << std::endl;
|
std::cout<< iargval << " " << sargname << std::endl;
|
||||||
#endif
|
#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++;
|
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);
|
cmd=new multiSlsDetectorClient(iargval, args, PUT_ACTION, this);
|
||||||
delete cmd;
|
delete cmd;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ class multiSlsDetectorClient {
|
|||||||
if (action==slsDetectorDefs::GET_ACTION && argc<1) { \
|
if (action==slsDetectorDefs::GET_ACTION && argc<1) { \
|
||||||
cout << "Wrong usage - should be: "<< argv[0] << "[id-][pos:]channel arg" << endl; \
|
cout << "Wrong usage - should be: "<< argv[0] << "[id-][pos:]channel arg" << endl; \
|
||||||
cout << endl; \
|
cout << endl; \
|
||||||
|
|
||||||
return; \
|
return; \
|
||||||
}; \
|
}; \
|
||||||
if (myDetector==NULL) {
|
if (myDetector==NULL) {
|
||||||
|
@ -4792,11 +4792,10 @@ int slsDetector::readConfigurationFile(string const fname){
|
|||||||
ifstream infile;
|
ifstream infile;
|
||||||
// int iargval;
|
// int iargval;
|
||||||
// int interrupt=0;
|
// int interrupt=0;
|
||||||
char *args[100];
|
char *args[1000];
|
||||||
for (int ia=0; ia<100; ia++) {
|
// for (int ia=0; ia<100; ia++) {
|
||||||
args[ia]=new char[1000];
|
// args[ia]=new char[1000];
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
string sargname, sargval;
|
string sargname, sargval;
|
||||||
int iline=0;
|
int iline=0;
|
||||||
@ -4831,10 +4830,7 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
|||||||
int iargval;
|
int iargval;
|
||||||
int interrupt=0;
|
int interrupt=0;
|
||||||
char *args[100];
|
char *args[100];
|
||||||
for (int ia=0; ia<100; ia++) {
|
char myargs[1000][1000];
|
||||||
args[ia]=new char[1000];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string sargname, sargval;
|
string sargname, sargval;
|
||||||
int iline=0;
|
int iline=0;
|
||||||
@ -4866,7 +4862,8 @@ int slsDetector::readConfigurationFile(ifstream &infile){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< iargval << " " << sargname << std::endl;
|
std::cout<< iargval << " " << sargname << std::endl;
|
||||||
#endif
|
#endif
|
||||||
strcpy(args[iargval],sargname.c_str());
|
strcpy(myargs[iargval],sargname.c_str());
|
||||||
|
args[iargval]=myargs[iargval];
|
||||||
iargval++;
|
iargval++;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
@ -605,9 +605,9 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
|||||||
|
|
||||||
numberOfCommands=i;
|
numberOfCommands=i;
|
||||||
|
|
||||||
#ifdef VERBOSE
|
// #ifdef VERBOSE
|
||||||
cout << "Number of commands is " << numberOfCommands << endl;
|
// cout << "Number of commands is " << numberOfCommands << endl;
|
||||||
#endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -523,9 +523,11 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
|||||||
int iargval;
|
int iargval;
|
||||||
int interrupt=0;
|
int interrupt=0;
|
||||||
char *args[2];
|
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;
|
string sargname, sargval;
|
||||||
int iline=0;
|
int iline=0;
|
||||||
|
|
||||||
@ -562,7 +564,7 @@ int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
|||||||
while (ssstr.good()) {
|
while (ssstr.good()) {
|
||||||
ssstr >> sargname;
|
ssstr >> sargname;
|
||||||
// if (ssstr.good()) {
|
// if (ssstr.good()) {
|
||||||
strcpy(args[iargval],sargname.c_str());
|
strcpy(myargs[iargval],sargname.c_str());
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< args[iargval] << std::endl;
|
std::cout<< args[iargval] << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user