diff --git a/slsDetectorSoftware/usersFunctions/angleFunction.h b/slsDetectorSoftware/usersFunctions/angleFunction.h new file mode 100644 index 000000000..65e3decd3 --- /dev/null +++ b/slsDetectorSoftware/usersFunctions/angleFunction.h @@ -0,0 +1,12 @@ + + +/* + contains the conversion channel-angle for a module channel + conv_r=pitch/radius +*/ + + +double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) {\ + (void) tilt; \ + return 180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset;\ +}; diff --git a/slsDetectorSoftware/usersFunctions/usersFunctions.cpp b/slsDetectorSoftware/usersFunctions/usersFunctions.cpp index 0315d4038..229b495cc 100644 --- a/slsDetectorSoftware/usersFunctions/usersFunctions.cpp +++ b/slsDetectorSoftware/usersFunctions/usersFunctions.cpp @@ -99,11 +99,6 @@ int caput(chid ch_id, double value) { - - - - - #endif @@ -111,27 +106,6 @@ int caput(chid ch_id, double value) { - -/* - contains the conversion channel-angle for a module channel - conv_r=pitch/radius -*/ - - -double defaultAngleFunction(double ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction) { - - - (void) tilt; /* to avoid warning: unused parameter */ - double ang; - - ang=180./PI*(center*conv_r+direction*atan((double)(ichan-center)*conv_r))+encoder+totalOffset+offset; - - - - return ang; - -} - /* reads the encoder and returns the position */ double defaultGetPosition(void *d) { diff --git a/slsDetectorSoftware/usersFunctions/usersFunctions.h b/slsDetectorSoftware/usersFunctions/usersFunctions.h index ec2bae586..eabc26b71 100644 --- a/slsDetectorSoftware/usersFunctions/usersFunctions.h +++ b/slsDetectorSoftware/usersFunctions/usersFunctions.h @@ -14,6 +14,7 @@ Functions depending on the experimental setup should be defined here #include #endif #include "detectorData.h" +#include "angleFunction.h" #ifdef __cplusplus extern "C" {