mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12: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:
@ -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: e599bfe56f512ea6a262483f61ffd8d67d6c6fcd
|
||||
Revision: 1720
|
||||
Branch: 3.1.3
|
||||
Repsitory UUID: d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960
|
||||
Revision: 1722
|
||||
Branch: 3.1.4-rc
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3475
|
||||
Last Changed Date: 2018-06-28 15:27:02.000000002 +0200 ./threadFiles/ThreadPool.o
|
||||
Last Changed Rev: 3483
|
||||
Last Changed Date: 2018-07-25 16:51:25.000000002 +0200 ./slsDetector/slsDetectorCommand.cpp
|
||||
|
@ -905,21 +905,16 @@ int64_t getFrames(){
|
||||
|
||||
int64_t setExposureTime(int64_t value){
|
||||
/* time is in ns */
|
||||
if (value!=-1) {
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
if (value != -1) {
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getExposureTime(){
|
||||
return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setGates(int64_t value){
|
||||
@ -933,23 +928,16 @@ int64_t getGates(){
|
||||
int64_t setPeriod(int64_t value){
|
||||
/* time is in ns */
|
||||
if (value!=-1) {
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getPeriod(){
|
||||
return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setDelay(int64_t value){
|
||||
@ -959,16 +947,11 @@ int64_t setDelay(int64_t value){
|
||||
value += masterdefaultdelay;
|
||||
cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value);
|
||||
}
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
int64_t retval = set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
|
||||
int64_t retval = (set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
if (masterflags == IS_MASTER) {
|
||||
cprintf(BLUE,"Actual delay read from master: %lld\n", (long long int) retval);
|
||||
retval -= masterdefaultdelay;
|
||||
@ -978,7 +961,8 @@ int64_t setDelay(int64_t value){
|
||||
}
|
||||
|
||||
int64_t getDelay(){
|
||||
return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setTrains(int64_t value){
|
||||
@ -996,37 +980,26 @@ int64_t setProbes(int64_t value){
|
||||
|
||||
|
||||
int64_t setProgress() {
|
||||
|
||||
//????? eventually call after setting the registers
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t getProgress() {
|
||||
|
||||
|
||||
//should be done in firmware!!!!
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int64_t getActualTime(){
|
||||
return get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getMeasurementTime(){
|
||||
int64_t v=get64BitReg(GET_MEASUREMENT_TIME_LSB_REG, GET_MEASUREMENT_TIME_MSB_REG);
|
||||
/* u_int64_t mask=0x8000000000000000;
|
||||
if (v & mask ) {
|
||||
#ifdef VERBOSE
|
||||
printf("no measurement time left\n");
|
||||
#endif
|
||||
return -1E+9;
|
||||
} else*/
|
||||
return v/(1E-9*CLK_FREQ);
|
||||
return (v / (1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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: 675d69392a6497d42b23057c7c8783c8dad768d0
|
||||
Revision: 223
|
||||
Branch: 3.1.0-rc
|
||||
Repsitory UUID: d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960
|
||||
Revision: 225
|
||||
Branch: 3.1.4-rc
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3447
|
||||
Last Changed Date: 2018-02-27 14:04:08.000000002 +0100 ./server_funcs.c
|
||||
Last Changed Rev: 3483
|
||||
Last Changed Date: 2018-07-25 14:56:37.000000002 +0200 ./firmware_funcs.c
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "675d69392a6497d42b23057c7c8783c8dad768d0"
|
||||
#define GITREPUUID "d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3447
|
||||
#define GITDATE 0x20180227
|
||||
#define GITBRANCH "3.1.0-rc"
|
||||
#define GITREV 0x3483
|
||||
#define GITDATE 0x20180725
|
||||
#define GITBRANCH "3.1.4-rc"
|
||||
|
Binary file not shown.
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0
Executable file
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0
Executable file
Binary file not shown.
@ -54,7 +54,7 @@
|
||||
#define DEBUGOUT
|
||||
#endif
|
||||
|
||||
#define CLK_FREQ 32.1E+6
|
||||
#define CLK_FREQ 32.007729
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "e599bfe56f512ea6a262483f61ffd8d67d6c6fcd"
|
||||
#define GITREPUUID "d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3475
|
||||
#define GITDATE 0x20180628
|
||||
#define GITBRANCH "3.1.3"
|
||||
#define GITREV 0x3483
|
||||
#define GITDATE 0x20180725
|
||||
#define GITBRANCH "3.1.4-rc"
|
||||
|
@ -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