mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
Merge branch 'developer' into roundrobin
This commit is contained in:
@ -509,6 +509,15 @@ class Detector {
|
||||
/** [CTB] Options: 0-255 \n [Gotthard2] Options: 0-7 */
|
||||
void setDBITPipeline(int value, Positions pos = {});
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<int> getPartialReadout(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] Number of lines 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 = {});
|
||||
|
||||
///@{
|
||||
|
||||
/** @name Acquisition */
|
||||
@ -1053,15 +1062,6 @@ class Detector {
|
||||
*/
|
||||
void setRateCorrection(ns dead_time, Positions pos = {});
|
||||
|
||||
/** [Eiger] */
|
||||
Result<int> getPartialReadout(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] Number of lines to read out per half module
|
||||
* Options: 0 - 256. 256 is default. The permissible values depend on
|
||||
* dynamic range and 10Gbe enabled.
|
||||
*/
|
||||
void setPartialReadout(const int lines, Positions pos = {});
|
||||
|
||||
/** [Eiger] */
|
||||
Result<bool> getInterruptSubframe(Positions pos = {}) const;
|
||||
|
||||
|
@ -593,6 +593,7 @@ class CmdProxy {
|
||||
{"vhighvoltage", "highvoltage"},
|
||||
{"digitest", "imagetest"},
|
||||
{"filter", "filterresistor"},
|
||||
{"readnlines", "partialread"},
|
||||
|
||||
/** temperature */
|
||||
|
||||
@ -806,6 +807,7 @@ class CmdProxy {
|
||||
{"filterresistor", &CmdProxy::filterresistor},
|
||||
{"currentsource", &CmdProxy::CurrentSource},
|
||||
{"dbitpipeline", &CmdProxy::dbitpipeline},
|
||||
{"partialread", &CmdProxy::partialread},
|
||||
|
||||
/** temperature */
|
||||
{"templist", &CmdProxy::templist},
|
||||
@ -915,7 +917,6 @@ class CmdProxy {
|
||||
{"subdeadtime", &CmdProxy::subdeadtime},
|
||||
{"overflow", &CmdProxy::overflow},
|
||||
{"ratecorr", &CmdProxy::RateCorrection},
|
||||
{"readnlines", &CmdProxy::readnlines},
|
||||
{"interruptsubframe", &CmdProxy::interruptsubframe},
|
||||
{"measuredperiod", &CmdProxy::measuredperiod},
|
||||
{"measuredsubperiod", &CmdProxy::measuredsubperiod},
|
||||
@ -1372,6 +1373,12 @@ class CmdProxy {
|
||||
"clock for latching digital bits.\n\t[Gotthard2] "
|
||||
"Options: 0-7\n\t[CTB] Options: 0-255");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
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.\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.");
|
||||
|
||||
/** temperature */
|
||||
GET_COMMAND_NOID(
|
||||
templist, getTemperatureList,
|
||||
@ -1812,12 +1819,6 @@ class CmdProxy {
|
||||
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
|
||||
"32 bit mode. Default is disabled.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
readnlines, 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.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
interruptsubframe, getInterruptSubframe, setInterruptSubframe,
|
||||
StringTo<int>,
|
||||
|
@ -732,6 +732,14 @@ 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);
|
||||
}
|
||||
|
||||
void Detector::setPartialReadout(const int lines, Positions pos) {
|
||||
pimpl->Parallel(&Module::setPartialReadout, pos, lines);
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Detector::acquire() { pimpl->acquire(); }
|
||||
@ -839,13 +847,14 @@ void Detector::setNumberofUDPInterfaces_(int n, Positions pos) {
|
||||
bool previouslyClientStreaming = pimpl->getDataStreamingToClient();
|
||||
bool useReceiver = getUseReceiverFlag().squash(false);
|
||||
bool previouslyReceiverStreaming = false;
|
||||
int startingPort = 0;
|
||||
if (useReceiver) {
|
||||
previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(true);
|
||||
startingPort = getRxZmqPort({0}).squash(0);
|
||||
}
|
||||
pimpl->Parallel(&Module::setNumberofUDPInterfaces, pos, n);
|
||||
// ensure receiver zmq socket ports are multiplied by 2 (2 interfaces)
|
||||
if (getUseReceiverFlag().squash(false) && size()) {
|
||||
int startingPort = getRxZmqPort({0}).squash(0);
|
||||
setRxZmqPort(startingPort, -1);
|
||||
}
|
||||
// redo the zmq sockets if enabled
|
||||
@ -1385,14 +1394,6 @@ void Detector::updateRxRateCorrections() {
|
||||
}
|
||||
}
|
||||
|
||||
Result<int> Detector::getPartialReadout(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getReadNLines, pos);
|
||||
}
|
||||
|
||||
void Detector::setPartialReadout(const int lines, Positions pos) {
|
||||
pimpl->Parallel(&Module::setReadNLines, pos, lines);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getInterruptSubframe(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getInterruptSubframe, pos);
|
||||
}
|
||||
|
@ -734,6 +734,17 @@ void Module::setDBITPipeline(int value) {
|
||||
sendToDetector(F_SET_DBIT_PIPELINE, value, nullptr);
|
||||
}
|
||||
|
||||
int Module::getPartialReadout() const {
|
||||
return sendToDetector<int>(F_GET_PARTIAL_READOUT);
|
||||
}
|
||||
|
||||
void Module::setPartialReadout(const int value) {
|
||||
sendToDetector(F_SET_PARTIAL_READOUT, value, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SET_RECEIVER_PARTIAL_READOUT, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Module::startReceiver() {
|
||||
@ -1487,17 +1498,6 @@ void Module::sendReceiverRateCorrections(const std::vector<int64_t> &t) {
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getReadNLines() const {
|
||||
return sendToDetector<int>(F_GET_READ_N_LINES);
|
||||
}
|
||||
|
||||
void Module::setReadNLines(const int value) {
|
||||
sendToDetector(F_SET_READ_N_LINES, value, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SET_RECEIVER_READ_N_LINES, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getInterruptSubframe() const {
|
||||
return sendToDetector<int>(F_GET_INTERRUPT_SUBFRAME);
|
||||
}
|
||||
|
@ -178,7 +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);
|
||||
/**************************************************
|
||||
* *
|
||||
* Acquisition *
|
||||
@ -339,8 +340,6 @@ 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);
|
||||
bool getInterruptSubframe() const;
|
||||
void setInterruptSubframe(const bool enable);
|
||||
int64_t getMeasuredPeriod() const;
|
||||
|
@ -374,36 +374,6 @@ TEST_CASE("ratecorr", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("readnlines", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER) {
|
||||
auto prev_val = det.getPartialReadout();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {"256"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "readnlines 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "readnlines 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("readnlines", {"16"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "readnlines 16\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("readnlines", {"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));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("interruptsubframe", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
|
@ -1494,6 +1494,43 @@ TEST_CASE("dbitpipeline", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("partialread", "[.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();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("partialread", {"256"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "partialread 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("partialread", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "partialread 256\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("partialread", {"16"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "partialread 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("partialread", {"0"}, -1, PUT));
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPartialReadout(prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("partialread", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("currentsource", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
|
Reference in New Issue
Block a user