mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer
This commit is contained in:
commit
bab7d8e3fb
@ -595,47 +595,23 @@ string multiSlsDetector::ssetDetectorsType(string name, int pos)
|
|||||||
|
|
||||||
string multiSlsDetector::getHostname(int pos)
|
string multiSlsDetector::getHostname(int pos)
|
||||||
{
|
{
|
||||||
string hostnames;
|
return concatResultOrPos(&slsDetector::getHostname, pos);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorsType(int pos)
|
slsDetectorDefs::detectorType multiSlsDetector::getDetectorsType(int pos)
|
||||||
{
|
{
|
||||||
|
detectorType dt = GENERIC;
|
||||||
detectorType s = GENERIC;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout << "returning type of detector with ID " << pos << endl;
|
|
||||||
#endif
|
|
||||||
if (pos >= 0) {
|
if (pos >= 0) {
|
||||||
if (detectors[pos])
|
if (detectors[pos])
|
||||||
return detectors[pos]->getDetectorsType();
|
return detectors[pos]->getDetectorsType();
|
||||||
} else if (detectors[0])
|
} else if (detectors[0])
|
||||||
return detectors[0]->getDetectorsType();
|
return detectors[0]->getDetectorsType();
|
||||||
return s;
|
return dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
string multiSlsDetector::sgetDetectorsType(int pos)
|
std::string multiSlsDetector::sgetDetectorsType(int pos)
|
||||||
{
|
{
|
||||||
string s;
|
return concatResultOrPos(&slsDetector::sgetDetectorsType, pos);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getDetectorId(int pos)
|
int multiSlsDetector::getDetectorId(int pos)
|
||||||
@ -1779,49 +1755,6 @@ void multiSlsDetector::resetFinalDataQueue()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// int64_t ret = -100;
|
|
||||||
|
|
||||||
// if (!threadpool) {
|
|
||||||
// cout << "Error in creating threadpool. Exiting" << endl;
|
|
||||||
// return -1;
|
|
||||||
// } else {
|
|
||||||
// //return storage values
|
|
||||||
// int64_t* iret[thisMultiDetector->numberOfDetectors];
|
|
||||||
// for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
|
|
||||||
// if (detectors[idet]) {
|
|
||||||
// iret[idet] = new int64_t(-1);
|
|
||||||
// Task* task = new Task(new func2_t<int64_t, timerIndex, int64_t>(&slsDetector::setTimer,
|
|
||||||
// detectors[idet], index, t, iret[idet]));
|
|
||||||
// threadpool->add_task(task);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// threadpool->startExecuting();
|
|
||||||
// threadpool->wait_for_tasks_to_complete();
|
|
||||||
// for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
|
|
||||||
// if (detectors[idet]) {
|
|
||||||
// if (iret[idet] != NULL) {
|
|
||||||
// if (ret == -100)
|
|
||||||
// ret = *iret[idet];
|
|
||||||
// else if (ret != *iret[idet])
|
|
||||||
// ret = -1;
|
|
||||||
// delete iret[idet];
|
|
||||||
// } else
|
|
||||||
// ret = -1;
|
|
||||||
// if (detectors[idet]->getErrorMask())
|
|
||||||
// setErrorMask(getErrorMask() | (1 << idet));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (index == SAMPLES_JCTB)
|
|
||||||
// setDynamicRange();
|
|
||||||
|
|
||||||
// thisMultiDetector->timerValue[index] = ret;
|
|
||||||
// return ret;
|
|
||||||
// }
|
|
||||||
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t)
|
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t)
|
||||||
{
|
{
|
||||||
int64_t ret = parallelCallDetectorMember(&slsDetector::setTimer, index, t);
|
int64_t ret = parallelCallDetectorMember(&slsDetector::setTimer, index, t);
|
||||||
@ -1833,35 +1766,20 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t)
|
|||||||
}
|
}
|
||||||
int64_t multiSlsDetector::getTimeLeft(timerIndex index)
|
int64_t multiSlsDetector::getTimeLeft(timerIndex index)
|
||||||
{
|
{
|
||||||
int i;
|
int64_t ret = -100;
|
||||||
int64_t ret1 = -100, ret;
|
|
||||||
|
|
||||||
if (thisMultiDetector->masterPosition >= 0)
|
if (thisMultiDetector->masterPosition >= 0)
|
||||||
if (detectors[thisMultiDetector->masterPosition]) {
|
if (detectors[thisMultiDetector->masterPosition]) {
|
||||||
ret1 = detectors[thisMultiDetector->masterPosition]->getTimeLeft(index);
|
ret = detectors[thisMultiDetector->masterPosition]->getTimeLeft(index);
|
||||||
if (detectors[thisMultiDetector->masterPosition]->getErrorMask())
|
if (detectors[thisMultiDetector->masterPosition]->getErrorMask())
|
||||||
setErrorMask(getErrorMask() | (1 << thisMultiDetector->masterPosition));
|
setErrorMask(getErrorMask() | (1 << thisMultiDetector->masterPosition));
|
||||||
return ret1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
return callDetectorMember(&slsDetector::getTimeLeft, index);
|
||||||
for (i = 0; i < thisMultiDetector->numberOfDetectors; ++i) {
|
|
||||||
if (detectors[i]) {
|
|
||||||
ret = detectors[i]->getTimeLeft(index);
|
|
||||||
if (detectors[i]->getErrorMask())
|
|
||||||
setErrorMask(getErrorMask() | (1 << i));
|
|
||||||
if (ret1 == -100)
|
|
||||||
ret1 = ret;
|
|
||||||
else if (ret != ret1)
|
|
||||||
ret1 = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setStoragecellStart(int pos)
|
int multiSlsDetector::setStoragecellStart(int pos)
|
||||||
{
|
{
|
||||||
parallelCallDetectorMember(&slsDetector::setStoragecellStart, pos);
|
return parallelCallDetectorMember(&slsDetector::setStoragecellStart, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setSpeed(speedVariable index, int value)
|
int multiSlsDetector::setSpeed(speedVariable index, int value)
|
||||||
@ -3337,18 +3255,19 @@ void multiSlsDetector::setErrorMaskFromAllDetectors()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
std::string multiSlsDetector::concatResultOrPos(std::string (slsDetector::*somefunc)(int), int pos)
|
||||||
bool allElementsEqual(const std::vector<T>& v)
|
|
||||||
{
|
{
|
||||||
if (v.empty())
|
if (pos >= 0) {
|
||||||
return true;
|
if (detectors[pos])
|
||||||
|
return (detectors[pos]->*somefunc)(pos);
|
||||||
const T& first = v[0];
|
} else {
|
||||||
for (int i = 1; i != v.size(); ++i) {
|
std::string s;
|
||||||
if (v[i] != first)
|
for (int i = 0; i < thisMultiDetector->numberOfDetectors; ++i) {
|
||||||
return false;
|
if (detectors[i])
|
||||||
|
s += (detectors[i]->*somefunc)(pos) + "+";
|
||||||
|
}
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -3718,21 +3637,7 @@ string multiSlsDetector::setNetworkParameter(networkParameter p, string s)
|
|||||||
|
|
||||||
int multiSlsDetector::setPort(portType t, int p)
|
int multiSlsDetector::setPort(portType t, int p)
|
||||||
{
|
{
|
||||||
|
return callDetectorMember(&slsDetector::setPort, t, p);
|
||||||
int ret = -100, ret1;
|
|
||||||
|
|
||||||
for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
|
|
||||||
if (detectors[idet]) {
|
|
||||||
ret1 = detectors[idet]->setPort(t, p);
|
|
||||||
if (detectors[idet]->getErrorMask())
|
|
||||||
setErrorMask(getErrorMask() | (1 << idet));
|
|
||||||
if (ret == -100)
|
|
||||||
ret = ret1;
|
|
||||||
else if (ret != ret1)
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::lockServer(int p)
|
int multiSlsDetector::lockServer(int p)
|
||||||
@ -5658,7 +5563,7 @@ void multiSlsDetector::readFrameFromReceiver()
|
|||||||
delete[] multigappixels;
|
delete[] multigappixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** eiger 4 bit mode */
|
// eiger 4 bit mode
|
||||||
int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage)
|
int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage)
|
||||||
{
|
{
|
||||||
int nxb = thisMultiDetector->numberOfDetector[X] * (512 + 3);
|
int nxb = thisMultiDetector->numberOfDetector[X] * (512 + 3);
|
||||||
@ -5789,7 +5694,7 @@ string multiSlsDetector::getReceiverLastClientIP()
|
|||||||
|
|
||||||
int multiSlsDetector::exitReceiver()
|
int multiSlsDetector::exitReceiver()
|
||||||
{
|
{
|
||||||
//(Erik) logic is flawed should return fail if any fails
|
//(Erik) logic is flawed should return fail if any fails?
|
||||||
int ival = FAIL, iv;
|
int ival = FAIL, iv;
|
||||||
for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
|
for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
|
||||||
if (detectors[idet]) {
|
if (detectors[idet]) {
|
||||||
@ -6048,8 +5953,7 @@ bool multiSlsDetector::isAcquireReady()
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int multiSlsDetector::checkVersionCompatibility(portType t)
|
||||||
|
{
|
||||||
int multiSlsDetector::checkVersionCompatibility(portType t) {
|
|
||||||
return parallelCallDetectorMember(&slsDetector::checkVersionCompatibility, t);
|
return parallelCallDetectorMember(&slsDetector::checkVersionCompatibility, t);
|
||||||
}
|
}
|
||||||
|
@ -1044,6 +1044,9 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
|
|
||||||
void setErrorMaskFromAllDetectors();
|
void setErrorMaskFromAllDetectors();
|
||||||
|
|
||||||
|
|
||||||
|
std::string concatResultOrPos(std::string (slsDetector::*somefunc)(int), int pos);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool allElemetsEqual(const std::vector<T>&);
|
bool allElemetsEqual(const std::vector<T>&);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user