mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
generic call for hostname and sgetDetectorsType
This commit is contained in:
parent
e3088d822f
commit
ceed0eaa9b
@ -595,47 +595,23 @@ string multiSlsDetector::ssetDetectorsType(string name, int pos)
|
||||
|
||||
string multiSlsDetector::getHostname(int pos)
|
||||
{
|
||||
string hostnames;
|
||||
if (pos >= 0) {
|
||||
if (detectors[pos])
|
||||
return detectors[pos]->getHostname();
|
||||
} else {
|
||||
for (int ip = 0; ip < thisMultiDetector->numberOfDetectors; ++ip) {
|
||||
if (detectors[ip])
|
||||
hostnames += detectors[ip]->getHostname() + "+";
|
||||
}
|
||||
}
|
||||
return hostnames;
|
||||
return concatResultOrPos(&slsDetector::getHostname, pos);
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorsType(int pos)
|
||||
{
|
||||
|
||||
detectorType s = GENERIC;
|
||||
#ifdef VERBOSE
|
||||
cout << "returning type of detector with ID " << pos << endl;
|
||||
#endif
|
||||
detectorType dt = GENERIC;
|
||||
if (pos >= 0) {
|
||||
if (detectors[pos])
|
||||
return detectors[pos]->getDetectorsType();
|
||||
} else if (detectors[0])
|
||||
return detectors[0]->getDetectorsType();
|
||||
return s;
|
||||
return dt;
|
||||
}
|
||||
|
||||
string multiSlsDetector::sgetDetectorsType(int pos)
|
||||
std::string multiSlsDetector::sgetDetectorsType(int pos)
|
||||
{
|
||||
string s;
|
||||
if (pos >= 0) {
|
||||
if (detectors[pos])
|
||||
return detectors[pos]->sgetDetectorsType();
|
||||
} else {
|
||||
for (int ip = 0; ip < thisMultiDetector->numberOfDetectors; ++ip) {
|
||||
if (detectors[ip])
|
||||
s += detectors[ip]->sgetDetectorsType() + "+";
|
||||
}
|
||||
}
|
||||
return s;
|
||||
return concatResultOrPos(&slsDetector::sgetDetectorsType, pos);
|
||||
}
|
||||
|
||||
int multiSlsDetector::getDetectorId(int pos)
|
||||
@ -3279,6 +3255,21 @@ void multiSlsDetector::setErrorMaskFromAllDetectors()
|
||||
}
|
||||
}
|
||||
|
||||
std::string multiSlsDetector::concatResultOrPos(std::string (slsDetector::*somefunc)(int), int pos)
|
||||
{
|
||||
if (pos >= 0) {
|
||||
if (detectors[pos])
|
||||
return (detectors[pos]->*somefunc)(pos);
|
||||
} else {
|
||||
std::string s;
|
||||
for (int i = 0; i < thisMultiDetector->numberOfDetectors; ++i) {
|
||||
if (detectors[i])
|
||||
s += (detectors[i]->*somefunc)(pos) + "+";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T multiSlsDetector::callDetectorMember(T (slsDetector::*somefunc)())
|
||||
{
|
||||
@ -5962,6 +5953,7 @@ bool multiSlsDetector::isAcquireReady()
|
||||
return OK;
|
||||
}
|
||||
|
||||
int multiSlsDetector::checkVersionCompatibility(portType t) {
|
||||
int multiSlsDetector::checkVersionCompatibility(portType t)
|
||||
{
|
||||
return parallelCallDetectorMember(&slsDetector::checkVersionCompatibility, t);
|
||||
}
|
||||
|
@ -1044,6 +1044,9 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
|
||||
void setErrorMaskFromAllDetectors();
|
||||
|
||||
|
||||
std::string concatResultOrPos(std::string (slsDetector::*somefunc)(int), int pos);
|
||||
|
||||
template<typename T>
|
||||
bool allElemetsEqual(const std::vector<T>&);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user