mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
gotthard works for short frame
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorCalibration@44 113b152e-814d-439b-b186-022a431db7b5
This commit is contained in:
@ -8,8 +8,7 @@
|
||||
#define Y_PIXELS 1
|
||||
#define NPACKETS 2
|
||||
#define BUFFERSIZE 1286
|
||||
#define NUMPACKETS 2
|
||||
#define NUMSHORTPACKETS 1
|
||||
|
||||
#define FRAMEMASK 0xFFFFFFFE
|
||||
#define PACKETMASK 1
|
||||
#define FRAMEOFFSET 0x1
|
||||
@ -29,12 +28,7 @@ public:
|
||||
*/
|
||||
|
||||
|
||||
gotthardModuleData(double c=0, int s=-1): slsReceiverData<uint16_t>(X_PIXELS, Y_PIXELS, NPACKETS, BUFFERSIZE), xtalk(c),shortFrame(s) {
|
||||
|
||||
if(shortFrame == -1)
|
||||
shortFrame = 0;
|
||||
else
|
||||
shortFrame = 1;
|
||||
gotthardModuleData(double c=0): slsReceiverData<uint16_t>(X_PIXELS, Y_PIXELS, NPACKETS, BUFFERSIZE), xtalk(c) {
|
||||
|
||||
uint16_t **dMask;
|
||||
int **dMap;
|
||||
@ -42,7 +36,6 @@ public:
|
||||
int initial_offset = 2;
|
||||
int offset = initial_offset;
|
||||
|
||||
|
||||
dMask=new uint16_t*[Y_PIXELS];
|
||||
dMap=new int*[Y_PIXELS];
|
||||
for (int i = 0; i < Y_PIXELS; i++) {
|
||||
@ -50,34 +43,21 @@ public:
|
||||
dMask[i] = new uint16_t[X_PIXELS];
|
||||
}
|
||||
|
||||
|
||||
for(ix=0; ix<Y_PIXELS; ++ix)
|
||||
for(iy=0; iy<X_PIXELS; ++iy)
|
||||
dMask[ix][iy] = 0x0;
|
||||
|
||||
|
||||
if(!shortFrame){
|
||||
for(ix=0; ix<Y_PIXELS; ++ix){
|
||||
if(ix == (Y_PIXELS/2)){
|
||||
offset += initial_offset;//2
|
||||
offset++;
|
||||
}
|
||||
for(iy=0; iy<X_PIXELS; ++iy){
|
||||
dMap[ix][iy] = offset;
|
||||
offset++;
|
||||
}
|
||||
for(ix=0; ix<Y_PIXELS; ++ix){
|
||||
if(ix == (Y_PIXELS/2)){
|
||||
offset += initial_offset;//2
|
||||
offset++;
|
||||
}
|
||||
for(iy=0; iy<X_PIXELS; ++iy){
|
||||
dMap[ix][iy] = offset;
|
||||
offset++;
|
||||
}
|
||||
}else{
|
||||
for(ix=0; ix<Y_PIXELS; ++ix)
|
||||
for(iy=0; iy<X_PIXELS; ++iy){
|
||||
dMap[ix][iy] = offset;
|
||||
offset++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
setDataMap(dMap);
|
||||
setDataMask(dMask);
|
||||
|
||||
@ -94,10 +74,6 @@ public:
|
||||
|
||||
int getFrameNumber(char *buff){
|
||||
int np=(*(int*)buff);
|
||||
|
||||
if(shortFrame)
|
||||
return np;
|
||||
|
||||
//gotthards frame header must be incremented
|
||||
++np;
|
||||
//packet index should be 1 or 2
|
||||
@ -114,9 +90,6 @@ public:
|
||||
*/
|
||||
|
||||
int getPacketNumber(char *buff){
|
||||
if(shortFrame)
|
||||
return 1;
|
||||
|
||||
int np=(*(int*)buff);
|
||||
//gotthards frame header must be incremented
|
||||
++np;
|
||||
@ -165,7 +138,6 @@ public:
|
||||
private:
|
||||
|
||||
double xtalk; /**<output buffer crosstalk correction parameter */
|
||||
int shortFrame; /**<short frame */
|
||||
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user