partialread changed to readnrows

This commit is contained in:
2021-08-31 16:46:49 +02:00
parent 11b1d9f6db
commit 25d03f949e
35 changed files with 171 additions and 168 deletions

View File

@ -510,13 +510,13 @@ class Detector {
void setDBITPipeline(int value, Positions pos = {});
/** [Eiger][Jungfrau] */
Result<int> getPartialReadout(Positions pos = {}) const;
Result<int> getReadNRows(Positions pos = {}) const;
/** [Eiger] Number of lines to read out per half module
/** [Eiger] Number of rows to read out per half module
* Options: 0 - 256. 256 is default. The permissible values depend on
* dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512.
*/
void setPartialReadout(const int lines, Positions pos = {});
void setReadNRows(const int lines, Positions pos = {});
///@{

View File

@ -593,7 +593,7 @@ class CmdProxy {
{"vhighvoltage", "highvoltage"},
{"digitest", "imagetest"},
{"filter", "filterresistor"},
{"readnlines", "partialread"},
{"readnlines", "readnrows"},
/** temperature */
@ -807,7 +807,7 @@ class CmdProxy {
{"filterresistor", &CmdProxy::filterresistor},
{"currentsource", &CmdProxy::CurrentSource},
{"dbitpipeline", &CmdProxy::dbitpipeline},
{"partialread", &CmdProxy::partialread},
{"readnrows", &CmdProxy::readnrows},
/** temperature */
{"templist", &CmdProxy::templist},
@ -1376,7 +1376,7 @@ class CmdProxy {
"Options: 0-7\n\t[CTB] Options: 0-255");
INTEGER_COMMAND_VEC_ID(
partialread, getPartialReadout, setPartialReadout, StringTo<int>,
readnrows, getReadNRows, setReadNRows, 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.\n[8-512 (multiple of 8)]\n\t[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512.");

View File

@ -732,12 +732,12 @@ void Detector::setDBITPipeline(int value, Positions pos) {
pimpl->Parallel(&Module::setDBITPipeline, pos, value);
}
Result<int> Detector::getPartialReadout(Positions pos) const {
return pimpl->Parallel(&Module::getPartialReadout, pos);
Result<int> Detector::getReadNRows(Positions pos) const {
return pimpl->Parallel(&Module::getReadNRows, pos);
}
void Detector::setPartialReadout(const int lines, Positions pos) {
pimpl->Parallel(&Module::setPartialReadout, pos, lines);
void Detector::setReadNRows(const int lines, Positions pos) {
pimpl->Parallel(&Module::setReadNRows, pos, lines);
}
// Acquisition

View File

@ -734,14 +734,14 @@ void Module::setDBITPipeline(int value) {
sendToDetector(F_SET_DBIT_PIPELINE, value, nullptr);
}
int Module::getPartialReadout() const {
return sendToDetector<int>(F_GET_PARTIAL_READOUT);
int Module::getReadNRows() const {
return sendToDetector<int>(F_GET_READ_N_ROWS);
}
void Module::setPartialReadout(const int value) {
sendToDetector(F_SET_PARTIAL_READOUT, value, nullptr);
void Module::setReadNRows(const int value) {
sendToDetector(F_SET_READ_N_ROWS, value, nullptr);
if (shm()->useReceiverFlag) {
sendToReceiver(F_SET_RECEIVER_PARTIAL_READOUT, value, nullptr);
sendToReceiver(F_SET_RECEIVER_READ_N_ROWS, value, nullptr);
}
}

View File

@ -178,8 +178,8 @@ class Module : public virtual slsDetectorDefs {
void setCurrentSource(defs::currentSrcParameters par);
int getDBITPipeline() const;
void setDBITPipeline(int value);
int getPartialReadout() const;
void setPartialReadout(const int value);
int getReadNRows() const;
void setReadNRows(const int value);
/**************************************************
* *
* Acquisition *

View File

@ -1494,40 +1494,40 @@ TEST_CASE("dbitpipeline", "[.cmd]") {
}
}
TEST_CASE("partialread", "[.cmd]") {
TEST_CASE("readnrows", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
auto prev_val = det.getPartialReadout();
auto prev_val = det.getReadNRows();
{
std::ostringstream oss;
proxy.Call("partialread", {"256"}, -1, PUT, oss);
REQUIRE(oss.str() == "partialread 256\n");
proxy.Call("readnrows", {"256"}, -1, PUT, oss);
REQUIRE(oss.str() == "readnrows 256\n");
}
{
std::ostringstream oss;
proxy.Call("partialread", {}, -1, GET, oss);
REQUIRE(oss.str() == "partialread 256\n");
proxy.Call("readnrows", {}, -1, GET, oss);
REQUIRE(oss.str() == "readnrows 256\n");
}
{
std::ostringstream oss;
proxy.Call("partialread", {"16"}, -1, PUT, oss);
REQUIRE(oss.str() == "partialread 16\n");
proxy.Call("readnrows", {"16"}, -1, PUT, oss);
REQUIRE(oss.str() == "readnrows 16\n");
}
if (det_type == defs::JUNGFRAU) {
REQUIRE_THROWS(proxy.Call("partialread", {"7"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("partialread", {"20"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("partialread", {"44"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("partialread", {"513"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("partialread", {"1"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"7"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"20"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"44"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"513"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"1"}, -1, PUT));
}
REQUIRE_THROWS(proxy.Call("partialread", {"0"}, -1, PUT));
REQUIRE_THROWS(proxy.Call("readnrows", {"0"}, -1, PUT));
for (int i = 0; i != det.size(); ++i) {
det.setPartialReadout(prev_val[i], {i});
det.setReadNRows(prev_val[i], {i});
}
} else {
REQUIRE_THROWS(proxy.Call("partialread", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("readnrows", {}, -1, GET));
}
}