partial clean

This commit is contained in:
Erik Frojdh 2020-08-04 17:00:20 +02:00
parent a70d4e1e5d
commit 857aa47ee7
3 changed files with 11 additions and 37 deletions

View File

@ -2609,7 +2609,7 @@ void Module::sendToReceiver(int fnum, const void *args, size_t args_size,
}
template <typename Arg, typename Ret>
void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) {
void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) const{
LOG(logDEBUG1) << "Sending to Receiver: ["
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
<< ", " << args << ", " << sizeof(args) << ", "
@ -2621,7 +2621,7 @@ void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) {
}
template <typename Arg, typename Ret>
void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) const {
void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) {
static_cast<const Module &>(*this).sendToReceiver(fnum, args, retval);
}

View File

@ -866,8 +866,7 @@ int ClientInterface::get_missing_packets(Interface &socket) {
auto size = static_cast<int>(missing_packets.size());
socket.Send(OK);
socket.Send(size);
socket.Send(missing_packets.data(),
sizeof(missing_packets[0]) * missing_packets.size());
socket.Send(missing_packets);
return OK;
}
@ -1270,9 +1269,6 @@ int ClientInterface::set_discard_policy(Interface &socket) {
verifyIdle(socket);
LOG(logDEBUG1) << "Setting frames discard policy: " << index;
impl()->setFrameDiscardPolicy(static_cast<frameDiscardPolicy>(index));
int retval = impl()->getFrameDiscardPolicy();
validate(index, retval, "set discard policy", DEC);
LOG(logDEBUG1) << "frame discard policy:" << retval;
return socket.Send(OK);
}
@ -1290,10 +1286,6 @@ int ClientInterface::set_padding_enable(Interface &socket) {
verifyIdle(socket);
LOG(logDEBUG1) << "Setting frames padding enable: " << index;
impl()->setFramePaddingEnable(static_cast<bool>(index));
auto retval = static_cast<int>(impl()->getFramePaddingEnable());
validate(index, retval, "set frame padding enable", DEC);
LOG(logDEBUG1) << "Frame Padding Enable:" << retval;
return socket.Send(OK);
}
@ -1614,12 +1606,10 @@ int ClientInterface::set_additional_json_parameter(Interface &socket) {
}
int ClientInterface::get_additional_json_parameter(Interface &socket) {
char arg[SHORT_STR_LENGTH]{};
socket.Receive(arg);
char retval[SHORT_STR_LENGTH]{};
sls::strcpy_safe(retval, impl()->getAdditionalJsonParameter(arg).c_str());
LOG(logDEBUG1) << "additional json parameter (" << arg << "):" << retval;
return socket.sendResult(retval);
std::string key = socket.Receive(SHORT_STR_LENGTH);
std::string value = impl()->getAdditionalJsonParameter(key);
value.resize(SHORT_STR_LENGTH);
return socket.sendResult(value);
}
int ClientInterface::get_progress(Interface &socket) {
@ -1691,9 +1681,6 @@ int ClientInterface::set_streaming_start_fnum(Interface &socket) {
verifyIdle(socket);
LOG(logDEBUG1) << "Setting streaming start fnum: " << index;
impl()->setStreamingStartingFrameNumber(index);
int retval = impl()->getStreamingStartingFrameNumber();
validate(index, retval, "set streaming start fnum", DEC);
return socket.Send(OK);
}
@ -1705,7 +1692,7 @@ int ClientInterface::set_rate_correct(Interface &socket) {
}
LOG(logDEBUG) << "Number of detectors for rate correction: " << index;
std::vector<int64_t> t(index);
socket.Receive(t.data(), t.size() * sizeof(t[0]));
socket.Receive(t);
verifyIdle(socket);
LOG(logINFOBLUE) << "Setting rate corrections[" << index << ']';
impl()->setRateCorrections(t);

View File

@ -427,27 +427,20 @@ void Implementation::setFifoDepth(const uint32_t i) {
slsDetectorDefs::frameDiscardPolicy
Implementation::getFrameDiscardPolicy() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return frameDiscardMode;
}
void Implementation::setFrameDiscardPolicy(const frameDiscardPolicy i) {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
if (i >= 0 && i < NUM_DISCARD_POLICIES)
frameDiscardMode = i;
frameDiscardMode = i;
LOG(logINFO) << "Frame Discard Policy: " << sls::ToString(frameDiscardMode);
}
bool Implementation::getFramePaddingEnable() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return framePadding;
}
void Implementation::setFramePaddingEnable(const bool i) {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
framePadding = i;
LOG(logINFO) << "Frame Padding: " << framePadding;
}
@ -1273,14 +1266,11 @@ uint32_t Implementation::getStreamingStartingFrameNumber() const {
}
void Implementation::setStreamingStartingFrameNumber(const uint32_t fnum) {
if (streamingStartFnum != fnum) {
streamingStartFnum = fnum;
}
streamingStartFnum = fnum;
LOG(logINFO) << "Streaming Start Frame num: " << streamingStartFnum;
}
uint32_t Implementation::getStreamingPort() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return streamingPort;
}
@ -1291,19 +1281,16 @@ void Implementation::setStreamingPort(const uint32_t i) {
}
sls::IpAddr Implementation::getStreamingSourceIP() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return streamingSrcIP;
}
void Implementation::setStreamingSourceIP(const sls::IpAddr ip) {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
streamingSrcIP = ip;
LOG(logINFO) << "Streaming Source IP: " << streamingSrcIP;
}
std::map<std::string, std::string>
Implementation::getAdditionalJsonHeader() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return additionalJsonHeader;
}