mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
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
This commit is contained in:
parent
b98545814f
commit
aae7c68f65
@ -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
|
||||
//
|
||||
|
@ -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; id<thisMultiDetector->numberOfDetectors; 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;
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user