moench server first draft

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@509 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-04-11 12:44:19 +00:00
parent c5b3f10669
commit 61a1356bc3
8 changed files with 38 additions and 24 deletions

View File

@ -172,7 +172,8 @@ enum detectorType {
EIGER, /**< eiger */ EIGER, /**< eiger */
GOTTHARD, /**< gotthard */ GOTTHARD, /**< gotthard */
PICASSO, /**< picasso */ PICASSO, /**< picasso */
AGIPD /**< agipd */ AGIPD, /**< agipd */
MOENCH /**< moench */
}; };
/* /\** */ /* /\** */

View File

@ -26,12 +26,13 @@ const enum detectorType myDetectorType=GOTTHARD;
const enum detectorType myDetectorType=EIGER; const enum detectorType myDetectorType=EIGER;
#elif PICASSOD #elif PICASSOD
const enum detectorType myDetectorType=PICASSO; const enum detectorType myDetectorType=PICASSO;
#elif MOENCHD
const enum detectorType myDetectorType=MOENCH;
#else #else
const enum detectorType myDetectorType=GENERIC; const enum detectorType myDetectorType=GENERIC;
#endif #endif
extern int nModX; extern int nModX;
extern int nModY; extern int nModY;
extern int dataBytes; extern int dataBytes;

View File

@ -6,10 +6,10 @@
CROSS = bfin-uclinux- CROSS = bfin-uclinux-
CC = $(CROSS)gcc CC = $(CROSS)gcc
CFLAGS += -Wall -DMCB_FUNCS -DDACS_INT -DDEBUG #-DVERBOSE #-DVERYVERBOSE #-DVIRTUAL #-DDACS_INT_CSERVER CFLAGS += -Wall -DMOENCHD -DMCB_FUNCS -DDACS_INT -DDEBUG #-DVERBOSE #-DVERYVERBOSE #-DVIRTUAL #-DDACS_INT_CSERVER
PROGS= gotthardDetectorServer PROGS= moenchDetectorServer
INSTDIR= /tftpboot INSTDIR= /tftpboot
INSTMODE= 0777 INSTMODE= 0777

View File

@ -2,7 +2,7 @@
DESTDIR ?= ./ DESTDIR ?= ./
CC = gcc CC = gcc
CFLAGS += -Wall -DMCB_FUNCS -DDACS_INT -DDEBUG -DVIRTUAL CFLAGS += -Wall -DMOENCH -DMCB_FUNCS -DDACS_INT -DDEBUG -DVIRTUAL
PROGS= $(DESTDIR)/gotthardVirtualServer PROGS= $(DESTDIR)/gotthardVirtualServer

View File

@ -26,7 +26,6 @@ const int nChans=NCHAN;
const int nChips=NCHIP; const int nChips=NCHIP;
const int nDacs=NDAC; const int nDacs=NDAC;
const int nAdcs=NADC; const int nAdcs=NADC;
const enum detectorType myDetectorType=GOTTHARD;
enum detectorSettings thisSettings; enum detectorSettings thisSettings;
int sChan, sChip, sMod, sDac, sAdc; int sChan, sChip, sMod, sDac, sAdc;

View File

@ -8,13 +8,13 @@
// Hardware definitions // Hardware definitions
#define NCHAN 128 #define NCHAN 160*160
#define NCHIP 10 #define NCHIP 1
#define NMAXMODX 1 #define NMAXMODX 1
#define NMAXMODY 1 #define NMAXMODY 1
#define NMAXMOD NMAXMODX*NMAXMODY #define NMAXMOD NMAXMODX*NMAXMODY
#define NDAC 8 #define NDAC 8
#define NADC 5 #define NADC 1
#define NCHANS NCHAN*NCHIP*NMAXMOD #define NCHANS NCHAN*NCHIP*NMAXMOD
#define NDACS NDAC*NMAXMOD #define NDACS NDAC*NMAXMOD

View File

