mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
partialread changed to readnrows
This commit is contained in:
@ -33,7 +33,7 @@ int Beb_top = 0;
|
||||
uint64_t Beb_deactivatedNextFrameNumber = 0;
|
||||
int Beb_quadEnable = 0;
|
||||
int Beb_positions[2] = {0, 0};
|
||||
int Beb_partialReadout = MAX_ROWS_PER_READOUT;
|
||||
int Beb_readNRows = MAX_ROWS_PER_READOUT;
|
||||
int Beb_deactivated_transmission_flowcontrol_10g = 0;
|
||||
int Beb_deactivated_transmission_delay_frame = 0;
|
||||
int Beb_deactivated_transmission_delay_left = 0;
|
||||
@ -903,7 +903,7 @@ int Beb_RequestNImages(int ten_gig, unsigned int nimages, int test_just_send_out
|
||||
|
||||
unsigned int maxnl = MAX_ROWS_PER_READOUT;
|
||||
unsigned int maxnp = (ten_gig ? 4 : 16) * Beb_bit_mode;
|
||||
unsigned int nl = Beb_partialReadout;
|
||||
unsigned int nl = Beb_readNRows;
|
||||
unsigned int npackets = (nl * maxnp) / maxnl;
|
||||
if ((nl * maxnp) % maxnl) {
|
||||
LOG(logERROR, ("Read N Lines is incorrect. Switching to Full Image "
|
||||
@ -1265,7 +1265,7 @@ int Beb_GetNextFrameNumber(uint64_t *retval, int tengigaEnable) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
void Beb_SetPartialReadout(int value) { Beb_partialReadout = value; }
|
||||
void Beb_SetReadNRows(int value) { Beb_readNRows = value; }
|
||||
|
||||
int Beb_GetNumberofDestinations(int *retval) {
|
||||
if (!Beb_activated) {
|
||||
|
@ -1554,24 +1554,24 @@ int Feb_Control_SetChipSignalsToTrimQuad(int enable) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Feb_Control_SetPartialReadout(int value) {
|
||||
LOG(logINFO, ("Setting Partial Readout to %d\n", value));
|
||||
int Feb_Control_SetReadNRows(int value) {
|
||||
LOG(logINFO, ("Setting number of rows to %d\n", value));
|
||||
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),
|
||||
DAQ_REG_PARTIAL_READOUT, value, 0, 0)) {
|
||||
LOG(logERROR, ("Could not write %d to Partial Readout reg\n", value));
|
||||
DAQ_REG_READ_N_ROWS, value, 0, 0)) {
|
||||
LOG(logERROR, ("Could not write %d to number of rows reg\n", value));
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Feb_Control_GetPartialReadout() {
|
||||
int Feb_Control_GetReadNRows() {
|
||||
uint32_t regVal = 0;
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_AddressToAll(),
|
||||
DAQ_REG_PARTIAL_READOUT, ®Val)) {
|
||||
LOG(logERROR, ("Could not read back Partial Readout reg\n"));
|
||||
DAQ_REG_READ_N_ROWS, ®Val)) {
|
||||
LOG(logERROR, ("Could not read back ReadNRows reg\n"));
|
||||
return -1;
|
||||
}
|
||||
LOG(logDEBUG1, ("Retval Partial Readout: %d\n", regVal));
|
||||
LOG(logDEBUG1, ("Retval ReadNRows: %d\n", regVal));
|
||||
return regVal;
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ void Feb_Control_SetMasterVariable(int val);
|
||||
int Feb_Control_SetMaster(enum MASTERINDEX ind);
|
||||
int Feb_Control_SetQuad(int val);
|
||||
int Feb_Control_SetChipSignalsToTrimQuad(int enable);
|
||||
int Feb_Control_SetPartialReadout(int value);
|
||||
int Feb_Control_GetPartialReadout();
|
||||
int Feb_Control_SetReadNRows(int value);
|
||||
int Feb_Control_GetReadNRows();
|
||||
int Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
|
||||
int Feb_Control_ReadRegister(uint32_t offset, uint32_t *retval);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0)
|
||||
#define DAQ_REG_SUBFRAME_EXPOSURES 6
|
||||
#define DAQ_REG_SUBFRAME_PERIOD 7 // also pg and fifo status register
|
||||
#define DAQ_REG_PARTIAL_READOUT 8
|
||||
#define DAQ_REG_READ_N_ROWS 8
|
||||
|
||||
#define DAQ_REG_HRDWRE 12
|
||||
// clang-format off
|
||||
|
Binary file not shown.
@ -85,7 +85,7 @@ uint64_t eiger_virtual_nextframenumber = 1;
|
||||
int eiger_virtual_detPos[2] = {0, 0};
|
||||
int eiger_virtual_test_mode = 0;
|
||||
int eiger_virtual_quad_mode = 0;
|
||||
int eiger_virtual_partial_readout = 256;
|
||||
int eiger_virtual_read_n_rows = 256;
|
||||
int eiger_virtual_interrupt_subframe = 0;
|
||||
int eiger_virtual_left_datastream = 1;
|
||||
int eiger_virtual_right_datastream = 1;
|
||||
@ -708,7 +708,7 @@ void setupDetector() {
|
||||
setIODelay(DEFAULT_IO_DELAY);
|
||||
setTiming(DEFAULT_TIMING_MODE);
|
||||
setNextFrameNumber(DEFAULT_STARTING_FRAME_NUMBER);
|
||||
setPartialReadout(MAX_ROWS_PER_READOUT);
|
||||
setReadNRows(MAX_ROWS_PER_READOUT);
|
||||
// SetPhotonEnergyCalibrationParameters(-5.8381e-5,1.838515,5.09948e-7,-4.32390e-11,1.32527e-15);
|
||||
eiger_tau_ns = DEFAULT_RATE_CORRECTION;
|
||||
setRateCorrection(DEFAULT_RATE_CORRECTION);
|
||||
@ -1683,29 +1683,29 @@ int getInterruptSubframe() {
|
||||
#endif
|
||||
}
|
||||
|
||||
int setPartialReadout(int value) {
|
||||
int setReadNRows(int value) {
|
||||
if (value < 0)
|
||||
return FAIL;
|
||||
#ifndef VIRTUAL
|
||||
sharedMemory_lockLocalLink();
|
||||
if (!Feb_Control_SetPartialReadout(value)) {
|
||||
if (!Feb_Control_SetReadNRows(value)) {
|
||||
sharedMemory_unlockLocalLink();
|
||||
return FAIL;
|
||||
}
|
||||
sharedMemory_unlockLocalLink();
|
||||
Beb_SetPartialReadout(value);
|
||||
Beb_SetReadNRows(value);
|
||||
#else
|
||||
eiger_virtual_partial_readout = value;
|
||||
eiger_virtual_read_n_rows = value;
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
||||
int getPartialReadout() {
|
||||
int getReadNRows() {
|
||||
#ifdef VIRTUAL
|
||||
return eiger_virtual_partial_readout;
|
||||
return eiger_virtual_read_n_rows;
|
||||
#else
|
||||
sharedMemory_lockLocalLink();
|
||||
int retval = Feb_Control_GetPartialReadout();
|
||||
int retval = Feb_Control_GetReadNRows();
|
||||
sharedMemory_unlockLocalLink();
|
||||
return retval;
|
||||
#endif
|
||||
@ -2328,15 +2328,15 @@ void *start_timer(void *arg) {
|
||||
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 partialReadout = getPartialReadout();
|
||||
if (partialReadout == -1) {
|
||||
int readNRows = getReadNRows();
|
||||
if (readNRows == -1) {
|
||||
LOG(logERROR,
|
||||
("partial readout is -1. Assuming no partial readout.\n"));
|
||||
partialReadout = MAX_ROWS_PER_READOUT;
|
||||
("readNRows is -1. Assuming no readNRows.\n"));
|
||||
readNRows = MAX_ROWS_PER_READOUT;
|
||||
}
|
||||
const int maxRows = MAX_ROWS_PER_READOUT;
|
||||
const int packetsPerFrame =
|
||||
(maxPacketsPerFrame * partialReadout) / maxRows;
|
||||
(maxPacketsPerFrame * readNRows) / maxRows;
|
||||
|
||||
|
||||
LOG(logDEBUG1,
|
||||
@ -2419,7 +2419,7 @@ void *start_timer(void *arg) {
|
||||
// loop packet
|
||||
for (int i = 0; i != maxPacketsPerFrame; ++i) {
|
||||
|
||||
// calculate for partial readout
|
||||
// calculate for readNRows
|
||||
const int startval = 0;
|
||||
const int endval = startval + packetsPerFrame - 1;
|
||||
|
||||
|
Reference in New Issue
Block a user