From 590e611afcf395ffee26a3e9616cf86bf46b2172 Mon Sep 17 00:00:00 2001 From: bergamaschi Date: Tue, 17 Jan 2012 13:47:20 +0000 Subject: [PATCH] using only the slsDetector class git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@391 951219d9-93cf-4727-9268-0efd64621fa3 --- .../slsDetectorClient/Makefile | 3 +- .../slsDetectorClient/sls_detector_client.cpp | 81 +++++++++---------- 2 files changed, 38 insertions(+), 46 deletions(-) diff --git a/slsDetectorSoftware/slsDetectorClient/Makefile b/slsDetectorSoftware/slsDetectorClient/Makefile index e6e5a318f..1588a5c66 100644 --- a/slsDetectorSoftware/slsDetectorClient/Makefile +++ b/slsDetectorSoftware/slsDetectorClient/Makefile @@ -1,6 +1,7 @@ CFLAGS= -DC_ONLY #FLAGS=-DVERBOSE -INCLUDES= -I../slsDetectorSoftware/commonFiles -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/mythenDetector -I../slsDetectorSoftware/gotthardDetector -I../slsDetectorSoftware/usersFunctions +INCLUDES= -I../slsDetectorSoftware/commonFiles -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/usersFunctions +#-I../slsDetectorSoftware/mythenDetector -I../slsDetectorSoftware/gotthardDetector #LIBS=-L../TMythenDetector/bin/ -L$(QTDIR)/lib LIBS= -L$(QTDIR)/lib -L../slsDetectorSoftware/ LDFLAG=-lSlsDetector -lpthread diff --git a/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp b/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp index 4a5331cdf..54c2c39b2 100644 --- a/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp +++ b/slsDetectorSoftware/slsDetectorClient/sls_detector_client.cpp @@ -1,13 +1,7 @@ #include #include -#ifdef MYTHEN_DET -#include "mythenDetector.h" -#endif - -#ifdef GOTTHARD_DET -#include "gotthardDetector.h" -#endif +#include "slsDetector.h" #include @@ -17,54 +11,54 @@ int main(int argc, char *argv[]) { + int id=0; char *c; string answer; int action; -#ifdef MYTHEN_DET - mythenDetector *myDetector; + slsDetector *myDetector; + + + #ifdef READOUT - action=mythenDetector::READOUT_ACTION; + action=slsDetector::READOUT_ACTION; #elif PUT - action=mythenDetector::PUT_ACTION; + action=slsDetector::PUT_ACTION; #elif GET - action=mythenDetector::GET_ACTION; -#endif -#endif - -#ifdef GOTTHARD_DET - gotthardDetector *myDetector; -#ifdef READOUT - action=gotthardDetector::READOUT_ACTION; -#elif PUT - action=gotthardDetector::PUT_ACTION; -#elif GET - action=gotthardDetector::GET_ACTION; + action=slsDetector::GET_ACTION; #endif + + + detectorType t; + +#ifdef MYTHEN_DET +#ifndef PICASSOD + t=MYTHEN; +#else + t=PICASSO; +#endif; +#elif GOTTHARD_DET + t=GOTTHARD; +#else + t=GENERIC; #endif + + + if (argc>1 && sscanf(argv[1],"%d",&id)){ -#ifdef MYTHEN_DET -#ifndef PICASSOD - myDetector=new mythenDetector(id); -#else - myDetector=new mythenDetector(id,PICASSO); -#endif -#endif -#ifdef GOTTHARD_DET - myDetector=new gotthardDetector(id); -#endif + + myDetector=new slsDetector(t,id); + + } else { cout << "Wrong usage - should be: "<< argv[0] << " id"; cout << "(:channel arg)" << endl; -#ifdef MYTHEN_DET - cout << mythenDetector::helpLine(action); -#endif -#ifdef GOTTHARD_DET - cout << gotthardDetector::helpLine(action); -#endif + + cout << slsDetector::helpLine(action); + cout << endl; return -1; } @@ -75,12 +69,9 @@ int main(int argc, char *argv[]) if (argc<3) { cout << "Wrong usage - should be: "<< argv[0] << " id"; cout << ":channel arg" << endl; -#ifdef MYTHEN_DET - cout << mythenDetector::helpLine(action); -#endif -#ifdef GOTTHARD_DET - cout << gotthardDetector::helpLine(action); -#endif + + cout << slsDetector::helpLine(action); + cout << endl; return -1; }