mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user