mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
moench client and receiver works with gotthard module, without gui
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@511 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1206,7 +1206,7 @@ int setADC(int adc){
|
||||
ipPacketSize= DEFAULT_IP_PACKETSIZE;
|
||||
udpPacketSize=DEFAULT_UDP_PACKETSIZE;
|
||||
//set channel mask
|
||||
nchips = NCHIP;
|
||||
nchips = GOTTHARDNCHIP;
|
||||
mask = ACTIVE_ADC_MASK;
|
||||
}
|
||||
//1 adc
|
||||
@ -1219,7 +1219,7 @@ int setADC(int adc){
|
||||
}
|
||||
|
||||
//set channel mask
|
||||
reg = (NCHAN*nchips)<<CHANNEL_OFFSET;
|
||||
reg = (GOTTHARDNCHAN*nchips)<<CHANNEL_OFFSET;
|
||||
reg&=CHANNEL_MASK;
|
||||
reg|=(ACTIVE_ADC_MASK & mask);
|
||||
bus_w(CHIP_OF_INTRST_REG,reg);
|
||||
|
@ -2601,11 +2601,11 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
|
||||
adc=-1;
|
||||
else{
|
||||
//if its for 1 adc or general
|
||||
if ((arg[0].xmin==0) && (arg[0].xmax==NCHIP*NCHAN))
|
||||
if ((arg[0].xmin==0) && (arg[0].xmax==GOTTHARDNCHIP*GOTTHARDNCHAN))
|
||||
adc=-1;
|
||||
else{
|
||||
//adc = mid value/numchans also for only 1 roi
|
||||
adc = ((((arg[0].xmax)+(arg[0].xmin))/2)/(NCHAN*NCHIPS_PER_ADC));
|
||||
adc = ((((arg[0].xmax)+(arg[0].xmin))/2)/(GOTTHARDNCHAN*NCHIPS_PER_ADC));
|
||||
if((adc>=0) && (adc<=4));
|
||||
else {
|
||||
printf("warning:adc value greater than 5. deleting roi\n");
|
||||
@ -2617,8 +2617,8 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
|
||||
|
||||
//set rois for just 1 adc - take only 1st roi
|
||||
if(adc!=-1){
|
||||
rois[0].xmin=adc*(NCHAN*NCHIPS_PER_ADC);
|
||||
rois[0].xmax=(adc+1)*(NCHAN*NCHIPS_PER_ADC)-1;
|
||||
rois[0].xmin=adc*(GOTTHARDNCHAN*NCHIPS_PER_ADC);
|
||||
rois[0].xmax=(adc+1)*(GOTTHARDNCHAN*NCHIPS_PER_ADC)-1;
|
||||
rois[0].ymin=-1;
|
||||
rois[0].ymax=-1;
|
||||
nROI = 1;
|
||||
|
@ -16,6 +16,13 @@
|
||||
#define NDAC 8
|
||||
#define NADC 1
|
||||
|
||||
/**change this for the real moench chip*/
|
||||
#define GOTTHARDNCHAN 128
|
||||
#define GOTTHARDNCHIP 10
|
||||
|
||||
|
||||
|
||||
|
||||
#define NCHANS NCHAN*NCHIP*NMAXMOD
|
||||
#define NDACS NDAC*NMAXMOD
|
||||
|
||||
|
@ -80,7 +80,7 @@ int init_detector( int b) {
|
||||
prepareADC();
|
||||
setADC(-1); //already does setdaqreg and clean fifo
|
||||
printf("in chip of interes reg:%d\n",bus_r(CHIP_OF_INTRST_REG));
|
||||
int reg = (NCHAN*NCHIP)<<CHANNEL_OFFSET;
|
||||
int reg = (GOTTHARDNCHAN*GOTTHARDNCHIP)<<CHANNEL_OFFSET;
|
||||
reg&=CHANNEL_MASK;
|
||||
reg|=ACTIVE_ADC_MASK;
|
||||
bus_w(CHIP_OF_INTRST_REG,reg);
|
||||
@ -277,7 +277,7 @@ int get_detector_type(int file_des) {
|
||||
|
||||
/* receive arguments */
|
||||
/* execute action */
|
||||
ret=myDetectorType;
|
||||
ret=myDetectorType;printf("det type:%d\n",myDetectorType);
|
||||
|
||||
#ifdef VERBOSE
|
||||
printf("Returning detector type %d\n",ret);
|
||||
@ -1592,7 +1592,7 @@ int get_threshold_energy(int file_des) {
|
||||
n += sendDataOnly(file_des,mess,sizeof(mess));
|
||||
|
||||
/*return ok/fail*/
|
||||
return ret;
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
@ -1613,7 +1613,7 @@ int set_threshold_energy(int file_des) {
|
||||
n += sendDataOnly(file_des,mess,sizeof(mess));
|
||||
|
||||
/*return ok/fail*/
|
||||
return ret;
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user