mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
Fixpositions (#436)
* fix positions on server side * wip * numports wip * wip * jungfrau top inner interface row increment * x, y detpos, wip * removed eiger row indices flipping in gui (bottom flipping maintained) * wip * wip, jungfrau numinterfaces2 * jungfrau virtual works * eiger, jungfrau, g2 virtual server works * eiger positions fix, wip * binaries in * minor printout * binaries in * pointer bug * comment to define test_mod_geometry define
This commit is contained in:
@ -1095,19 +1095,19 @@ int *Beb_GetDetectorPosition() { return Beb_positions; }
|
||||
int Beb_SetDetectorPosition(int pos[]) {
|
||||
if (!Beb_activated)
|
||||
return OK;
|
||||
LOG(logINFO, ("Got Position values %d %d...\n", pos[0], pos[1]));
|
||||
LOG(logINFO, ("Setting Position: (%d, %d)\n", pos[X], pos[Y]));
|
||||
|
||||
// save positions
|
||||
Beb_positions[0] = pos[0];
|
||||
Beb_positions[1] = pos[1];
|
||||
Beb_positions[Y] = pos[Y];
|
||||
Beb_positions[X] = pos[X];
|
||||
|
||||
// get left and right
|
||||
int posLeft[2] = {pos[0], Beb_top ? pos[1] : pos[1] + 1};
|
||||
int posRight[2] = {pos[0], Beb_top ? pos[1] + 1 : pos[1]};
|
||||
int posLeft[2] = {Beb_top ? pos[X] : pos[X] + 1, pos[Y]};
|
||||
int posRight[2] = {Beb_top ? pos[X] + 1 : pos[X], pos[Y]};
|
||||
|
||||
if (Beb_quadEnable) {
|
||||
posRight[0] = 1; // right is next row
|
||||
posRight[1] = 0; // right same first column
|
||||
posRight[Y] = 1; // right is next row
|
||||
posRight[X] = 0; // right same first column
|
||||
}
|
||||
|
||||
int ret = FAIL;
|
||||
@ -1122,7 +1122,7 @@ int Beb_SetDetectorPosition(int pos[]) {
|
||||
uint32_t value = 0;
|
||||
ret = OK;
|
||||
// x left
|
||||
int posval = Beb_swap_uint16(posLeft[0]);
|
||||
int posval = Beb_swap_uint16(posLeft[Y]);
|
||||
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_LEFT_OFST,
|
||||
@ -1134,7 +1134,7 @@ int Beb_SetDetectorPosition(int pos[]) {
|
||||
ret = FAIL;
|
||||
}
|
||||
// x right
|
||||
posval = Beb_swap_uint16(posRight[0]);
|
||||
posval = Beb_swap_uint16(posRight[Y]);
|
||||
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_RIGHT_OFST,
|
||||
@ -1147,7 +1147,7 @@ int Beb_SetDetectorPosition(int pos[]) {
|
||||
}
|
||||
|
||||
// y left (column)
|
||||
posval = Beb_swap_uint16(posLeft[1]);
|
||||
posval = Beb_swap_uint16(posLeft[X]);
|
||||
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
|
||||
value &= UDP_HEADER_Z_MSK; // to keep previous z value
|
||||
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST,
|
||||
@ -1160,7 +1160,7 @@ int Beb_SetDetectorPosition(int pos[]) {
|
||||
}
|
||||
|
||||
// y right
|
||||
posval = Beb_swap_uint16(posRight[1]);
|
||||
posval = Beb_swap_uint16(posRight[X]);
|
||||
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
|
||||
value &= UDP_HEADER_Z_MSK; // to keep previous z value
|
||||
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST,
|
||||
@ -1176,10 +1176,10 @@ int Beb_SetDetectorPosition(int pos[]) {
|
||||
Beb_close(fd, csp0base);
|
||||
}
|
||||
if (ret == OK) {
|
||||
LOG(logINFO, ("Position set to...\n"
|
||||
LOG(logINFO, ("Position set to (col, row):\n"
|
||||
"\tLeft: [%d, %d]\n"
|
||||
"\tRight:[%d, %d]\n",
|
||||
posLeft[0], posLeft[1], posRight[0], posRight[1]));
|
||||
posLeft[X], posLeft[Y], posRight[X], posRight[Y]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Binary file not shown.
@ -19,7 +19,7 @@
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
extern int portno;
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
@ -2473,9 +2473,9 @@ void *start_timer(void *arg) {
|
||||
int maxPacketsPerFrame = (tgEnable ? 4 : 16) * dr;
|
||||
int npixelsx = 256 * 2 * bytesPerPixel;
|
||||
int databytes = 256 * 256 * 2 * bytesPerPixel;
|
||||
int row = eiger_virtual_detPos[0];
|
||||
int colLeft = top ? eiger_virtual_detPos[1] : eiger_virtual_detPos[1] + 1;
|
||||
int colRight = top ? eiger_virtual_detPos[1] + 1 : eiger_virtual_detPos[1];
|
||||
int row = eiger_virtual_detPos[Y];
|
||||
int colLeft = top ? eiger_virtual_detPos[X] : eiger_virtual_detPos[X] + 1;
|
||||
int colRight = top ? eiger_virtual_detPos[X] + 1 : eiger_virtual_detPos[X];
|
||||
|
||||
int readNRows = getReadNRows();
|
||||
if (readNRows == -1) {
|
||||
@ -2548,8 +2548,20 @@ void *start_timer(void *arg) {
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
// to debug multi module geometry (row, column) in virtual servers (all pixels
|
||||
// in a module set to particular value)
|
||||
#ifdef TEST_MOD_GEOMETRY
|
||||
if ((i % 1024) < 512) {
|
||||
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
|
||||
top ? (portno % 1900) : ((portno % 1900) + 1);
|
||||
} else {
|
||||
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
|
||||
top ? ((portno % 1900) + 1) : (portno % 1900);
|
||||
}
|
||||
#else
|
||||
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
|
||||
eiger_virtual_test_mode ? 0xFFE : (uint16_t)pixelVal;
|
||||
#endif
|
||||
break;
|
||||
case 32:
|
||||
*((uint32_t *)(imageData + i * sizeof(uint32_t))) =
|
||||
|
Reference in New Issue
Block a user