mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
multidet to multi shm
This commit is contained in:
parent
eec7b22582
commit
21046bcae0
@ -15,7 +15,8 @@ class detectorData;
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define MULTI_SHMVERSION 0x190726
|
#define MULTI_SHMAPIVERSION 0x190807
|
||||||
|
#define MULTI_SHMVERSION 0x190807
|
||||||
#define SHORT_STRING_LENGTH 50
|
#define SHORT_STRING_LENGTH 50
|
||||||
#define DATE_LENGTH 30
|
#define DATE_LENGTH 30
|
||||||
|
|
||||||
@ -46,6 +47,9 @@ struct sharedMultiSlsDetector {
|
|||||||
/** number of sls detectors in shared memory */
|
/** number of sls detectors in shared memory */
|
||||||
int numberOfDetectors;
|
int numberOfDetectors;
|
||||||
|
|
||||||
|
/** multi detector type */
|
||||||
|
slsDetectorDefs::detectorType multiDetectorType;
|
||||||
|
|
||||||
/** END OF FIXED PATTERN
|
/** END OF FIXED PATTERN
|
||||||
* -----------------------------------------------*/
|
* -----------------------------------------------*/
|
||||||
|
|
||||||
@ -2347,9 +2351,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
/** Multi detector Id */
|
/** Multi detector Id */
|
||||||
const int multiId{0};
|
const int multiId{0};
|
||||||
|
|
||||||
/** multi detector type */
|
|
||||||
detectorType multiDetType;
|
|
||||||
|
|
||||||
/** Shared Memory object */
|
/** Shared Memory object */
|
||||||
sls::SharedMemory<sharedMultiSlsDetector> multi_shm{0, -1};
|
sls::SharedMemory<sharedMultiSlsDetector> multi_shm{0, -1};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
using namespace sls;
|
using namespace sls;
|
||||||
|
|
||||||
multiSlsDetector::multiSlsDetector(int multi_id, bool verify, bool update)
|
multiSlsDetector::multiSlsDetector(int multi_id, bool verify, bool update)
|
||||||
: multiId(multi_id), multiDetType(GENERIC), multi_shm(multi_id, -1) {
|
: multiId(multi_id), multi_shm(multi_id, -1) {
|
||||||
setupMultiDetector(verify, update);
|
setupMultiDetector(verify, update);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,9 +236,16 @@ std::string multiSlsDetector::getUserDetails() {
|
|||||||
sstream << (d->isFixedPatternSharedMemoryCompatible() ? d->getHostname() : "Unknown") << "+";
|
sstream << (d->isFixedPatternSharedMemoryCompatible() ? d->getHostname() : "Unknown") << "+";
|
||||||
}
|
}
|
||||||
sstream << "\nType: ";
|
sstream << "\nType: ";
|
||||||
|
// get type from multi shm
|
||||||
|
if (multi_shm()->shmversion >= MULTI_SHMAPIVERSION) {
|
||||||
|
sstream << slsDetectorDefs::detectorTypeToString(getDetectorTypeAsEnum());
|
||||||
|
}
|
||||||
|
// get type from slsdet shm
|
||||||
|
else {
|
||||||
for (auto &d : detectors) {
|
for (auto &d : detectors) {
|
||||||
sstream << (d->isFixedPatternSharedMemoryCompatible() ? d->getDetectorTypeAsString() : "Unknown") << "+";
|
sstream << (d->isFixedPatternSharedMemoryCompatible() ? d->getDetectorTypeAsString() : "Unknown") << "+";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sstream << "\nPID: " << multi_shm()->lastPID
|
sstream << "\nPID: " << multi_shm()->lastPID
|
||||||
<< "\nUser: " << multi_shm()->lastUser
|
<< "\nUser: " << multi_shm()->lastUser
|
||||||
@ -268,6 +275,7 @@ void multiSlsDetector::initSharedMemory(bool verify) {
|
|||||||
void multiSlsDetector::initializeDetectorStructure() {
|
void multiSlsDetector::initializeDetectorStructure() {
|
||||||
multi_shm()->shmversion = MULTI_SHMVERSION;
|
multi_shm()->shmversion = MULTI_SHMVERSION;
|
||||||
multi_shm()->numberOfDetectors = 0;
|
multi_shm()->numberOfDetectors = 0;
|
||||||
|
multi_shm()->multiDetectorType = GENERIC;
|
||||||
multi_shm()->numberOfDetector[X] = 0;
|
multi_shm()->numberOfDetector[X] = 0;
|
||||||
multi_shm()->numberOfDetector[Y] = 0;
|
multi_shm()->numberOfDetector[Y] = 0;
|
||||||
multi_shm()->dataBytes = 0;
|
multi_shm()->dataBytes = 0;
|
||||||
@ -465,7 +473,7 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
|
|||||||
multi_shm()->numberOfChannels += detectors[pos]->getTotalNumberOfChannels();
|
multi_shm()->numberOfChannels += detectors[pos]->getTotalNumberOfChannels();
|
||||||
|
|
||||||
detectors[pos]->setHostname(hostname);
|
detectors[pos]->setHostname(hostname);
|
||||||
multiDetType = getDetectorTypeAsEnum();
|
multi_shm()->multiDetectorType = getDetectorTypeAsEnum(-1);// -1 needed here
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
||||||
@ -476,10 +484,11 @@ void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
|||||||
detectors.back()->getDataBytesInclGapPixels();
|
detectors.back()->getDataBytesInclGapPixels();
|
||||||
multi_shm()->numberOfChannels +=
|
multi_shm()->numberOfChannels +=
|
||||||
detectors.back()->getTotalNumberOfChannels();
|
detectors.back()->getTotalNumberOfChannels();
|
||||||
|
multi_shm()->multiDetectorType = getDetectorTypeAsEnum(-1);// -1 needed here
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
||||||
return multiDetType;
|
return multi_shm()->multiDetectorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorType
|
slsDetectorDefs::detectorType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user