adding exptime to receiver for file header

This commit is contained in:
Dhanya Maliakal 2016-11-14 11:57:29 +01:00
parent b980640a4c
commit c639477f28
2 changed files with 49 additions and 46 deletions

View File

@ -39,40 +39,43 @@ using namespace std;
#define RECEIVER_DET_HOSTTYPE_NOT_SET 0x0020000000000000ULL
#define DETECTOR_TEN_GIGA 0x0010000000000000ULL
#define DETECTOR_ACTIVATE 0x0008000000000000ULL
#define COULD_NOT_CONFIGURE_MAC 0x0004000000000000ULL
#define COULDNOT_START_RECEIVER 0x0002000000000000ULL // default error like starting threads
#define COULDNOT_STOP_RECEIVER 0x0001000000000000ULL
// 0xFFFFFFFF00000000ULL
#define COULD_NOT_CONFIGURE_MAC 0x0000000000000001ULL
#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000002ULL
#define COULDNOT_SET_ROI 0x0000000000000004ULL
#define RECEIVER_READ_FREQUENCY 0x0000000000000008ULL
#define SETTINGS_NOT_SET 0x0000000000000010ULL
#define SETTINGS_FILE_NOT_OPEN 0x0000000000000020ULL
#define COULDNOT_START_RECEIVER 0x0000000000000040ULL // default error like starting threads
#define COULDNOT_STOP_RECEIVER 0x0000000000000080ULL
#define DETECTOR_TIMER_VALUE_NOT_SET 0x0000000000000100ULL
#define RECEIVER_ACQ_PERIOD_NOT_SET 0x0000000000000200ULL
#define RECEIVER_FRAME_NUM_NOT_SET 0x0000000000000400ULL
#define RECEIVER_DYNAMIC_RANGE 0x0000000000000800ULL
#define RECEIVER_TEN_GIGA 0x0000000000001000ULL
#define ALLTIMBITS_NOT_SET 0x0000000000002000ULL
#define COULD_NOT_SET_SPEED_PARAMETERS 0x0000000000004000ULL
#define COULD_NOT_SET_READOUT_FLAGS 0x0000000000008000ULL
#define COULD_NOT_SET_FIFO_DEPTH 0x0000000000010000ULL
#define COULD_NOT_SET_COUNTER_BIT 0x0000000000020000ULL
#define COULD_NOT_PULSE_PIXEL 0x0000000000040000ULL
#define COULD_NOT_PULSE_PIXEL_NMOVE 0x0000000000080000ULL
#define COULD_NOT_PULSE_CHIP 0x0000000000100000ULL
#define COULD_NOT_SET_RATE_CORRECTION 0x0000000000200000ULL
#define DETECTOR_NETWORK_PARAMETER 0x0000000000400000ULL
#define RATE_CORRECTION_NOT_32or16BIT 0x0000000000800000ULL
#define RATE_CORRECTION_NO_TAU_PROVIDED 0x0000000001000000ULL
#define PROGRAMMING_ERROR 0x0000000002000000ULL
#define RECEIVER_ACTIVATE 0x0000000004000000ULL
#define DATA_STREAMING 0x0000000008000000ULL
#define RESET_ERROR 0x0000000010000000ULL
#define POWER_CHIP 0x0000000020000000ULL
#define RECEIVER_READ_TIMER 0x0000000040000000ULL
#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000001ULL
#define COULDNOT_SET_ROI 0x0000000000000002ULL
#define RECEIVER_READ_FREQUENCY 0x0000000000000004ULL
#define SETTINGS_NOT_SET 0x0000000000000008ULL
#define SETTINGS_FILE_NOT_OPEN 0x0000000000000010ULL
#define DETECTOR_TIMER_VALUE_NOT_SET 0x0000000000000020ULL
#define RECEIVER_ACQ_PERIOD_NOT_SET 0x0000000000000040ULL
#define RECEIVER_FRAME_NUM_NOT_SET 0x0000000000000080ULL
#define RECEIVER_DYNAMIC_RANGE 0x0000000000000100ULL
#define RECEIVER_TEN_GIGA 0x0000000000000200ULL
#define ALLTIMBITS_NOT_SET 0x0000000000000400ULL
#define COULD_NOT_SET_SPEED_PARAMETERS 0x0000000000000800ULL
#define COULD_NOT_SET_READOUT_FLAGS 0x0000000000001000ULL
#define COULD_NOT_SET_FIFO_DEPTH 0x0000000000002000ULL
#define COULD_NOT_SET_COUNTER_BIT 0x0000000000004000ULL
#define COULD_NOT_PULSE_PIXEL 0x0000000000008000ULL
#define COULD_NOT_PULSE_PIXEL_NMOVE 0x0000000000010000ULL
#define COULD_NOT_PULSE_CHIP 0x0000000000020000ULL
#define COULD_NOT_SET_RATE_CORRECTION 0x0000000000040000ULL
#define DETECTOR_NETWORK_PARAMETER 0x0000000000080000ULL
#define RATE_CORRECTION_NOT_32or16BIT 0x0000000000100000ULL
#define RATE_CORRECTION_NO_TAU_PROVIDED 0x0000000000200000ULL
#define PROGRAMMING_ERROR 0x0000000000400000ULL
#define RECEIVER_ACTIVATE 0x0000000000800000ULL
#define DATA_STREAMING 0x0000000001000000ULL
#define RESET_ERROR 0x0000000002000000ULL
#define POWER_CHIP 0x0000000004000000ULL
#define RECEIVER_READ_TIMER 0x0000000008000000ULL
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000010000000ULL
// 0x00000000FFFFFFFFULL
/** @short class returning all error messages for error mask */
class errorDefs {

View File

@ -4061,7 +4061,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
//send acquisiton period/frame number to receiver
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)){
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME)){
if(ret != FAIL){
int64_t args[2];
retval = -1;
@ -4073,21 +4073,21 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
//set #frames, #cycles
if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){
#ifdef VERBOSE
std::cout << "Setting/Getting number of frames " << index <<" to/from receiver " << args[1] << std::endl;
std::cout << "Setting/Getting number of frames*cycles " << index <<" to/from receiver " << args[1] << std::endl;
#endif
if(thisDetector->timerValue[CYCLES_NUMBER]==0)
args[1] = thisDetector->timerValue[FRAME_NUMBER];
else
args[1] = thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER];
}
//set period
//set period/exptime
else{
#ifdef VERBOSE
if(index==ACQUISITION_TIME)
std::cout << "Setting/Getting acquisition time " << index << " to/from receiver " << args[1] << std::endl;
else
std::cout << "Setting/Getting acquisition period " << index << " to/from receiver " << args[1] << std::endl;
#endif
//if acquisition period is zero, then #frames/buffer depends on exposure time and not acq period
if(!args[1])
args[1] = timerValue[ACQUISITION_TIME];
}
char mess[MAX_STR_LENGTH]="";
@ -4097,20 +4097,20 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
}
if((args[1] != retval)|| (ret==FAIL)){
ret = FAIL;
if(index==FRAME_PERIOD){
//exptime sent if acq period = 0
if(retval){
if(index==ACQUISITION_TIME){
if(strstr(mess,"receiver not idle")==NULL)
cout << "ERROR:Acquisition Time in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
setErrorMask((getErrorMask())|(RECEIVER_ACQ_TIME_NOT_SET));
}else if(index==FRAME_PERIOD){
if(strstr(mess,"receiver not idle")==NULL)
cout << "ERROR:Acquisition Period in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
}
}else{
if(strstr(mess,"receiver not idle")==NULL)
cout << "ERROR:Number of Frames (* Number of cycles) in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
}
}
if(ret==FORCE_UPDATE)
updateReceiver();
}