mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Changed everywhere from float to double, even mythenDetectorServer and the standalone files
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@206 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -362,13 +362,13 @@ int sendModule(int file_des, sls_detector_module *myMod) {
|
||||
#ifdef VERBOSE
|
||||
printf("module %d of size %d sent\n",myMod->module, ts);
|
||||
#endif
|
||||
ts+= sendDataOnly(file_des,myMod->dacs,sizeof(float)*nDacs);
|
||||
ts+= sendDataOnly(file_des,myMod->dacs,sizeof(double)*nDacs);
|
||||
#ifdef VERBOSE
|
||||
printf("dacs %d of size %d sent\n",myMod->module, ts);
|
||||
for (idac=0; idac< nDacs; idac++)
|
||||
printf("dac %d is %d\n",idac,myMod->dacs[idac]);
|
||||
#endif
|
||||
ts+= sendDataOnly(file_des,myMod->adcs,sizeof(float)*nAdcs);
|
||||
ts+= sendDataOnly(file_des,myMod->adcs,sizeof(double)*nAdcs);
|
||||
#ifdef VERBOSE
|
||||
printf("adcs %d of size %d sent\n",myMod->module, ts);
|
||||
#endif
|
||||
@ -432,8 +432,8 @@ int receiveChip(int file_des, sls_detector_chip* myChip) {
|
||||
int receiveModule(int file_des, sls_detector_module* myMod) {
|
||||
|
||||
|
||||
float *dacptr=myMod->dacs;
|
||||
float *adcptr=myMod->adcs;
|
||||
double *dacptr=myMod->dacs;
|
||||
double *adcptr=myMod->adcs;
|
||||
int *chipptr=myMod->chipregs, *chanptr=myMod->chanregs;
|
||||
int ts=0;
|
||||
int nChips, nchipold=myMod->nchip, nchipdiff;
|
||||
@ -490,29 +490,29 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
|
||||
printf("received %d adcs\n",nAdcs);
|
||||
#endif
|
||||
if (ndacdiff<=0) {
|
||||
ts+=receiveDataOnly(file_des,myMod->dacs, sizeof(float)*nDacs);
|
||||
ts+=receiveDataOnly(file_des,myMod->dacs, sizeof(double)*nDacs);
|
||||
#ifdef VERBOSE
|
||||
printf("dacs received\n");
|
||||
#endif
|
||||
} else {
|
||||
dacptr=malloc(ndacdiff*sizeof(float));
|
||||
dacptr=malloc(ndacdiff*sizeof(double));
|
||||
myMod->ndac=ndold;
|
||||
ts+=receiveDataOnly(file_des,myMod->dacs, sizeof(float)*ndold);
|
||||
ts+=receiveDataOnly(file_des,dacptr, sizeof(float)*ndacdiff);
|
||||
ts+=receiveDataOnly(file_des,myMod->dacs, sizeof(double)*ndold);
|
||||
ts+=receiveDataOnly(file_des,dacptr, sizeof(double)*ndacdiff);
|
||||
free(dacptr);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (nadcdiff<=0) {
|
||||
ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(float)*nAdcs);
|
||||
ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(double)*nAdcs);
|
||||
#ifdef VERBOSE
|
||||
printf("adcs received\n");
|
||||
#endif
|
||||
} else {
|
||||
adcptr=malloc(nadcdiff*sizeof(float));
|
||||
adcptr=malloc(nadcdiff*sizeof(double));
|
||||
myMod->nadc=naold;
|
||||
ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(float)*naold);
|
||||
ts+=receiveDataOnly(file_des,adcptr, sizeof(float)*nadcdiff);
|
||||
ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(double)*naold);
|
||||
ts+=receiveDataOnly(file_des,adcptr, sizeof(double)*nadcdiff);
|
||||
free(adcptr);
|
||||
return FAIL;
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
/** maxmimum number of detectors ina multidetector structure*/
|
||||
#define MAXDET 100
|
||||
|
||||
typedef float float32_t;
|
||||
typedef double double32_t;
|
||||
typedef int int32_t;
|
||||
typedef char mystring[MAX_STR_LENGTH];
|
||||
typedef float mysteps[MAX_SCAN_STEPS];
|
||||
typedef double mysteps[MAX_SCAN_STEPS];
|
||||
|
||||
/**
|
||||
\file sls_detector_defs.h
|
||||
@ -102,14 +102,14 @@ typedef struct {
|
||||
int nadc; /**< is the number of adcs on the module */
|
||||
int reg; /**< is the module register (e.g. dynamic range?)
|
||||
\see moduleRegisterBit */
|
||||
float *dacs; /**< is the pointer to the array of the dac values (in V) */
|
||||
float *adcs; /**< is the pointer to the array of the adc values (in V) FLAT_FIELD_CORRECTION*/
|
||||
double *dacs; /**< is the pointer to the array of the dac values (in V) */
|
||||
double *adcs; /**< is the pointer to the array of the adc values (in V) FLAT_FIELD_CORRECTION*/
|
||||
int *chipregs; /**< is the pointer to the array of the chip registers
|
||||
\see ::chipRegisterBit */
|
||||
int *chanregs; /**< is the pointer to the array of the channel registers
|
||||
\see ::channelRegisterBit */
|
||||
float gain; /**< is the module gain (V/keV) */
|
||||
float offset; /**< is the module offset (V) */
|
||||
double gain; /**< is the module gain (V/keV) */
|
||||
double offset; /**< is the module offset (V) */
|
||||
} sls_detector_module;
|
||||
|
||||
/**
|
||||
@ -464,14 +464,14 @@ enum imageType {
|
||||
/* angular conversion constant for a module */
|
||||
/* *\/ */
|
||||
/* typedef struct { */
|
||||
/* float center; /\**< center of the module (channel at which the radius is perpendicular to the module surface) *\/ */
|
||||
/* float ecenter; /\**< error in the center determination *\/ */
|
||||
/* float r_conversion; /\**< detector pixel size (or strip pitch) divided by the diffractometer radius *\/ */
|
||||
/* float er_conversion; /\**< error in the r_conversion determination *\/ */
|
||||
/* float offset; /\**< the module offset i.e. the position of channel 0 with respect to the diffractometer 0 *\/ */
|
||||
/* float eoffset; /\**< error in the offset determination *\/ */
|
||||
/* float tilt; /\**< ossible tilt in the orthogonal direction (unused)*\/ */
|
||||
/* float etilt; /\**< error in the tilt determination *\/ */
|
||||
/* double center; /\**< center of the module (channel at which the radius is perpendicular to the module surface) *\/ */
|
||||
/* double ecenter; /\**< error in the center determination *\/ */
|
||||
/* double r_conversion; /\**< detector pixel size (or strip pitch) divided by the diffractometer radius *\/ */
|
||||
/* double er_conversion; /\**< error in the r_conversion determination *\/ */
|
||||
/* double offset; /\**< the module offset i.e. the position of channel 0 with respect to the diffractometer 0 *\/ */
|
||||
/* double eoffset; /\**< error in the offset determination *\/ */
|
||||
/* double tilt; /\**< ossible tilt in the orthogonal direction (unused)*\/ */
|
||||
/* double etilt; /\**< error in the tilt determination *\/ */
|
||||
/* } angleConversionConstant; */
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user