mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
client moved everythign from common files to slsSupportLin/include
This commit is contained in:
@ -5,14 +5,14 @@ set(SOURCES
|
||||
slsDetector/slsDetectorCommand.cpp
|
||||
slsDetector/slsDetector.cpp
|
||||
slsReceiverInterface/receiverInterface.cpp
|
||||
../commonFiles/utilities.cpp
|
||||
../slsSupportLib/include/utilities.cpp
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
include_directories(
|
||||
../commonFiles
|
||||
../slsSupportLib/include
|
||||
multiSlsDetector
|
||||
sharedMemory
|
||||
slsDetector
|
||||
@ -36,7 +36,7 @@ add_library(slsDetectorShared SHARED
|
||||
|
||||
add_library(zmq STATIC IMPORTED GLOBAL)
|
||||
|
||||
set(ZMQ_STATIC_ARCHIVE ${CMAKE_CURRENT_SOURCE_DIR}/../commonFiles/libzmq.a)
|
||||
set(ZMQ_STATIC_ARCHIVE ${CMAKE_CURRENT_SOURCE_DIR}/../slsSupportLib/include/libzmq.a)
|
||||
set_target_properties(zmq PROPERTIES
|
||||
IMPORTED_LOCATION ${ZMQ_STATIC_ARCHIVE}
|
||||
)
|
||||
@ -46,12 +46,12 @@ target_link_libraries(slsDetectorShared
|
||||
)
|
||||
|
||||
set(PUBLICHEADERS
|
||||
../commonFiles/sls_detector_defs.h
|
||||
../commonFiles/sls_detector_funcs.h
|
||||
../commonFiles/error_defs.h
|
||||
../commonFiles/versionAPI.h
|
||||
../commonFiles/sls_receiver_exceptions.h
|
||||
../commonFiles/utilties.h
|
||||
../slsSupportLib/include/sls_detector_defs.h
|
||||
../slsSupportLib/include/sls_detector_funcs.h
|
||||
../slsSupportLib/include/error_defs.h
|
||||
../slsSupportLib/include/versionAPI.h
|
||||
../slsSupportLib/include/sls_receiver_exceptions.h
|
||||
../slsSupportLib/include/utilties.h
|
||||
../slsSupportLib/include/container_utils.h
|
||||
sharedMemory/SharedMemory.h
|
||||
slsDetector/slsDetector.h
|
||||
|
@ -9,15 +9,15 @@ CFLAGS= -g -DC_ONLY -fPIC
|
||||
|
||||
DFLAGS= -g -DDACS_INT
|
||||
|
||||
INCLUDES?= -I../commonFiles -IslsDetector -ImultiSlsDetector -IslsReceiverInterface -IsharedMemory -I ../slsSupportLib/include-I$(ASM)
|
||||
INCLUDES?= -I../slsSupportLib/include -IslsDetector -ImultiSlsDetector -IslsReceiverInterface -IsharedMemory I$(ASM)
|
||||
|
||||
#EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -Wl,-R/usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -lca -lCom
|
||||
|
||||
LIBZMQDIR = ../commonFiles
|
||||
LIBZMQDIR = ../slsSupportLib/include
|
||||
LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq
|
||||
|
||||
SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp sharedMemory/SharedMemory.cpp ../commonFiles/utilities.cpp
|
||||
DEPSINCLUDES = ../commonFiles/sls_receiver_defs.h ../commonFiles/sls_receiver_funcs.h ../commonFiles/ansi.h ../commonFiles/sls_detector_defs.h ../commonFiles/sls_detector_funcs.h ../commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetector/detectorData.h sharedMemory/SharedMemory.h ../commonFiles/sls_receiver_exceptions.h ../commonFiles/versionAPI.h ../commonFiles/utilities.h ../slsSupportLib/include/container_utils.h
|
||||
SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp sharedMemory/SharedMemory.cpp ../slsSupportLib/include/utilities.cpp
|
||||
DEPSINCLUDES = ../slsSupportLib/include/sls_receiver_defs.h ../slsSupportLib/include/sls_receiver_funcs.h ../slsSupportLib/include/ansi.h ../slsSupportLib/include/sls_detector_defs.h ../slsSupportLib/include/sls_detector_funcs.h ../slsSupportLib/include/error_defs.h slsDetector/slsDetectorBase.h slsDetector/detectorData.h sharedMemory/SharedMemory.h ../slsSupportLib/include/sls_receiver_exceptions.h ../slsSupportLib/include/versionAPI.h ../slsSupportLib/include/utilities.h ../slsSupportLib/include/container_utils.h
|
||||
|
||||
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
This subversion repository contains
|
||||
|
||||
Common directories
|
||||
Please inform Anna or Dhanya if you make modifications to these directories
|
||||
- MySocketTCP : socket class
|
||||
- commonFiles : header file common to server and client
|
||||
- slsDetector : base class with all main detector functionalities (client side)
|
||||
|
||||
|
||||
Mythen specific directories
|
||||
Please inform Anna if you make modifications to these directories
|
||||
- mythenDetector : mythen specific funcs (mainly files I/O and angular conversion)
|
||||
- mythenDetectorServer : mythen server (for etrax compiler)
|
||||
- firmware lib might be added in the future
|
||||
|
||||
Other Detector specific directories
|
||||
Please inform Dhanya if you make modifications to these directories
|
||||
|
||||
make doc
|
@ -80,18 +80,18 @@ LATEX_HIDE_INDICES = YES
|
||||
|
||||
PREDEFINED = __cplusplus
|
||||
|
||||
INPUT = ../commonfiles/communication_funcs.h \
|
||||
../commonfiles/error_defs.h \
|
||||
../commonfiles/sls_detector_defs.h \
|
||||
../commonfiles/sls_detector_funcs.h \
|
||||
../commonfiles/ansi.h \
|
||||
../commonfiles/include/genericSocket.h \
|
||||
../commonfiles/include/logger.h \
|
||||
../commonfiles/include/MySocketTCP.h \
|
||||
../commonfiles/include/sls_receiver_defs.h \
|
||||
../commonfiles/include/sls_receiver_funcs.h \
|
||||
../commonfiles/include/utilities.h \
|
||||
../commonfiles/include/ZmqSocket.h \
|
||||
INPUT = ../slsSupportLib/include/communication_funcs.h \
|
||||
../slsSupportLib/include/error_defs.h \
|
||||
../slsSupportLib/include/sls_detector_defs.h \
|
||||
../slsSupportLib/include/sls_detector_funcs.h \
|
||||
../slsSupportLib/include/ansi.h \
|
||||
../slsSupportLib/include/genericSocket.h \
|
||||
../slsSupportLib/include/logger.h \
|
||||
../slsSupportLib/include/MySocketTCP.h \
|
||||
../slsSupportLib/include/sls_receiver_defs.h \
|
||||
../slsSupportLib/include/sls_receiver_funcs.h \
|
||||
../slsSupportLib/include/utilities.h \
|
||||
../slsSupportLib/include/ZmqSocket.h \
|
||||
multiSlsDetector/multiSlsDetectorClient.h \
|
||||
multiSlsDetector/multiSlsDetectorCommand.h \
|
||||
multiSlsDetector/multiSlsDetector.h \
|
||||
|
@ -1,21 +0,0 @@
|
||||
CC = g++
|
||||
#CC = bfin-uclinux-
|
||||
SRC = slsADCReader.cpp
|
||||
INCLUDES = -I ../../slsReceiverSoftware/include -I ../../commonFiles
|
||||
CFLAGS = -Wall -lm -lstdc++
|
||||
|
||||
|
||||
all: clean slsADCReader
|
||||
|
||||
|
||||
slsADCReader: $(SRC)
|
||||
echo "creating adc reader"
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(INCLUDES)
|
||||
|
||||
|
||||
clean:
|
||||
echo "cleaning"
|
||||
rm -rf *.o
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -1,120 +0,0 @@
|
||||
#include "MySocketTCP.h"
|
||||
|
||||
#include "sls_detector_defs.h"
|
||||
#include "sls_receiver_defs.h"
|
||||
|
||||
#include "sls_detector_funcs.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define INVALID -999
|
||||
|
||||
enum detectorFunctions{
|
||||
F_GET_ADC=13
|
||||
};
|
||||
|
||||
void help() {
|
||||
cerr << "Usage:\n"
|
||||
"slsAdcReader [hostname] [adcval]" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
slsDetectorDefs::dacIndex getADCEnum(char* cval){
|
||||
int idac;
|
||||
string cmd;
|
||||
cmd.assign(cval);
|
||||
|
||||
if (sscanf(cval,"adc:%d",&idac)==1) {
|
||||
return (slsDetectorDefs::dacIndex)(idac+1000);
|
||||
} else if (cmd=="temp_adc")
|
||||
return slsDetectorDefs::TEMPERATURE_ADC;
|
||||
else if (cmd=="temp_fpga")
|
||||
return slsDetectorDefs::TEMPERATURE_FPGA;
|
||||
else if (cmd=="temp_fpgaext")
|
||||
return slsDetectorDefs::TEMPERATURE_FPGAEXT;
|
||||
else if (cmd=="temp_10ge")
|
||||
return slsDetectorDefs::TEMPERATURE_10GE;
|
||||
else if (cmd=="temp_dcdc")
|
||||
return slsDetectorDefs::TEMPERATURE_DCDC;
|
||||
else if (cmd=="temp_sodl")
|
||||
return slsDetectorDefs::TEMPERATURE_SODL;
|
||||
else if (cmd=="temp_sodr")
|
||||
return slsDetectorDefs::TEMPERATURE_SODR;
|
||||
else if (cmd=="temp_fpgafl")
|
||||
return slsDetectorDefs::TEMPERATURE_FPGA2;
|
||||
else if (cmd=="temp_fpgafr")
|
||||
return slsDetectorDefs::TEMPERATURE_FPGA3;
|
||||
else if (cmd=="i_a")
|
||||
return slsDetectorDefs::I_POWER_A;
|
||||
else if (cmd=="i_b")
|
||||
return slsDetectorDefs::I_POWER_B;
|
||||
else if (cmd=="i_c")
|
||||
return slsDetectorDefs::I_POWER_C;
|
||||
else if (cmd=="i_d")
|
||||
return slsDetectorDefs::I_POWER_D;
|
||||
else if (cmd=="vm_a")
|
||||
return slsDetectorDefs::V_POWER_A;
|
||||
else if (cmd=="vm_b")
|
||||
return slsDetectorDefs::V_POWER_B;
|
||||
else if (cmd=="vm_c")
|
||||
return slsDetectorDefs::V_POWER_C;
|
||||
else if (cmd=="vm_d")
|
||||
return slsDetectorDefs::V_POWER_D;
|
||||
else if (cmd=="vm_io")
|
||||
return slsDetectorDefs::V_POWER_IO;
|
||||
else if (cmd=="i_io")
|
||||
return slsDetectorDefs::I_POWER_IO;
|
||||
else {
|
||||
cerr << "cannot decode dac " << cmd << endl;
|
||||
help();
|
||||
return slsDetectorDefs::I_POWER_IO;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 3)
|
||||
help();
|
||||
slsDetectorDefs::dacIndex idx=getADCEnum(argv[2]);
|
||||
|
||||
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
detectorFunctions fnum=F_GET_ADC;
|
||||
int retval=-1;
|
||||
int ret=slsReceiverDefs::FAIL;
|
||||
int arg[2]={idx,0};
|
||||
|
||||
MySocketTCP* mySocket = 0;
|
||||
|
||||
try {
|
||||
mySocket = new MySocketTCP(argv[1],1952);
|
||||
} catch (...) {
|
||||
cerr << "could not create socket with " << argv[1] << endl;
|
||||
help();
|
||||
}
|
||||
|
||||
if (mySocket->Connect()) {
|
||||
mySocket->SendDataOnly(&fnum, sizeof(fnum));
|
||||
mySocket->SendDataOnly(arg,sizeof(arg));
|
||||
mySocket->ReceiveDataOnly(&ret, sizeof(ret));
|
||||
if (ret != slsReceiverDefs::FAIL) {
|
||||
mySocket->ReceiveDataOnly(&retval, sizeof(retval));
|
||||
} else {
|
||||
mySocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
printf("Detector returned Error: %s",mess);
|
||||
}
|
||||
mySocket->Disconnect();
|
||||
} else
|
||||
cerr << "could not connect to " << argv[1] << endl;
|
||||
|
||||
if (idx <= 100) {
|
||||
printf("%.2f°C\n",(double)retval/1000.00);
|
||||
}else
|
||||
printf("%dmV\n",retval);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
@ -3,7 +3,7 @@ set(SOURCES
|
||||
)
|
||||
|
||||
include_directories(
|
||||
../../commonfiles
|
||||
../../slsSupportLib/include
|
||||
../multiSlsDetector
|
||||
../slsDetector
|
||||
../slsReceiverInterface
|
||||
|
@ -4,7 +4,7 @@ CFLAGS= -DC_ONLY
|
||||
#FLAGS=-DVERBOSE
|
||||
#ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||
|
||||
INCLUDES?= -I../../commonfiles -I../slsDetector -I../multiSlsDetector -I../slsReceiverInterface -I$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||
INCLUDES?= -I../../slsSupportLib/include -I../slsDetector -I../multiSlsDetector -I../slsReceiverInterface -I$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||
DESTDIR ?= ../../bin
|
||||
BIN=$(DESTDIR)
|
||||
LIBS?= -L$(DESTDIR) -lSlsDetector
|
||||
|
@ -1,6 +1,6 @@
|
||||
CFLAGS= -DC_ONLY
|
||||
FLAGS=-DVERBOSE
|
||||
INCLUDES= -I../commonFiles -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/usersFunctions -I../slsDetectorSoftware/multiSlsDetector -I../slsDetectorSoftware/slsDetectorAnalysis
|
||||
INCLUDES= -I../slsSupportLib/include -I../slsDetectorSoftware/slsDetector -I ../slsDetectorSoftware/MySocketTCP -I../slsDetectorSoftware/usersFunctions -I../slsDetectorSoftware/multiSlsDetector -I../slsDetectorSoftware/slsDetectorAnalysis
|
||||
LIBS= -L../slsDetectorSoftware/
|
||||
LDFLAG= -lSlsDetector -pthread
|
||||
|
||||
|
Reference in New Issue
Block a user