From b484ad7f20ed94fc49ccb2247aed968c44b761de Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Fri, 11 May 2012 07:22:40 +0000 Subject: [PATCH] changed the getdetectorstype function to return type and not string git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@178 951219d9-93cf-4727-9268-0efd64621fa3 --- slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp | 6 +++--- slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h | 2 +- slsDetectorSoftware/slsDetector/slsDetector.cpp | 5 ++--- slsDetectorSoftware/slsDetector/slsDetector.h | 4 ++-- slsDetectorSoftware/slsDetector/slsDetectorUtils.h | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 31856ab48..87369d10f 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -401,11 +401,11 @@ string multiSlsDetector::getHostname(int pos) { } -string multiSlsDetector::getDetectorsType(int pos) { +slsDetectorDefs::detectorType multiSlsDetector::getDetectorsType(int pos) { - string s=string("Unknown"); + detectorType s =GENERIC; #ifdef VERBOSE - cout << "returning type " << pos << endl; + cout << "returning type of detector with ID " << pos << endl; #endif if (pos>=0) { if (detectors[pos]) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h index e46abd432..5c6ef4e60 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h @@ -264,7 +264,7 @@ class multiSlsDetector : public slsDetectorUtils { string getHostname(int pos=-1); - string getDetectorsType(int pos=-1); + detectorType getDetectorsType(int pos=-1); /** adds a detector by id in position pos diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index e0ebaf851..b518bf2f4 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -1265,9 +1265,8 @@ int slsDetector::setDetectorType(string const stype){ return setDetectorType(getDetectorType(stype)); }; -string slsDetector::getDetectorsType(int pos){ - return getDetectorType(thisDetector->myDetectorType); - +slsDetectorDefs::detectorType slsDetector::getDetectorsType(int pos){ + return thisDetector->myDetectorType; } diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index 8bb7c9ce6..6b7f798a6 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -602,9 +602,9 @@ typedef struct sharedSlsDetector { /** gets detector type normally the detector knows what type of detector it is - \param type is the string where the detector type will be written ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd") + \returns returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed) */ - string getDetectorsType(int pos=-1); + detectorType getDetectorsType(int pos=-1); // Detector configuration functions diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h index 9984edce9..cd0413db4 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h @@ -115,7 +115,7 @@ class slsDetectorUtils : public slsDetectorActions, public slsDetectorBase { \param pos position in the multi detector structure (is -1 returns type of detector with id -1) \returns type */ - virtual string getDetectorsType(int pos=-1)=0; + virtual detectorType getDetectorsType(int pos=-1)=0;