mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
fixed resolution for exptime, period and delay in server
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//for memory mapping
|
//for memory mapping
|
||||||
u_int64_t CSP0BASE;
|
u_int64_t CSP0BASE;
|
||||||
|
|
||||||
@ -1054,8 +1055,16 @@ int64_t getFrames(){
|
|||||||
|
|
||||||
int64_t setExposureTime(int64_t value){
|
int64_t setExposureTime(int64_t value){
|
||||||
/* time is in ns */
|
/* time is in ns */
|
||||||
if (value!=-1)
|
if (value!=-1) {
|
||||||
value*=(1E-9*CLK_FREQ);
|
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||||
|
value*=(1E-9*CLK_FREQ);
|
||||||
|
if(fabs(actualvalue-value)>= 0.5){
|
||||||
|
if(actualvalue > value)
|
||||||
|
value++;
|
||||||
|
else
|
||||||
|
value--;
|
||||||
|
}
|
||||||
|
}
|
||||||
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-9*CLK_FREQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1074,7 +1083,14 @@ int64_t getGates(){
|
|||||||
int64_t setPeriod(int64_t value){
|
int64_t setPeriod(int64_t value){
|
||||||
/* time is in ns */
|
/* time is in ns */
|
||||||
if (value!=-1) {
|
if (value!=-1) {
|
||||||
value*=(1E-9*CLK_FREQ);
|
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||||
|
value*=(1E-9*CLK_FREQ);
|
||||||
|
if(fabs(actualvalue-value)>= 0.5){
|
||||||
|
if(actualvalue > value)
|
||||||
|
value++;
|
||||||
|
else
|
||||||
|
value--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1093,7 +1109,14 @@ int64_t setDelay(int64_t value){
|
|||||||
value += masterdefaultdelay;
|
value += masterdefaultdelay;
|
||||||
cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value);
|
cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value);
|
||||||
}
|
}
|
||||||
value*=(1E-9*CLK_FREQ);
|
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||||
|
value*=(1E-9*CLK_FREQ);
|
||||||
|
if(fabs(actualvalue-value)>= 0.5){
|
||||||
|
if(actualvalue > value)
|
||||||
|
value++;
|
||||||
|
else
|
||||||
|
value--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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-9*CLK_FREQ);
|
||||||
if (masterflags == IS_MASTER) {
|
if (masterflags == IS_MASTER) {
|
||||||
|
Binary file not shown.
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.0.0.4
Executable file
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.0.0.4
Executable file
Binary file not shown.
Reference in New Issue
Block a user