mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
free fix WIP
This commit is contained in:
@ -18,21 +18,27 @@ void freeSharedMemory(int detectorId, int moduleId) {
|
|||||||
// single
|
// single
|
||||||
if (moduleId >= 0) {
|
if (moduleId >= 0) {
|
||||||
SharedMemory<sharedModule> moduleShm(detectorId, moduleId);
|
SharedMemory<sharedModule> moduleShm(detectorId, moduleId);
|
||||||
int numReceivers = 0, numReceivers2 = 0;
|
|
||||||
if (moduleShm.IsExisting()) {
|
if (moduleShm.IsExisting()) {
|
||||||
moduleShm.OpenSharedMemory();
|
moduleShm.OpenSharedMemory();
|
||||||
|
int numReceivers = 0, numReceivers2 = 0;
|
||||||
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
||||||
numReceivers = moduleShm()->numberOfReceivers;
|
numReceivers = moduleShm()->numberOfReceivers;
|
||||||
numReceivers2 = moduleShm()->numberOfReceivers2;
|
numReceivers2 = moduleShm()->numberOfReceivers2;
|
||||||
}
|
}
|
||||||
moduleShm.RemoveSharedMemory();
|
moduleShm.RemoveSharedMemory();
|
||||||
}
|
for (int iReceiver = 0; iReceiver < numReceivers; ++iReceiver) {
|
||||||
for (int iReceiver = 0; iReceiver < numReceivers + numReceivers2; ++iReceiver) {
|
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, 0, iReceiver);
|
||||||
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, iReceiver);
|
|
||||||
if (receiverShm.IsExisting()) {
|
if (receiverShm.IsExisting()) {
|
||||||
receiverShm.RemoveSharedMemory();
|
receiverShm.RemoveSharedMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int iReceiver = 0; iReceiver < numReceivers2; ++iReceiver) {
|
||||||
|
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, 1, iReceiver);
|
||||||
|
if (receiverShm.IsExisting()) {
|
||||||
|
receiverShm.RemoveSharedMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,21 +54,27 @@ void freeSharedMemory(int detectorId, int moduleId) {
|
|||||||
|
|
||||||
for (int iModule = 0; iModule < numDetectors; ++iModule) {
|
for (int iModule = 0; iModule < numDetectors; ++iModule) {
|
||||||
SharedMemory<sharedModule> moduleShm(detectorId, iModule);
|
SharedMemory<sharedModule> moduleShm(detectorId, iModule);
|
||||||
int numReceivers = 0, numReceivers2 = 0;
|
|
||||||
if (moduleShm.IsExisting()) {
|
if (moduleShm.IsExisting()) {
|
||||||
moduleShm.OpenSharedMemory();
|
moduleShm.OpenSharedMemory();
|
||||||
|
int numReceivers = 0, numReceivers2 = 0;
|
||||||
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
||||||
numReceivers = moduleShm()->numberOfReceivers;
|
numReceivers = moduleShm()->numberOfReceivers;
|
||||||
numReceivers2 = moduleShm()->numberOfReceivers2;
|
numReceivers2 = moduleShm()->numberOfReceivers2;
|
||||||
}
|
}
|
||||||
moduleShm.RemoveSharedMemory();
|
moduleShm.RemoveSharedMemory();
|
||||||
}
|
for (int iReceiver = 0; iReceiver < numReceivers; ++iReceiver) {
|
||||||
for (int iReceiver = 0; iReceiver < numReceivers + numReceivers2; ++iReceiver) {
|
SharedMemory<sharedModule> receiverShm(detectorId, iModule, 0, iReceiver);
|
||||||
SharedMemory<sharedModule> receiverShm(detectorId, iModule, iReceiver);
|
|
||||||
if (receiverShm.IsExisting()) {
|
if (receiverShm.IsExisting()) {
|
||||||
receiverShm.RemoveSharedMemory();
|
receiverShm.RemoveSharedMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int iReceiver = 0; iReceiver < numReceivers2; ++iReceiver) {
|
||||||
|
SharedMemory<sharedModule> receiverShm(detectorId, iModule, 1, iReceiver);
|
||||||
|
if (receiverShm.IsExisting()) {
|
||||||
|
receiverShm.RemoveSharedMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,21 +54,27 @@ void DetectorImpl::freeSharedMemory(int detectorId, int moduleId) {
|
|||||||
// single
|
// single
|
||||||
if (moduleId >= 0) {
|
if (moduleId >= 0) {
|
||||||
SharedMemory<sharedModule> moduleShm(detectorId, moduleId);
|
SharedMemory<sharedModule> moduleShm(detectorId, moduleId);
|
||||||
int numReceivers = 0, numReceivers2 = 0;
|
|
||||||
if (moduleShm.IsExisting()) {
|
if (moduleShm.IsExisting()) {
|
||||||
moduleShm.OpenSharedMemory();
|
moduleShm.OpenSharedMemory();
|
||||||
|
int numReceivers = 0, numReceivers2 = 0;
|
||||||
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
||||||
numReceivers = moduleShm()->numberOfReceivers;
|
numReceivers = moduleShm()->numberOfReceivers;
|
||||||
numReceivers2 = moduleShm()->numberOfReceivers2;
|
numReceivers2 = moduleShm()->numberOfReceivers2;
|
||||||
}
|
}
|
||||||
moduleShm.RemoveSharedMemory();
|
moduleShm.RemoveSharedMemory();
|
||||||
}
|
for (int iReceiver = 0; iReceiver < numReceivers; ++iReceiver) {
|
||||||
for (int iReceiver = 0; iReceiver < numReceivers + numReceivers2; ++iReceiver) {
|
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, 0, iReceiver);
|
||||||
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, iReceiver);
|
|
||||||
if (receiverShm.IsExisting()) {
|
if (receiverShm.IsExisting()) {
|
||||||
receiverShm.RemoveSharedMemory();
|
receiverShm.RemoveSharedMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int iReceiver = 0; iReceiver < numReceivers2; ++iReceiver) {
|
||||||
|
SharedMemory<sharedModule> receiverShm(detectorId, moduleId, 1, iReceiver);
|
||||||
|
if (receiverShm.IsExisting()) {
|
||||||
|
receiverShm.RemoveSharedMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,21 +90,27 @@ void DetectorImpl::freeSharedMemory(int detectorId, int moduleId) {
|
|||||||
|
|
||||||
for (int iModule = 0; iModule < numDetectors; ++iModule) {
|
for (int iModule = 0; iModule < numDetectors; ++iModule) {
|
||||||
SharedMemory<sharedModule> moduleShm(detectorId, iModule);
|
SharedMemory<sharedModule> moduleShm(detectorId, iModule);
|
||||||
int numReceivers = 0, numReceivers2 = 0;
|
|
||||||
if (moduleShm.IsExisting()) {
|
if (moduleShm.IsExisting()) {
|
||||||
moduleShm.OpenSharedMemory();
|
moduleShm.OpenSharedMemory();
|
||||||
|
int numReceivers = 0, numReceivers2 = 0;
|
||||||
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
if (Module::hasSharedMemoryReceiverList(moduleShm()->shmversion)) {
|
||||||
numReceivers = moduleShm()->numberOfReceivers;
|
numReceivers = moduleShm()->numberOfReceivers;
|
||||||
numReceivers2 = moduleShm()->numberOfReceivers2;
|
numReceivers2 = moduleShm()->numberOfReceivers2;
|
||||||
}
|
}
|
||||||
moduleShm.RemoveSharedMemory();
|
moduleShm.RemoveSharedMemory();
|
||||||
}
|
for (int iReceiver = 0; iReceiver < numReceivers; ++iReceiver) {
|
||||||
for (int iReceiver = 0; iReceiver < numReceivers + numReceivers2; ++iReceiver) {
|
SharedMemory<sharedModule> receiverShm(detectorId, iModule, 0, iReceiver);
|
||||||
SharedMemory<sharedModule> receiverShm(detectorId, iModule, iReceiver);
|
|
||||||
if (receiverShm.IsExisting()) {
|
if (receiverShm.IsExisting()) {
|
||||||
receiverShm.RemoveSharedMemory();
|
receiverShm.RemoveSharedMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int iReceiver = 0; iReceiver < numReceivers2; ++iReceiver) {
|
||||||
|
SharedMemory<sharedModule> receiverShm(detectorId, iModule, 1, iReceiver);
|
||||||
|
if (receiverShm.IsExisting()) {
|
||||||
|
receiverShm.RemoveSharedMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ sls::MacAddr Receiver::configure(slsDetectorDefs::rxParameters arg) {
|
|||||||
arg.udpInterfaces = 2;
|
arg.udpInterfaces = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(logDEBUG1)
|
LOG(logINFO)
|
||||||
<< "detType:" << arg.detType << std::endl
|
<< "detType:" << arg.detType << std::endl
|
||||||
<< "detectorSize.x:" << arg.detectorSize.x << std::endl
|
<< "detectorSize.x:" << arg.detectorSize.x << std::endl
|
||||||
<< "detectorSize.y:" << arg.detectorSize.y << std::endl
|
<< "detectorSize.y:" << arg.detectorSize.y << std::endl
|
||||||
|
Reference in New Issue
Block a user