mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
corrections to the angular conversion made at the beamline
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@536 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -39,9 +39,9 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
|
|||||||
enc=pos;
|
enc=pos;
|
||||||
|
|
||||||
for (int ip=0; ip<nch; ip++) {
|
for (int ip=0; ip<nch; ip++) {
|
||||||
#ifdef VERBOSE
|
//#ifdef VERBOSE
|
||||||
// cout << "ip " << ip << " ch0 " << ch0 << " chlast " << chlast << " imod " << imod << endl;
|
cout << "ip " << ip << " ch0 " << ch0 << " chlast " << chlast << " imod " << imod << endl;
|
||||||
#endif
|
//#endif
|
||||||
if (ip>chlast) {
|
if (ip>chlast) {
|
||||||
imod++;
|
imod++;
|
||||||
p=angOff[imod];
|
p=angOff[imod];
|
||||||
@ -50,6 +50,11 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
|
|||||||
else
|
else
|
||||||
enc=pos;
|
enc=pos;
|
||||||
|
|
||||||
|
if (p)
|
||||||
|
cout << enc << endl << fo+go << endl << p->r_conversion << endl << p->center << endl << p->offset << endl << p->tilt << angdir << endl;
|
||||||
|
else
|
||||||
|
cout << "no ang conv " << endl;
|
||||||
|
|
||||||
ch0=chlast+1;
|
ch0=chlast+1;
|
||||||
nchmod=chansPerMod[imod];
|
nchmod=chansPerMod[imod];
|
||||||
if (nchmod>0)
|
if (nchmod>0)
|
||||||
@ -65,6 +70,7 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
|
|||||||
p->offset, \
|
p->offset, \
|
||||||
p->tilt, \
|
p->tilt, \
|
||||||
angdir );
|
angdir );
|
||||||
|
cout << "ip " << ip << " ch0 " << ch0 << " chlast " << chlast << " imod " << imod << endl;
|
||||||
}
|
}
|
||||||
return ang;
|
return ang;
|
||||||
}
|
}
|
||||||
@ -76,6 +82,10 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
|
|||||||
|
|
||||||
double angularConversionStatic::convertAngle(double pos, int ich, angleConversionConstant *p, int mF, double fo, double go, int angdir) {
|
double angularConversionStatic::convertAngle(double pos, int ich, angleConversionConstant *p, int mF, double fo, double go, int angdir) {
|
||||||
|
|
||||||
|
// if (p)
|
||||||
|
// cout << pos << endl << fo+go << endl << p->r_conversion << endl << p->center << endl << p->offset << endl << mF << endl << angdir << endl;
|
||||||
|
// else
|
||||||
|
// cout << "no ang conv " << endl;
|
||||||
|
|
||||||
double enc=0, trans=0;
|
double enc=0, trans=0;
|
||||||
double ang;
|
double ang;
|
||||||
@ -115,7 +125,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, angleConversio
|
|||||||
p->offset, \
|
p->offset, \
|
||||||
trans, \
|
trans, \
|
||||||
angdir );
|
angdir );
|
||||||
|
// cout << ich << " " << ang << endl << endl;
|
||||||
return ang;
|
return ang;
|
||||||
|
|
||||||
|
|
||||||
@ -198,14 +208,16 @@ int angularConversionStatic::readAngularConversion( ifstream& infile, int nmod,
|
|||||||
//" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n"
|
//" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n"
|
||||||
while (infile.good() and interrupt==0) {
|
while (infile.good() and interrupt==0) {
|
||||||
getline(infile,str);
|
getline(infile,str);
|
||||||
#ifdef VERBOSE
|
//#ifdef VERBOSE
|
||||||
cout << "** mod " << nm << " " ;
|
cout << "** mod " << nm << " " ;
|
||||||
std::cout<< str << std::endl;
|
std::cout<< str << std::endl;
|
||||||
#endif
|
//#endif
|
||||||
istringstream ssstr(str);
|
istringstream ssstr(str);
|
||||||
ssstr >> ss >> mod;
|
ssstr >> ss >> mod;
|
||||||
ssstr >> ss >> center;
|
ssstr >> ss >> center;
|
||||||
if (ss==string("center"))
|
if (ss==string("center"))
|
||||||
|
newangconv=0;
|
||||||
|
else
|
||||||
newangconv=1;
|
newangconv=1;
|
||||||
ssstr >> ss >> ecenter;
|
ssstr >> ss >> ecenter;
|
||||||
if (newangconv) {
|
if (newangconv) {
|
||||||
@ -216,23 +228,29 @@ int angularConversionStatic::readAngularConversion( ifstream& infile, int nmod,
|
|||||||
ssstr >> ss >> er_conv;
|
ssstr >> ss >> er_conv;
|
||||||
ssstr >> ss >> off;
|
ssstr >> ss >> off;
|
||||||
ssstr >> ss >> eoff;
|
ssstr >> ss >> eoff;
|
||||||
|
cout << nm << " " << nmod << endl;
|
||||||
if (nm<nmod && nm>=0 ) {
|
if (nm<nmod && nm>=0 ) {
|
||||||
if (newangconv==0) {
|
|
||||||
angOff[nm].center=center;
|
angOff[nm].center=center;
|
||||||
angOff[nm].r_conversion=r_conv;
|
angOff[nm].r_conversion=r_conv;
|
||||||
angOff[nm].offset=off;
|
angOff[nm].offset=off;
|
||||||
angOff[nm].ecenter=ecenter;
|
angOff[nm].ecenter=ecenter;
|
||||||
angOff[nm].er_conversion=er_conv;
|
angOff[nm].er_conversion=er_conv;
|
||||||
angOff[nm].eoffset=eoff;
|
angOff[nm].eoffset=eoff;
|
||||||
} else {
|
|
||||||
|
if (newangconv!=0) {
|
||||||
|
// } else {
|
||||||
|
|
||||||
angOff[nm].tilt=pitch;
|
angOff[nm].tilt=pitch;
|
||||||
angOff[nm].etilt=epitch;
|
angOff[nm].etilt=epitch;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// cout << angOff[nm].center << " " << \
|
||||||
|
// angOff[nm].r_conversion << " " << \
|
||||||
|
// angOff[nm].offset << endl;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
//cout << nm<<" " << angOff[nm].offset << endl;
|
cout << nm<<" " << angOff[nm].offset << endl;
|
||||||
nm++;
|
nm++;
|
||||||
if (nm>=nmod)
|
if (nm>=nmod)
|
||||||
break;
|
break;
|
||||||
|
@ -633,6 +633,12 @@ void postProcessing::initDataset(int r) {
|
|||||||
angRad[im]=p->r_conversion;
|
angRad[im]=p->r_conversion;
|
||||||
angOff[im]=p->offset;
|
angOff[im]=p->offset;
|
||||||
angCenter[im]=p->center;
|
angCenter[im]=p->center;
|
||||||
|
|
||||||
|
|
||||||
|
cout << im << " " << angCenter[im] << " " << angRad[im] << " " << angOff[im] << endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
sx=getAngularConversionParameter(SAMPLE_X);
|
sx=getAngularConversionParameter(SAMPLE_X);
|
||||||
sy=getAngularConversionParameter(SAMPLE_Y);
|
sy=getAngularConversionParameter(SAMPLE_Y);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "postProcessingFuncs.h"
|
#include "postProcessingFuncs.h"
|
||||||
#include "angleConversionConstant.h"
|
#include "angleConversionConstant.h"
|
||||||
|
|
||||||
|
#define VERBOSE
|
||||||
|
|
||||||
postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCentre[], double* to, double* bs, double *sX, double *sY):
|
postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCentre[], double* to, double* bs, double *sX, double *sY):
|
||||||
nMods(0), chansPerMod(NULL), moduleMask(NULL), badChannelMask(NULL), ffCoeff(NULL), ffErr(NULL), tDead(0), angDir(1), angConv(NULL), totalOffset(0), binSize(0), sampleX(0), sampleY(0), totalChans(0), nBins(0), mp(NULL), mv(NULL), me(NULL), mm(NULL)
|
nMods(0), chansPerMod(NULL), moduleMask(NULL), badChannelMask(NULL), ffCoeff(NULL), ffErr(NULL), tDead(0), angDir(1), angConv(NULL), totalOffset(0), binSize(0), sampleX(0), sampleY(0), totalChans(0), nBins(0), mp(NULL), mv(NULL), me(NULL), mm(NULL)
|
||||||
@ -144,17 +145,17 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
|
|||||||
if (nBins) {
|
if (nBins) {
|
||||||
//angconv
|
//angconv
|
||||||
|
|
||||||
#ifdef VERBOSE
|
// #ifdef VERBOSE
|
||||||
cout << "ppFuncs angconv" << endl;
|
// cout << "ppFuncs angconv" << endl;
|
||||||
#endif
|
// #endif
|
||||||
//check module mask?!?!?!?
|
// //check module mask?!?!?!?
|
||||||
|
|
||||||
|
|
||||||
p1=convertAngle(*pos,ich-ch0,angConv[imod],moduleMask[imod],totalOffset,0,angDir);
|
p1=convertAngle(*pos,ich-ch0,angConv[imod],moduleMask[imod],totalOffset,0,angDir);
|
||||||
|
|
||||||
#ifdef VERBOSE
|
// #ifdef VERBOSE
|
||||||
cout << "ppFuncs merge" << endl;
|
// cout << "ppFuncs merge" << endl;
|
||||||
#endif
|
// #endif
|
||||||
addPointToMerging(p1,vout,eout,mp,mv,me,mm, binSize, nBins);
|
addPointToMerging(p1,vout,eout,mp,mv,me,mm, binSize, nBins);
|
||||||
|
|
||||||
|
|
||||||
@ -191,6 +192,11 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
nMods=*nModules;
|
nMods=*nModules;
|
||||||
else
|
else
|
||||||
nMods=0;
|
nMods=0;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << nMods << endl;
|
||||||
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "tdead " << endl;
|
cout << "tdead " << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -198,8 +204,11 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
if (t)
|
if (t)
|
||||||
tDead=*t;
|
tDead=*t;
|
||||||
else
|
else
|
||||||
t=0;
|
tDead=0;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << tDead << endl;
|
||||||
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "toffset " << endl;
|
cout << "toffset " << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -207,7 +216,10 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
if (to)
|
if (to)
|
||||||
totalOffset=*to;
|
totalOffset=*to;
|
||||||
else
|
else
|
||||||
to=0;
|
totalOffset=0;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << totalOffset << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -218,6 +230,10 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
else
|
else
|
||||||
binSize=0;
|
binSize=0;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << binSize << endl;
|
||||||
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "samplex " << endl;
|
cout << "samplex " << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -226,6 +242,9 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
else
|
else
|
||||||
sampleX=0;
|
sampleX=0;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << sampleX << endl;
|
||||||
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "sampley " << endl;
|
cout << "sampley " << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -233,7 +252,10 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
sampleY=*sY;
|
sampleY=*sY;
|
||||||
else
|
else
|
||||||
sampleY=0;
|
sampleY=0;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << sampleY << endl;
|
||||||
|
#endif
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "angdir " << endl;
|
cout << "angdir " << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -242,6 +264,9 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
else
|
else
|
||||||
angDir=1;
|
angDir=1;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << angDir << endl;
|
||||||
|
#endif
|
||||||
totalChans=0;
|
totalChans=0;
|
||||||
|
|
||||||
|
|
||||||
@ -256,19 +281,19 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
|
|||||||
angConv=new angleConversionConstant*[nMods];
|
angConv=new angleConversionConstant*[nMods];
|
||||||
nBins=(int)(360./binSize)+1;
|
nBins=(int)(360./binSize)+1;
|
||||||
}
|
}
|
||||||
|
cout << "nBins " << nBins << endl;
|
||||||
for (int im=0; im<nMods; im++) {
|
for (int im=0; im<nMods; im++) {
|
||||||
#ifdef VERBOSE
|
//#ifdef VERBOSE
|
||||||
cout << "MODULE "<< im << endl;
|
// cout << "MODULE "<< im << endl;
|
||||||
#endif
|
//#endif
|
||||||
chansPerMod[im]=chPerMod[im];
|
chansPerMod[im]=chPerMod[im];
|
||||||
moduleMask[im]=modMask[im];
|
moduleMask[im]=modMask[im];
|
||||||
totalChans+=chansPerMod[im];
|
totalChans+=chansPerMod[im];
|
||||||
|
|
||||||
if (angConv) {
|
if (angConv) {
|
||||||
angConv[im]=new angleConversionConstant(angCenter[im], angRadius[im], angOffset[im], 0);
|
angConv[im]=new angleConversionConstant(angCenter[im], angRadius[im], angOffset[im], 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// cout << angCenter[im] << " " << chansPerMod[im] << " " << angRadius[im] << " " << angOffset[im] << " " << moduleMask[im] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#ifndef DEFAULT_ANGLE_FUNCTION_H
|
#ifndef DEFAULT_ANGLE_FUNCTION_H
|
||||||
#define DEFAULT_ANGLE_FUNCTION_H
|
#define DEFAULT_ANGLE_FUNCTION_H
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
contains the conversion channel-angle for a module channel
|
contains the conversion channel-angle for a module channel
|
||||||
@ -9,7 +10,17 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) {\
|
double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) {\
|
||||||
(void) tilt; \
|
(void) tilt;
|
||||||
|
double ang;
|
||||||
|
|
||||||
|
ang=180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset;
|
||||||
|
|
||||||
|
|
||||||
|
//#ifdef VERBOSE
|
||||||
|
// printf("%d %f %f %f %f %f %f %d\n", ichan, ang, center, encoder, totalOffset, conv_r, offset, direction);
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
return ang; \
|
||||||
return 180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset; };
|
return 180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset; };
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
double pos;
|
float pos;
|
||||||
double i0=0;
|
float i0=0;
|
||||||
#ifdef EPICS
|
#ifdef EPICS
|
||||||
|
|
||||||
#include <cadef.h>
|
#include <cadef.h>
|
||||||
@ -99,6 +99,11 @@ int caput(chid ch_id, double value) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -106,9 +111,33 @@ int caput(chid ch_id, double value) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /*
|
||||||
|
// contains the conversion channel-angle for a module channel
|
||||||
|
// conv_r=pitch/radius
|
||||||
|
// */
|
||||||
|
|
||||||
|
|
||||||
|
// double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) {
|
||||||
|
|
||||||
|
|
||||||
|
// (void) tilt; /* to avoid warning: unused parameter */
|
||||||
|
// double ang;
|
||||||
|
|
||||||
|
// ang=180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset;
|
||||||
|
|
||||||
|
|
||||||
|
// //#ifdef VERBOSE
|
||||||
|
// printf("%d %f \n", ichan, ang);
|
||||||
|
// //#endif
|
||||||
|
|
||||||
|
// return ang;
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
/* reads the encoder and returns the position */
|
/* reads the encoder and returns the position */
|
||||||
|
|
||||||
double defaultGetPosition(void *d) {
|
double defaultGetPosition(void*) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Getting motor position \n");
|
printf("Getting motor position \n");
|
||||||
#endif
|
#endif
|
||||||
@ -128,8 +157,6 @@ double defaultGetPosition(void *d) {
|
|||||||
pos=value;
|
pos=value;
|
||||||
} else
|
} else
|
||||||
printf(ca_message(status));
|
printf(ca_message(status));
|
||||||
#else
|
|
||||||
printf("\nmotor position is %f\n",pos);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -137,11 +164,10 @@ double defaultGetPosition(void *d) {
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* moves the encoder to position p */
|
/* moves the encoder to position p */
|
||||||
|
|
||||||
|
|
||||||
int defaultGoToPosition(double p,void *d) {
|
int defaultGoToPosition(double p, void*) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Setting motor position \n");
|
printf("Setting motor position \n");
|
||||||
#endif
|
#endif
|
||||||
@ -153,26 +179,22 @@ int defaultGoToPosition(double p,void *d) {
|
|||||||
if ((status = caput(ch_pos, p)) == ECA_NORMAL) {
|
if ((status = caput(ch_pos, p)) == ECA_NORMAL) {
|
||||||
;
|
;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("caput: success\n");
|
printf("caput %f: success\n", p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else
|
} else
|
||||||
printf(ca_message(status));
|
printf(ca_message(status));
|
||||||
#else
|
#else
|
||||||
pos=p;
|
pos=p;
|
||||||
printf("\nmoving motor to position %f\n",p);
|
|
||||||
#endif
|
#endif
|
||||||
//"caputq X04SA-ES2-TH2:RO p"
|
//"caputq X04SA-ES2-TH2:RO p"
|
||||||
//cawait -nounit -timeout 3600 X04SA-ES2-TH2:RO.DMOV '==1'
|
//cawait -nounit -timeout 3600 X04SA-ES2-TH2:RO.DMOV '==1'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (int)p;
|
return (int)p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* moves the encoder to position p without waiting */
|
/* moves the encoder to position p without waiting */
|
||||||
|
|
||||||
int defaultGoToPositionNoWait(double p,void *d) {
|
int defaultGoToPositionNoWait(double p, void*) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Setting motor position no wait \n");
|
printf("Setting motor position no wait \n");
|
||||||
#endif
|
#endif
|
||||||
@ -203,7 +225,7 @@ int defaultGoToPositionNoWait(double p,void *d) {
|
|||||||
|
|
||||||
/* reads I0 and returns the intensity */
|
/* reads I0 and returns the intensity */
|
||||||
|
|
||||||
double defaultGetI0(int t,void *d) {
|
double defaultGetI0(int t, void*) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Getting I0 readout \n");
|
printf("Getting I0 readout \n");
|
||||||
#endif
|
#endif
|
||||||
@ -239,7 +261,7 @@ double defaultGetI0(int t,void *d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int defaultConnectChannels(void*d) {
|
int defaultConnectChannels(void *) {
|
||||||
#ifdef EPICS
|
#ifdef EPICS
|
||||||
//double value = 256;
|
//double value = 256;
|
||||||
/* channel name */
|
/* channel name */
|
||||||
@ -289,7 +311,7 @@ int defaultConnectChannels(void*d) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int defaultDisconnectChannels(void *d) {
|
int defaultDisconnectChannels(void*) {
|
||||||
#ifdef EPICS
|
#ifdef EPICS
|
||||||
/* close channel connect */
|
/* close channel connect */
|
||||||
disconnect_channel(ch_i0);
|
disconnect_channel(ch_i0);
|
||||||
@ -304,49 +326,11 @@ int defaultDisconnectChannels(void *d) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int defaultDataReadyFunc(detectorData* d, int i, void* p) {
|
int defaultDataReadyFunc(detectorData* d) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Data received \n");
|
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Data received \n");
|
||||||
printf("Filename %s\n",d->fileName);
|
|
||||||
printf("Number of points %d (%d)\n",d->npoints,d->npy);
|
|
||||||
/* for(int i=0;i<d->npoints;i++){
|
|
||||||
if ((d->angles))
|
|
||||||
printf("%d-[%f]:%f\n",i,(d->angles)[i],(d->values)[i]);
|
|
||||||
else
|
|
||||||
printf("%d-%f\n",i,(d->values)[i]);
|
|
||||||
}*/
|
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Finished \n");
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int defaultRawDataReadyFunc(double* d, int np, void* p) {
|
|
||||||
//#ifdef VERBOSE
|
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Raw Data received \n");
|
|
||||||
if (d==NULL)
|
|
||||||
printf("no data received\n");
|
|
||||||
else
|
|
||||||
printf("received %d channels\n",np);
|
|
||||||
|
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Finished \n");
|
|
||||||
//#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int defaultWriteReceiverDataFunc(char* d, int np, FILE* f, void* p){
|
|
||||||
//#ifdef VERBOSE
|
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Receiver Data received \n");
|
|
||||||
if (d==NULL)
|
|
||||||
printf("no data received\n");
|
|
||||||
else{
|
|
||||||
printf("received %d bytes of data\n",np);
|
|
||||||
printf("index:%d\n",(int)(*(int*)d));
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU Finished \n");
|
|
||||||
//#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@ -6,10 +6,8 @@ Functions depending on the experimental setup should be defined here
|
|||||||
|
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
//#define PI 3.14159265358979323846
|
#define PI 3.14159265358979323846
|
||||||
#ifdef __cplusplus
|
|
||||||
#include <iostream>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EPICS
|
#ifdef EPICS
|
||||||
#include <cadef.h>
|
#include <cadef.h>
|
||||||
@ -31,20 +29,17 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction);
|
// double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction);
|
||||||
double defaultGetPosition(void *d);
|
double defaultGetPosition(void*);
|
||||||
int defaultGoToPosition(double p,void *d);
|
int defaultGoToPosition(double p, void*);
|
||||||
int defaultGoToPositionNoWait(double p,void *d);
|
int defaultGoToPositionNoWait(double p, void*);
|
||||||
int defaultConnectChannels(void *d);
|
int defaultConnectChannels(void*);
|
||||||
int defaultDisconnectChannels(void *d);
|
int defaultDisconnectChannels(void*);
|
||||||
double defaultGetI0(int t,void *d);
|
double defaultGetI0(int t, void*);
|
||||||
|
|
||||||
int defaultDataReadyFunc(detectorData* d, int i, void* p);
|
int defaultDataReadyFunc(detectorData* d, void*);
|
||||||
int defaultRawDataReadyFunc(double* d, int np, void* p);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
int defaultWriteReceiverDataFunc(char* d, int np, FILE* f, void* p);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user