mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 05:08:06 +01:00
enableWriteToFile added
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@204 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "usersFunctions.h"
|
||||
|
||||
|
||||
|
||||
postProcessing::postProcessing(){
|
||||
pthread_mutex_t mp1 = PTHREAD_MUTEX_INITIALIZER;
|
||||
mp=mp1;
|
||||
@@ -33,7 +34,7 @@ int postProcessing::flatFieldCorrect(float datain, float errin, float &dataout,
|
||||
if (dataout>0)
|
||||
errout=sqrt(e*ffcoefficient*e*ffcoefficient+datain*fferr*datain*fferr);
|
||||
else
|
||||
errout=1.;
|
||||
errout=1.0;
|
||||
|
||||
return 0;
|
||||
};
|
||||
@@ -147,12 +148,19 @@ void postProcessing::processFrame(int *myData, int delflag) {
|
||||
|
||||
fdata=decodeData(myData, fdata);
|
||||
|
||||
fname=createFileName();
|
||||
|
||||
|
||||
fname=createFileName();
|
||||
|
||||
//Checking for write flag
|
||||
if(*correctionMask&(1<<WRITE_FILE))
|
||||
{
|
||||
|
||||
|
||||
//uses static function?!?!?!?
|
||||
writeDataFile (fname+string(".raw"),fdata, NULL, NULL, 'i');
|
||||
|
||||
|
||||
}
|
||||
|
||||
doProcessing(fdata,delflag, fname);
|
||||
|
||||
delete [] myData;
|
||||
|
||||
@@ -31,11 +31,11 @@ using namespace std;
|
||||
|
||||
(including thread for writing data files and plotting in parallel with the acquisition)
|
||||
*/
|
||||
class postProcessing : public angularConversion, public fileIO
|
||||
//: public virtual angularConversion, public virtual fileIO
|
||||
{
|
||||
|
||||
class postProcessing : public virtual angularConversion, public virtual fileIO {
|
||||
|
||||
|
||||
//: public angularConversion, public fileIO
|
||||
|
||||
public:
|
||||
postProcessing();
|
||||
@@ -66,7 +66,7 @@ class postProcessing : public angularConversion, public fileIO
|
||||
\param ecorr if !=NULL the flat field correction errors will be filled with ecorr (1 otherwise)
|
||||
\returns 0 if ff correction disabled, >0 otherwise
|
||||
*/
|
||||
virtual int setFlatFieldCorrection(float *corr, float *ecorr=NULL)=0;
|
||||
virtual int setFlatFieldCorrection(float *corr, float *ecorr=NULL)=0;
|
||||
|
||||
/**
|
||||
set bad channels correction
|
||||
@@ -120,16 +120,17 @@ class postProcessing : public angularConversion, public fileIO
|
||||
static int rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t);
|
||||
|
||||
|
||||
int enableWriteToFile(int i=-1) {if (i>0) ((*correctionMask)|=(1<<WRITE_FILE)); if(i==0) ((*correctionMask)&=~(1<< WRITE_FILE)); return ((*correctionMask)&(1<< WRITE_FILE));};
|
||||
|
||||
|
||||
int setAngularCorrectionMask(int i=-1){if (i==0) (*correctionMask)&=~(1<< ANGULAR_CONVERSION); if (i>0) (*correctionMask)|=(1<< ANGULAR_CONVERSION); return ((*correctionMask)&(1<< ANGULAR_CONVERSION));};
|
||||
|
||||
|
||||
|
||||
int enableAngularConversion(int i=-1) {if (i>0) return setAngularConversionFile("default"); if (i==0) return setAngularConversionFile(""); return setAngularCorrectionMask();}
|
||||
int enableAngularConversion(int i=-1) {if (i>0) return setAngularConversionFile("default"); if (i==0) return setAngularConversionFile(""); return setAngularCorrectionMask();};
|
||||
|
||||
|
||||
int enableBadChannelCorrection(int i=-1) {if (i>0) return setBadChannelCorrection("default"); if (i==0) return setBadChannelCorrection(""); return ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS));}
|
||||
int enableBadChannelCorrection(int i=-1) {if (i>0) return setBadChannelCorrection("default"); if (i==0) return setBadChannelCorrection(""); return ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS));};
|
||||
|
||||
|
||||
|
||||
@@ -138,11 +139,7 @@ class postProcessing : public angularConversion, public fileIO
|
||||
string getBadChannelCorrectionFile() {if ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS)) return string(badChanFile); else return string("none");};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
get flat field corrections file directory
|
||||
\returns flat field correction file directory
|
||||
*/
|
||||
@@ -169,7 +166,7 @@ s
|
||||
\returns thread flag
|
||||
*/
|
||||
|
||||
int setThreadedProcessing(int b=-1) {if (b>=0) *threadedProcessing=b; return *threadedProcessing;}
|
||||
int setThreadedProcessing(int b=-1) {if (b>=0) *threadedProcessing=b; return *threadedProcessing;};
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user