This commit is contained in:
2019-08-07 15:23:58 +02:00
parent 615835f03d
commit 6a71e61c12
4 changed files with 125 additions and 18 deletions

View File

@ -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

View File

@ -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) {