mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
WIP
This commit is contained in:
@ -121,11 +121,15 @@ Result<bool> Detector::getFileOverWrite(Positions pos) const {
|
||||
}
|
||||
|
||||
// dhanya
|
||||
Result<void> Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
||||
int Detector::getMultiId() const {
|
||||
pimpl->getMultiId());
|
||||
}
|
||||
|
||||
void Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
||||
pimpl->Parallel(&slsDetector::checkDetectorVersionCompatibility, pos);
|
||||
}
|
||||
|
||||
Result<void> Detector::checkReceiverVersionCompatibility(Positions pos) const {
|
||||
void Detector::checkReceiverVersionCompatibility(Positions pos) const {
|
||||
pimpl->Parallel(&slsDetector::checkReceiverVersionCompatibility, pos);
|
||||
}
|
||||
|
||||
@ -141,12 +145,31 @@ Result<int64_t> Detector::getDetectorSerialNumber(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, DETECTOR_SERIAL_NUMBER, pos);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getClientSoftwareVersion() const {
|
||||
return APILIB;
|
||||
}
|
||||
Result<int64_t> Detector::getClientSoftwareVersion() const { return APILIB; }
|
||||
|
||||
Result<int64_t> Detector::getReceiverSoftwareVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
||||
}
|
||||
|
||||
std::string Detector::getUserDetails() const {
|
||||
return pimpl->getUserDetails();
|
||||
}
|
||||
|
||||
void Detector::setHostname(const std::vector<std::string> &name,
|
||||
Positions pos) {
|
||||
pimpl->setHostname(name);
|
||||
}
|
||||
|
||||
detectorType Detector::getDetectorTypeAsEnum() const {
|
||||
return pimpl->getDetectorTypeAsEnum();
|
||||
}
|
||||
|
||||
Result<detectorType> Detector::getDetectorTypeAsEnum(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
||||
}
|
||||
|
||||
Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||
}
|
||||
|
||||
} // namespace sls
|
@ -30,7 +30,7 @@
|
||||
using namespace sls;
|
||||
|
||||
multiSlsDetector::multiSlsDetector(int multi_id, bool verify, bool update)
|
||||
: multiId(multi_id), multi_shm(multi_id, -1) {
|
||||
: multiId(multi_id), multiDetType(GENERIC), multi_shm(multi_id, -1) {
|
||||
setupMultiDetector(verify, update);
|
||||
}
|
||||
|
||||
@ -332,6 +332,11 @@ void multiSlsDetector::initializeDetectorStructure() {
|
||||
|
||||
void multiSlsDetector::initializeMembers(bool verify) {
|
||||
// multiSlsDetector
|
||||
if (multi_shm()->numberOfDetectors == 0) {
|
||||
multiDetType = GENERIC;
|
||||
} else {
|
||||
multiDetType = getDetectorTypeAsEnum();
|
||||
}
|
||||
zmqSocket.clear();
|
||||
|
||||
// get objects from single det shared memory (open)
|
||||
@ -385,6 +390,22 @@ std::string multiSlsDetector::exec(const char *cmd) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void multiSlsDetector::setHostname(const std::vector<std::string> &name) {
|
||||
// this check is there only to allow the previous detsizechan command
|
||||
if (multi_shm()->numberOfDetectors != 0) {
|
||||
FILE_LOG(logWARNING)
|
||||
<< "There are already detector(s) in shared memory."
|
||||
"Freeing Shared memory now.";
|
||||
freeSharedMemory();
|
||||
setupMultiDetector();
|
||||
}
|
||||
for (const auto &hostname : name) {
|
||||
addSlsDetector(hostname);
|
||||
}
|
||||
|
||||
updateOffsets();
|
||||
}
|
||||
|
||||
void multiSlsDetector::setHostname(const char *name, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
@ -461,6 +482,10 @@ void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
||||
detectors.back()->getTotalNumberOfChannels();
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
||||
return multiDetType;
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorType
|
||||
multiSlsDetector::getDetectorTypeAsEnum(int detPos) {
|
||||
// single
|
||||
@ -842,6 +867,12 @@ void multiSlsDetector::readConfigurationFile(const std::string &fname) {
|
||||
}
|
||||
}
|
||||
input_file.close();
|
||||
|
||||
if (multi_shm()->numberOfDetectors == 0) {
|
||||
multiDetType = GENERIC;
|
||||
} else {
|
||||
multiDetType = getDetectorTypeAsEnum();
|
||||
}
|
||||
}
|
||||
|
||||
int multiSlsDetector::writeConfigurationFile(const std::string &fname) {
|
||||
|
Reference in New Issue
Block a user