Detectors types can (should) be configured in the multiSlsDetector structure

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@181 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2012-05-22 12:24:15 +00:00
parent 83ee449e3c
commit 0bab16cde7
13 changed files with 650 additions and 248 deletions

View File

@ -53,6 +53,10 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
i++;
descrToFuncMap[i].m_pFuncName="type"; //OK
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname;
i++;
descrToFuncMap[i].m_pFuncName="hostname"; //OK
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname;
i++;
@ -929,23 +933,44 @@ string slsDetectorCommand::cmdHostname(int narg, char *args[], int action){
if (vvstr.fail())
ivar=-1;
}
p=string(args[0]).find("hostname");
if (action==PUT_ACTION) {
//add by hostname
if (ivar==-1) {
strcpy(hostname,"");
for (int id=1; id<narg; id++) {
strcat(hostname,args[id]);
if(narg>2)
strcat(hostname,"+");
}
} else
strcpy(hostname,args[1]);
myDet->setHostname(hostname, ivar);
}
return string(myDet->getHostname(ivar));
if (p==string::npos) {
//type
// cout << "should add by type!" << endl;
if (action==PUT_ACTION) {
//add by type
if (ivar==-1) {
strcpy(hostname,"");
for (int id=1; id<narg; id++) {
strcat(hostname,args[id]);
if(narg>2)
strcat(hostname,"+");
}
} else
strcpy(hostname,args[1]);
myDet->ssetDetectorsType(hostname, ivar);
}
return myDet->sgetDetectorsType(ivar);
} else {
if (action==PUT_ACTION) {
//add by hostname
if (ivar==-1) {
strcpy(hostname,"");
for (int id=1; id<narg; id++) {
strcat(hostname,args[id]);
if(narg>2)
strcat(hostname,"+");
}
} else
strcpy(hostname,args[1]);
myDet->setHostname(hostname, ivar);
}
return string(myDet->getHostname(ivar));
}
}