mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
some basic changes
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@582 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
43322a6c80
commit
cdddd92a9e
@ -1,12 +1,12 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CLAGS += -Wall -DVIRTUAL -DDACS_INT -DGENERIC # -DSLS_DETECTOR_FUNCTION_LIST
|
CLAGS += -Wall -DVIRTUAL -DDACS_INT -DGENERICD # -DSLS_DETECTOR_FUNCTION_LIST
|
||||||
LDLIBS += -lm
|
LDLIBS += -lm
|
||||||
|
|
||||||
PROGS = genericDetectorServer
|
PROGS = genericDetectorServer
|
||||||
DESTDIR ?= bin
|
DESTDIR ?= bin
|
||||||
INSTMODE = 0777
|
INSTMODE = 0777
|
||||||
|
|
||||||
SRC_CLNT = slsDetectorServer.c slsDetectorServer_funcs.c communication_funcs.c slsDetector_firmware.c slsDetectorFunctionList.c
|
SRC_CLNT = slsDetectorServer.c slsDetectorServer_funcs.c communication_funcs.c slsDetectorFunctionList.c
|
||||||
OBJS = $(SRC_CLNT:.cpp=.o)
|
OBJS = $(SRC_CLNT:.cpp=.o)
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,37 +7,39 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern int nModX;
|
|
||||||
extern int nModBoard;
|
|
||||||
extern int dataBytes;
|
|
||||||
extern int dynamicRange;
|
|
||||||
const int nChans=NCHAN;
|
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;
|
||||||
enum detectorSettings thisSettings;
|
|
||||||
|
|
||||||
int sChan, sChip, sMod, sDac, sAdc;
|
|
||||||
const int allSelected=-2;
|
const int allSelected=-2;
|
||||||
const int noneSelected=-1;
|
const int noneSelected=-1;
|
||||||
|
|
||||||
|
|
||||||
sls_detector_module *detectorModules=NULL;
|
sls_detector_module *detectorModules=NULL;
|
||||||
int *detectorChips=NULL;
|
int *detectorChips=NULL;
|
||||||
int *detectorChans=NULL;
|
int *detectorChans=NULL;
|
||||||
dacs_t *detectorDacs=NULL;
|
dacs_t *detectorDacs=NULL;
|
||||||
dacs_t *detectorAdcs=NULL;
|
dacs_t *detectorAdcs=NULL;
|
||||||
|
|
||||||
|
int nModY = NMAXMOD;
|
||||||
|
int nModX = NMAXMOD;
|
||||||
|
int dynamicRange= DYNAMIC_RANGE;
|
||||||
|
int dataBytes = NMAXMOD*NCHIP*NCHAN*2;
|
||||||
|
int masterMode = NO_MASTER;
|
||||||
|
int syncMode = NO_SYNCHRONIZATION;
|
||||||
|
int timingMode = AUTO_TIMING;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum detectorSettings thisSettings;
|
||||||
|
int sChan, sChip, sMod, sDac, sAdc;
|
||||||
|
int nModBoard;
|
||||||
|
extern int dataBytes;
|
||||||
|
|
||||||
|
|
||||||
int initializeDetector(){
|
int initializeDetector(){
|
||||||
|
|
||||||
int imod;
|
int imod;
|
||||||
|
|
||||||
int n=getNModBoard(X)*getNModBoard(Y);
|
int n=getNModBoard(X)*getNModBoard(Y);
|
||||||
/*nModX=n;*/
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Board is for %d modules\n",n);
|
printf("Board is for %d modules\n",n);
|
||||||
#endif
|
#endif
|
||||||
@ -299,16 +301,21 @@ int setDynamicRange(int dr){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int setROI(int mask){ //////?????????????????
|
|
||||||
return FAIL;
|
enum readOutFlags setReadOutFlags(enum readOutFlags val){
|
||||||
|
//template setStoreInRAM from firmware_funcs.c
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int getROI(int *mask){ //////////?????????????????????
|
|
||||||
|
|
||||||
|
int setROI(int n, ROI arg[], int *retvalsize, int *ret){
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int setSpeed(enum speedVariable arg, int val){
|
int setSpeed(enum speedVariable arg, int val){
|
||||||
//template setClockDivider() from firmware_funcs.c
|
//template setClockDivider() from firmware_funcs.c
|
||||||
//CLOCK_DIVIDER
|
//CLOCK_DIVIDER
|
||||||
@ -322,11 +329,6 @@ int setSpeed(enum speedVariable arg, int val){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val){
|
|
||||||
//template setStoreInRAM from firmware_funcs.c
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int executeTrimming(enum trimMode mode, int par1, int par2, int imod){
|
int executeTrimming(enum trimMode mode, int par1, int par2, int imod){
|
||||||
// template trim_with_noise from trimming_funcs.c
|
// template trim_with_noise from trimming_funcs.c
|
||||||
@ -358,6 +360,16 @@ int resetCounterBlock(int startACQ){
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int startReceiver(int d){
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int calibratePedestal(int frames){
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int calculateDataBytes(){
|
int calculateDataBytes(){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -35,16 +35,9 @@ Here are the definitions, but the actual implementation should be done for each
|
|||||||
int mapCSP0(void);
|
int mapCSP0(void);
|
||||||
int initializeDetector();
|
int initializeDetector();
|
||||||
|
|
||||||
enum masterFlags setMaster(enum masterFlags arg);
|
|
||||||
enum synchronizationMode setSynchronization(enum synchronizationMode arg);
|
|
||||||
|
|
||||||
int setNMod(int nm, enum dimension dim);
|
int setNMod(int nm, enum dimension dim);
|
||||||
int getNModBoard(enum dimension arg);
|
int getNModBoard(enum dimension arg);
|
||||||
|
|
||||||
enum externalSignalFlag getExtSignal(int signalindex);
|
|
||||||
enum externalSignalFlag setExtSignal(int signalindex, enum externalSignalFlag flag);
|
|
||||||
enum externalCommunicationMode setTiming( enum externalCommunicationMode arg);
|
|
||||||
|
|
||||||
int64_t getModuleId(enum idMode arg, int imod);
|
int64_t getModuleId(enum idMode arg, int imod);
|
||||||
int64_t getDetectorId(enum idMode arg);
|
int64_t getDetectorId(enum idMode arg);
|
||||||
int moduleTest( enum digitalTestMode arg, int imod);
|
int moduleTest( enum digitalTestMode arg, int imod);
|
||||||
@ -53,18 +46,28 @@ int detectorTest( enum digitalTestMode arg);
|
|||||||
|
|
||||||
double setDAC(enum dacIndex ind, double val, int imod);
|
double setDAC(enum dacIndex ind, double val, int imod);
|
||||||
double getADC(enum dacIndex ind, int imod);
|
double getADC(enum dacIndex ind, int imod);
|
||||||
bus_w()
|
|
||||||
bus_r()
|
#if defined(MYTHEND) || defined(GOTTHARDD)
|
||||||
|
u_int32_t writeRegister(u_int32_t offset, u_int32_t data);
|
||||||
|
u_int32_t readRegister(u_int32_t offset);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MYTHEND
|
||||||
int setChannel(sls_detector_channel myChan);
|
int setChannel(sls_detector_channel myChan);
|
||||||
int getChannel(sls_detector_channel *myChan);
|
int getChannel(sls_detector_channel *myChan);
|
||||||
int setChip(sls_detector_chip myChip);
|
int setChip(sls_detector_chip myChip);
|
||||||
int getChip(sls_detector_chip *myChip);
|
int getChip(sls_detector_chip *myChip);
|
||||||
|
#endif
|
||||||
|
|
||||||
int setModule(sls_detector_module myChan);
|
int setModule(sls_detector_module myChan);
|
||||||
int getModule(sls_detector_module *myChan);
|
int getModule(sls_detector_module *myChan);
|
||||||
|
|
||||||
enum detectorSettings setSettings(enum detectorSettings sett, int imod);
|
enum detectorSettings setSettings(enum detectorSettings sett, int imod);
|
||||||
|
|
||||||
|
#if defined(MYTHEND) || defined(EIGERD)
|
||||||
int getThresholdEnergy(int imod);
|
int getThresholdEnergy(int imod);
|
||||||
int setThresholdEnergy(int thr, int imod);
|
int setThresholdEnergy(int thr, int imod);
|
||||||
|
#endif
|
||||||
|
|
||||||
int startStateMachine();
|
int startStateMachine();
|
||||||
int stopStateMachine();
|
int stopStateMachine();
|
||||||
@ -76,11 +79,19 @@ char *readFrame(int *ret, char *mess);
|
|||||||
int64_t setTimer(enum timerIndex ind, int64_t val);
|
int64_t setTimer(enum timerIndex ind, int64_t val);
|
||||||
int64_t getTimeLeft(enum timerIndex ind);
|
int64_t getTimeLeft(enum timerIndex ind);
|
||||||
|
|
||||||
|
|
||||||
int setDynamicRange(int dr);
|
int setDynamicRange(int dr);
|
||||||
|
int setROI(int n, ROI arg[], int *retvalsize, int *ret);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef MYTHEND
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val);
|
enum readOutFlags setReadOutFlags(enum readOutFlags val);
|
||||||
int setROI(int mask);
|
|
||||||
int setSpeed(enum speedVariable arg, int val);
|
int setSpeed(enum speedVariable arg, int val);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(EIGERD) || defined(MYTHEND)
|
||||||
int executeTrimming(enum trimMode mode, int par1, int par2, int imod);
|
int executeTrimming(enum trimMode mode, int par1, int par2, int imod);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GOTTHARDD
|
#ifdef GOTTHARDD
|
||||||
int configureMAC(int ipad, long long int imacadd, long long int iservermacadd, int dtb);
|
int configureMAC(int ipad, long long int imacadd, long long int iservermacadd, int dtb);
|
||||||
@ -103,6 +114,12 @@ int getNumberOfDACsPerModule();
|
|||||||
int getNumberOfADCsPerModule();
|
int getNumberOfADCsPerModule();
|
||||||
|
|
||||||
|
|
||||||
|
enum externalSignalFlag getExtSignal(int signalindex);
|
||||||
|
enum externalSignalFlag setExtSignal(int signalindex, enum externalSignalFlag flag);
|
||||||
|
enum externalCommunicationMode setTiming( enum externalCommunicationMode arg);
|
||||||
|
enum masterFlags setMaster(enum masterFlags arg);
|
||||||
|
enum synchronizationMode setSynchronization(enum synchronizationMode arg);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* slsDetectorServer_defs.h
|
||||||
|
*
|
||||||
|
* Created on: Jan 24, 2013
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SLSDETECTORSERVER_DEFS_H_
|
||||||
|
#define SLSDETECTORSERVER_DEFS_H_
|
||||||
|
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define GOODBYE -200
|
||||||
|
|
||||||
|
|
||||||
|
/* examples*/
|
||||||
|
#define NCHAN 1
|
||||||
|
#define NCHIP 1
|
||||||
|
#define NDAC 1
|
||||||
|
#define NADC 1
|
||||||
|
#define NMAXMODX 1
|
||||||
|
#define NMAXMODY 1
|
||||||
|
#define NMAXMOD NMAXMODX*NMAXMODY
|
||||||
|
#define NCHANS NCHAN*NCHIP*NMAXMOD
|
||||||
|
#define NDACS NDAC*NMAXMOD
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* SLSDETECTORSERVER_DEFS_H_ */
|
@ -14,6 +14,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//#if defined(EIGERD) || defined(GOTTHARDD)
|
||||||
|
//#endif
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
int (*flist[256])(int);
|
int (*flist[256])(int);
|
||||||
//defined in the detector specific file
|
//defined in the detector specific file
|
||||||
@ -36,9 +39,9 @@ extern char thisClientIP[INET_ADDRSTRLEN];
|
|||||||
extern int differentClients;
|
extern int differentClients;
|
||||||
*/
|
*/
|
||||||
//global variables for optimized readout
|
//global variables for optimized readout
|
||||||
|
char mess[1000];
|
||||||
char *dataretval=NULL;
|
char *dataretval=NULL;
|
||||||
int dataret;
|
int dataret;
|
||||||
char mess[1000];
|
|
||||||
int dataBytes;
|
int dataBytes;
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +52,7 @@ 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){
|
||||||
@ -893,7 +896,7 @@ int get_id(int file_des) {
|
|||||||
|
|
||||||
int digital_test(int file_des) {
|
int digital_test(int file_des) {
|
||||||
|
|
||||||
int retval;
|
int retval=-1;
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
int imod=-1;
|
int imod=-1;
|
||||||
int n=0;
|
int n=0;
|
||||||
@ -926,6 +929,10 @@ int digital_test(int file_des) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("of module %d\n", imod);
|
printf("of module %d\n", imod);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MYTHEND
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (imod>=0 && imod<getTotalNumberOfModules())
|
if (imod>=0 && imod<getTotalNumberOfModules())
|
||||||
retval=moduleTest(arg,imod);
|
retval=moduleTest(arg,imod);
|
||||||
@ -933,12 +940,18 @@ int digital_test(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"Module number %d out of range\n", imod);
|
sprintf(mess,"Module number %d out of range\n", imod);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case MODULE_FIRMWARE_TEST:
|
case MODULE_FIRMWARE_TEST:
|
||||||
case DETECTOR_FIRMWARE_TEST:
|
case DETECTOR_FIRMWARE_TEST:
|
||||||
case DETECTOR_MEMORY_TEST:
|
case DETECTOR_MEMORY_TEST:
|
||||||
case DETECTOR_BUS_TEST:
|
case DETECTOR_BUS_TEST:
|
||||||
|
#ifndef MYTHEND
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case DETECTOR_SOFTWARE_TEST:
|
case DETECTOR_SOFTWARE_TEST:
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
retval=detectorTest(arg);
|
retval=detectorTest(arg);
|
||||||
@ -950,8 +963,12 @@ int digital_test(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
retval=FAIL;
|
retval=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
retval=0;
|
retval=0;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("Unknown digital test required %d\n",arg);
|
printf("Unknown digital test required %d\n",arg);
|
||||||
@ -1026,24 +1043,40 @@ int set_dac(int file_des) {
|
|||||||
|
|
||||||
// check if dac exists for this detector
|
// check if dac exists for this detector
|
||||||
switch (ind) {
|
switch (ind) {
|
||||||
case TRIMBIT_SIZE:
|
#ifdef MYTHEND
|
||||||
//if (myDetectorType==MYTHEN)
|
case TRIMBIT_SIZE: //ind = VTRIM;
|
||||||
break;
|
break;
|
||||||
case THRESHOLD:
|
case THRESHOLD:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
case SHAPER1:
|
case SHAPER1:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
case SHAPER2:
|
case SHAPER2:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
case CALIBRATION_PULSE:
|
case CALIBRATION_PULSE:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
case PREAMP:
|
case PREAMP:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef GOTTHARDD
|
||||||
|
case G_VREF_DS :
|
||||||
|
break;
|
||||||
|
case G_VCASCN_PB:
|
||||||
|
break;
|
||||||
|
case G_VCASCP_PB:
|
||||||
|
break;
|
||||||
|
case G_VOUT_CM:
|
||||||
|
break;
|
||||||
|
case G_VCASC_OUT:
|
||||||
|
break;
|
||||||
|
case G_VIN_CM:
|
||||||
|
break;
|
||||||
|
case G_VREF_COMP:
|
||||||
|
break;
|
||||||
|
case G_IB_TESTC:
|
||||||
|
break;
|
||||||
|
case HV_POT:
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
printf("Unknown DAC index %d\n",ind);
|
printf("Unknown DAC index %d\n",ind);
|
||||||
sprintf(mess,"Unknown DAC index %d\n",ind);
|
sprintf(mess,"Unknown DAC index %d\n",ind);
|
||||||
@ -1119,24 +1152,12 @@ int get_adc(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (ind) {
|
switch (ind) {
|
||||||
case TRIMBIT_SIZE:
|
#ifdef GOTTHARDD
|
||||||
//if (myDetectorType==MYTHEN)
|
case TEMPERATURE_FPGA: //ind = TEMP_FPGA;
|
||||||
break;
|
break;
|
||||||
case THRESHOLD:
|
case TEMPERATURE_ADC:
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
|
||||||
case SHAPER1:
|
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
|
||||||
case SHAPER2:
|
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
|
||||||
case CALIBRATION_PULSE:
|
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
|
||||||
case PREAMP:
|
|
||||||
//if (myDetectorType==MYTHEN)
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
printf("Unknown DAC index %d\n",ind);
|
printf("Unknown DAC index %d\n",ind);
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -1202,6 +1223,7 @@ int write_register(int file_des) {
|
|||||||
addr=arg[0];
|
addr=arg[0];
|
||||||
val=arg[1];
|
val=arg[1];
|
||||||
|
|
||||||
|
#if defined(MYTHEND) || defined(GOTTHARDD)
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("writing to register 0x%x data 0x%x\n", addr, val);
|
printf("writing to register 0x%x data 0x%x\n", addr, val);
|
||||||
#endif
|
#endif
|
||||||
@ -1210,11 +1232,14 @@ int write_register(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
||||||
} else
|
} else
|
||||||
retval=bus_w(addr,val);
|
retval=writeRegister(addr,val);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Data set to 0x%x\n", retval);
|
printf("Data set to 0x%x\n", retval);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
#endif
|
#endif
|
||||||
if (retval==val) {
|
if (retval==val) {
|
||||||
ret=OK;
|
ret=OK;
|
||||||
@ -1258,17 +1283,21 @@ int read_register(int file_des) {
|
|||||||
}
|
}
|
||||||
addr=arg;
|
addr=arg;
|
||||||
|
|
||||||
|
#if defined(MYTHEND) || defined(GOTTHARDD)
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("reading register 0x%x\n", addr);
|
printf("reading register 0x%x\n", addr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
retval=bus_r(addr);
|
retval=readRegister(addr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Returned value 0x%x\n", retval);
|
printf("Returned value 0x%x\n", retval);
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
printf("Reading register 0x%x failed\n", addr);
|
printf("Reading register 0x%x failed\n", addr);
|
||||||
} else if (differentClients)
|
} else if (differentClients)
|
||||||
@ -1312,6 +1341,7 @@ int set_channel(int file_des) {
|
|||||||
ret=OK;
|
ret=OK;
|
||||||
else
|
else
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
|
#ifdef MYTHEND
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("channel number is %d, chip number is %d, module number is %d, register is %lld\n", myChan.chan,myChan.chip, myChan.module, myChan.reg);
|
printf("channel number is %d, chip number is %d, module number is %d, register is %lld\n", myChan.chan,myChan.chip, myChan.module, myChan.reg);
|
||||||
#endif
|
#endif
|
||||||
@ -1339,6 +1369,7 @@ int set_channel(int file_des) {
|
|||||||
retval=setChannel(myChan);
|
retval=setChannel(myChan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* Maybe this is done inside the initialization funcs */
|
/* Maybe this is done inside the initialization funcs */
|
||||||
//copyChannel(detectorChans[myChan.module][myChan.chip]+(myChan.chan), &myChan);
|
//copyChannel(detectorChans[myChan.module][myChan.chip]+(myChan.chan), &myChan);
|
||||||
@ -1387,6 +1418,7 @@ int get_channel(int file_des) {
|
|||||||
ichip=arg[1];
|
ichip=arg[1];
|
||||||
imod=arg[2];
|
imod=arg[2];
|
||||||
|
|
||||||
|
#ifdef MYTHEND
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ichan>=getNumberOfChannelsPerChip()) {
|
if (ichan>=getNumberOfChannelsPerChip()) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -1408,6 +1440,7 @@ int get_channel(int file_des) {
|
|||||||
|
|
||||||
if (ret==OK)
|
if (ret==OK)
|
||||||
ret=getChannel(&retval);
|
ret=getChannel(&retval);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (differentClients && ret==OK)
|
if (differentClients && ret==OK)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
@ -1454,6 +1487,7 @@ int set_chip(int file_des) {
|
|||||||
printf("Setting chip\n");
|
printf("Setting chip\n");
|
||||||
#endif
|
#endif
|
||||||
ret=receiveChip(file_des, &myChip);
|
ret=receiveChip(file_des, &myChip);
|
||||||
|
#ifdef MYTHEND
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Chip received\n");
|
printf("Chip received\n");
|
||||||
#endif
|
#endif
|
||||||
@ -1482,6 +1516,7 @@ int set_chip(int file_des) {
|
|||||||
} else {
|
} else {
|
||||||
retval=setChip(myChip);
|
retval=setChip(myChip);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* Maybe this is done inside the initialization funcs */
|
/* Maybe this is done inside the initialization funcs */
|
||||||
//copyChip(detectorChips[myChip.module]+(myChip.chip), &myChip);
|
//copyChip(detectorChips[myChip.module]+(myChip.chip), &myChip);
|
||||||
@ -1529,6 +1564,7 @@ int get_chip(int file_des) {
|
|||||||
ichip=arg[0];
|
ichip=arg[0];
|
||||||
imod=arg[1];
|
imod=arg[1];
|
||||||
|
|
||||||
|
#ifdef MYTHEND
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ichip>=getNumberOfChipsPerModule()) {
|
if (ichip>=getNumberOfChipsPerModule()) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -1544,6 +1580,7 @@ int get_chip(int file_des) {
|
|||||||
|
|
||||||
if (ret==OK)
|
if (ret==OK)
|
||||||
ret=getChip(&retval);
|
ret=getChip(&retval);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (differentClients && ret==OK)
|
if (differentClients && ret==OK)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
@ -1844,7 +1881,7 @@ int get_threshold_energy(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MYTHEND) || defined(EIGERD)
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Getting threshold energy of module %d\n", imod);
|
printf("Getting threshold energy of module %d\n", imod);
|
||||||
#endif
|
#endif
|
||||||
@ -1859,7 +1896,7 @@ int get_threshold_energy(int file_des) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Threshold is %d eV\n", retval);
|
printf("Threshold is %d eV\n", retval);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if (differentClients==1 && ret==OK)
|
if (differentClients==1 && ret==OK)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
@ -1899,6 +1936,7 @@ int set_threshold_energy(int file_des) {
|
|||||||
ethr=arg[0];
|
ethr=arg[0];
|
||||||
imod=arg[1];
|
imod=arg[1];
|
||||||
isett=arg[2];
|
isett=arg[2];
|
||||||
|
#if defined(MYTHEND) || defined(EIGERD)
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (imod>=getTotalNumberOfModules()) {
|
if (imod>=getTotalNumberOfModules()) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -1923,6 +1961,7 @@ int set_threshold_energy(int file_des) {
|
|||||||
printf("Setting threshold of module %d: wrote %d but read %d\n", imod, ethr, retval);
|
printf("Setting threshold of module %d: wrote %d but read %d\n", imod, ethr, retval);
|
||||||
sprintf(mess,"Setting threshold of module %d: wrote %d but read %d\n", imod, ethr, retval);
|
sprintf(mess,"Setting threshold of module %d: wrote %d but read %d\n", imod, ethr, retval);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (ret==OK && differentClients==1)
|
if (ret==OK && differentClients==1)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
@ -2204,32 +2243,26 @@ int set_timer(int file_des) {
|
|||||||
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
||||||
} else {
|
} else {
|
||||||
switch(ind) {
|
switch(ind) {
|
||||||
case FRAME_NUMBER:
|
|
||||||
retval=setFrames(tns);
|
|
||||||
break;
|
|
||||||
case ACQUISITION_TIME:
|
|
||||||
retval=setExposureTime(tns);
|
|
||||||
break;
|
|
||||||
case FRAME_PERIOD:
|
|
||||||
retval=setPeriod(tns);
|
|
||||||
break;
|
|
||||||
case DELAY_AFTER_TRIGGER:
|
|
||||||
retval=setDelay(tns);
|
|
||||||
break;
|
|
||||||
case GATES_NUMBER:
|
|
||||||
retval=setGates(tns);
|
|
||||||
break;
|
|
||||||
case PROBES_NUMBER:
|
case PROBES_NUMBER:
|
||||||
retval=setProbes(tns);
|
#ifndef MYTHEND
|
||||||
|
ret=FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
case FRAME_NUMBER:
|
||||||
|
case ACQUISITION_TIME:
|
||||||
|
case FRAME_PERIOD:
|
||||||
|
case DELAY_AFTER_TRIGGER:
|
||||||
|
case GATES_NUMBER:
|
||||||
case CYCLES_NUMBER:
|
case CYCLES_NUMBER:
|
||||||
retval=setTrains(tns);
|
retval = setTimer(ind,tns);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"timer index unknown %d\n",ind);
|
sprintf(mess,"timer index unknown %d\n",ind);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2291,6 +2324,12 @@ int get_time_left(int file_des) {
|
|||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
switch(ind) {
|
switch(ind) {
|
||||||
|
case PROBES_NUMBER:
|
||||||
|
#ifndef MYTHEND
|
||||||
|
ret=FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case FRAME_NUMBER:
|
case FRAME_NUMBER:
|
||||||
case ACQUISITION_TIME:
|
case ACQUISITION_TIME:
|
||||||
case FRAME_PERIOD:
|
case FRAME_PERIOD:
|
||||||
@ -2298,15 +2337,9 @@ int get_time_left(int file_des) {
|
|||||||
case GATES_NUMBER:
|
case GATES_NUMBER:
|
||||||
case CYCLES_NUMBER:
|
case CYCLES_NUMBER:
|
||||||
case PROGRESS:
|
case PROGRESS:
|
||||||
retval=getTimeLeft(ind);
|
|
||||||
break;
|
|
||||||
case PROBES_NUMBER:
|
|
||||||
case ACTUAL_TIME:
|
case ACTUAL_TIME:
|
||||||
case MEASUREMENT_TIME:
|
case MEASUREMENT_TIME:
|
||||||
if (myDetectorType==MYTHEN) {
|
getTimeLeft(ind);
|
||||||
retval=getTimeLeft(ind);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -2402,7 +2435,10 @@ int set_readout_flags(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef MYTHEND
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("setting readout flags to %d\n",arg);
|
printf("setting readout flags to %d\n",arg);
|
||||||
#endif
|
#endif
|
||||||
@ -2437,7 +2473,7 @@ int set_readout_flags(int file_des) {
|
|||||||
sprintf(mess,"Could not change readout flag: should be %d but is %d\n", arg, retval);
|
sprintf(mess,"Could not change readout flag: should be %d but is %d\n", arg, retval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
@ -2453,6 +2489,72 @@ int set_readout_flags(int file_des) {
|
|||||||
|
|
||||||
|
|
||||||
int set_roi(int file_des) {
|
int set_roi(int file_des) {
|
||||||
|
|
||||||
|
int ret=OK;
|
||||||
|
ROI arg[MAX_ROIS];
|
||||||
|
ROI* retval=0;
|
||||||
|
int nroi=-1, n=0, retvalsize=0;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
int i;
|
||||||
|
#endif
|
||||||
|
strcpy(mess,"Could not set/get roi\n");
|
||||||
|
|
||||||
|
n = receiveDataOnly(file_des,&nroi,sizeof(nroi));
|
||||||
|
if (n < 0) {
|
||||||
|
sprintf(mess,"Error reading from socket\n");
|
||||||
|
ret=FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nroi!=-1){
|
||||||
|
n = receiveDataOnly(file_des,arg,nroi*sizeof(ROI));
|
||||||
|
if (n != (nroi*sizeof(ROI))) {
|
||||||
|
sprintf(mess,"Received wrong number of bytes for ROI\n");
|
||||||
|
ret=FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
|
#ifdef VERBOSE
|
||||||
|
printf("Setting ROI to:");
|
||||||
|
for( i=0;i<nroi;i++)
|
||||||
|
printf("%d\t%d\t%d\t%d\n",arg[i].xmin,arg[i].xmax,arg[i].ymin,arg[i].ymax);
|
||||||
|
#endif
|
||||||
|
/* execute action if the arguments correctly arrived*/
|
||||||
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
|
if (lockStatus==1 && differentClients==1){//necessary???
|
||||||
|
sprintf(mess,"Detector locked by %s\n", lastClientIP);
|
||||||
|
ret=FAIL;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
retval=setROI(nroi,arg,&retvalsize,&ret);
|
||||||
|
if (ret==FAIL){
|
||||||
|
printf("mess:%s\n",mess);
|
||||||
|
sprintf(mess,"Could not set all roi, should have set %d rois, but only set %d rois\n",nroi,retvalsize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if(ret==OK && differentClients){
|
||||||
|
printf("Force update\n");
|
||||||
|
ret=FORCE_UPDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* send answer */
|
||||||
|
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
||||||
|
if(ret==FAIL)
|
||||||
|
n = sendDataOnly(file_des,mess,sizeof(mess));
|
||||||
|
else{
|
||||||
|
sendDataOnly(file_des,&retvalsize,sizeof(retvalsize));
|
||||||
|
sendDataOnly(file_des,retval,retvalsize*sizeof(ROI));
|
||||||
|
}
|
||||||
|
/*return ok/fail*/
|
||||||
|
return ret;
|
||||||
|
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
dataBytes=calculateDataBytes();
|
dataBytes=calculateDataBytes();
|
||||||
#endif
|
#endif
|
||||||
@ -2480,7 +2582,10 @@ int set_speed(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef MYTHEND
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("setting speed variable %d to %d\n",arg,val);
|
printf("setting speed variable %d to %d\n",arg,val);
|
||||||
#endif
|
#endif
|
||||||
@ -2518,6 +2623,7 @@ int set_speed(int file_des) {
|
|||||||
if (differentClients && ret==OK)
|
if (differentClients && ret==OK)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
@ -2536,7 +2642,9 @@ int execute_trimming(int file_des) {
|
|||||||
int arg[3];
|
int arg[3];
|
||||||
int n;
|
int n;
|
||||||
int ret=OK, retval;
|
int ret=OK, retval;
|
||||||
|
#if defined(MYTHEND) || defined(EIGERD)
|
||||||
int imod, par1,par2;
|
int imod, par1,par2;
|
||||||
|
#endif
|
||||||
enum trimMode mode;
|
enum trimMode mode;
|
||||||
|
|
||||||
printf("called function execute trimming\n");
|
printf("called function execute trimming\n");
|
||||||
@ -2559,6 +2667,11 @@ int execute_trimming(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(MYTHEND) && !defined(EIGERD)
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
|
|
||||||
imod=arg[0];
|
imod=arg[0];
|
||||||
par1=arg[1];
|
par1=arg[1];
|
||||||
par2=arg[2];
|
par2=arg[2];
|
||||||
@ -2600,6 +2713,7 @@ int execute_trimming(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret!=OK) {
|
if (ret!=OK) {
|
||||||
sprintf(mess,"can't set execute trimming\n");
|
sprintf(mess,"can't set execute trimming\n");
|
||||||
@ -2633,10 +2747,12 @@ int configure_mac(int file_des) {
|
|||||||
char arg[3][50];
|
char arg[3][50];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
#ifdef GOTTHARDD
|
||||||
int imod=0;//should be in future sent from client as -1, arg[2]
|
int imod=0;//should be in future sent from client as -1, arg[2]
|
||||||
int ipad;
|
int ipad;
|
||||||
long long int imacadd;
|
long long int imacadd;
|
||||||
long long int iservermacadd;
|
long long int iservermacadd;
|
||||||
|
#endif
|
||||||
|
|
||||||
sprintf(mess,"Can't configure MAC\n");
|
sprintf(mess,"Can't configure MAC\n");
|
||||||
|
|
||||||
@ -2646,6 +2762,10 @@ int configure_mac(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
sscanf(arg[0], "%x", &ipad);
|
sscanf(arg[0], "%x", &ipad);
|
||||||
sscanf(arg[1], "%llx", &imacadd);
|
sscanf(arg[1], "%llx", &imacadd);
|
||||||
sscanf(arg[2], "%llx", &iservermacadd);
|
sscanf(arg[2], "%llx", &iservermacadd);
|
||||||
@ -2685,7 +2805,7 @@ int configure_mac(int file_des) {
|
|||||||
|
|
||||||
if (differentClients)
|
if (differentClients)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
|
#endif
|
||||||
/* send answer */
|
/* send answer */
|
||||||
/* send OK/failed */
|
/* send OK/failed */
|
||||||
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
n = sendDataOnly(file_des,&ret,sizeof(ret));
|
||||||
@ -2723,6 +2843,11 @@ int load_image(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
if (differentClients==1 && lockStatus==1) {
|
if (differentClients==1 && lockStatus==1) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -2753,6 +2878,8 @@ int load_image(int file_des) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if(ret==OK){
|
if(ret==OK){
|
||||||
if (differentClients)
|
if (differentClients)
|
||||||
@ -2792,6 +2919,10 @@ int read_counter_block(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
if (differentClients==1 && lockStatus==1) {
|
if (differentClients==1 && lockStatus==1) {
|
||||||
@ -2807,6 +2938,8 @@ int read_counter_block(int file_des) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if(ret!=FAIL){
|
if(ret!=FAIL){
|
||||||
if (differentClients)
|
if (differentClients)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
@ -2843,6 +2976,10 @@ int reset_counter_block(int file_des) {
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
if (differentClients==1 && lockStatus==1) {
|
if (differentClients==1 && lockStatus==1) {
|
||||||
@ -2851,6 +2988,7 @@ int reset_counter_block(int file_des) {
|
|||||||
} else
|
} else
|
||||||
ret=resetCounterBlock(startACQ);
|
ret=resetCounterBlock(startACQ);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if(ret==OK){
|
if(ret==OK){
|
||||||
if (differentClients)
|
if (differentClients)
|
||||||
@ -2880,6 +3018,10 @@ int start_receiver(int file_des) {
|
|||||||
strcpy(mess,"Could not start receiver\n");
|
strcpy(mess,"Could not start receiver\n");
|
||||||
|
|
||||||
/* execute action if the arguments correctly arrived*/
|
/* execute action if the arguments correctly arrived*/
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (lockStatus==1 && differentClients==1){//necessary???
|
if (lockStatus==1 && differentClients==1){//necessary???
|
||||||
sprintf(mess,"Detector locked by %s\n", lastClientIP);
|
sprintf(mess,"Detector locked by %s\n", lastClientIP);
|
||||||
@ -2889,7 +3031,7 @@ int start_receiver(int file_des) {
|
|||||||
ret = startReceiver(1);
|
ret = startReceiver(1);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if(ret==OK && differentClients){
|
if(ret==OK && differentClients){
|
||||||
printf("Force update\n");
|
printf("Force update\n");
|
||||||
@ -2916,6 +3058,10 @@ int stop_receiver(int file_des) {
|
|||||||
strcpy(mess,"Could not stop receiver\n");
|
strcpy(mess,"Could not stop receiver\n");
|
||||||
|
|
||||||
/* execute action if the arguments correctly arrived*/
|
/* execute action if the arguments correctly arrived*/
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (lockStatus==1 && differentClients==1){//necessary???
|
if (lockStatus==1 && differentClients==1){//necessary???
|
||||||
sprintf(mess,"Detector locked by %s\n", lastClientIP);
|
sprintf(mess,"Detector locked by %s\n", lastClientIP);
|
||||||
@ -2925,7 +3071,7 @@ int stop_receiver(int file_des) {
|
|||||||
ret=startReceiver(0);
|
ret=startReceiver(0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if(ret==OK && differentClients){
|
if(ret==OK && differentClients){
|
||||||
printf("Force update\n");
|
printf("Force update\n");
|
||||||
@ -2958,6 +3104,10 @@ int calibrate_pedestal(int file_des){
|
|||||||
sprintf(mess,"Error reading from socket\n");
|
sprintf(mess,"Error reading from socket\n");
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,"Not applicable/implemented for this detector\n");
|
||||||
|
#else
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
if (differentClients==1 && lockStatus==1) {
|
if (differentClients==1 && lockStatus==1) {
|
||||||
@ -2966,6 +3116,7 @@ int calibrate_pedestal(int file_des){
|
|||||||
} else
|
} else
|
||||||
ret=calibratePedestal(frames);
|
ret=calibratePedestal(frames);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if(ret==OK){
|
if(ret==OK){
|
||||||
if (differentClients)
|
if (differentClients)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user