rxr: warnings shouldnt throw exception

This commit is contained in:
maliakal_d 2019-11-29 11:09:41 +01:00
parent 1d6be74ee5
commit 2ece6b945e
7 changed files with 21 additions and 19 deletions

View File

@ -268,7 +268,7 @@ void ClientInterface::VerifyLock() {
void ClientInterface::VerifyIdle(Interface &socket) { void ClientInterface::VerifyIdle(Interface &socket) {
if (impl()->getStatus() != IDLE) { if (impl()->getStatus() != IDLE) {
std::ostringstream oss; std::ostringstream oss;
oss << "Can not execute " << GetFunctionNameFromEnum((enum detFuncs)fnum) oss << "Can not execute " << getFunctionNameFromEnum((enum detFuncs)fnum)
<< " when receiver is not idle"; << " when receiver is not idle";
throw sls::SocketError(oss.str()); throw sls::SocketError(oss.str());
} }
@ -286,7 +286,7 @@ int ClientInterface::exec_command(Interface &socket) {
if (!pipe) { if (!pipe) {
throw RuntimeError("Executing Command failed\n"); throw RuntimeError("Executing Command failed\n");
} else { } else {
while (!feof(pipe.Get())) { while (!feof(pipe.get())) {
if (fgets(temp.data(), tempsize, pipe.get()) != nullptr) if (fgets(temp.data(), tempsize, pipe.get()) != nullptr)
sresult += temp.data(); sresult += temp.data();
} }

View File

@ -159,10 +159,13 @@ void DataProcessor::SetThreadPriority(int priority) {
struct sched_param param; struct sched_param param;
param.sched_priority = priority; param.sched_priority = priority;
if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) { if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) {
throw sls::RuntimeError("Could not prioritize dataprocessing threads. " if (!index) {
"(No Root Privileges?)"); FILE_LOG(logWARNING) << "Could not prioritize dataprocessing thread. "
"(No Root Privileges?)";
}
} else {
FILE_LOG(logINFO) << "Priorities set - DataProcessor: " << priority;
} }
FILE_LOG(logINFO) << "Processor Thread Priority set to " << priority;
} }

View File

@ -108,10 +108,13 @@ void DataStreamer::SetThreadPriority(int priority) {
struct sched_param param; struct sched_param param;
param.sched_priority = priority; param.sched_priority = priority;
if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) { if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) {
throw sls::RuntimeError("Could not prioritize datastreaming threads. " if (!index) {
"(No Root Privileges?)"); FILE_LOG(logWARNING) << "Could not prioritize datastreaming thread. "
"(No Root Privileges?)";
}
} else {
FILE_LOG(logINFO) << "Priorities set - DataStreamer: " << priority;
} }
FILE_LOG(logINFO) << "Streamer Thread Priority set to " << priority;
} }
void DataStreamer::SetNumberofDetectors(int* nd) { void DataStreamer::SetNumberofDetectors(int* nd) {

View File

@ -161,16 +161,9 @@ void Implementation::SetLocalNetworkParameters() {
void Implementation::SetThreadPriorities() { void Implementation::SetThreadPriorities() {
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called"; FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
for (const auto &it : listener) { for (const auto &it : listener) {
it->SetThreadPriority(LISTENER_PRIORITY); it->SetThreadPriority(LISTENER_PRIORITY);
} }
std::ostringstream osfn;
osfn << "Priorities set - "
"Listener:"
<< LISTENER_PRIORITY;
FILE_LOG(logINFO) << osfn.str();
} }
void Implementation::SetupFifoStructure() { void Implementation::SetupFifoStructure() {

View File

@ -157,10 +157,13 @@ void Listener::SetThreadPriority(int priority) {
struct sched_param param; struct sched_param param;
param.sched_priority = priority; param.sched_priority = priority;
if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) { if (pthread_setschedparam(thread, SCHED_FIFO, &param) == EPERM) {
throw sls::RuntimeError("Could not prioritize listener threads. " if (!index) {
"(No Root Privileges?)"); FILE_LOG(logWARNING) << "Could not prioritize listener thread. "
"(No Root Privileges?)";
}
} else {
FILE_LOG(logINFO) << "Priorities set - Listener: " << priority;
} }
FILE_LOG(logINFO) << "Listener Thread Priority set to " << priority;
} }
void Listener::CreateUDPSockets() { void Listener::CreateUDPSockets() {

View File

@ -4,9 +4,9 @@
#define APIRECEIVER 0x190722 #define APIRECEIVER 0x190722
#define APIGUI 0x190723 #define APIGUI 0x190723
#define APIMOENCH 0x190820 #define APIMOENCH 0x190820
#define APIEIGER 0x191111
#define APIGOTTHARD2 0x191127 #define APIGOTTHARD2 0x191127
#define APIMYTHEN3 0x191127 #define APIMYTHEN3 0x191127
#define APICTB 0x191127 #define APICTB 0x191127
#define APIGOTTHARD 0x191127 #define APIGOTTHARD 0x191127
#define APIJUNGFRAU 0x191127 #define APIJUNGFRAU 0x191127
#define APIEIGER 0x191129