merge from 4.0.1

This commit is contained in:
2019-02-11 14:04:09 +01:00
79 changed files with 1911 additions and 851 deletions

View File

@ -41,15 +41,6 @@ add_definitions(
-DDACS_INT
)
add_library(slsDetectorStatic STATIC
${SOURCES}
${HEADERS}
)
set_target_properties(slsDetectorStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsDetector
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(slsDetectorShared SHARED
${SOURCES}
${HEADERS}
@ -98,7 +89,8 @@ if(DOXYGEN_FOUND)
)
endif()
install(TARGETS slsDetectorShared slsDetectorStatic
install(TARGETS slsDetectorShared
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib)

View File

@ -1,6 +1,5 @@
/** API versions */
#define APIRECEIVER 0x180927
#define APIEIGER 0x180820
#define APIJUNGFRAU 0x180925
#define APIGOTTHARD 0x180928
#define APIEIGER 0x190207
#define APIJUNGFRAU 0x190107
#define APIGOTTHARD 0x190201

View File

@ -1966,7 +1966,7 @@ int64_t Feb_Control_GetMeasuredPeriod() {
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_PERIOD_REG, &value);
return value*10;
return (int64_t)value*10;
}
int64_t Feb_Control_GetSubMeasuredPeriod() {
@ -1976,7 +1976,7 @@ int64_t Feb_Control_GetSubMeasuredPeriod() {
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_SUBPERIOD_REG, &value);
return value*10;
return (int64_t)value*10;
}
@ -2014,14 +2014,24 @@ uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t value=0;
if(Module_TopAddressIsValid(&modules[1])){
if(!Feb_Interface_WriteRegister(Module_GetTopRightAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
cprintf(RED,"Could not read tr value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_WriteRegister(Module_GetTopLeftAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read tl value. Value read:%d\n", value);
value = 0;
}
} else {
if(!Feb_Interface_WriteRegister(Module_GetBottomRightAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
cprintf(RED,"Could not read br value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_WriteRegister(Module_GetBottomLeftAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read bl value. Value read:%d\n", value);
value = 0;
}
}
return Feb_Control_ReadRegister(offset);
}
@ -2029,16 +2039,34 @@ uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t Feb_Control_ReadRegister(uint32_t offset) {
uint32_t value=0;
uint32_t value1=0;
if(Module_TopAddressIsValid(&modules[1])){
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
printf("Read top right addr: 0x%08x\n", value);
if(!Feb_Interface_ReadRegister(Module_GetTopLeftAddress (&modules[1]),offset, &value1)) {
cprintf(RED,"Could not read value. Value read:%d\n", value1);
value1 = 0;
}
printf("Read top left addr: 0x%08x\n", value1);
if (value != value1)
value = -1;
} else {
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
printf("Read bottom right addr: 0x%08x\n", value);
if(!Feb_Interface_ReadRegister(Module_GetBottomLeftAddress (&modules[1]),offset, &value1)) {
cprintf(RED,"Could not read value. Value read:%d\n", value1);
value1 = 0;
}
printf("Read bottom left addr: 0x%08x\n", value1);
if (value != value1)
value = -1;
}
return value;
}

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: c52025dd7c4b44b93e64353a22997d971996ab18
Revision: 350
Repsitory UUID: def79807f6f40ed1797b8154240adbc0e35c95e0
Revision: 352
Branch: developer
Last Changed Author: Gemma_Tinti
Last Changed Rev: 3999
Last Changed Date: 2018-09-28 14:11:53.000000002 +0200 ./Makefile.virtual
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4039
Last Changed Date: 2019-02-07 18:05:28.000000002 +0100 ./xparameters.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "c52025dd7c4b44b93e64353a22997d971996ab18"
#define GITAUTH "Gemma_Tinti"
#define GITREV 0x3999
#define GITDATE 0x20180928
#define GITREPUUID "def79807f6f40ed1797b8154240adbc0e35c95e0"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4039
#define GITDATE 0x20190207
#define GITBRANCH "developer"

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: d2bce7e372c241cd235977b92be18555bca6a77d
Revision: 2040
Branch: 4.0.0
Repsitory UUID: 3c774478681813e451df683e2bc8403b37490323
Revision: 2071
Branch: 4.0.1
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4020
Last Changed Date: 2018-09-27 18:22:10.000000002 +0200 ./sharedMemory/SharedMemory.o
Last Changed Rev: 4084
Last Changed Date: 2019-02-08 17:25:57.000000002 +0100 ./threadFiles/ThreadPool.o

View File

@ -887,7 +887,7 @@ int64_t get64BitReg(int aLSB, int aMSB){
return v64;
}
int64_t setFrames(int64_t value){
int64_t setFrames(int64_t value){printf("setting frames to %lld\n", (long long int)value);
return set64BitReg(value, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
}
@ -895,7 +895,7 @@ int64_t getFrames(){
return get64BitReg(GET_FRAMES_LSB_REG, GET_FRAMES_MSB_REG);
}
int64_t setExposureTime(int64_t value){
int64_t setExposureTime(int64_t value){printf("setting exptime to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
@ -909,7 +909,7 @@ int64_t getExposureTime(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setGates(int64_t value){
int64_t setGates(int64_t value){printf("setting gates to %lld\n", (long long int)value);
return set64BitReg(value, SET_GATES_LSB_REG, SET_GATES_MSB_REG);
}
@ -917,7 +917,7 @@ int64_t getGates(){
return get64BitReg(GET_GATES_LSB_REG, GET_GATES_MSB_REG);
}
int64_t setPeriod(int64_t value){
int64_t setPeriod(int64_t value){printf("setting period to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
@ -931,7 +931,7 @@ int64_t getPeriod(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setDelay(int64_t value){
int64_t setDelay(int64_t value){printf("setting delay to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
if (masterflags == IS_MASTER) {
@ -955,7 +955,7 @@ int64_t getDelay(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setTrains(int64_t value){
int64_t setTrains(int64_t value){printf("setting cycles to %lld\n", (long long int)value);
return set64BitReg(value, SET_TRAINS_LSB_REG, SET_TRAINS_MSB_REG);
}
@ -1438,6 +1438,56 @@ int configureMAC(int ipad,long long int macad,long long int detectormacad, int d
usleep(1000 * 1000);
/** send out first image as first packet does not give 0xcacacaca (needed to know if first image
* when switching back and forth between roi and no roi
*/
// remember old parameters
int oldtiming = setTiming(-1);
uint64_t oldframes = setFrames(-1);
uint64_t oldcycles = setTrains(-1);
uint64_t oldPeriod = setPeriod(-1);
uint64_t oldExptime = setExposureTime(-1);
// set to basic parameters
cprintf(BLUE,"Setting basic parameters\n"
"\tTiming: auto, frames: 1, cycles: 1, period: 1s, exptime: 900ms\n");
setTiming(AUTO_TIMING);
setFrames(1);
setTrains(1);
setPeriod(1e9); // important to keep this until we have to wait for acquisition to start
setExposureTime(900 * 1000);
// take an image
if (masterflags == IS_MASTER)
usleep(1 * 1000 * 1000); // required to ensure master starts acquisition only after slave has changed to basic parameters and is waiting
int loop = 0;
startStateMachine();
// wait for acquisition to start (trigger from master)
printf(" Waiting for acquisition to start\n");
while(!runBusy()) {
usleep(0);
++loop;
}
cprintf(MAGENTA, "waited %d loops to start\n", loop);
cprintf(BLUE, " Waiting for acquisition to end (frames left: %lld)\n", (long long int)getFrames());
waitForAcquisitionFinish();
// set to previous parameters
cprintf(BLUE,"Setting previous parameters:\n"
"\tTiming: %d, "
"frames: %lld, "
"cycles: %lld, "
"period: %lld ns, "
"exptime:%lld ns\n",
oldtiming, oldframes, oldcycles, oldPeriod, oldExptime);
setTiming(oldtiming);
setFrames(oldframes);
setTrains(oldcycles);
setPeriod(oldPeriod);
setExposureTime(oldExptime);
return adcConfigured;
}
@ -1448,6 +1498,7 @@ int getAdcConfigured(){
u_int32_t runBusy(void) {
u_int32_t s = bus_r(STATUS_REG) & RUN_BUSY_BIT;
//printf("runBusy: 0x%08x\n", s);
return s;
}
@ -1478,7 +1529,8 @@ u_int32_t runState(void) {
int startStateMachine(){
//#ifdef VERBOSE
printf("*******Starting State Machine*******\n");
cprintf(GREEN,"*******Starting State Machine*******\n");
cprintf(GREEN,"Number of frames to acquire:%lld\n", (long long int)setFrames(-1));
//#endif
cleanFifo();
// fifoReset();
@ -1559,28 +1611,29 @@ u_int32_t fifo_full(void)
void waitForAcquisitionFinish(){
volatile u_int32_t t = bus_r(LOOK_AT_ME_REG);
volatile u_int32_t t = bus_r(LOOK_AT_ME_REG);
#ifdef VERBOSE
printf("lookatmereg=x%x\n",t);
printf("lookatmereg=x%x\n",t);
#endif
while((t&0x1)==0) {
if (runBusy()==0) {
t = bus_r(LOOK_AT_ME_REG);
if ((t&0x1)==0) {
while((t&0x1)==0) {
if (runBusy() == 0) {
t = bus_r(LOOK_AT_ME_REG);
if ((t&0x1)==0) {
#ifdef VERBOSE
printf("no frame found - exiting ");
printf("%08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG));
printf("no frame found - exiting ");
printf("%08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG));
#endif
return;
} else {
return;
} else {
#ifdef VERBOSE
printf("no frame found %x status %x\n", bus_r(LOOK_AT_ME_REG),runState());
printf("no frame found %x status %x\n", bus_r(LOOK_AT_ME_REG),runState());
#endif
break;
}
}
t = bus_r(LOOK_AT_ME_REG);
}
break;
}
}
t = bus_r(LOOK_AT_ME_REG);
}
}

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: c52025dd7c4b44b93e64353a22997d971996ab18
Revision: 237
Repsitory UUID: def79807f6f40ed1797b8154240adbc0e35c95e0
Revision: 244
Branch: developer
Last Changed Author: Gemma_Tinti
Last Changed Rev: 3999
Last Changed Date: 2018-09-28 16:10:41.000000002 +0200 ./server_funcs.c
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4039
Last Changed Date: 2019-02-11 11:53:14.000000002 +0100 ./server_funcs.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "c52025dd7c4b44b93e64353a22997d971996ab18"
#define GITAUTH "Gemma_Tinti"
#define GITREV 0x3999
#define GITDATE 0x20180928
#define GITREPUUID "def79807f6f40ed1797b8154240adbc0e35c95e0"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4039
#define GITDATE 0x20190211
#define GITBRANCH "developer"

View File

@ -42,7 +42,7 @@
#define TOKEN_RESTART_DELAY 0x88000000
#define TOKEN_RESTART_DELAY_ROI 0x1b000000
#define TOKEN_TIMING_REV1 0x1f16
#define TOKEN_TIMING_REV2 0x1f0f
#define TOKEN_TIMING_REV2 0x1f10
#define DEFAULT_PHASE_SHIFT 120
#define DEFAULT_IP_PACKETSIZE 0x0522

View File

@ -1829,7 +1829,7 @@ int get_run_status(int file_des) {
#endif
retval= runState();
printf("\n\nSTATUS=%08x\n",retval);
printf("STATUS=%08x\n",retval);
//stopped (external stop, also maybe fifo full)
@ -2046,9 +2046,9 @@ int set_timer(int file_des) {
printf(mess);
}
//#ifdef VERBOSE
#ifdef VERBOSE
printf("setting timer %d to %lld ns\n",ind,tns);
//#endif
#endif
if (ret==OK) {
if (differentClients==1 && lockStatus==1 && tns!=-1) {
@ -2593,7 +2593,7 @@ int configure_mac(int file_des) {
sscanf(arg[3], "%llx", &idetectormacadd);
sscanf(arg[4], "%x", &detipad);
//arg[5] is udpport2 for eiger
#ifdef VERBOSE
//#ifdef VERBOSE
int i;
printf("\ndigital_test_bit in server %d\t",digitalTestBit);
printf("\nipadd %x\t",ipad);
@ -2606,8 +2606,9 @@ int configure_mac(int file_des) {
for (i=0;i<6;i++)
printf("detector mac adress %d is 0x%x \n",6-i,(unsigned int)(((idetectormacadd>>(8*i))&0xFF)));
printf("detipad %x\n",detipad);
printf("destination ip is %d.%d.%d.%d = 0x%x \n",(detipad>>24)&0xff,(detipad>>16)&0xff,(detipad>>8)&0xff,(detipad)&0xff,detipad);
printf("\n");
#endif
//#endif

View File

@ -11,11 +11,11 @@
#define DETECTOR_TYPE_OFST (24)
#define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
/* Fix pattern register */
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
#define FIX_PATT_VAL (0xACDC2014)
/* Status register */
#define STATUS_REG (0x02 << MEM_MAP_SHIFT)
@ -32,7 +32,6 @@
#define RUNMACHINE_BUSY_OFST (17)
#define RUNMACHINE_BUSY_MSK (0x00000001 << RUNMACHINE_BUSY_OFST)
/* Look at me register */
#define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT) //Not used in firmware or software
@ -86,20 +85,19 @@
#define GET_FRAMES_LSB_REG (0x16 << MEM_MAP_SHIFT)
#define GET_FRAMES_MSB_REG (0x17 << MEM_MAP_SHIFT)
/* Get Period 64 bit register */
/* Get Period 64 bit register tT = T x 50 ns */
#define GET_PERIOD_LSB_REG (0x18 << MEM_MAP_SHIFT)
#define GET_PERIOD_MSB_REG (0x19 << MEM_MAP_SHIFT)
/** Get Temperature Carlos, incorrectl as get gates */
#define GET_TEMPERATURE_TMP112_REG (0x1c << MEM_MAP_SHIFT) // (after multiplying by 625) in 10ths of millidegrees of TMP112
#define TEMPERATURE_POLARITY_BIT (15)
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
#define TEMPERATURE_VALUE_BIT (0)
#define TEMPERATURE_VALUE_MSK (0x00007FFF << TEMPERATURE_VALUE_BIT)
#define TEMPERATURE_VALUE_MSK (0x000007FF << TEMPERATURE_VALUE_BIT)
#define TEMPERATURE_POLARITY_BIT (11)
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
/* Get Frames from Start 64 bit register (frames from start Run Control) */
/* Get Frames from Start 64 bit register (frames from last reset using CONTROL_CRST) */
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
@ -140,6 +138,15 @@
/* ADC Port Invert Register */
#define ADC_PORT_INVERT_REG (0x43 << MEM_MAP_SHIFT)
#define ADC_PORT_INVERT_ADC_0_OFST (0)
#define ADC_PORT_INVERT_ADC_0_MSK (0x000000FF << ADC_PORT_INVERT_ADC_0_OFST)
#define ADC_PORT_INVERT_ADC_1_OFST (8)
#define ADC_PORT_INVERT_ADC_1_MSK (0x000000FF << ADC_PORT_INVERT_ADC_1_OFST)
#define ADC_PORT_INVERT_ADC_2_OFST (16)
#define ADC_PORT_INVERT_ADC_2_MSK (0x000000FF << ADC_PORT_INVERT_ADC_2_OFST)
#define ADC_PORT_INVERT_ADC_3_OFST (24)
#define ADC_PORT_INVERT_ADC_3_MSK (0x000000FF << ADC_PORT_INVERT_ADC_3_OFST)
/* Receiver IP Address Register */
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
@ -181,10 +188,12 @@
/* Configuration Register */
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
#define CONFIG_OPERATION_MODE_OFST (16)
#define CONFIG_OPERATION_MODE_MSK (0x00000001 << CONFIG_OPERATION_MODE_OFST)
#define CONFIG_MODE_1_X_10GBE_VAL ((0x0 << CONFIG_OPERATION_MODE_OFST) & CONFIG_OPERATION_MODE_MSK)
#define CONFIG_MODE_2_X_10GBE_VAL ((0x1 << CONFIG_OPERATION_MODE_OFST) & CONFIG_OPERATION_MODE_MSK)
// readout timer (from chip) to stabilize (esp in burst acquisition mode) tRDT = (RDT + 1) * 25ns
#define CONFIG_RDT_TMR_OFST (0)
#define CONFIG_RDT_TMR_MSK (0x0000FFFF << CONFIG_RDT_TMR_OFST)
#define CONFIG_OPRTN_MDE_2_X_10GbE_OFST (16)
#define CONFIG_OPRTN_MDE_2_X_10GbE_MSK (0x00000001 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST)
#define CONFIG_OPRTN_MDE_1_X_10GBE_VAL ((0x0 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST) & CONFIG_OPRTN_MDE_2_X_10GbE_MSK)
#define CONFIG_READOUT_SPEED_OFST (20)
#define CONFIG_READOUT_SPEED_MSK (0x00000003 << CONFIG_READOUT_SPEED_OFST)
#define CONFIG_QUARTER_SPEED_10MHZ_VAL ((0x0 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
@ -192,17 +201,17 @@
#define CONFIG_FULL_SPEED_40MHZ_VAL ((0x2 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
#define CONFIG_TDMA_OFST (24)
#define CONFIG_TDMA_MSK (0x00000001 << CONFIG_TDMA_OFST)
#define CONFIG_TDMA_DISABLE_VAL ((0x0 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_ENABLE_VAL ((0x1 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_TIMESLOT_OFST (25)
#define CONFIG_TDMA_DISABLE_VAL ((0x0 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_TIMESLOT_OFST (25) // 1ms
#define CONFIG_TDMA_TIMESLOT_MSK (0x0000001F << CONFIG_TDMA_TIMESLOT_OFST)
#define CONFIG_ETHRNT_FLW_CNTRL_OFST (31)
#define CONFIG_ETHRNT_FLW_CNTRL_MSK (0x00000001 << CONFIG_ETHRNT_FLW_CNTRL_OFST)
/* External Signal Register */
#define EXT_SIGNAL_REG (0x4E << MEM_MAP_SHIFT)
#define EXT_SIGNAL_OFST (0)
#define EXT_SIGNAL_MSK (0x00000003 << EXT_SIGNAL_OFST) //enabled when both bits high
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
/* Control Register */
#define CONTROL_REG (0x4F << MEM_MAP_SHIFT)
@ -250,7 +259,7 @@
#define SAMPLE_ADC_SAMPLE_5_VAL ((0x5 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_6_VAL ((0x6 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_7_VAL ((0x7 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
// Decimation = ADF + 1
#define SAMPLE_ADC_DECMT_FACTOR_OFST (4)
#define SAMPLE_ADC_DECMT_FACTOR_MSK (0x00000007 << SAMPLE_ADC_DECMT_FACTOR_OFST)
#define SAMPLE_ADC_DECMT_FACTOR_0_VAL ((0x0 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
@ -283,6 +292,7 @@
#define SAMPLE_DGTL_DECMT_FACTOR_OFST (12)
#define SAMPLE_DGTL_DECMT_FACTOR_MSK (0x00000003 << SAMPLE_DGTL_DECMT_FACTOR_OFST)
// 1 = full speed, 2 = half speed, 4 = quarter speed
#define SAMPLE_DECMT_FACTOR_1_VAL ((0x0 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define SAMPLE_DECMT_FACTOR_2_VAL ((0x1 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define SAMPLE_DECMT_FACTOR_4_VAL ((0x2 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
@ -293,7 +303,7 @@
#define VREF_COMP_MOD_OFST (0)
#define VREF_COMP_MOD_MSK (0x00000FFF << VREF_COMP_MOD_OFST)
#define VREF_COMP_MOD_ENABLE_OFST (31)
#define VREF_COMP_MOD_ENABLE_MSK (0x00000FFF << VREF_COMP_MOD_ENABLE_OFST)
#define VREF_COMP_MOD_ENABLE_MSK (0x00000001 << VREF_COMP_MOD_ENABLE_OFST)
/** DAQ Register */
@ -343,10 +353,9 @@
#define TEMP_CTRL_PROTCT_THRSHLD_MSK (0x000007FF << TEMP_CTRL_PROTCT_THRSHLD_OFST)
#define TEMP_CTRL_PROTCT_ENABLE_OFST (16)
#define TEMP_CTRL_PROTCT_ENABLE_MSK (0x00000001 << TEMP_CTRL_PROTCT_ENABLE_OFST)
// set when temp higher than over threshold, write 1 to clear it
#define TEMP_CTRL_OVR_TMP_EVNT_OFST (31)
#define TEMP_CTRL_OVR_TMP_EVNT_MSK (0x00000001 << TEMP_CTRL_OVR_TMP_EVNT_OFST)
#define TEMP_CTRL_CLR_OVR_TMP_EVNT_VAL ((0x1 << TEMP_CTRL_OVR_TMP_EVNT_OFST) & TEMP_CTRL_OVR_TMP_EVNT_MSK)
/* Set Delay 64 bit register */
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
@ -360,11 +369,11 @@
#define SET_FRAMES_LSB_REG (0x64 << MEM_MAP_SHIFT)
#define SET_FRAMES_MSB_REG (0x65 << MEM_MAP_SHIFT)
/* Set Period 64 bit register */
/* Set Period 64 bit register tT = T x 50 ns */
#define SET_PERIOD_LSB_REG (0x66 << MEM_MAP_SHIFT)
#define SET_PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
/* Set Period 64 bit register */
/* Set Exposure Time 64 bit register eEXP = Exp x 25 ns */
#define SET_EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT)
#define SET_EXPTIME_MSB_REG (0x69 << MEM_MAP_SHIFT)
@ -388,13 +397,17 @@
/* ASIC Control Register */
#define ASIC_CTRL_REG (0x7F << MEM_MAP_SHIFT)
// tPC = (PCT + 1) * 25ns
#define ASIC_CTRL_PRCHRG_TMR_OFST (0)
#define ASIC_CTRL_PRCHRG_TMR_MSK (0x000000FF << ASIC_CTRL_PRCHRG_TMR_OFST)
#define ASIC_CTRL_PRCHRG_TMR_VAL ((0x1F << ASIC_CTRL_PRCHRG_TMR_OFST) & ASIC_CTRL_PRCHRG_TMR_MSK)
// tDS = (DST + 1) * 25ns
#define ASIC_CTRL_DS_TMR_OFST (8)
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage cells)
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
#define ASIC_CTRL_EXPSRE_TMR_MSK (0x0000FFFF << ASIC_CTRL_EXPSRE_TMR_OFST)
#endif //REGISTERS_G_H

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: c52025dd7c4b44b93e64353a22997d971996ab18
Revision: 163
Repsitory UUID: def79807f6f40ed1797b8154240adbc0e35c95e0
Revision: 168
Branch: developer
Last Changed Author: Gemma_Tinti
Last Changed Rev: 3999
Last Changed Date: 2018-09-28 14:11:53.000000002 +0200 ./RegisterDefs.h
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4039
Last Changed Date: 2019-02-11 11:53:14.000000002 +0100 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "c52025dd7c4b44b93e64353a22997d971996ab18"
#define GITAUTH "Gemma_Tinti"
#define GITREV 0x3999
#define GITDATE 0x20180928
#define GITREPUUID "def79807f6f40ed1797b8154240adbc0e35c95e0"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4039
#define GITDATE 0x20190211
#define GITBRANCH "developer"

View File

@ -1588,6 +1588,7 @@ enum runStatus getRunStatus(){
//not running
else {
// stopped or error
if ((retval & STOPPED_MSK) >> STOPPED_OFST) {
printf("-----------------------------------STOPPED--------------------------\n");
s=STOPPED;

View File

@ -10,7 +10,7 @@
#define GOODBYE (-200)
#define PROGRAMMING_MODE (-200)
#define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWR_VRSN 0x180615
#define REQRD_FRMWR_VRSN 0x181206 // temp bug fix from last version, timing mode is backwards compatible
/* Struct Definitions */
@ -76,8 +76,6 @@ enum NETWORKINDEX { TXN_FRAME };
#define DEFAULT_STRG_CLL_STRT (0xf)
/* Defines in the Firmware */
#define FIX_PATT_VAL (0xACDC2014)
#define ADC_PORT_INVERT_VAL (0x453b2a9c)
#define MAX_TIMESLOT_VAL (0x1F)
#define MAX_THRESHOLD_TEMP_VAL (127999) //millidegrees
#define MAX_STORAGE_CELL_VAL (15) //0xF
@ -86,8 +84,8 @@ enum NETWORKINDEX { TXN_FRAME };
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_DECMT_FACTOR_4_VAL + SAMPLE_DGTL_SAMPLE_8_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x2810 */
#define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_OPRTN_MDE_1_X_10GBE_VAL)
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_OPRTN_MDE_1_X_10GBE_VAL)
#define ADC_OFST_HALF_SPEED_VAL (0x1f) //(0x20)
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) //(0x0f)
#define ADC_PHASE_HALF_SPEED (0x2D) //45

View File

@ -604,7 +604,7 @@ int64_t multiSlsDetector::getId(idMode mode, int imod) {
slsDetector* multiSlsDetector::getSlsDetector(unsigned int pos) {
if (pos >= 0 && pos < detectors.size()) {
if (pos < detectors.size()) {
return detectors[pos];
}
return 0;
@ -1315,7 +1315,9 @@ void multiSlsDetector::updateOffsets() {
numY_gp += detectors[idet]->getTotalNumberOfChannelsInclGapPixels(Y);
maxY += detectors[idet]->getMaxNumberOfChannels(Y);
maxY_gp += detectors[idet]->getMaxNumberOfChannelsInclGapPixels(Y);
++thisMultiDetector->numberOfDetector[Y];
// increment in y again only in the first column (else you double increment)
if (thisMultiDetector->numberOfDetector[X] == 1)
++thisMultiDetector->numberOfDetector[Y];
#ifdef VERBOSE
cout << "incrementing in y direction" << endl;
#endif
@ -2341,7 +2343,7 @@ int multiSlsDetector::sendSoftwareTrigger() {
int multiSlsDetector::startReadOut() {
unsigned int i = 0;
int i = 0;
int ret = OK, ret1 = OK;
i = thisMultiDetector->masterPosition;
if (i >= 0) {
@ -2351,7 +2353,7 @@ int multiSlsDetector::startReadOut() {
if (ret != OK)
ret1 = FAIL;
}
for (i = 0; i < detectors.size(); ++i) {
for (i = 0; i < (int)detectors.size(); ++i) {
ret = detectors[i]->startReadOut();
if (detectors[i]->getErrorMask())
setErrorMask(getErrorMask() | (1 << i));
@ -3261,7 +3263,10 @@ void multiSlsDetector::verifyMinMaxROI(int n, ROI r[]) {
}
}
int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
int multiSlsDetector::setROI(int n, ROI roiLimits[], int imod) {
if (imod > 0 && imod < (int)detectors.size()) {
return detectors[imod]->setROI(n, roiLimits, imod);
}
int ret1 = -100, ret;
int i, xmin, xmax, ymin, ymax, channelX, channelY, idet, lastChannelX,
lastChannelY, index, offsetX, offsetY;
@ -3393,8 +3398,10 @@ int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
}
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n) {
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n, int imod) {
if (imod > 0 && imod < (int)detectors.size()) {
return detectors[imod]->getROI(n, imod);
}
n = 0;
int num = 0, i, j;
int ndet = detectors.size();
@ -5379,7 +5386,7 @@ int multiSlsDetector::setCTBPattern(std::string fname) {
uint64_t word;
int addr = 0;
FILE* fd = fopen(fname.c_str(), "r");
if (fd > 0) {
if (fd) {
while (fread(&word, sizeof(word), 1, fd)) {
for (unsigned int idet = 0; idet < detectors.size(); ++idet)
detectors[idet]->setCTBWord(addr, word);

View File

@ -1222,16 +1222,18 @@ public:
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (-1 for all)
* @returns OK or FAIL
*/
int setROI(int n=-1,ROI roiLimits[]=NULL);
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @returns OK or FAIL
* @param imod module number (-1 for all)
* @returns pointer to array of ROI structure
*/
ROI* getROI(int &n);
ROI* getROI(int &n, int imod = -1);
/**
* Write to ADC register (Gotthard, Jungfrau, ChipTestBoard). For expert users

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "d2bce7e372c241cd235977b92be18555bca6a77d"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4020
#define GITDATE 0x20180927
#define GITBRANCH "4.0.0"
#define GITREV 0x4084
#define GITDATE 0x20190208
#define GITBRANCH "4.0.1"

View File

@ -2213,7 +2213,7 @@ string slsDetector::getLastClientIP() {
int slsDetector::exitServer() {
int retval;
int retval = FAIL;
int fnum=F_EXIT_SERVER;
if (thisDetector->onlineFlag==ONLINE_FLAG) {
@ -3158,13 +3158,15 @@ string slsDetector::getSettingsDir() {
return std::string(thisDetector->settingsDir);
}
string slsDetector::setSettingsDir(string s) {
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
sprintf(thisDetector->settingsDir, "%s", s.c_str());
return thisDetector->settingsDir;
}
string slsDetector::getCalDir() {
return thisDetector->calDir;
}
string slsDetector::setCalDir(string s) {
sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;
sprintf(thisDetector->calDir, "%s", s.c_str());
return thisDetector->calDir;
}
@ -4338,7 +4340,7 @@ int64_t slsDetector::getTimeLeft(timerIndex index, int imod) {
int fnum=F_GET_TIME_LEFT;
int64_t retval;
int64_t retval = FAIL;
char mess[MAX_STR_LENGTH]="";
int ret=OK;
@ -4627,7 +4629,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
dacs_t slsDetector::getADC(dacIndex index, int imod) {
dacs_t retval;
dacs_t retval = 0;
int fnum=F_GET_ADC;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
@ -5353,12 +5355,13 @@ string slsDetector::setReceiverUDPMAC(string udpmac) {
if((udpmac[2]==':')&&(udpmac[5]==':')&&(udpmac[8]==':')&&
(udpmac[11]==':')&&(udpmac[14]==':')){
strcpy(thisDetector->receiverUDPMAC,udpmac.c_str());
if(!strcmp(thisDetector->receiver_hostname,"none"))
if(!strcmp(thisDetector->receiver_hostname,"none")) {
#ifdef VERBOSE
std::cout << "Warning: Receiver hostname not set yet." << endl;
#else
;
#endif
}
/* else if(setUDPConnection()==FAIL){ commented out to be replaced by user
* defined udpmac
std::cout<< "Warning: UDP connection set up failed" << std::endl;
@ -5732,8 +5735,10 @@ int slsDetector::setUDPConnection() {
std::cout << "could not configure mac" << endl;
}
}
}else
}else {
ret=FAIL;
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
}
#ifdef VERBOSE
printReceiverConfiguration();
#endif
@ -6017,7 +6022,7 @@ int slsDetector::setCounterBit(int i) {
int slsDetector::setROI(int n,ROI roiLimits[]) {
int slsDetector::setROI(int n,ROI roiLimits[], int imod) {
int ret = FAIL;
//sort ascending order
int temp;
@ -6053,7 +6058,7 @@ int slsDetector::setROI(int n,ROI roiLimits[]) {
}
slsDetectorDefs::ROI* slsDetector::getROI(int &n) {
slsDetectorDefs::ROI* slsDetector::getROI(int &n, int imod) {
sendROI(-1,NULL);
n=thisDetector->nROI;
if(thisDetector->myDetectorType==JUNGFRAUCTB) getTotalNumberOfChannels();
@ -6126,7 +6131,7 @@ int slsDetector::sendROI(int n,ROI roiLimits[]) {
#endif
// old firmware requires configuremac after setting roi
if (thisDetector->myDetectorType == GOTTHARD) {
if (thisDetector->myDetectorType == GOTTHARD && n != -1) {
configureMAC();
}
@ -6362,7 +6367,7 @@ int slsDetector::setFlippedData(dimension d, int value) {
int slsDetector::setAllTrimbits(int val, int imod) {
int fnum=F_SET_ALL_TRIMBITS;
int retval;
int retval = FAIL;
char mess[MAX_STR_LENGTH]="";
int ret=OK;
@ -7663,17 +7668,13 @@ int slsDetector::setChip(int reg, int ichip, int imod) {
int slsDetector::setChip(sls_detector_chip chip) {
int fnum=F_SET_CHIP;
int retval;
int retval = FAIL;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
int ichi=chip.chip;
int im=chip.module;
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
@ -8490,7 +8491,7 @@ string slsDetector::getReceiverLastClientIP() {
int slsDetector::exitReceiver() {
int retval;
int retval = FAIL;
int fnum=F_EXIT_RECEIVER;
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
@ -8662,7 +8663,7 @@ void slsDetector::sendMultiDetectorSize() {
ret=thisReceiver->sendIntArray(fnum,retval,arg);
disconnectData();
}
if((ret==FAIL)){
if(ret==FAIL){
std::cout << "Could not set position Id" << std::endl;
setErrorMask((getErrorMask())|(RECEIVER_MULTI_DET_SIZE_NOT_SET));
}
@ -9561,7 +9562,7 @@ int slsDetector::setCTBPattern(string fname) {
int addr=0;
FILE *fd=fopen(fname.c_str(),"r");
if (fd>0) {
if (fd) {
while (fread(&word, sizeof(word), 1,fd)) {
setCTBWord(addr,word);
// cout << hex << addr << " " << word << dec << endl;

View File

@ -1500,16 +1500,18 @@ public:
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (ignored)
* @returns OK or FAIL
*/
int setROI(int n=-1,ROI roiLimits[]=NULL);
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @returns OK or FAIL
*/
slsDetectorDefs::ROI* getROI(int &n);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @param imod module number (ignored)
* @returns pointer to array of ROI structure
*/
ROI* getROI(int &n, int imod = -1);
/**
* Returns number of rois

View File

@ -343,11 +343,11 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
\returns id
*/
virtual int64_t getId(idMode mode, int imod=0)=0;
int64_t getModuleFirmwareVersion(){return getId(MODULE_FIRMWARE_VERSION,-1);};
int64_t getModuleFirmwareVersion(int imod=-1){return getId(MODULE_FIRMWARE_VERSION,imod);};
int64_t getModuleSerialNumber(int imod=-1){return getId(MODULE_SERIAL_NUMBER,imod);};
int64_t getDetectorFirmwareVersion(){return getId(DETECTOR_FIRMWARE_VERSION,-1);};
int64_t getDetectorSerialNumber(){return getId(DETECTOR_SERIAL_NUMBER,-1);};
int64_t getDetectorSoftwareVersion(){return getId(DETECTOR_SOFTWARE_VERSION,-1);};
int64_t getDetectorFirmwareVersion(int imod=-1){return getId(DETECTOR_FIRMWARE_VERSION,imod);};
int64_t getDetectorSerialNumber(int imod=-1){return getId(DETECTOR_SERIAL_NUMBER,imod);};
int64_t getDetectorSoftwareVersion(int imod=-1){return getId(DETECTOR_SOFTWARE_VERSION,imod);};
int64_t getThisSoftwareVersion(){return getId(THIS_SOFTWARE_VERSION,-1);};
/**
@ -846,6 +846,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
case RUNNING: return std::string("running");\
case TRANSMITTING: return std::string("data"); \
case RUN_FINISHED: return std::string("finished"); \
case STOPPED: return std::string("stopped"); \
default: return std::string("idle"); \
}};

View File

@ -3434,34 +3434,27 @@ string slsDetectorCommand::cmdAngConv(int narg, char *args[], int action){
} else {
return string("none");
}
}else{
return "unknown action";
}
} else if (string(args[0])==string("globaloff")) {
c=GLOBAL_OFFSET;
} else if (string(args[0])==string("fineoff")) {
c=FINE_OFFSET;
} else if (string(args[0])==string("binsize")) {
c=BIN_SIZE;
} else if (string(args[0])==string("angdir")) {
c=ANGULAR_DIRECTION;
} else if (string(args[0])==string("moveflag")) {
c=MOVE_FLAG;
} else if (string(args[0])==string("samplex")) {
c=SAMPLE_X;
} else if (string(args[0])==string("sampley")) {
c=SAMPLE_Y;
}
else
}else{
return string("could not decode angular conversion parameter ")+cmd;
}
if (action==PUT_ACTION) {
if (sscanf(args[1],"%lf",&fval))
@ -3568,7 +3561,7 @@ string slsDetectorCommand::helpThreaded(int narg, char *args[], int action){
string slsDetectorCommand::cmdImage(int narg, char *args[], int action){
string sval;
int retval;
int retval = FAIL;
if (action==HELP_ACTION)
return helpImage(narg,args,HELP_ACTION);
else if (action==GET_ACTION)
@ -3609,7 +3602,7 @@ string slsDetectorCommand::cmdCounter(int narg, char *args[], int action){
int ival;
char answer[100];
string sval;
int retval;
int retval = FAIL;
if (action==HELP_ACTION)
return helpCounter(narg,args,HELP_ACTION);
else if (action==PUT_ACTION)
@ -4533,7 +4526,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
myDet->setReceiverOnline(ONLINE_FLAG);
ret=myDet->setDynamicRange(val);
} else if (cmd=="roi") {
myDet->getROI(ret);
ROI* r = myDet->getROI(ret);
if (myDet->isMultiSlsDetectorClass() && r != NULL)
delete [] r;
} else if (cmd=="detsizechan") {
sprintf(ans,"%d %d",myDet->getMaxNumberOfChannelsPerDetector(X),myDet->getMaxNumberOfChannelsPerDetector(Y));
return string(ans);
@ -6207,7 +6202,8 @@ string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action)
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION)
return string("cannot put");
return string(""+myDet->printReceiverConfiguration());
myDet->printReceiverConfiguration();
return string("");
}else if (cmd=="parameters") {
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION) {
@ -6995,6 +6991,8 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
}
}
os << hex << reg << dec;
if (myDet->isMultiSlsDetectorClass() && aa != NULL)
delete [] aa;
//os <<" "<< hex << myDet->readRegister(120) << dec;

View File

@ -115,18 +115,37 @@ int slsDetectorUsers::getPositions(double *pos){
}
int slsDetectorUsers::setDetectorSize(int x0, int y0, int nx, int ny){
if(myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y)>1)
return 1;
int nmod=nx/(myDetector->getChansPerMod(0));
cout << myDetector->getChansPerMod(0) << " " << nx << " " << nmod << endl;
return myDetector->setNumberOfModules(nmod)*myDetector->getChansPerMod(0);}
// only one roi
slsDetectorDefs::ROI roi[1];
roi[0].xmin = x0;
roi[0].ymin = y0;
roi[0].xmax = x0 + nx;
roi[0].ymax = y0 + ny;
return myDetector->setROI(1, roi);
}
int slsDetectorUsers::getDetectorSize(int &x0, int &y0, int &nx, int &ny){
y0=0;
x0=0;
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
return nx*ny;
// default (no roi)
y0=0;
x0=0;
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
int n = 0;
slsDetectorDefs::ROI* roi = myDetector->getROI(n);
// roi
if (roi != NULL && n == 1) {
x0 = roi[0].xmin;
y0 = roi[0].ymin;
nx = roi[0].xmax - roi[0].xmin;
ny = roi[0].ymax - roi[0].ymin;
}
if (roi != NULL)
delete [] roi;
return nx*ny;
}
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
@ -267,24 +286,24 @@ string slsDetectorUsers::setClientDataStreamingInIP(string ip){
return myDetector->setClientDataStreamingInIP(ip);
}
int64_t slsDetectorUsers::getModuleFirmwareVersion(){
return myDetector->getModuleFirmwareVersion();
int64_t slsDetectorUsers::getModuleFirmwareVersion(int imod){
return myDetector->getModuleFirmwareVersion(imod);
}
int64_t slsDetectorUsers::getModuleSerialNumber(int imod){
return myDetector->getModuleSerialNumber(imod);
}
int64_t slsDetectorUsers::getDetectorFirmwareVersion(){
return myDetector->getDetectorFirmwareVersion();
int64_t slsDetectorUsers::getDetectorFirmwareVersion(int imod){
return myDetector->getDetectorFirmwareVersion(imod);
}
int64_t slsDetectorUsers::getDetectorSerialNumber(){
return myDetector->getDetectorSerialNumber();
int64_t slsDetectorUsers::getDetectorSerialNumber(int imod){
return myDetector->getDetectorSerialNumber(imod);
}
int64_t slsDetectorUsers::getDetectorSoftwareVersion(){
return myDetector->getDetectorSoftwareVersion();
int64_t slsDetectorUsers::getDetectorSoftwareVersion(int imod){
return myDetector->getDetectorSoftwareVersion(imod);
}
int64_t slsDetectorUsers::getThisSoftwareVersion(){
@ -494,3 +513,11 @@ int64_t slsDetectorUsers::setNumberOfStorageCells(int64_t t, int imod) {
int slsDetectorUsers::setStoragecellStart(int pos) {
return myDetector->setStoragecellStart(pos);
}
int slsDetectorUsers::setROI(int n, slsDetectorDefs::ROI roiLimits[], int imod) {
return myDetector->setROI(n, roiLimits, imod);
}
slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int imod) {
return myDetector->getROI(n, imod);
}

View File

@ -17,6 +17,8 @@ class detectorData;
class multiSlsDetector;
class multiSlsDetectorCommand;
#include "sls_detector_defs.h"
#include <stdint.h>
#include <string>
@ -247,7 +249,7 @@ class slsDetectorUsers
int getPositions(double *pos=NULL);
/**
@short sets the detector size
@short sets the detector size (only 1 ROI)
\param x0 horizontal position origin in channel number (-1 unchanged)
\param y0 vertical position origin in channel number (-1 unchanged)
\param nx number of channels in horiziontal (-1 unchanged)
@ -256,14 +258,13 @@ class slsDetectorUsers
*/
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1);
/**
@short gets detector size
@short gets detector size (roi size if only one roi)
\param x0 horizontal position origin in channel number
\param y0 vertical position origin in channel number
\param nx number of channels in horiziontal
\param ny number of channels in vertical
\returns OK/FAIL
\returns total number of channels
*/
int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
/**
@ -505,12 +506,13 @@ class slsDetectorUsers
/**
get get Module Firmware Version
@param imod module number
\returns id
*/
int64_t getModuleFirmwareVersion();
int64_t getModuleFirmwareVersion(int imod=-1);
/**
get get Module Serial Number
get get Module Serial Number (only mythen)
@param imod module number
\returns id
*/
@ -518,21 +520,24 @@ class slsDetectorUsers
/**
get get Detector Firmware Version
@param imod module number
\returns id
*/
int64_t getDetectorFirmwareVersion();
int64_t getDetectorFirmwareVersion(int imod=-1);
/**
get get Detector Serial Number
@param imod module number
\returns id
*/
int64_t getDetectorSerialNumber();
int64_t getDetectorSerialNumber(int imod=-1);
/**
get get Detector Software Version
@param imod module number
\returns id
*/
int64_t getDetectorSoftwareVersion();
int64_t getDetectorSoftwareVersion(int imod=-1);
/**
get this Software Version
@ -814,6 +819,25 @@ class slsDetectorUsers
*/
int setStoragecellStart(int pos=-1);
/**
* Set ROI (Gotthard) (>= 1 roi, but max 1 roi per module)
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (-1 for all)
* @returns OK or FAIL
*/
int setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* >= 1 roi, but max 1 roi per module
* @param n number of rois
* @param imod module number (ignored)
* @returns pointer to array of ROI structure
*/
slsDetectorDefs::ROI* getROI(int &n, int imod = -1);
/************************************************************************
STATIC FUNCTIONS
@ -832,6 +856,7 @@ class slsDetectorUsers
case 3: return std::string("finished"); \
case 4: return std::string("data"); \
case 5: return std::string("running"); \
case 6: return std::string("stoppped"); \
default: return std::string("unknown"); \
}};

View File

@ -869,16 +869,18 @@ virtual int calibratePedestal(int frames = 0)=0;
set roi
\param n number of rois
\param roiLimits array of roi
\param imod module number (-1 for all)
\returns success or failure
*/
virtual int setROI(int n=-1,ROI roiLimits[]=NULL)=0;
virtual int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1)=0;
/**
get roi from each detector and convert it to the multi detector scale
\param n number of rois
\returns an array of multidetector's rois
\param imod module number (-1 for all)
\returns pointer to array of ROI structure
*/
virtual ROI* getROI(int &n)=0;
virtual ROI* getROI(int &n, int imod = -1)=0;
/** Sets the read receiver frequency
if data required from receiver randomly readRxrFrequency=0,

View File

@ -96,7 +96,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, angleConversio
// cout << "no ang conv " << endl;
double enc=0, trans=0;
double ang;
double ang=0;
switch (mF) {
case 0:

View File

@ -93,7 +93,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
*/
virtual std::string setFilePath(std::string s) {
pthread_mutex_lock(&mf);
sprintf(filePath, s.c_str());
sprintf(filePath, "%s", s.c_str());
pthread_mutex_unlock(&mf);
return std::string(filePath);
};
@ -105,7 +105,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
*/
virtual std::string setFileName(std::string s) {
pthread_mutex_lock(&mf);
sprintf(fileName, s.c_str());
sprintf(fileName, "%s", s.c_str());
pthread_mutex_unlock(&mf);
return std::string(fileName);};

View File

@ -103,7 +103,7 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
if (I0>0) {
if (I0 != NULL) {
i0=*I0;
totalI0+=i0;
} else

View File

@ -1,5 +1,5 @@
#ifndef POSTPROCESSINGFUNCS_H
#define POSTPROCESSINGFUNC_H
#define POSTPROCESSINGFUNCS_H
@ -77,4 +77,4 @@ class postProcessingFuncs : public virtual angularConversionStatic
};
#endif
#endif //POSTPROCESSINGFUNCS_H