diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h index 9bfd9d224..6bcc3581d 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h @@ -19,15 +19,32 @@ class multiSlsDetectorClient { public: multiSlsDetectorClient(int argc, char *argv[], int action, multiSlsDetector *myDetector=NULL) { \ string answer; \ - multiSlsDetectorCommand *myCmd; \ + 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" <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; \