mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
readnlines->partialread, better debugging for TCP socket interface bug
This commit is contained in:
@ -716,6 +716,7 @@ class CmdProxy {
|
||||
{"rx_datastream", "rx_zmqstream"},
|
||||
|
||||
/* Eiger Specific */
|
||||
{"readnlines", "partialread"},
|
||||
{"resmat", "partialreset"},
|
||||
|
||||
/* Jungfrau Specific */
|
||||
@ -914,7 +915,7 @@ class CmdProxy {
|
||||
{"subdeadtime", &CmdProxy::subdeadtime},
|
||||
{"overflow", &CmdProxy::overflow},
|
||||
{"ratecorr", &CmdProxy::RateCorrection},
|
||||
{"readnlines", &CmdProxy::readnlines},
|
||||
{"partialread", &CmdProxy::partialread},
|
||||
{"interruptsubframe", &CmdProxy::interruptsubframe},
|
||||
{"measuredperiod", &CmdProxy::measuredperiod},
|
||||
{"measuredsubperiod", &CmdProxy::measuredsubperiod},
|
||||
@ -1809,7 +1810,7 @@ class CmdProxy {
|
||||
"32 bit mode. Default is disabled.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
readnlines, getPartialReadout, setPartialReadout, StringTo<int>,
|
||||
partialread, getPartialReadout, setPartialReadout, StringTo<int>,
|
||||
"[1 - 256]\n\t[Eiger] Number of rows to readout per half module "
|
||||
"starting from the centre. Options: 0 - 256. 256 is default. The "
|
||||
"permissible values depend on dynamic range and 10Gbe enabled.");
|
||||
|
@ -1373,11 +1373,11 @@ void Detector::updateRxRateCorrections() {
|
||||
}
|
||||
|
||||
Result<int> Detector::getPartialReadout(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getReadNLines, pos);
|
||||
return pimpl->Parallel(&Module::getPartialReadout, pos);
|
||||
}
|
||||
|
||||
void Detector::setPartialReadout(const int lines, Positions pos) {
|
||||
pimpl->Parallel(&Module::setReadNLines, pos, lines);
|
||||
pimpl->Parallel(&Module::setPartialReadout, pos, lines);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getInterruptSubframe(Positions pos) const {
|
||||
|
@ -1469,14 +1469,14 @@ void Module::sendReceiverRateCorrections(const std::vector<int64_t> &t) {
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getReadNLines() const {
|
||||
return sendToDetector<int>(F_GET_READ_N_LINES);
|
||||
int Module::getPartialReadout() const {
|
||||
return sendToDetector<int>(F_GET_PARTIAL_READOUT);
|
||||
}
|
||||
|
||||
void Module::setReadNLines(const int value) {
|
||||
sendToDetector(F_SET_READ_N_LINES, value, nullptr);
|
||||
void Module::setPartialReadout(const int value) {
|
||||
sendToDetector(F_SET_PARTIAL_READOUT, value, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SET_RECEIVER_READ_N_LINES, value, nullptr);
|
||||
sendToReceiver(F_SET_RECEIVER_PARTIAL_READOUT, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,8 +337,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setDefaultRateCorrection();
|
||||
void setRateCorrection(int64_t t = 0);
|
||||
void sendReceiverRateCorrections(const std::vector<int64_t> &t);
|
||||
int getReadNLines() const;
|
||||
void setReadNLines(const int value);
|
||||
int getPartialReadout() const;
|
||||
void setPartialReadout(const int value);
|
||||
bool getInterruptSubframe() const;
|
||||
void setInterruptSubframe(const bool enable);
|
||||
int64_t getMeasuredPeriod() const;
|
||||
|
@ -374,7 +374,7 @@ TEST_CASE("ratecorr", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("readnlines", "[.cmd]") {
|
||||
TEST_CASE("partialread", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@ -382,25 +382,25 @@ TEST_CASE("readnlines", "[.cmd]") {
|
||||
auto prev_val = det.getPartialReadout();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {"256"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "readnlines 256\n");
|
||||
proxy.Call("partialread", {"256"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "partialread 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "readnlines 256\n");
|
||||
proxy.Call("partialread", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "partialread 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {"16"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "readnlines 16\n");
|
||||
proxy.Call("partialread", {"16"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "partialread 16\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("readnlines", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("partialread", {"0"}, -1, PUT));
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPartialReadout(prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("readnlines", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("partialread", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user