From 3075b8ae11d492dc2d0019e85903b464cdb22b8c Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 26 Feb 2013 08:34:41 +0000 Subject: [PATCH] made advanced tab detector dependent. each set mac adress etc is done via slsdetector and not multi git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@471 951219d9-93cf-4727-9268-0efd64621fa3 --- .../commonFiles/sls_detector_defs.h | 3 +- .../gotthardDetectorServer/svnInfoGotthard.h | 6 +- .../multiSlsDetector/multiSlsDetector.cpp | 11 ++-- .../mythenDetectorServer/svnInfoMythen.h | 6 +- .../slsDetector/slsDetector.cpp | 11 ++++ slsDetectorSoftware/slsDetector/slsDetector.h | 62 ++++++++++--------- slsDetectorSoftware/slsDetector/svnInfoLib.h | 6 +- .../slsDetectorAnalysis/fileIOStatic.h | 4 +- .../slsReceiver/svnInfoReceiver.h | 6 +- 9 files changed, 65 insertions(+), 50 deletions(-) diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h index 1991c8932..f1551acec 100755 --- a/slsDetectorSoftware/commonFiles/sls_detector_defs.h +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -1,6 +1,7 @@ #ifndef SLS_DETECTOR_DEFS_H #define SLS_DETECTOR_DEFS_H + #ifdef __CINT__ #define MYROOT #define __cplusplus @@ -544,7 +545,7 @@ enum angleConversionParameter { #ifndef MYROOT #include "sls_detector_funcs.h" #endif - + #ifdef __cplusplus }; #endif diff --git a/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h b/slsDetectorSoftware/gotthardDetectorServer/svnInfoGotthard.h index 34a3ad768..a8fcbe9e7 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 0x468 +//#define SVNREV 0x469 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x468 -#define SVNDATE 0x20130221 +#define SVNREV 0x469 +#define SVNDATE 0x20130222 // diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 948aaaf28..4a6fa93ce 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -4162,7 +4162,7 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ int *retdet, *p=retval; string fullFName=""; string ext=""; - + char * pch; for (int id=0; idnumberOfDetectors; id++) { @@ -4176,9 +4176,11 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ //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); + if (strrchr(fName,'.')!=NULL){ + ext.assign(fName); + size_t dot = ext.rfind("."); + ext = ext.erase(0,dot); + } } fullFName.append(getReceiverFileNameToConcatenate(fName)); }else { @@ -4347,7 +4349,6 @@ int64_t multiSlsDetector::clearAllErrorMask(){ - int multiSlsDetector::calibratePedestal(int frames){ int ret=-100, ret1; diff --git a/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h b/slsDetectorSoftware/mythenDetectorServer/svnInfoMythen.h index f84795178..a9f5d2ba4 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 0x431 +//#define SVNREV 0x469 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x431 -#define SVNDATE 0x20130116 +#define SVNREV 0x469 +#define SVNDATE 0x20130222 // diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index f83b32450..f5dc36f29 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -6260,3 +6260,14 @@ int slsDetector::calibratePedestal(int frames){ +int64_t slsDetector::clearAllErrorMask(){ + clearErrorMask(); + for(int i=0;igetNumberOfDetectors();i++){ + if(parentDet->getDetectorId(i) == getDetectorId()) + parentDet->setErrorMask(parentDet->getErrorMask()|(0<detectorMAC;}; + /** returns the detector IP address\sa sharedSlsDetector */ + char* getDetectorIP() {return thisDetector->detectorIP;}; + /** returns the receiver IP address \sa sharedSlsDetector */ + char* getReceiver() {return thisDetector->receiver_hostname;}; + /** returns the receiver UDP IP address \sa sharedSlsDetector */ + char* getReceiverUDPIP() {return thisDetector->receiverUDPIP;}; + /** returns the receiver UDP MAC address \sa sharedSlsDetector */ + char* getReceiverUDPMAC() {return thisDetector->receiverUDPMAC;}; + /** returns the receiver UDP IP address \sa sharedSlsDetector */ + char* getReceiverUDPPort() {char *c= new char[MAX_STR_LENGTH];sprintf(c,"%d",thisDetector->receiverUDPPort); return c;}; + + /** validates the format of detector MAC address and sets it \sa sharedSlsDetector */ + char* setDetectorMAC(string detectorMAC); + /** validates the format of detector IP address and sets it \sa sharedSlsDetector */ + char* setDetectorIP(string detectorIP); + /** validates and sets the receiver IP address/hostname \sa sharedSlsDetector */ + char* setReceiver(string receiver); + /** validates the format of receiver udp ip and sets it \sa sharedSlsDetector */ + char* setReceiverUDPIP(string udpip); + /** validates the format of receiver udp mac and sets it \sa sharedSlsDetector */ + char* setReceiverUDPMAC(string udpmac); + /** sets the receiver udp port \sa sharedSlsDetector */ + int setReceiverUDPPort(int udpport); + protected: @@ -1652,36 +1684,6 @@ class slsDetector : public slsDetectorUtils, public energyConversion { */ int receiveModule(sls_detector_module*); - - - - - /** returns the detector MAC address\sa sharedSlsDetector */ - char* getDetectorMAC() {return thisDetector->detectorMAC;}; - /** returns the detector IP address\sa sharedSlsDetector */ - char* getDetectorIP() {return thisDetector->detectorIP;}; - /** returns the receiver IP address \sa sharedSlsDetector */ - char* getReceiver() {return thisDetector->receiver_hostname;}; - /** returns the receiver UDP IP address \sa sharedSlsDetector */ - char* getReceiverUDPIP() {return thisDetector->receiverUDPIP;}; - /** returns the receiver UDP MAC address \sa sharedSlsDetector */ - char* getReceiverUDPMAC() {return thisDetector->receiverUDPMAC;}; - /** returns the receiver UDP IP address \sa sharedSlsDetector */ - char* getReceiverUDPPort() {char *c= new char[MAX_STR_LENGTH];sprintf(c,"%d",thisDetector->receiverUDPPort); return c;}; - - /** validates the format of detector MAC address and sets it \sa sharedSlsDetector */ - char* setDetectorMAC(string detectorMAC); - /** validates the format of detector IP address and sets it \sa sharedSlsDetector */ - char* setDetectorIP(string detectorIP); - /** validates and sets the receiver IP address/hostname \sa sharedSlsDetector */ - char* setReceiver(string receiver); - /** validates the format of receiver udp ip and sets it \sa sharedSlsDetector */ - char* setReceiverUDPIP(string udpip); - /** validates the format of receiver udp mac and sets it \sa sharedSlsDetector */ - char* setReceiverUDPMAC(string udpmac); - /** sets the receiver udp port \sa sharedSlsDetector */ - int setReceiverUDPPort(int udpport); - /** Gets MAC from receiver and sets up UDP Connection */ int setUDPConnection(); diff --git a/slsDetectorSoftware/slsDetector/svnInfoLib.h b/slsDetectorSoftware/slsDetector/svnInfoLib.h index 352427d3c..8171175ce 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 0x468 +//#define SVNREV 0x469 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTHLIB "l_maliakal_d" -#define SVNREVLIB 0x468 -#define SVNDATELIB 0x20130221 +#define SVNREVLIB 0x469 +#define SVNDATELIB 0x20130222 // diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h index a2781bd2e..857881c5c 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h @@ -288,8 +288,8 @@ class fileIOStatic { 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); \ + //if ((uscore!= string::npos) && (sscanf( s.substr(1,uscore-1).c_str(),"d%d",&i))) + //s=s.substr(uscore,s.size()-uscore); return s; \ }; diff --git a/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h b/slsDetectorSoftware/slsReceiver/svnInfoReceiver.h index 0ff91c6d3..b364c1fde 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 0x451 +//#define SVNREV 0x469 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x451 -#define SVNDATE 0x20130205 +#define SVNREV 0x469 +#define SVNDATE 0x20130222 //