servers, setupdetector

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@588 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-05-29 13:50:41 +00:00
parent 392129675c
commit 78aaedf243
5 changed files with 79 additions and 8 deletions

View File

@ -13,6 +13,11 @@ OBJS = $(SRC_CLNT:.cpp=.o)
all: clean $(PROGS)
pc: clean pccompile $(PROGS)
pccompile:
CC := gcc
boot: $(OBJS)
$(PROGS):

View File

@ -36,7 +36,19 @@ int nModBoard;
extern int dataBytes;
int initializeDetector(){
/** temporary */
u_int32_t CSP0BASE;
int mapCSP0(void) {
CSP0BASE = (u_int32_t)malloc(0xFFFFFFF);
printf("memory allocated\n");
printf("CSPOBASE is 0x%x \n",CSP0BASE);
printf("CSPOBASE=from %08x to %x\n",CSP0BASE,CSP0BASE+0xFFFFFFF);
return OK;
}
int initializeDetectorStructure(){
int imod;
int n=getNModBoard(X)*getNModBoard(Y);
@ -82,6 +94,31 @@ int initializeDetector(){
int setupDetector(){
//testFpga();
//testRAM();
//setSettings(GET_SETTINGS,-1);
//setFrames(1);
//setTrains(1);
//setExposureTime(1e6);
//setPeriod(1e9);
//setDelay(0);
//setGates(0);
//setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
//setMaster(GET_MASTER);
//setSynchronization(GET_SYNCHRONIZATION_MODE);
return OK;
}
int setNMod(int nm, enum dimension dim){
return 1;
}

View File

@ -36,7 +36,7 @@ int nModBoard;
extern int dataBytes;
int initializeDetector(){
int initializeDetectorStructure(){
int imod;
int n=getNModBoard(X)*getNModBoard(Y);
@ -82,6 +82,30 @@ int initializeDetector(){
int setupDetector(){
//testFpga();
//testRAM();
//setSettings(GET_SETTINGS,-1);
//setFrames(1);
//setTrains(1);
//setExposureTime(1e6);
//setPeriod(1e9);
//setDelay(0);
//setGates(0);
//setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
//setMaster(GET_MASTER);
//setSynchronization(GET_SYNCHRONIZATION_MODE);
return OK;
}
int setNMod(int nm, enum dimension dim){
return 1;
}

View File

@ -33,7 +33,8 @@ Here are the definitions, but the actual implementation should be done for each
int mapCSP0(void);
int initializeDetector();
int initializeDetectorStructure();
int setupDetector();
int setNMod(int nm, enum dimension dim);
int getNModBoard(enum dimension arg);

View File

@ -52,16 +52,17 @@ int init_detector(int b) {
printf("This is a VIRTUAL detector\n");
#endif
#ifdef SLS_DETECTOR_FUNCTION_LIST
//mapCSP0();
mapCSP0();
#endif
//only for control server
if(b){
#ifdef SLS_DETECTOR_FUNCTION_LIST
initializeDetector();
initializeDetectorStructure();
setupDetector();
/* all these should also be included in setupDetector */
//testFpga();
//testRAM();
//Initialization
//setSettings(GET_SETTINGS,-1);
//setFrames(1);
//setTrains(1);
@ -69,7 +70,6 @@ int init_detector(int b) {
//setPeriod(1e9);
//setDelay(0);
//setGates(0);
//setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
//setMaster(GET_MASTER);
//setSynchronization(GET_SYNCHRONIZATION_MODE);
@ -91,7 +91,9 @@ int decode_function(int file_des) {
#endif
n = receiveDataOnly(file_des,&fnum,sizeof(fnum));
if (n <= 0) {
#ifdef VERBOSE
printf("ERROR reading from socket %d, %d %d\n", n, fnum, file_des);
#endif
return FAIL;
}
#ifdef VERBOSE
@ -102,6 +104,8 @@ int decode_function(int file_des) {
#ifdef VERBOSE
printf( "calling function fnum = %d %x\n",fnum,flist[fnum]);
#endif
printf( "calling function fnum = %x %x\n",fnum,(unsigned int)flist[fnum]);
if (fnum<0 || fnum>255)
fnum=255;
ret=(*flist[fnum])(file_des);