mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
sending and writing subexptime in the receiver files, adding 0x in front of all numbers printed in command line which is hexa
This commit is contained in:
parent
af079f3168
commit
f084efd263
@ -79,6 +79,7 @@ using namespace std;
|
|||||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL
|
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL
|
||||||
#define THRESHOLD_NOT_SET 0x0000000040000000ULL
|
#define THRESHOLD_NOT_SET 0x0000000040000000ULL
|
||||||
#define RECEIVER_FILE_FORMAT 0x0000000080000000ULL
|
#define RECEIVER_FILE_FORMAT 0x0000000080000000ULL
|
||||||
|
#define RECEIVER_SUBF_TIME_NOT_SET 0x0000000100000000ULL
|
||||||
// 0x0000000FFFFFFFFFULL
|
// 0x0000000FFFFFFFFFULL
|
||||||
|
|
||||||
/** @short class returning all error messages for error mask */
|
/** @short class returning all error messages for error mask */
|
||||||
@ -251,6 +252,9 @@ public:
|
|||||||
if(slsErrorMask&RECEIVER_FILE_FORMAT)
|
if(slsErrorMask&RECEIVER_FILE_FORMAT)
|
||||||
retval.append("Could not set receiver file format\n");
|
retval.append("Could not set receiver file format\n");
|
||||||
|
|
||||||
|
if(slsErrorMask&RECEIVER_SUBF_TIME_NOT_SET)
|
||||||
|
retval.append("Could not set sub exposure time in receiver.\n");
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------ length of message
|
//------------------------------------------------------ length of message
|
||||||
|
|
||||||
|
@ -4450,7 +4450,8 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
|||||||
|
|
||||||
|
|
||||||
//send acquisiton period/frame number to receiver
|
//send acquisiton period/frame number to receiver
|
||||||
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME)){
|
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME)){
|
||||||
|
string timername = getTimerType(index);
|
||||||
if(ret != FAIL){
|
if(ret != FAIL){
|
||||||
int64_t args[2];
|
int64_t args[2];
|
||||||
retval = -1;
|
retval = -1;
|
||||||
@ -4459,25 +4460,21 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
|||||||
|
|
||||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||||
|
|
||||||
//set #frames, #cycles
|
//set #frames * #cycles
|
||||||
if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){
|
if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){
|
||||||
|
timername.assign("(Number of Frames) * (Number of cycles)");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << "Setting/Getting number of frames*cycles " << index <<" to/from receiver " << args[1] << std::endl;
|
std::cout << "Setting/Getting " << timername << " " << index <<" to/from receiver " << args[1] << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if(thisDetector->timerValue[CYCLES_NUMBER]==0)
|
if(thisDetector->timerValue[CYCLES_NUMBER]==0)
|
||||||
args[1] = thisDetector->timerValue[FRAME_NUMBER];
|
args[1] = thisDetector->timerValue[FRAME_NUMBER];
|
||||||
else
|
else
|
||||||
args[1] = thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER];
|
args[1] = thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER];
|
||||||
}
|
}
|
||||||
//set period/exptime
|
|
||||||
else{
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
if(index==ACQUISITION_TIME)
|
// set period/exptime/subexptime
|
||||||
std::cout << "Setting/Getting acquisition time " << index << " to/from receiver " << args[1] << std::endl;
|
else std::cout << "Setting/Getting " << timername << " " << index << " to/from receiver " << args[1] << std::endl;
|
||||||
else
|
|
||||||
std::cout << "Setting/Getting acquisition period " << index << " to/from receiver " << args[1] << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
if (connectData() == OK){
|
if (connectData() == OK){
|
||||||
@ -4486,18 +4483,23 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
|||||||
}
|
}
|
||||||
if((args[1] != retval)|| (ret==FAIL)){
|
if((args[1] != retval)|| (ret==FAIL)){
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
if(index==ACQUISITION_TIME){
|
cout << "ERROR: " << timername << " in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
||||||
if(strstr(mess,"receiver not idle")==NULL)
|
|
||||||
cout << "ERROR:Acquisition Time in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
if(strstr(mess,"receiver not idle")==NULL) {
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_TIME_NOT_SET));
|
switch(index) {
|
||||||
}else if(index==FRAME_PERIOD){
|
case ACQUISITION_TIME:
|
||||||
if(strstr(mess,"receiver not idle")==NULL)
|
setErrorMask((getErrorMask())|(RECEIVER_ACQ_TIME_NOT_SET));
|
||||||
cout << "ERROR:Acquisition Period in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
break;
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
|
case FRAME_PERIOD:
|
||||||
}else{
|
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
|
||||||
if(strstr(mess,"receiver not idle")==NULL)
|
break;
|
||||||
cout << "ERROR:Number of Frames (* Number of cycles) in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
case SUBFRAME_ACQUISITION_TIME:
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
|
setErrorMask((getErrorMask())|(RECEIVER_SUBF_TIME_NOT_SET));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ret==FORCE_UPDATE)
|
if(ret==FORCE_UPDATE)
|
||||||
@ -5990,6 +5992,7 @@ string slsDetector::setReceiver(string receiverIP){
|
|||||||
std::cout << "frame index needed:" << ((thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER])>1) << endl;
|
std::cout << "frame index needed:" << ((thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER])>1) << endl;
|
||||||
std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl;
|
std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl;
|
||||||
std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl;
|
std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl;
|
||||||
|
std::cout << "sub exp time:" << thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME] << endl;
|
||||||
std::cout << "dynamic range:" << thisDetector->dynamicRange << endl << endl;
|
std::cout << "dynamic range:" << thisDetector->dynamicRange << endl << endl;
|
||||||
std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl;
|
std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl;
|
||||||
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << endl;
|
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << endl;
|
||||||
@ -6026,6 +6029,7 @@ string slsDetector::setReceiver(string receiverIP){
|
|||||||
setTimer(FRAME_PERIOD,thisDetector->timerValue[FRAME_PERIOD]);
|
setTimer(FRAME_PERIOD,thisDetector->timerValue[FRAME_PERIOD]);
|
||||||
setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]);
|
setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]);
|
||||||
setTimer(ACQUISITION_TIME,thisDetector->timerValue[ACQUISITION_TIME]);
|
setTimer(ACQUISITION_TIME,thisDetector->timerValue[ACQUISITION_TIME]);
|
||||||
|
setTimer(SUBFRAME_ACQUISITION_TIME,thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]);
|
||||||
setDynamicRange(thisDetector->dynamicRange);
|
setDynamicRange(thisDetector->dynamicRange);
|
||||||
if(thisDetector->myDetectorType == EIGER){
|
if(thisDetector->myDetectorType == EIGER){
|
||||||
setFlippedData(X,-1);
|
setFlippedData(X,-1);
|
||||||
|
@ -751,6 +751,30 @@ virtual void readFrameFromReceiver()=0;
|
|||||||
default: return string("unknown"); \
|
default: return string("unknown"); \
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
/** returns string from timer index
|
||||||
|
\param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD, DELAY_AFTER_TRIGGER,GATES_NUMBER,PROBES_NUMBER, CYCLES_NUMBER, ACTUAL_TIME,MEASUREMENT_TIME, PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES_JCTB,SUBFRAME_ACQUISITION_TIME
|
||||||
|
\returns string frame_number,acquisition_time,frame_period, delay_after_trigger,gates_number,probes_number, cycles_number, actual_time,measurement_time, progress,measurements_number,frames_from_start,frames_from_start_pg,samples_jctb,subframe_acquisition_time
|
||||||
|
*/
|
||||||
|
static string getTimerType(timerIndex t){ \
|
||||||
|
switch (t) { \
|
||||||
|
case FRAME_NUMBER: return string("frame_number"); \
|
||||||
|
case ACQUISITION_TIME: return string("acquisition_time"); \
|
||||||
|
case FRAME_PERIOD: return string("frame_period"); \
|
||||||
|
case DELAY_AFTER_TRIGGER: return string("delay_after_trigger"); \
|
||||||
|
case GATES_NUMBER: return string("gates_number"); \
|
||||||
|
case PROBES_NUMBER: return string("probes_number"); \
|
||||||
|
case CYCLES_NUMBER: return string("cycles_number"); \
|
||||||
|
case ACTUAL_TIME: return string("actual_time"); \
|
||||||
|
case MEASUREMENT_TIME: return string("measurement_time"); \
|
||||||
|
case PROGRESS: return string("progress"); \
|
||||||
|
case MEASUREMENTS_NUMBER: return string("measurements_number"); \
|
||||||
|
case FRAMES_FROM_START: return string("frames_from_start"); \
|
||||||
|
case FRAMES_FROM_START_PG: return string("frames_from_start_pg"); \
|
||||||
|
case SAMPLES_JCTB: return string("samples_jctb"); \
|
||||||
|
case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \
|
||||||
|
default: return string("unknown"); \
|
||||||
|
}};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -3586,7 +3586,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3600,7 +3600,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
} else
|
} else
|
||||||
return string("undefined module number");
|
return string("undefined module number");
|
||||||
@ -3610,7 +3610,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
if (cmd.find("modulenumber")!=string::npos) {
|
if (cmd.find("modulenumber")!=string::npos) {
|
||||||
@ -3620,7 +3620,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
} else
|
} else
|
||||||
return string("undefined module number");
|
return string("undefined module number");
|
||||||
@ -3631,7 +3631,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3640,7 +3640,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3650,7 +3650,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", retval);
|
sprintf(answer,"0x%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
return string("unknown id mode ")+cmd;
|
return string("unknown id mode ")+cmd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user