modification to setDetectorSize

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@201 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi 2012-06-29 07:21:30 +00:00
parent f0dfedeba7
commit cee632e3b5
3 changed files with 19 additions and 12 deletions

View File

@ -4957,8 +4957,12 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
int iv=0;
char *args[100];
char myargs[100][1000];
for (int ia=0; ia<100; ia++) {
args[ia]=new char[1000];
//args[ia]=new char[1000];
args[ia]=myargs[ia];
}

View File

@ -292,9 +292,9 @@ class slsDetectorBase : public virtual slsDetectorDefs, public slsDetectorUsers
*/
virtual int setNumberOfModules(int i=-1, dimension d=X)=0;
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1){return setNumberOfModules(nx/getChansPerMod(0),X);};
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1){int nm=-1; if (nx>=0) nm=nx/getChansPerMod(0); return setNumberOfModules(nm,X);};
int getDetectorSize(int &x0, int &y0, int &nx, int &ny){x0=0; nx=setNumberOfModules(-1,X)*getChansPerMod(0); return nx;};
int getDetectorSize(int &x0, int &y0, int &nx, int &ny){x0=0; nx=setNumberOfModules(-1,X)*getChansPerMod(0); y0=0; ny=1; return nx;};
virtual int getMaxNumberOfModules(dimension d=X)=0; //
int getMaximumDetectorSize(int &nx, int &ny){nx=getMaxNumberOfModules(X)*getChansPerMod(0); ny=1; return nx;};

View File

@ -658,9 +658,12 @@ int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
ofstream outfile;
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];
// for (int ia=0; ia<2; ia++) {
// args[ia]=new char[1000];
//}
@ -691,18 +694,18 @@ int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
}
strcpy(args[0],names[iv].c_str());
strcpy(myargs[0],names[iv].c_str());
if (level==2) {
fname1=fname+string(".ff");
strcpy(args[1],fname1.c_str());
strcpy(myargs[1],fname1.c_str());
}
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
iv++;
strcpy(args[0],names[iv].c_str());
strcpy(myargs[0],names[iv].c_str());
if (level==2) {
fname1=fname+string(".bad");
strcpy(args[1],fname1.c_str());
strcpy(myargs[1],fname1.c_str());
}
outfile << names[iv] << " " << cmd->executeLine(nargs,args,GET_ACTION) << std::endl;
iv++;
@ -710,14 +713,14 @@ int slsDetectorUtils::dumpDetectorSetup(string const fname, int level){
if (level==2) {
strcpy(args[0],names[iv].c_str());
strcpy(myargs[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());
strcpy(myargs[1],fname1.c_str());
#ifdef VERBOSE
std::cout<< "writing to file " << fname1 << std::endl;
#endif