mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
changes for new chipterboard -now works with reduced dynamic range and analog/digital readout
This commit is contained in:
@ -22,10 +22,10 @@ string fileIO::createFileName() {
|
||||
detIndex \
|
||||
);
|
||||
|
||||
if (getDetectorsType()==JUNGFRAUCTB) {
|
||||
nBytes=2*getTotalNumberOfChannels();
|
||||
} else
|
||||
nBytes=getDataBytes();
|
||||
//if (getDetectorsType()==JUNGFRAUCTB) {
|
||||
// nBytes=2*getTotalNumberOfChannels();
|
||||
//} else
|
||||
nBytes=getDataBytes();
|
||||
return currentFileName;
|
||||
|
||||
}
|
||||
@ -57,7 +57,7 @@ int fileIO::writeDataFile(string fname, double *data, double *err, double *ang,
|
||||
if (nch==-1)
|
||||
nch=getTotalNumberOfChannels();
|
||||
|
||||
cout << "Write filexxx...." << endl;
|
||||
// cout << "Write filexxx...." << endl;
|
||||
|
||||
return fileIOStatic::writeDataFile(fname, nch, data, err, ang, dataformat);
|
||||
|
||||
@ -66,7 +66,7 @@ int fileIO::writeDataFile(ofstream &outfile, double *data, double *err, double *
|
||||
if (nch==-1)
|
||||
nch=getTotalNumberOfChannels();
|
||||
|
||||
cout << "Write file...." << endl;
|
||||
//cout << "Write file...." << endl;
|
||||
|
||||
return fileIOStatic::writeDataFile(outfile, nch, data, err, ang, dataformat, offset);
|
||||
|
||||
@ -97,13 +97,14 @@ int fileIO::writeDataFile(void *data, int iframe) {
|
||||
if ((*framesPerFile)<2)
|
||||
iframe=-1;
|
||||
|
||||
if ((iframe%(*framesPerFile))==0 || (iframe<0)) {
|
||||
if ((iframe%(*framesPerFile))==0 || (iframe<0) || filefd==0) {
|
||||
createFileName();
|
||||
filefd = fopen((currentFileName+string(".raw")).c_str(), "w");
|
||||
}
|
||||
|
||||
if (filefd){
|
||||
// fileIOStatic::writeBinaryDataFile(filefd,getDataBytes(), data);
|
||||
cout <<"Writing "<< nBytes<< " dataBytes"<< endl;
|
||||
fileIOStatic::writeBinaryDataFile(filefd,nBytes, data);
|
||||
iframe++;
|
||||
}
|
||||
@ -119,7 +120,7 @@ int fileIO::writeDataFile(void *data, int iframe) {
|
||||
|
||||
|
||||
int fileIO::closeDataFile() {
|
||||
cout << "close file...." << endl;
|
||||
// cout << "close file...." << endl;
|
||||
if (filefd)
|
||||
fclose(filefd);
|
||||
filefd=NULL;
|
||||
|
@ -71,6 +71,7 @@ postProcessing::~postProcessing(){
|
||||
void postProcessing::processFrame(int *myData, int delflag, int jctb) {
|
||||
|
||||
string fname;
|
||||
int nn;
|
||||
//double *fdata=NULL;
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -85,20 +86,22 @@ void postProcessing::processFrame(int *myData, int delflag, int jctb) {
|
||||
|
||||
/** decode data */
|
||||
|
||||
// cout << "decode 0"<< endl;
|
||||
// if (getDetectorsType()==MYTHEN) {
|
||||
fdata=decodeData(myData, fdata);
|
||||
fdata=decodeData(myData,nn, fdata);
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "decode"<< endl;
|
||||
#endif
|
||||
//#ifdef VERBOSE
|
||||
// cout << "decode 1"<< endl;
|
||||
//#endif
|
||||
// } else
|
||||
// fdata=NULL;
|
||||
|
||||
if (rawDataReady) {
|
||||
#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
cout << "decoded data size is "<<nn << endl;
|
||||
cout << "raw data ready..." << endl;
|
||||
#endif
|
||||
rawDataReady(fdata,numberOfChannels, pRawDataArg);
|
||||
#endif
|
||||
// rawDataReady(fdata,numberOfChannels, pRawDataArg);
|
||||
rawDataReady(fdata,nn, pRawDataArg);
|
||||
#ifdef VERBOSE
|
||||
cout << "done" << endl;
|
||||
cout << "NO FILE WRITING AND/OR DATA PROCESSING DONE BY SLS DETECTOR SOFTWARE!!!" << endl;
|
||||
@ -140,7 +143,8 @@ void postProcessing::processFrame(int *myData, int delflag, int jctb) {
|
||||
|
||||
// cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl;
|
||||
// cout << "DATAREADY 1" <<endl;
|
||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels()); //only 1d detectors
|
||||
// thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels()); //only 1d detectors
|
||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),nn); //only 1d detectors
|
||||
dataReady(thisData, currentFrameIndex, -1, pCallbackArg);
|
||||
delete thisData;
|
||||
fdata=NULL;
|
||||
@ -428,14 +432,14 @@ void* postProcessing::processData(int delflag) {
|
||||
// cout << "loop" << endl;
|
||||
while((queuesize=dataQueueSize())>0) {
|
||||
/** Pop data queue */
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
cout << "data found"<< endl<<endl;;
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
myData=dataQueueFront(); // get the data from the queue
|
||||
#ifdef VERBOSE
|
||||
cout << "got them"<< endl;
|
||||
#endif
|
||||
//#ifdef VERBOSE
|
||||
// cout << "got them"<< endl;
|
||||
//#endif
|
||||
|
||||
if (myData) {
|
||||
|
||||
@ -486,7 +490,7 @@ void* postProcessing::processData(int delflag) {
|
||||
}
|
||||
//receiver
|
||||
else{
|
||||
|
||||
int nn;
|
||||
|
||||
int progress = 0;
|
||||
char currentfName[MAX_STR_LENGTH]="";
|
||||
@ -640,7 +644,7 @@ void* postProcessing::processData(int delflag) {
|
||||
#ifdef VERY_VERY_DEBUG
|
||||
cout << "GOT data" << endl;
|
||||
#endif
|
||||
fdata = decodeData(receiverData);
|
||||
fdata = decodeData(receiverData, nn);
|
||||
delete [] receiverData;
|
||||
if ((fdata) && (dataReady)){
|
||||
// cout << "DATAREADY 3" << endl;
|
||||
|
Reference in New Issue
Block a user