slsDetectorSoftware & eiger server: fixed coordinates in 2 d, but switch to row (x), col(y); numdetx and numdety sent to all receivers now, likely bug fix virtual file linked in master for 1 mod jungfrau; xccoord and y coord calculated at setdetector pos and given to listener

This commit is contained in:
2018-08-15 19:02:16 +02:00
parent b3ccd5e1a1
commit 87e8333dfd
13 changed files with 156 additions and 98 deletions

View File

@ -1215,8 +1215,10 @@ void Beb_SetDetectorNumber(uint32_t detid) {
int Beb_SetDetectorPosition(int pos[]) {
if(!Beb_activated)
return OK;
cprintf(BLUE,"Got Position values %d %d %d...\n", pos[0],pos[1], pos[2]);
pos[1] = Beb_swap_uint16(pos[1]);
pos[0] = Beb_swap_uint16(pos[0]);
//pos[1] = Beb_swap_uint16(pos[1]);
pos[2] = Beb_swap_uint16(pos[2]);
int ret = FAIL;
@ -1231,37 +1233,37 @@ int Beb_SetDetectorPosition(int pos[]) {
uint32_t value = 0;
ret = OK;
// x left
int posval = Beb_swap_uint16((Beb_top ? pos[0] : (pos[0]+1)));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// x right
posval = Beb_swap_uint16((Beb_top ? (pos[0]+1) : pos[0]));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// y left
// y left (column)
// overwriting z anyway, so no need to look at previous z value
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
int posval = Beb_swap_uint16(Beb_top ? pos[1] : (pos[1]+1));
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
if(value != ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
ret = FAIL;
// y right
// overwriting z anyway, so no need to look at previous z value
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
posval = Beb_swap_uint16(Beb_top ? (pos[1]+1) : pos[1]);
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
if(value != ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
ret = FAIL;
@ -1290,8 +1292,8 @@ int Beb_SetDetectorPosition(int pos[]) {
cprintf(BLUE, "Position set to...\n"
"Left: [%d, %d, %d]\n"
"Right:[%d, %d, %d]\n",
(Beb_top ? pos[0] : (pos[0]+1)), Beb_swap_uint16(pos[1]), Beb_swap_uint16(pos[2]),
(Beb_top ? (pos[0]+1) : pos[0]), Beb_swap_uint16(pos[1]), Beb_swap_uint16(pos[2]));
Beb_swap_uint16(pos[0]), Beb_top ? pos[1] : (pos[1]+1), Beb_swap_uint16(pos[2]),
Beb_swap_uint16(pos[0]), Beb_top ? (pos[1]+1) : pos[1], Beb_swap_uint16(pos[2]));
}
return ret;

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: c934e92a41da49db07f8d3fed98d88dc39325401
Revision: 344
Branch: eigerfeature
Repsitory UUID: b3ccd5e1a137ddb5f11bc88d51a80e9dd777bc09
Revision: 346
Branch: developer
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3976
Last Changed Date: 2018-08-10 17:34:43.000000002 +0200 ./FebRegisterDefs.h
Last Changed Rev: 3980
Last Changed Date: 2018-08-15 18:03:20.000000002 +0200 ./Beb.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "c934e92a41da49db07f8d3fed98d88dc39325401"
#define GITREPUUID "b3ccd5e1a137ddb5f11bc88d51a80e9dd777bc09"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3976
#define GITDATE 0x20180810
#define GITBRANCH "eigerfeature"
#define GITREV 0x3980
#define GITDATE 0x20180815
#define GITBRANCH "developer"