sls_detector_acquire [id-] should finally work

This commit is contained in:
bergamaschi 2015-08-31 14:44:40 +02:00
parent d19b051860
commit 34a1dac0fe

View File

@ -20,14 +20,31 @@ class multiSlsDetectorClient {
multiSlsDetectorClient(int argc, char *argv[], int action, multiSlsDetector *myDetector=NULL) { \
string answer; \
multiSlsDetectorCommand *myCmd; \
int id=-1, iv=0, pos=-1; \
int del=0; \
if (argc==0 && action==slsDetectorDefs::READOUT_ACTION) { \
char cmd[100]; \
if (action==slsDetectorDefs::READOUT_ACTION) { \
if (argc!=0) {
iv=sscanf(argv[0],"%d-%s",&id,cmd); \
if (iv>0 && id>=0 && strchr(argv[0],'-')) {
cout << "id " << id << endl; \
if (iv>1)
argv[0]=cmd;
}
iv=sscanf(argv[0],"%d:",&pos); \
if (iv>0 && pos>=0 && strchr(argv[0],':'))
cout << "pos " << pos << "is not allowed!" << endl; \
}
if (id<0)
id=0;
if (myDetector==NULL) { \
myDetector=new multiSlsDetector(); \
myDetector=new multiSlsDetector(id); \
//myDetector->registerDataCallback(&dummyCallback, NULL);
del=1; \
};
cout << "noid" <<endl;
// cout << "noid" <<endl;
myCmd=new multiSlsDetectorCommand(myDetector); \
answer=myCmd->executeLine(argc, argv, action); \
cout << answer<< endl; \
@ -35,8 +52,6 @@ class multiSlsDetectorClient {
if (del) delete myDetector; \
return; \
}; \
int id=-1, iv=0, pos=-1; \
char cmd[100]; \
if (action==slsDetectorDefs::PUT_ACTION && argc<2) { \
cout << "Wrong usage - should be: "<< argv[0] << \
"[id-][pos:]channel arg" << endl; \