house keeping

This commit is contained in:
Erik Frojdh 2020-08-06 16:50:29 +02:00
parent 78fdf5b60a
commit 8af1183220

View File

@ -672,7 +672,7 @@ std::string Module::printReceiverConfiguration() {
} }
bool Module::getTenGiga() const { bool Module::getTenGiga() const {
return static_cast<bool>(sendToDetector<int>(F_ENABLE_TEN_GIGA, GET_FLAG)); return sendToDetector<int>(F_ENABLE_TEN_GIGA, GET_FLAG);
} }
void Module::setTenGiga(bool value) { void Module::setTenGiga(bool value) {
@ -854,7 +854,7 @@ void Module::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) {
} }
bool Module::getReceiverLock() const { bool Module::getReceiverLock() const {
return static_cast<bool>(sendToReceiver<int>(F_LOCK_RECEIVER, GET_FLAG)); return sendToReceiver<int>(F_LOCK_RECEIVER, GET_FLAG);
} }
void Module::setReceiverLock(bool lock) { void Module::setReceiverLock(bool lock) {
@ -1103,8 +1103,7 @@ std::string Module::setSettingsDir(const std::string &dir) {
} }
bool Module::getParallelMode() const { bool Module::getParallelMode() const {
auto r = sendToDetector<int>(F_GET_PARALLEL_MODE); return sendToDetector<int>(F_GET_PARALLEL_MODE);
return static_cast<bool>(r);
} }
void Module::setParallelMode(const bool enable) { void Module::setParallelMode(const bool enable) {
@ -1112,8 +1111,7 @@ void Module::setParallelMode(const bool enable) {
} }
bool Module::getOverFlowMode() const { bool Module::getOverFlowMode() const {
auto r = sendToDetector<int>(F_GET_OVERFLOW_MODE); return sendToDetector<int>(F_GET_OVERFLOW_MODE);
return static_cast<bool>(r);
} }
void Module::setOverFlowMode(const bool enable) { void Module::setOverFlowMode(const bool enable) {
@ -1189,8 +1187,7 @@ void Module::setReadNLines(const int value) {
} }
bool Module::getInterruptSubframe() const { bool Module::getInterruptSubframe() const {
auto r = sendToDetector<int>(F_GET_INTERRUPT_SUBFRAME); return sendToDetector<int>(F_GET_INTERRUPT_SUBFRAME);
return static_cast<bool>(r);
} }
void Module::setInterruptSubframe(const bool enable) { void Module::setInterruptSubframe(const bool enable) {
@ -2277,7 +2274,7 @@ void Module::setStopPort(int port_number) {
} }
bool Module::getLockDetector() const { bool Module::getLockDetector() const {
return static_cast<bool>(sendToDetector<int>(F_LOCK_SERVER, GET_FLAG)); return sendToDetector<int>(F_LOCK_SERVER, GET_FLAG);
} }
void Module::setLockDetector(bool lock) { void Module::setLockDetector(bool lock) {
@ -3169,13 +3166,12 @@ void Module::programFPGAviaBlackfin(std::vector<char> buffer) {
} }
void Module::programFPGAviaNios(std::vector<char> buffer) { void Module::programFPGAviaNios(std::vector<char> buffer) {
uint64_t filesize = buffer.size();
LOG(logINFO) << "Sending programming binary (from rbf) to detector " LOG(logINFO) << "Sending programming binary (from rbf) to detector "
<< moduleId << " (" << shm()->hostname << ")"; << moduleId << " (" << shm()->hostname << ")";
auto client = DetectorSocket(shm()->hostname, shm()->controlPort); auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
client.Send(F_PROGRAM_FPGA); client.Send(F_PROGRAM_FPGA);
// filesize uint64_t filesize = buffer.size();
client.Send(filesize); client.Send(filesize);
if (client.Receive<int>() == FAIL) { if (client.Receive<int>() == FAIL) {
std::ostringstream os; std::ostringstream os;
@ -3183,7 +3179,6 @@ void Module::programFPGAviaNios(std::vector<char> buffer) {
<< " returned error: " << client.readErrorMessage(); << " returned error: " << client.readErrorMessage();
throw RuntimeError(os.str()); throw RuntimeError(os.str());
} }
// program
client.Send(buffer); client.Send(buffer);
if (client.Receive<int>() == FAIL) { if (client.Receive<int>() == FAIL) {
std::ostringstream os; std::ostringstream os;