mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
rxr sls namespace (#457)
* rxr src files and classes (detectordata, ZmqSocket) added to sls namespace * moving defines inside namespace * moving defines inside namespace, added helpdacs to namespace * added namespace to gui * gui also updated * removed unnecessary sls:: when already in sls namespace for slsDetectoSoftware, receverSoftware, slsDetectorGui and slsSupportlib
This commit is contained in:
@ -6,6 +6,8 @@
|
||||
#include <chrono>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
// gettid added in glibc 2.30
|
||||
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30
|
||||
#include <sys/syscall.h>
|
||||
@ -16,7 +18,7 @@ void Arping::SetInterfacesAndIps(const int index, const std::string &interface,
|
||||
const std::string &ip) {
|
||||
|
||||
if (interface.empty() || ip.empty()) {
|
||||
throw sls::RuntimeError("Could not arping. Interface name and ip not "
|
||||
throw RuntimeError("Could not arping. Interface name and ip not "
|
||||
"set up for interface " +
|
||||
std::to_string(index));
|
||||
}
|
||||
@ -38,7 +40,7 @@ void Arping::StartThread() {
|
||||
try {
|
||||
t = std::thread(&Arping::ThreadExecution, this);
|
||||
} catch (...) {
|
||||
throw sls::RuntimeError("Could not start arping thread");
|
||||
throw RuntimeError("Could not start arping thread");
|
||||
}
|
||||
runningFlag = true;
|
||||
}
|
||||
@ -74,13 +76,13 @@ void Arping::ThreadExecution() {
|
||||
void Arping::TestCommands() {
|
||||
// atleast one interface must be set up
|
||||
if (commands[0].empty()) {
|
||||
throw sls::RuntimeError(
|
||||
throw RuntimeError(
|
||||
"Could not arping. Interface not set up in apring thread");
|
||||
}
|
||||
// test if arping commands throw an error
|
||||
std::string error = ExecuteCommands();
|
||||
if (!error.empty()) {
|
||||
throw sls::RuntimeError(error);
|
||||
throw RuntimeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,4 +119,6 @@ std::string Arping::ExecuteCommands() {
|
||||
}
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user