From aae7c68f659ecd8641138b1217dd1b2d78e804a5 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Fri, 22 Feb 2013 11:26:43 +0000 Subject: [PATCH] concatenated filenames for the gui when using receiver git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@469 951219d9-93cf-4727-9268-0efd64621fa3 --- .../gotthardDetectorServer/svnInfoGotthard.h | 4 +-- .../multiSlsDetector/multiSlsDetector.cpp | 14 +++++++++++ .../mythenDetectorServer/svnInfoMythen.h | 6 ++--- slsDetectorSoftware/slsDetector/svnInfoLib.h | 6 ++--- .../slsDetectorAnalysis/fileIOStatic.h | 25 +++++++++++++++++++ .../slsDetectorAnalysis/postProcessing.cpp | 1 + .../slsReceiver/svnInfoReceiver.h | 6 ++--- 7 files changed, 51 insertions(+), 11 deletions(-) diff --git a/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h b/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h index 94f2339b9..34a3ad768 100644 --- a/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h +++ b/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h @@ -2,10 +2,10 @@ #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/gotthardDetectorServer" //#define SVNREPPATH "" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" -//#define SVNREV 0x463 +//#define SVNREV 0x468 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x463 +#define SVNREV 0x468 #define SVNDATE 0x20130221 // diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index bd59b15ce..948aaaf28 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -4160,6 +4160,10 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ int n; int* retval=new int[nel]; int *retdet, *p=retval; + string fullFName=""; + string ext=""; + + for (int id=0; idnumberOfDetectors; id++) { if (detectors[id]) { @@ -4169,6 +4173,14 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ memcpy(p,retdet,n); delete [] retdet; p+=n/sizeof(int); + //concatenate filenames + if(!fullFName.length()){ + fullFName.assign(fileIO::getFileName()); + size_t dot = fullFName.rfind("."); + if(dot != string::npos) + ext = fullFName.substr(dot,fullFName.size()-dot); + } + fullFName.append(getReceiverFileNameToConcatenate(fName)); }else { #ifdef VERBOSE cout << "Receiver for detector " << id << " does not have data left " << endl; @@ -4178,6 +4190,8 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ } } } + fullFName.append(ext); + strcpy(fName,fullFName.c_str()); return retval; }; diff --git a/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h b/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h index 0e439df5a..f84795178 100644 --- a/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h +++ b/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h @@ -2,10 +2,10 @@ #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/mythenDetectorServer" //#define SVNREPPATH "" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" -//#define SVNREV 0x418 +//#define SVNREV 0x431 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x418 -#define SVNDATE 0x20130108 +#define SVNREV 0x431 +#define SVNDATE 0x20130116 // diff --git a/slsDetectorSoftware/slsDetector/svnInfoLib.h b/slsDetectorSoftware/slsDetector/svnInfoLib.h index 9f2fe8fa1..352427d3c 100644 --- a/slsDetectorSoftware/slsDetector/svnInfoLib.h +++ b/slsDetectorSoftware/slsDetector/svnInfoLib.h @@ -2,10 +2,10 @@ #define SVNURLLIB "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware" //#define SVNREPPATH "" #define SVNREPUUIDLIB "951219d9-93cf-4727-9268-0efd64621fa3" -//#define SVNREV 0x430 +//#define SVNREV 0x468 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTHLIB "l_maliakal_d" -#define SVNREVLIB 0x430 -#define SVNDATELIB 0x20130116 +#define SVNREVLIB 0x468 +#define SVNDATELIB 0x20130221 // diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h index b5aaed8cb..a2781bd2e 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h @@ -271,6 +271,31 @@ class fileIOStatic { + + /** static function that returns the entire filename ithout file name prefix, detector index or extension + This will be concatenated with all the other detector file names for the gui + \param fname complete file name + \returns file name without file name prefix, detector index or extension + */ + static string getReceiverFileNameToConcatenate(string fname) { \ + int i; \ + string s; \ + s=fname; \ + size_t slash=s.rfind("/"); \ + if (slash!= string::npos) \ + s=s.substr(slash,s.size()-slash); \ + size_t dot=s.find("."); \ + size_t uscore=s.find("_"); \ + s=s.substr(uscore,dot-uscore); \ + uscore=s.find("_",1); \ + if ((uscore!= string::npos) && (sscanf( s.substr(1,uscore-1).c_str(),"d%d",&i))) \ + s=s.substr(uscore,s.size()-uscore); \ + return s; \ + }; + + + + /** writes a data file diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index dbd527a6c..53679501c 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -423,6 +423,7 @@ void* postProcessing::processData(int delflag) { prevCaught=caught; if (checkJoinThread()) break; if(newData){ + strcpy(currentfName,""); pthread_mutex_lock(&mg); int* receiverData = readFrameFromReceiver(currentfName,currentfIndex); pthread_mutex_unlock(&mg); diff --git a/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h b/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h index 0b3a9a1a5..0ff91c6d3 100644 --- a/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h +++ b/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h @@ -2,10 +2,10 @@ #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/slsReceiver" //#define SVNREPPATH "" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" -//#define SVNREV 0x428 +//#define SVNREV 0x451 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x428 -#define SVNDATE 0x20130115 +#define SVNREV 0x451 +#define SVNDATE 0x20130205 //