@ -9,7 +9,7 @@
#include "mcb_funcs.h" #include "mcb_funcs.h"
#include "trimming_funcs.h" #include "trimming_funcs.h"
#include "registers_g.h" #include "registers_g.h"
#include "svnInfoGotthard.h" #include "svnInfoMoench.h"
#define FIFO_DATA_REG_OFF 0x50<<11 #define FIFO_DATA_REG_OFF 0x50<<11
#define CONTROL_REG 0x24<<11 #define CONTROL_REG 0x24<<11
@ -17,12 +17,23 @@
int (*flist[256])(int); int (*flist[256])(int);
#ifdef MCB_FUNCS
extern const enum detectorType myDetectorType; //defined in the detector specific file
#endif #ifdef MYTHEND
#ifndef MCB_FUNCS const enum detectorType myDetectorType=MYTHEN;
#elif GOTTHARDD
const enum detectorType myDetectorType=GOTTHARD; const enum detectorType myDetectorType=GOTTHARD;
#elif EIGERD
const enum detectorType myDetectorType=EIGER;
#elif PICASSOD
const enum detectorType myDetectorType=PICASSO;
#elif MOENCHD
const enum detectorType myDetectorType=MOENCH;
#else
const enum detectorType myDetectorType=GENERIC;
#endif #endif
extern int nModX; extern int nModX;
extern int nModY; extern int nModY;
extern int dataBytes; extern int dataBytes;
@ -46,7 +57,7 @@ int digitalTestBit = 0;
int init_detector( int b) { int init_detector( int b) {
#ifndef PICASSOD #ifndef PICASSOD
printf("This is a GOTTHARD detector with %d chips per module\n", NCHIP); printf("This is a MOENCH detector with %d chips per module\n", NCHIP);
#else #else
printf("This is a PICASSO detector with %d chips per module\n", NCHIP); printf("This is a PICASSO detector with %d chips per module\n", NCHIP);
#endif #endif
@ -63,7 +74,7 @@ int init_detector( int b) {
#endif #endif
testFpga(); testFpga();
testRAM(); testRAM();
//gotthard specific //moench specific
setPhaseShiftOnce(); setPhaseShiftOnce();
prepareADC(); prepareADC();
@ -1569,7 +1580,7 @@ int get_threshold_energy(int file_des) {
int n; int n;
int imod; int imod;
strcpy(mess,"cannot set threshold for gotthard"); strcpy(mess,"cannot set threshold for moench");
n = receiveDataOnly(file_des,&imod,sizeof(imod)); n = receiveDataOnly(file_des,&imod,sizeof(imod));
if (n < 0) if (n < 0)
@ -1590,7 +1601,7 @@ int set_threshold_energy(int file_des) {
int arg[3]; int arg[3];
int n; int n;
strcpy(mess,"cannot set threshold for gotthard"); strcpy(mess,"cannot set threshold for moench");
n = receiveDataOnly(file_des,&arg,sizeof(arg)); n = receiveDataOnly(file_des,&arg,sizeof(arg));
if (n < 0) if (n < 0)
@ -2053,7 +2064,7 @@ int set_timer(int file_des) {
retval=setGates(tns); retval=setGates(tns);
break; break;
case PROBES_NUMBER: case PROBES_NUMBER:
sprintf(mess,"can't set timer for gotthard\n"); sprintf(mess,"can't set timer for moench\n");
ret=FAIL; ret=FAIL;
break; break;
case CYCLES_NUMBER: case CYCLES_NUMBER:
@ -2317,7 +2328,7 @@ int set_speed(int file_des) {
receiveDataOnly(file_des,&arg,sizeof(arg)); receiveDataOnly(file_des,&arg,sizeof(arg));
receiveDataOnly(file_des,&val,sizeof(val)); receiveDataOnly(file_des,&val,sizeof(val));
sprintf(mess,"can't set speed variable for gotthard\n"); sprintf(mess,"can't set speed variable for moench\n");
sendDataOnly(file_des,&ret,sizeof(ret)); sendDataOnly(file_des,&ret,sizeof(ret));
@ -2337,7 +2348,7 @@ int set_readout_flags(int file_des) {
receiveDataOnly(file_des,&arg,sizeof(arg)); receiveDataOnly(file_des,&arg,sizeof(arg));
sprintf(mess,"can't set readout flags for gotthard\n"); sprintf(mess,"can't set readout flags for moench\n");
sendDataOnly(file_des,&ret,sizeof(ret)); sendDataOnly(file_des,&ret,sizeof(ret));
sendDataOnly(file_des,mess,sizeof(mess)); sendDataOnly(file_des,mess,sizeof(mess));
@ -2355,7 +2366,7 @@ int execute_trimming(int file_des) {
int ret=FAIL; int ret=FAIL;
enum trimMode mode; enum trimMode mode;
sprintf(mess,"can't set execute trimming for gotthard\n"); sprintf(mess,"can't set execute trimming for moench\n");
receiveDataOnly(file_des,&mode,sizeof(mode)); receiveDataOnly(file_des,&mode,sizeof(mode));
receiveDataOnly(file_des,arg,sizeof(arg)); receiveDataOnly(file_des,arg,sizeof(arg));

View File

@ -477,7 +477,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
/** returns detector type string from detector type index /** returns detector type string from detector type index
\param t string can be Mythen, Pilatus, Eiger, Gotthard, Agipd, Unknown \param t string can be Mythen, Pilatus, Eiger, Gotthard, Agipd, Unknown
\returns MYTHEN, PILATUS, EIGER, GOTTHARD, AGIPD, GENERIC \returns MYTHEN, PILATUS, EIGER, GOTTHARD, AGIPD, MÖNCH, GENERIC
*/ */
static string getDetectorType(detectorType t){\ static string getDetectorType(detectorType t){\
switch (t) {\ switch (t) {\
@ -486,12 +486,13 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
case EIGER: return string("Eiger"); \ case EIGER: return string("Eiger"); \
case GOTTHARD: return string("Gotthard"); \ case GOTTHARD: return string("Gotthard"); \
case AGIPD: return string("Agipd"); \ case AGIPD: return string("Agipd"); \
case MOENCH: return string("Mönch"); \
default: return string("Unknown"); \ default: return string("Unknown"); \
}}; }};
/** returns detector type index from detector type string /** returns detector type index from detector type string
\param type can be MYTHEN, PILATUS, EIGER, GOTTHARD, AGIPD, GENERIC \param type can be MYTHEN, PILATUS, EIGER, GOTTHARD, AGIPD, GENERIC
\returns Mythen, Pilatus, Eiger, Gotthard, Agipd, Unknown \returns Mythen, Pilatus, Eiger, Gotthard, Agipd, Mönch, Unknown
*/ */
static detectorType getDetectorType(string const type){\ static detectorType getDetectorType(string const type){\
if (type=="Mythen") return MYTHEN;\ if (type=="Mythen") return MYTHEN;\
@ -499,6 +500,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
if (type=="Eiger") return EIGER; \ if (type=="Eiger") return EIGER; \
if (type=="Gotthard") return GOTTHARD; \ if (type=="Gotthard") return GOTTHARD; \
if (type=="Agipd") return AGIPD; \ if (type=="Agipd") return AGIPD; \
if (type=="Mönch") return MOENCH; \
return GENERIC;}; return GENERIC;};