mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
renaming sls and detectors to modules, multis to detector
This commit is contained in:
@ -17,29 +17,29 @@
|
||||
|
||||
namespace sls {
|
||||
|
||||
void freeSharedMemory(int multiId, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
SharedMemory<sharedSlsDetector> temp_shm(multiId, detPos);
|
||||
if (temp_shm.IsExisting()) {
|
||||
temp_shm.RemoveSharedMemory();
|
||||
void freeSharedMemory(int detectorIndex, int moduleIndex) {
|
||||
// single module
|
||||
if (moduleIndex >= 0) {
|
||||
SharedMemory<sharedModule> moduleShm(detectorIndex, moduleIndex);
|
||||
if (moduleShm.IsExisting()) {
|
||||
moduleShm.RemoveSharedMemory();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// multi - get number of detectors from shm
|
||||
SharedMemory<sharedMultiSlsDetector> multiShm(multiId, -1);
|
||||
// detector - multi module - get number of detectors from shm
|
||||
SharedMemory<sharedDetector> detectorShm(detectorIndex, -1);
|
||||
int numDetectors = 0;
|
||||
|
||||
if (multiShm.IsExisting()) {
|
||||
multiShm.OpenSharedMemory();
|
||||
numDetectors = multiShm()->numberOfDetectors;
|
||||
multiShm.RemoveSharedMemory();
|
||||
if (detectorShm.IsExisting()) {
|
||||
detectorShm.OpenSharedMemory();
|
||||
numDetectors = detectorShm()->numberOfModules;
|
||||
detectorShm.RemoveSharedMemory();
|
||||
}
|
||||
|
||||
for (int i = 0; i < numDetectors; ++i) {
|
||||
SharedMemory<sharedSlsDetector> shm(multiId, i);
|
||||
shm.RemoveSharedMemory();
|
||||
SharedMemory<sharedModule> moduleShm(detectorIndex, i);
|
||||
moduleShm.RemoveSharedMemory();
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ void Detector::setVirtualDetectorServers(int numServers, int startingPort) {
|
||||
pimpl->setVirtualDetectorServers(numServers, startingPort);
|
||||
}
|
||||
|
||||
int Detector::getShmId() const { return pimpl->getMultiId(); }
|
||||
int Detector::getShmId() const { return pimpl->getDetectorIndex(); }
|
||||
|
||||
std::string Detector::getPackageVersion() const { return GITBRANCH; }
|
||||
|
||||
@ -136,7 +136,7 @@ int Detector::size() const { return pimpl->size(); }
|
||||
bool Detector::empty() const { return pimpl->size() == 0; }
|
||||
|
||||
defs::xy Detector::getModuleGeometry() const {
|
||||
return pimpl->getNumberOfDetectors();
|
||||
return pimpl->getNumberOfModules();
|
||||
}
|
||||
|
||||
Result<defs::xy> Detector::getModuleSize(Positions pos) const {
|
||||
|
Reference in New Issue
Block a user