removed unused multi functions

This commit is contained in:
2019-10-30 18:20:16 +01:00
parent ba3bc9c408
commit ba9a0c7917
15 changed files with 157 additions and 3737 deletions

View File

@ -1167,12 +1167,12 @@ int set_dac(int file_des) {
if (val != -1) { if (val != -1) {
//changing dac changes settings to undefined //changing dac changes settings to undefined
switch(serverDacIndex) { switch(serverDacIndex) {
case VCMP_LL: case E_VCMP_LL:
case VCMP_LR: case E_VCMP_LR:
case VCMP_RL: case E_VCMP_RL:
case VCMP_RR: case E_VCMP_RR:
case VRF: case E_VRF:
case VCP: case E_VCP:
setSettings(UNDEFINED); setSettings(UNDEFINED);
FILE_LOG(logERROR, ("Settings has been changed " FILE_LOG(logERROR, ("Settings has been changed "
"to undefined (changed specific dacs)\n")); "to undefined (changed specific dacs)\n"));
@ -2495,6 +2495,13 @@ int send_update(int file_des) {
if (n < 0) return printSocketReadError(); if (n < 0) return printSocketReadError();
#endif #endif
// num udp interfaces
#ifdef JUNGFRAUD
i32 = getNumberofUDPInterfaces();
n = sendData(file_des,&i32,sizeof(i32),INT32);
if (n < 0) return printSocketReadError();
#endif
if (lockStatus == 0) { if (lockStatus == 0) {
lastClientIP = thisClientIP; lastClientIP = thisClientIP;
} }

File diff suppressed because it is too large Load Diff

View File

@ -169,6 +169,9 @@ struct sharedSlsDetector {
/** reciever dbit offset */ /** reciever dbit offset */
int rxDbitOffset; int rxDbitOffset;
/** num udp interfaces */
int numUDPInterfaces;
}; };
class slsDetector : public virtual slsDetectorDefs { class slsDetector : public virtual slsDetectorDefs {
@ -258,13 +261,7 @@ class slsDetector : public virtual slsDetectorDefs {
* Get Detector type from shared memory variable * Get Detector type from shared memory variable
* @returns detector type from shared memory variable * @returns detector type from shared memory variable
*/ */
detectorType getDetectorTypeAsEnum() const; detectorType getDetectorType() const;
/**
* Gets string version of detector type from shared memory variable
* @returns string version of detector type from shared memory variable
*/
std::string getDetectorTypeAsString() const;
/** /**
* Gets detector type from detector and set it in receiver * Gets detector type from detector and set it in receiver
@ -554,8 +551,6 @@ class slsDetector : public virtual slsDetectorDefs {
*/ */
int setDynamicRange(int n = -1); int setDynamicRange(int n = -1);
int getDynamicRangeFromShm();
/** /**
* Set/get dacs value * Set/get dacs value
* @param val value (in V) * @param val value (in V)
@ -848,6 +843,9 @@ class slsDetector : public virtual slsDetectorDefs {
*/ */
void setNumberofUDPInterfaces(int n); void setNumberofUDPInterfaces(int n);
/** Returns the number of udp interfaces from shared memory */
int getNumberofUDPInterfacesFromShm();
/** /**
* Returns the number of UDP interfaces to stream data from detector * Returns the number of UDP interfaces to stream data from detector
* (Jungfrau only) * (Jungfrau only)

View File

@ -33,16 +33,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
std::vector<std::string> getAllCommands(); std::vector<std::string> getAllCommands();
/* /\** */
/* returns the help for the executeLine command */
/* \param os output stream to return the help to */
/* \param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition) */
/* *\/ */
std::string helpLine(int narg, const char * const args[], int action=HELP_ACTION, int detPos = -1);
static std::string helpAcquire(int action); static std::string helpAcquire(int action);
static std::string helpFree(int action);
static std::string helpSN(int action);
static std::string helpConfiguration(int action); static std::string helpConfiguration(int action);
@ -51,9 +42,6 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
std::string cmdUnknown(int narg, const char * const args[], int action, int detPos = -1); std::string cmdUnknown(int narg, const char * const args[], int action, int detPos = -1);
std::string cmdAcquire(int narg, const char * const args[], int action, int detPos = -1); std::string cmdAcquire(int narg, const char * const args[], int action, int detPos = -1);
std::string cmdFree(int narg, const char * const args[], int action, int detPos = -1);
std::string cmdHelp(int narg, const char * const args[], int action, int detPos = -1);
std::string cmdSN(int narg, const char * const args[], int action, int detPos = -1);
std::string cmdConfiguration(int narg, const char * const args[], int action, int detPos = -1); std::string cmdConfiguration(int narg, const char * const args[], int action, int detPos = -1);

View File

@ -67,7 +67,7 @@ Result<int64_t> Detector::getReceiverVersion(Positions pos) const {
} }
Result<defs::detectorType> Detector::getDetectorType(Positions pos) const { Result<defs::detectorType> Detector::getDetectorType(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos); return pimpl->Parallel(&slsDetector::getDetectorType, pos);
} }
int Detector::size() const { return pimpl->size(); } int Detector::size() const { return pimpl->size(); }
@ -173,7 +173,7 @@ Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1, auto res = pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
0); 0);
Result<defs::speedLevel> speedResult(res.size()); Result<defs::speedLevel> speedResult(res.size());
for (size_t i = 0; i < res.size(); ++i) { for (unsigned int i = 0; i < res.size(); ++i) {
speedResult[i] = static_cast<defs::speedLevel>(res[i]); speedResult[i] = static_cast<defs::speedLevel>(res[i]);
} }
return speedResult; return speedResult;
@ -314,7 +314,7 @@ void Detector::stopReceiver() {
} }
void Detector::startDetector() { void Detector::startDetector() {
if (getDetectorType({}).squash() == defs::EIGER) { if (getDetectorType().squash() == defs::EIGER) {
pimpl->Parallel(&slsDetector::prepareAcquisition, {}); pimpl->Parallel(&slsDetector::prepareAcquisition, {});
} }
pimpl->Parallel(&slsDetector::startAcquisition, {}); pimpl->Parallel(&slsDetector::startAcquisition, {});
@ -782,7 +782,9 @@ Result<int> Detector::getDynamicRange(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDynamicRange, pos, -1); return pimpl->Parallel(&slsDetector::setDynamicRange, pos, -1);
} }
void Detector::setDynamicRange(int value) { pimpl->setDynamicRange(value); } void Detector::setDynamicRange(int value) {
pimpl->Parallel(&slsDetector::setDynamicRange, {}, value);
}
Result<ns> Detector::getSubExptime(Positions pos) const { Result<ns> Detector::getSubExptime(Positions pos) const {
return pimpl->Parallel(&slsDetector::setTimer, pos, return pimpl->Parallel(&slsDetector::setTimer, pos,
@ -832,7 +834,7 @@ Result<bool> Detector::getRxAddGapPixels(Positions pos) const {
} }
void Detector::setRxAddGapPixels(bool enable) { void Detector::setRxAddGapPixels(bool enable) {
pimpl->setGapPixelsEnable(enable, {}); pimpl->setGapPixelsinReceiver(enable);
} }
Result<bool> Detector::getParallelMode(Positions pos) const { Result<bool> Detector::getParallelMode(Positions pos) const {
@ -968,7 +970,13 @@ Result<bool> Detector::getQuad(Positions pos) const {
return pimpl->Parallel(&slsDetector::getQuad, pos); return pimpl->Parallel(&slsDetector::getQuad, pos);
} }
void Detector::setQuad(const bool value) { pimpl->setQuad(value); } void Detector::setQuad(const bool value) {
if (value && size() > 1) {
throw RuntimeError("Cannot set Quad type as it is available only for 1 "
"Eiger Quad Half module.");
}
pimpl->Parallel(&slsDetector::setQuad, {}, value);
}
// Jungfrau Specific // Jungfrau Specific
@ -1007,8 +1015,8 @@ Result<bool> Detector::getPowerChip(Positions pos) const {
void Detector::setPowerChip(bool on, Positions pos) { void Detector::setPowerChip(bool on, Positions pos) {
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) { if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
for (unsigned int i = 0; i != pimpl->size(); ++i) { for (int i = 0; i != pimpl->size(); ++i) {
pimpl->powerChip(static_cast<int>(on), i); pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast<int>(on));
usleep(1000 * 1000); usleep(1000 * 1000);
} }
} else { } else {
@ -1618,12 +1626,12 @@ Result<uint64_t> Detector::getRxCurrentFrameIndex(Positions pos) const {
std::vector<int> Detector::getPortNumbers(int start_port) { std::vector<int> Detector::getPortNumbers(int start_port) {
int num_sockets_per_detector = 1; int num_sockets_per_detector = 1;
switch (getDetectorType({}).squash()) { switch (getDetectorType().squash()) {
case defs::EIGER: case defs::EIGER:
num_sockets_per_detector *= 2; num_sockets_per_detector *= 2;
break; break;
case defs::JUNGFRAU: case defs::JUNGFRAU:
if (getNumberofUDPInterfaces({}).squash() == 2) { if (getNumberofUDPInterfaces().squash() == 2) {
num_sockets_per_detector *= 2; num_sockets_per_detector *= 2;
} }
break; break;

File diff suppressed because it is too large Load Diff

View File

@ -391,6 +391,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
shm()->rxMasterFileWrite = true; shm()->rxMasterFileWrite = true;
shm()->rxFileOverWrite = true; shm()->rxFileOverWrite = true;
shm()->rxDbitOffset = 0; shm()->rxDbitOffset = 0;
shm()->numUDPInterfaces = 1;
// get the detector parameters based on type // get the detector parameters based on type
detParameters parameters{type}; detParameters parameters{type};
@ -545,14 +546,10 @@ int slsDetector::setDetectorType(detectorType const type) {
return retval; return retval;
} }
slsDetectorDefs::detectorType slsDetector::getDetectorTypeAsEnum() const { slsDetectorDefs::detectorType slsDetector::getDetectorType() const {
return shm()->myDetectorType; return shm()->myDetectorType;
} }
std::string slsDetector::getDetectorTypeAsString() const {
return ToString(getDetectorTypeAsEnum());
}
void slsDetector::updateNumberOfChannels() { void slsDetector::updateNumberOfChannels() {
if (shm()->myDetectorType == CHIPTESTBOARD || if (shm()->myDetectorType == CHIPTESTBOARD ||
shm()->myDetectorType == MOENCH) { shm()->myDetectorType == MOENCH) {
@ -832,6 +829,12 @@ void slsDetector::updateCachedDetectorVariables() {
updateNumberOfChannels(); updateNumberOfChannels();
} }
// num udp interfaces
if (shm()->myDetectorType == JUNGFRAU) {
n += client.Receive(&i32, sizeof(i32));
shm()->numUDPInterfaces = i32;
}
if (n == 0) { if (n == 0) {
FILE_LOG(logERROR) << "Could not update detector, received 0 bytes"; FILE_LOG(logERROR) << "Could not update detector, received 0 bytes";
} }
@ -1312,6 +1315,8 @@ int slsDetector::setSpeed(speedVariable sp, int value, int mode) {
int slsDetector::setDynamicRange(int n) { int slsDetector::setDynamicRange(int n) {
// TODO! Properly handle fail // TODO! Properly handle fail
int prevDr = shm()->dynamicRange;
int retval = -1; int retval = -1;
FILE_LOG(logDEBUG1) << "Setting dynamic range to " << n; FILE_LOG(logDEBUG1) << "Setting dynamic range to " << n;
sendToDetector(F_SET_DYNAMIC_RANGE, n, retval); sendToDetector(F_SET_DYNAMIC_RANGE, n, retval);
@ -1325,11 +1330,22 @@ int slsDetector::setDynamicRange(int n) {
sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, n, retval); sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, n, retval);
FILE_LOG(logDEBUG1) << "Receiver Dynamic range: " << retval; FILE_LOG(logDEBUG1) << "Receiver Dynamic range: " << retval;
} }
// changes in dr
int dr = shm()->dynamicRange;
if (prevDr != dr && shm()->myDetectorType == EIGER) {
updateRateCorrection();
// update speed for usability
if (dr == 32) {
FILE_LOG(logINFO) << "Setting Clock to Quarter Speed to cope with Dynamic Range of 32"; setSpeed(CLOCK_DIVIDER, 2);
} else if (dr == 16) {
FILE_LOG(logINFO) << "Setting Clock to Half Speed to cope with Dynamic Range of 16"; setSpeed(CLOCK_DIVIDER, 1);
}
}
return shm()->dynamicRange; return shm()->dynamicRange;
} }
int slsDetector::getDynamicRangeFromShm() { return shm()->dynamicRange; }
int slsDetector::setDAC(int val, dacIndex index, int mV) { int slsDetector::setDAC(int val, dacIndex index, int mV) {
int args[]{static_cast<int>(index), mV, val}; int args[]{static_cast<int>(index), mV, val};
int retval = -1; int retval = -1;
@ -1857,17 +1873,24 @@ int slsDetector::getDestinationUDPPort2() {
void slsDetector::setNumberofUDPInterfaces(int n) { void slsDetector::setNumberofUDPInterfaces(int n) {
FILE_LOG(logDEBUG1) << "Setting number of udp interfaces to " << n; FILE_LOG(logDEBUG1) << "Setting number of udp interfaces to " << n;
sendToDetector(F_SET_NUM_INTERFACES, n, nullptr); sendToDetector(F_SET_NUM_INTERFACES, n, nullptr);
shm()->numUDPInterfaces = n;
if (shm()->useReceiverFlag) { if (shm()->useReceiverFlag) {
sendToReceiver(F_SET_RECEIVER_NUM_INTERFACES, n, nullptr); sendToReceiver(F_SET_RECEIVER_NUM_INTERFACES, n, nullptr);
} }
} }
int slsDetector::getNumberofUDPInterfacesFromShm() {
return shm()->numUDPInterfaces;
}
int slsDetector::getNumberofUDPInterfaces() { int slsDetector::getNumberofUDPInterfaces() {
int retval = -1; int retval = -1;
FILE_LOG(logDEBUG1) << "Getting number of udp interfaces"; FILE_LOG(logDEBUG1) << "Getting number of udp interfaces";
sendToDetector(F_GET_NUM_INTERFACES, nullptr, retval); sendToDetector(F_GET_NUM_INTERFACES, nullptr, retval);
FILE_LOG(logDEBUG1) << "Number of udp interfaces: " << retval; FILE_LOG(logDEBUG1) << "Number of udp interfaces: " << retval;
return retval; shm()->numUDPInterfaces = retval;
return shm()->numUDPInterfaces;
} }
void slsDetector::selectUDPInterface(int n) { void slsDetector::selectUDPInterface(int n) {
@ -2380,6 +2403,10 @@ int slsDetector::setAllTrimbits(int val) {
int slsDetector::enableGapPixels(int val) { int slsDetector::enableGapPixels(int val) {
if (val >= 0) { if (val >= 0) {
if (shm()->myDetectorType != EIGER) {
throw NotImplementedError(
"Function (enableGapPixels) not implemented for this detector");
}
int fnum = F_ENABLE_GAPPIXELS_IN_RECEIVER; int fnum = F_ENABLE_GAPPIXELS_IN_RECEIVER;
int retval = -1; int retval = -1;
FILE_LOG(logDEBUG1) << "Sending gap pixels enable to receiver: " << val; FILE_LOG(logDEBUG1) << "Sending gap pixels enable to receiver: " << val;

View File

@ -1,5 +1,6 @@
#include "slsDetectorCommand.h" #include "slsDetectorCommand.h"
#include "multiSlsDetector.h" #include "multiSlsDetector.h"
#include "slsDetector.h"
#include "string_utils.h" #include "string_utils.h"
#include <cstdlib> #include <cstdlib>
@ -80,16 +81,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
/*! \page test
- <b>help</b> Returns a list of possible commands.
*/
descrToFuncMap[i].m_pFuncName = "help";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHelp;
++i;
/* Acquisition and status commands */ /* Acquisition and status commands */
/*! \page acquisition Acquition commands /*! \page acquisition Acquition commands
Commands to control the acquisition Commands to control the acquisition
@ -103,28 +94,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i; ++i;
/*! \page config
- \b free Free shared memory on the control PC
*/
descrToFuncMap[i].m_pFuncName = "free";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdFree;
++i;
/*! \page config
- <b>checkdetversion</b> Checks the version compatibility with detector server (if hostname is in shared memory). Only get! Only for Eiger, Jungfrau & Gotthard. \c Returns \c ("compatible", "incompatible")
*/
descrToFuncMap[i].m_pFuncName = "checkdetversion";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN;
++i;
/*! \page config
- <b>rx_checkversion</b> Checks the version compatibility with receiver server (if rx_hostname is in shared memory). Only get! Only for Eiger, Jungfrau & Gotthard. \c Returns \c ("compatible", "incompatible")
*/
descrToFuncMap[i].m_pFuncName = "rx_checkversion";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN;
++i;
/* settings dump/retrieve */ /* settings dump/retrieve */
@ -182,40 +151,6 @@ std::vector<std::string> slsDetectorCommand::getAllCommands(){
return commands; return commands;
} }
std::string slsDetectorCommand::helpLine(int narg, const char * const args[], int action, int detPos) {
std::ostringstream os;
if (action == READOUT_ACTION) {
return helpAcquire(HELP_ACTION);
}
if (narg == 0) {
os << "Command can be: " << std::endl;
for (int i = 0; i < numberOfCommands; ++i) {
os << descrToFuncMap[i].m_pFuncName << "\n";
}
os << std::endl;
return os.str();
}
return executeLine(narg, args, HELP_ACTION, detPos);
}
std::string slsDetectorCommand::cmdHelp(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
std::cout << narg << std::endl;
if (narg >= 1)
return helpLine(narg - 1, args, action, detPos);
else
return helpLine(0, args, action, detPos);
}
std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[], int action, int detPos) { std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[], int action, int detPos) {
@ -237,10 +172,11 @@ std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[],
if (myDet->acquire() == FAIL) if (myDet->acquire() == FAIL)
return std::string("acquire failed"); return std::string("acquire failed");
if (myDet->getUseReceiverFlag(detPos)) { if (myDet->Parallel(&slsDetector::getUseReceiverFlag, {}).squash(false)) {
char answer[100]; std::ostringstream os;
sprintf(answer, "\nAcquired %d", myDet->getFramesCaughtByReceiver(detPos)); os << "\nAcquired ";
return std::string(answer); os << sls::ToString(myDet->Parallel(&slsDetector::getFramesCaughtByReceiver, {}));
return os.str();
} }
return std::string(); return std::string();
@ -260,61 +196,6 @@ std::string slsDetectorCommand::helpAcquire(int action) {
std::string slsDetectorCommand::cmdFree(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
if (action == HELP_ACTION) {
return helpFree(HELP_ACTION);
}
return ("Error: Should have been freed before creating constructor\n");
}
std::string slsDetectorCommand::helpFree(int action) {
return std::string("free \t frees the shared memory\n");
}
std::string slsDetectorCommand::cmdSN(int narg, const char * const args[], int action, int detPos) {
if (action == PUT_ACTION)
return std::string("cannot set");
if (action == HELP_ACTION)
return helpSN(action);
if (cmd == "checkdetversion") {
myDet->checkDetectorVersionCompatibility(detPos);
return std::string("compatible");
}
if (cmd == "rx_checkversion") {
myDet->checkReceiverVersionCompatibility(detPos);
return std::string("compatible");
}
return std::string("unknown id mode ") + cmd;
}
std::string slsDetectorCommand::helpSN(int action) {
std::ostringstream os;
if (action == GET_ACTION || action == HELP_ACTION) {
os << "checkdetversion \n gets the version compatibility with detector server (if hostname is in shared memory). Only for Eiger, Jungfrau & Gotthard. Prints compatible/ incompatible." << std::endl;
os << "rx_checkversion \n gets the version compatibility with receiver server (if rx_hostname is in shared memory). Only for Eiger, Jungfrau & Gotthard. Prints compatible/ incompatible." << std::endl;
}
return os.str();
}
std::string slsDetectorCommand::cmdConfiguration(int narg, const char * const args[], int action, int detPos) { std::string slsDetectorCommand::cmdConfiguration(int narg, const char * const args[], int action, int detPos) {

View File

@ -3076,14 +3076,14 @@ TEST_CASE("zmqport", "[.cmd]") {
} }
int port = 3500; int port = 3500;
REQUIRE_NOTHROW(multiSlsDetectorClient("zmqport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("zmqport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":zmqport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":zmqport", GET, nullptr, oss));
REQUIRE(oss.str() == "zmqport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "zmqport " + std::to_string(port + i * socketsperdetector) + '\n');
} }
port = 1954; port = 1954;
REQUIRE_NOTHROW(multiSlsDetectorClient("zmqport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("zmqport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":zmqport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":zmqport", GET, nullptr, oss));
REQUIRE(oss.str() == "zmqport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "zmqport " + std::to_string(port + i * socketsperdetector) + '\n');
@ -3104,14 +3104,14 @@ TEST_CASE("rx_zmqport", "[.cmd]") {
} }
int port = 3500; int port = 3500;
REQUIRE_NOTHROW(multiSlsDetectorClient("rx_zmqport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("rx_zmqport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_zmqport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_zmqport", GET, nullptr, oss));
REQUIRE(oss.str() == "rx_zmqport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "rx_zmqport " + std::to_string(port + i * socketsperdetector) + '\n');
} }
port = 30001; port = 30001;
REQUIRE_NOTHROW(multiSlsDetectorClient("rx_zmqport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("rx_zmqport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_zmqport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_zmqport", GET, nullptr, oss));
REQUIRE(oss.str() == "rx_zmqport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "rx_zmqport " + std::to_string(port + i * socketsperdetector) + '\n');
@ -3337,14 +3337,14 @@ TEST_CASE("network", "[.cmd]") {
} }
int port = 5500; int port = 5500;
REQUIRE_NOTHROW(multiSlsDetectorClient("udp_dstport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("udp_dstport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":udp_dstport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":udp_dstport", GET, nullptr, oss));
REQUIRE(oss.str() == "udp_dstport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "udp_dstport " + std::to_string(port + i * socketsperdetector) + '\n');
} }
port = 50001; port = 50001;
REQUIRE_NOTHROW(multiSlsDetectorClient("udp_dstport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("udp_dstport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":udp_dstport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":udp_dstport", GET, nullptr, oss));
REQUIRE(oss.str() == "udp_dstport " + std::to_string(port + i * socketsperdetector) + '\n'); REQUIRE(oss.str() == "udp_dstport " + std::to_string(port + i * socketsperdetector) + '\n');
@ -4235,7 +4235,7 @@ TEST_CASE("rx_tcpport", "[.cmd]") {
multiSlsDetector d; multiSlsDetector d;
int port = 3500; int port = 3500;
REQUIRE_NOTHROW(multiSlsDetectorClient("rx_tcpport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("rx_tcpport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_tcpport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_tcpport", GET, nullptr, oss));
REQUIRE(oss.str() == "rx_tcpport " + std::to_string(port + i) + '\n'); REQUIRE(oss.str() == "rx_tcpport " + std::to_string(port + i) + '\n');
@ -4243,7 +4243,7 @@ TEST_CASE("rx_tcpport", "[.cmd]") {
REQUIRE_THROWS(multiSlsDetectorClient("rx_tcpport 15", PUT)); REQUIRE_THROWS(multiSlsDetectorClient("rx_tcpport 15", PUT));
port = 1954; port = 1954;
REQUIRE_NOTHROW(multiSlsDetectorClient("rx_tcpport " + std::to_string(port), PUT)); REQUIRE_NOTHROW(multiSlsDetectorClient("rx_tcpport " + std::to_string(port), PUT));
for (size_t i = 0; i != d.size(); ++i) { for (int i = 0; i != d.size(); ++i) {
std::ostringstream oss; std::ostringstream oss;
REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_tcpport", GET, nullptr, oss)); REQUIRE_NOTHROW(multiSlsDetectorClient(std::to_string(i) + ":rx_tcpport", GET, nullptr, oss));
REQUIRE(oss.str() == "rx_tcpport " + std::to_string(port + i) + '\n'); REQUIRE(oss.str() == "rx_tcpport " + std::to_string(port + i) + '\n');

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 APICTB 0x191029
#define APIGOTTHARD 0x191029
#define APIGOTTHARD2 0x191029
#define APIEIGER 0x191029
#define APIMYTHEN3 0x191030
#define APIJUNGFRAU 0x191030 #define APIJUNGFRAU 0x191030
#define APIEIGER 0x191030
#define APIGOTTHARD 0x191030
#define APIGOTTHARD2 0x191030
#define APIMYTHEN3 0x191030
#define APICTB 0x191030