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) all: clean $(PROGS)
pc: clean pccompile $(PROGS)
pccompile:
CC := gcc
boot: $(OBJS) boot: $(OBJS)
$(PROGS): $(PROGS):

View File

@ -36,7 +36,19 @@ int nModBoard;
extern int dataBytes; 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 imod;
int n=getNModBoard(X)*getNModBoard(Y); 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){ int setNMod(int nm, enum dimension dim){
return 1; return 1;
} }

View File

@ -36,7 +36,7 @@ int nModBoard;
extern int dataBytes; extern int dataBytes;
int initializeDetector(){ int initializeDetectorStructure(){
int imod; int imod;
int n=getNModBoard(X)*getNModBoard(Y); 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){ int setNMod(int nm, enum dimension dim){
return 1; 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 mapCSP0(void);
int initializeDetector(); int initializeDetectorStructure();
int setupDetector();
int setNMod(int nm, enum dimension dim); int setNMod(int nm, enum dimension dim);
int getNModBoard(enum dimension arg); int getNModBoard(enum dimension arg);

View File

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