diff --git a/slsDetectorSoftware/Makefile.x04sa b/slsDetectorSoftware/Makefile.x04sa index 6ff533949..5a5eaf9d4 100644 --- a/slsDetectorSoftware/Makefile.x04sa +++ b/slsDetectorSoftware/Makefile.x04sa @@ -1,19 +1,26 @@ -#CFLAGS= -DC_ONLY -#FLAGS=-DVERBOSE -INCLUDES= -IcommonFiles -IslsDetector -IMySocketTCP -IusersFunctions -ImultiSlsDetector -IslsDetectorUtils -IslsDetectorCommand +INCLUDES= -IcommonFiles -IslsDetector -IMySocketTCP -IusersFunctions -ImultiSlsDetector -IslsDetectorUtils -IslsDetectorCommand -IslsDetectorAnalysis EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/SL5-x86/ -Wl,-R/usr/local/epics/base/lib/SL5-x86 -lca -lCom +CFLAGS= -DC_ONLY +FLAGS= $(EPICSFLAGS) -SRC_CLNT= slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp usersFunctions/usersFunctions.cpp MySocketTCP/MySocketTCP.cpp +CC=g++ + + +SRC_CLNT= slsDetectorAnalysis/fileIO.cpp MySocketTCP/MySocketTCP.cpp usersFunctions/usersFunctions.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp slsDetectorAnalysis/angularConversion.cpp slsDetectorAnalysis/energyConversion.cpp slsDetector/slsDetectorActions.cpp slsDetectorAnalysis/postProcessing.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp OBJS = $(SRC_CLNT:.cpp=.o) +HEADERS = $(SRC_CLNT:.cpp=.h) commonFiles/sls_detector_defs.h slsDetectorAnalysis/detectorData.h slsDetector/slsDetectorBase.h slsDetector/slsDetectorUsers.h multiSlsDetector/multiSlsDetectorCommand.h + + + SRC_MYTHEN_SVC = mythenDetectorServer/server.c mythenDetectorServer/server_funcs.c mythenDetectorServer/communication_funcs.c mythenDetectorServer/firmware_funcs.c mythenDetectorServer/mcb_funcs.c mythenDetectorServer/trimming_funcs.c -all: package $(SRC_CLNT) - +all: package $(SRC_CLNT) + echo "compiling all" doc: $(SRC_H) $(SRC_CLNT) doxygen doxy.config @@ -30,16 +37,19 @@ picassoServer: $(SRC_MYTHEN_SVC) mv a.out picassoServer + + %.o : %.cpp %.h $(CXX) -Wall -o $@ -c $< $(INCLUDES) $(FLAGS) $(EPICSFLAGS) + package: $(OBJS) - $(CXX) -shared -Wl,-soname,libSlsDetector.so -o libSlsDetector.so $(OBJS) -lc $(INCLUDES) $(FLAGS) $(EPICSFLAGS) + $(CXX) -shared -Wl,-soname,libSlsDetector.so -o libSlsDetector.so $(OBJS) -lc $(INCLUDES) $(FLAGS) $(EPICSFLAGS) ar rcs libSlsDetector.a $(OBJS) - clean: - rm -rf libSlsDetector.so libSlsDetector.a core $(OBJS) docs/* + rm -rf libSlsDetector.a libSlsDetector.so core docs/* $(OBJS) + #------------------------------------------------------------------------------- lib: package @@ -52,15 +62,9 @@ install_lib: lib install_inc: $(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR)) - cp -P ../slsDetectorSoftware/MySocketTCP/MySocketTCP.h $(DESTDIR) - cp -P ../slsDetectorSoftware/slsDetector/slsDetectorBase.h $(DESTDIR) - cp -P ../slsDetectorSoftware/slsDetector/slsDetector.h $(DESTDIR) - cp -P ../slsDetectorSoftware/slsDetector/slsDetectorUtils.h $(DESTDIR) - cp -P ../slsDetectorSoftware/slsDetector/slsDetectorCommand.h $(DESTDIR) - cp -P ../slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h $(DESTDIR) - cp -P ../slsDetectorSoftware/commonFiles/sls_detector_defs.h $(DESTDIR) - cp -P ../slsDetectorSoftware/usersFunctions/usersFunctions.h $(DESTDIR) + cp -P $(HEADERS) $(DESTDIR) + install_doc: $(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR)) - cp -Pr docs/* $(DESTDIR) \ No newline at end of file + cp -Pr docs/* $(DESTDIR) diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index b22f6a40e..0cd9af63e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -3854,11 +3854,10 @@ int slsDetector::executeTrimming(trimMode mode, int par1, int par2, int imod){ if (controlSocket) { if (controlSocket->Connect()>=0) { controlSocket->SendDataOnly(&fnum,sizeof(fnum)); -#ifndef VERBOSE - controlSocket->SendDataOnly(&mode,sizeof(mode)); -#else +#ifdef VERBOSE std::cout<< "sending mode bytes= "<< controlSocket->SendDataOnly(&mode,sizeof(mode)) << std::endl; #endif + controlSocket->SendDataOnly(&mode,sizeof(mode)); controlSocket->SendDataOnly(arg,sizeof(arg)); controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index 3e992df8d..f43752729 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -97,7 +97,6 @@ void slsDetectorUtils::acquire(int delflag){ ns1=1; - //cout << "action at start" << endl; if (*stoppedFlag==0) { executeAction(startScript); @@ -142,6 +141,8 @@ void slsDetectorUtils::acquire(int delflag){ break; + createFileName(); + if (*stoppedFlag==0) { executeAction(scriptBefore); } else @@ -149,6 +150,7 @@ void slsDetectorUtils::acquire(int delflag){ + if (*stoppedFlag==0) { executeAction(headerBefore); @@ -195,8 +197,9 @@ void slsDetectorUtils::acquire(int delflag){ pthread_mutex_lock(&mp); while (queuesize){ pthread_mutex_unlock(&mp); - usleep(10000); + usleep(100000); pthread_mutex_lock(&mp); + } pthread_mutex_unlock(&mp);