diff --git a/slsDetectorSoftware/slsDetectorClient/Makefile b/slsDetectorSoftware/slsDetectorClient/Makefile index 3eda2c3db..89c6def34 100644 --- a/slsDetectorSoftware/slsDetectorClient/Makefile +++ b/slsDetectorSoftware/slsDetectorClient/Makefile @@ -1,15 +1,17 @@ CFLAGS= -DC_ONLY -FLAGS=-DVERBOSE -INCLUDES= -I../slsDetectorSoftware/commonFiles -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/mythenDetector -I../slsDetectorSoftware/gotthardDetector -I../slsDetectorSoftware/usersFunctions -I../slsDetectorSoftware/multiSlsDetector +#FLAGS=-DVERBOSE +INCLUDES= -I../slsDetectorSoftware/commonFiles -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/usersFunctions -I../slsDetectorSoftware/multiSlsDetector #LIBS=-L../TMythenDetector/bin/ -L$(QTDIR)/lib LIBS= -L../slsDetectorSoftware/ LDFLAG= -lSlsDetector -lpthread BIN=bin -SRC_CLNT=multi_sls_detector_client.cpp +SRC_CLNT=sls_detector_client.cpp -all: lib sls_detector_put sls_detector_get sls_detector_acquire sls_detector_help +clients: sls_detector_put sls_detector_get sls_detector_acquire sls_detector_help + +all: lib clients lib: cd ../slsDetectorSoftware && $(MAKE) lib @@ -45,6 +47,7 @@ install_sls_detector: all cp -P $(BIN)/sls_detector_put $(DESTDIR) cp -P $(BIN)/sls_detector_get $(DESTDIR) cp -P $(BIN)/sls_detector_acquire $(DESTDIR) + cp -P $(BIN)/sls_detector_help $(DESTDIR) diff --git a/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp b/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp index 9dcf2a6d6..0783baa4c 100644 --- a/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp +++ b/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp @@ -4,6 +4,7 @@ #include "multiSlsDetector.h" #include "slsDetector.h" +#include "slsDetectorCommand.h" #include @@ -19,7 +20,8 @@ int main(int argc, char *argv[]) string answer; char cmd[100]; int action; - slsDetectorCommand *myDetector; + slsDetectorBase *myDetector; + slsDetectorCommand *myCmd; @@ -73,7 +75,7 @@ int main(int argc, char *argv[]) } else { #ifdef GET cout << "Wrong usage - should be: "<< argv[0] << "[id:/id-]channel" << endl; - cout << myDetector->helpLine(argc-1, argv, action); + cout << slsDetectorCommand::helpLine(argc-1, argv, action); cout << endl; return -1; #endif @@ -81,7 +83,7 @@ int main(int argc, char *argv[]) #ifdef PUT if (argc<3) { cout << "Wrong usage - should be: "<< argv[0] << "[id:/id-]channel arg" << endl; - cout << myDetector->helpLine(argc-1, argv+1, action); + cout << slsDetectorCommand::helpLine(argc-1, argv+1, action); cout << endl; return -1; } @@ -90,26 +92,23 @@ int main(int argc, char *argv[]) cout << "Using default multiSlsDetector" << id << endl; #endif myDetector=new multiSlsDetector(); - answer=myDetector->executeLine(argc-1, argv, action); - cout << answer<< endl; - return 0; } #ifdef PUT if (argc<3) { cout << "Wrong usage - should be: "<< argv[0] <<" " << argv[1]<< " arg" << endl; - cout << myDetector->helpLine(argc-1, argv+1, action); + cout << slsDetectorCommand::helpLine(argc-1, argv+1, action); cout << endl; return -1; } #endif - + myCmd=new slsDetectorCommand(myDetector); if (argc<2) { - answer=myDetector->executeLine(argc-1, argv, action); + answer=myCmd->executeLine(argc-1, argv, action); } else { - answer=myDetector->executeLine(argc-1, argv+1, action); + answer=myCmd->executeLine(argc-1, argv+1, action); } cout << answer<< endl;