mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
merge fix
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "Implementation.h"
|
||||
#include "Arping.h"
|
||||
#include "DataProcessor.h"
|
||||
#include "DataStreamer.h"
|
||||
#include "Fifo.h"
|
||||
#include "GeneralData.h"
|
||||
#include "Listener.h"
|
||||
#include "MasterAttributes.h"
|
||||
#include "ThreadArping.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/ZmqSocket.h" //just for the zmq port define
|
||||
#include "sls/file_utils.h"
|
||||
@ -109,8 +109,8 @@ void Implementation::SetupFifoStructure() {
|
||||
|
||||
void Implementation::setDetectorType(const detectorType d) {
|
||||
|
||||
// object to create threads to arping
|
||||
threadArping = sls::make_unique<ThreadArping>();
|
||||
// object to create thread for arping
|
||||
arping = sls::make_unique<Arping>();
|
||||
|
||||
detType = d;
|
||||
switch (detType) {
|
||||
@ -325,30 +325,31 @@ std::array<pid_t, NUM_RX_THREAD_IDS> Implementation::getThreadIds() const {
|
||||
retval[id++] = 0;
|
||||
}
|
||||
}
|
||||
if (threadArping->IsRunning()) {
|
||||
retval[NUM_RX_THREAD_IDS - 1] = threadArping->GetThreadId();
|
||||
}
|
||||
retval[NUM_RX_THREAD_IDS - 1] = arping->GetThreadId();
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool Implementation::getArping() const { return threadArping->IsRunning(); }
|
||||
bool Implementation::getArping() const { return arping->IsRunning(); }
|
||||
|
||||
pid_t Implementation::getArpingThreadId() const {
|
||||
return threadArping->GetThreadId();
|
||||
return arping->GetThreadId();
|
||||
}
|
||||
|
||||
void Implementation::setArping(const bool i,
|
||||
const std::vector<std::string> ips) {
|
||||
if (i != threadArping->IsRunning()) {
|
||||
if (i != arping->IsRunning()) {
|
||||
if (!i) {
|
||||
threadArping->StopRunning();
|
||||
arping->StopThread();
|
||||
} else {
|
||||
threadArping->ClearIpsAndInterfaces();
|
||||
threadArping->AddIpsAndInterfaces(eth[0], ips[0]);
|
||||
if (numUDPInterfaces == 2 && detType != EIGER) {
|
||||
threadArping->AddIpsAndInterfaces(eth[1], ips[1]);
|
||||
// setup interface
|
||||
for (int i = 0; i != numUDPInterfaces; ++i) {
|
||||
// ignore eiger with 2 interfaces (only udp port)
|
||||
if (i == 1 && (numUDPInterfaces == 1 || detType == EIGER)) {
|
||||
break;
|
||||
}
|
||||
arping->SetInterfacesAndIps(i, eth[i], ips[i]);
|
||||
}
|
||||
threadArping->StartRunning();
|
||||
arping->StartThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user