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:
l_maliakal_d
2012-08-02 12:58:08 +00:00
parent 3795dcedfe
commit 5aebcd4888
47 changed files with 615 additions and 611 deletions

View File

@ -37,8 +37,8 @@ const int noneSelected=-1;
sls_detector_module *detectorModules=NULL;
int *detectorChips=NULL;
int *detectorChans=NULL;
float *detectorDacs=NULL;
float *detectorAdcs=NULL;
double *detectorDacs=NULL;
double *detectorAdcs=NULL;
//int numberOfProbes;
@ -56,8 +56,8 @@ int initDetector() {
detectorModules=malloc(n*sizeof(sls_detector_module));
detectorChips=malloc(n*NCHIP*sizeof(int));
detectorChans=malloc(n*NCHIP*NCHAN*sizeof(int));
detectorDacs=malloc(n*NDAC*sizeof(float));
detectorAdcs=malloc(n*NADC*sizeof(float));
detectorDacs=malloc(n*NDAC*sizeof(double));
detectorAdcs=malloc(n*NADC*sizeof(double));
#ifdef VERBOSE
printf("modules from 0x%x to 0x%x\n",(unsigned int)(detectorModules), (unsigned int)(detectorModules+n));
printf("chips from 0x%x to 0x%x\n",(unsigned int)(detectorChips), (unsigned int)(detectorChips+n*NCHIP));
@ -540,15 +540,15 @@ int set_one_dac(int imod) {
return OK;
}
float initDACbyIndex(int ind,float val, int imod) {
double initDACbyIndex(int ind,double val, int imod) {
int v;
const float partref[NDAC]=PARTREF;
const float partr1[NDAC]=PARTR1;
const float partr2[NDAC]=PARTR2;
const double partref[NDAC]=PARTREF;
const double partr1[NDAC]=PARTR1;
const double partr2[NDAC]=PARTR2;
float ref=partref[ind];
float r1=partr1[ind];
float r2=partr2[ind];
double ref=partref[ind];
double r1=partr1[ind];
double r2=partr2[ind];
v=(val+(val-ref)*r1/r2)*DAC_DR/DAC_MAX;
@ -557,10 +557,10 @@ float initDACbyIndex(int ind,float val, int imod) {
return (v*DAC_MAX/DAC_DR+ref*r1/r2)/(1+r1/r2);
}
float initDACbyIndexDACU(int ind, int val, int imod) {
double initDACbyIndexDACU(int ind, int val, int imod) {
// const float daccs[NDAC]=DACCS;
// const float dacaddr[NDAC]=DACADDR;
// const double daccs[NDAC]=DACCS;
// const double dacaddr[NDAC]=DACADDR;
// int cs=daccs[ind];
// int addr=dacaddr[ind];
@ -601,9 +601,9 @@ float initDACbyIndexDACU(int ind, int val, int imod) {
}
int getThresholdEnergy() {
float g[3]=DEFAULTGAIN;
float o[3]=DEFAULTOFFSET;
float myg=-1, myo=-1;
double g[3]=DEFAULTGAIN;
double o[3]=DEFAULTOFFSET;
double myg=-1, myo=-1;
// int dacu;
int imod;
int ethr=-1;
@ -643,7 +643,7 @@ int getThresholdEnergy() {
}
#ifdef VERBOSE
//printf("module=%d gain=%f, offset=%f, dacu=%f\n",imod, myg, myo, detectorDacs[VTHRESH+imod*NDAC]);
printf("module=%d gain=%f, offset=%f, dacu=%f\n",imod, myg, myo,(float)(setDACRegister(VREF_DS,-1,imod)));//edited by dhanya
printf("module=%d gain=%f, offset=%f, dacu=%f\n",imod, myg, myo,(double)(setDACRegister(VREF_DS,-1,imod)));//edited by dhanya
printf("Threshold energy of module %d is %d eV\n", imod, ethr);
#endif
@ -659,9 +659,9 @@ int getThresholdEnergy() {
}
int setThresholdEnergy(int ethr) {
float g[3]=DEFAULTGAIN;
float o[3]=DEFAULTOFFSET;
float myg=-1, myo=-1;
double g[3]=DEFAULTGAIN;
double o[3]=DEFAULTOFFSET;
double myg=-1, myo=-1;
int dacu;
int imod;
int ret=ethr;
@ -698,7 +698,7 @@ int setThresholdEnergy(int ethr) {
myg=-1;
}
if (myg>0 && myo>0) {
dacu=myo-myg*((float)ethr)/1000.;
dacu=myo-myg*((double)ethr)/1000.;
#ifdef VERBOSE
printf("module %d (%x): gain %f, off %f, energy %d eV, dac %d\n",imod,(unsigned int)((detectorModules+imod)),(detectorModules+imod)->gain,(detectorModules+imod)->offset, ethr,dacu);
#endif
@ -715,7 +715,7 @@ int setThresholdEnergy(int ethr) {
float getDACbyIndexDACU(int ind, int imod) {
double getDACbyIndexDACU(int ind, int imod) {
/*
if (detectorDacs) {
if (imod<getNModBoard())
@ -741,7 +741,7 @@ int initDAC(int dac_addr, int value, int imod) {
return 0;
}
float getTemperatureByModule(int tempSensor, int imod)
double getTemperatureByModule(int tempSensor, int imod)
{
int im;
//for the particular module