gotthard server and slsDetectorSoftware: more accuracy when converting from double to int64_t by adding 0.5, improved clock precision of gotthard from 32.1 to 32.007729

This commit is contained in:
2018-07-26 11:47:55 +02:00
parent d69d69e892
commit 8cc05c5848
9 changed files with 41 additions and 71 deletions

View File

@ -5464,11 +5464,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
else
return string("cannot scan timer value ")+string(args[1]);
if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) {
// t=(int64_t)(val*1E+9); for precision of eg.0.0000325, following done
val*=1E9;
t = (int64_t)val;
if(fabs(val-t)) // to validate precision loss
t = t + val - t; //even t += vak-t loses precision
// +0.5 for precision of eg.0.0000325
t = ( val * 1E9 + 0.5);
}else t=(int64_t)val;
}