From dc94fc3c97ab55f4ac9ba75bd52667e68badb407 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 13 Nov 2012 10:21:22 +0000 Subject: [PATCH] receiver-read frame in right order, cleaned fileio, config file-include extsig and vhighvoltage git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@339 951219d9-93cf-4727-9268-0efd64621fa3 --- .../slsDetector/slsDetector.cpp | 17 ++++------ .../slsDetector/slsDetectorUtils.cpp | 3 -- .../slsDetectorAnalysis/fileIO.cpp | 34 ++++++------------- .../slsDetectorAnalysis/postProcessing.h | 7 +--- .../slsReceiver/slsReceiverFunctionList.c | 20 ++++------- 5 files changed, 25 insertions(+), 56 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index eec9180ad..502ef9ac2 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -4941,8 +4941,6 @@ int slsDetector::writeConfigurationFile(string const fname){ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){ slsDetectorCommand *cmd=new slsDetectorCommand(this); - int nvar; - int nsig=-1; string names[]={ \ "hostname", \ @@ -4965,8 +4963,7 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){ // "trimen", // "dataport", - switch (thisDetector->myDetectorType) { - case GOTTHARD: + if (thisDetector->myDetectorType==GOTTHARD) { names[4]= "angdir"; names[5]= "moveflag"; names[6]= "lock"; @@ -4977,15 +4974,12 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){ names[11]="servermac"; names[12]="receiverip"; names[13]="outdir"; - nvar=14; - break; - case MYTHEN: - nsig=4; - default: - nvar=15; - + names[14]="vhighvoltage"; } + + int nvar=15; + int nsig=4;//-1; int iv=0; char *args[100]; char myargs[100][1000]; @@ -5685,6 +5679,7 @@ int slsDetector::resetFramesCaught(int index){ int* slsDetector::readFrameFromReceiver(){ + //cout<<"databytes:"<dataBytes<<" headerlength:"<dataBytes+HEADERLENGTH)/sizeof(int);//2572/ int* retval=new int[nel]; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index 50243daca..d7c7eaf8c 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -126,8 +126,6 @@ void slsDetectorUtils::acquire(int delflag){ if(setReceiverOnline()==OFFLINE_FLAG) *stoppedFlag=1; - else - setReceiverAcquiring(1); } @@ -414,7 +412,6 @@ void slsDetectorUtils::acquire(int delflag){ // loop measurements } - setReceiverAcquiring(0); // waiting for the data processing thread to finish! if (*threadedProcessing) { diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIO.cpp b/slsDetectorSoftware/slsDetectorAnalysis/fileIO.cpp index fb3e0b41a..90b2dca81 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIO.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIO.cpp @@ -80,49 +80,37 @@ int fileIO::writeDataFile(ofstream &outfile, int *data, int offset){ int fileIO::writeDataFile(void *data, int iframe) { - cout <<"iframe " << iframe << endl; if (iframe<0) iframe=frameIndex; - //if (iframe>=0) - // frameIndex=iframe; if ((*framesPerFile)<2) iframe=-1; - //frameIndex=-1; + if ((iframe%(*framesPerFile))==0 || (iframe<0)) { - //if ((frameIndex%(*framesPerFile))==0 || (frameIndex<0)) { createFileName(); filefd = fopen((currentFileName+string(".raw")).c_str(), "w"); } + if (filefd){ - //if (iframe%(*framesPerFile)) { - /*if(setDynamicRange(-1)==16){ - fileIOStatic::writeBinaryDataFile(filefd,getDataBytes()*2, data); - frameIndex+=2; - } - else{*/ - fileIOStatic::writeBinaryDataFile(filefd,getDataBytes(), data);cout<<"write frameIndex:"<