mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
wip
This commit is contained in:
@ -913,6 +913,15 @@ class Detector {
|
||||
|
||||
void clearRxROI();
|
||||
|
||||
Result<int> getRxBunchSize(Positions pos = {}) const;
|
||||
|
||||
/** Number of frames the receiver listens to before pushing into fifo
|
||||
* (buffer between listener and writer threads).
|
||||
* Higher number results in fewer locks between fifo access. \n
|
||||
* Default is 1. */
|
||||
void setRxBunchSize(int value, Positions pos = {});
|
||||
|
||||
|
||||
///@}
|
||||
|
||||
/** @name File */
|
||||
|
@ -911,6 +911,7 @@ class CmdProxy {
|
||||
{"rx_arping", &CmdProxy::rx_arping},
|
||||
{"rx_roi", &CmdProxy::Rx_ROI},
|
||||
{"rx_clearroi", &CmdProxy::rx_clearroi},
|
||||
{"rx_bunchsize", &CmdProxy::rx_bunchsize},// FIXME: rx_fifobunchsize?
|
||||
|
||||
/* File */
|
||||
{"fformat", &CmdProxy::fformat},
|
||||
@ -1768,6 +1769,10 @@ class CmdProxy {
|
||||
"Resets Region of interest in receiver. Default is all "
|
||||
"channels/pixels enabled.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
rx_bunchsize, getRxBunchSize, setRxBunchSize, StringTo<int>,
|
||||
"[n_frames]\n\tSet the number of frames the receiver listens to before pushing into fifo (buffer between listener and writer threads). Higher number results in fewer locks between fifo access. Default is 1. Expect signed 32 bit integer. ");
|
||||
|
||||
/* File */
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
|
@ -1225,6 +1225,14 @@ void Detector::setRxROI(const defs::ROI value) { pimpl->setRxROI(value); }
|
||||
|
||||
void Detector::clearRxROI() { pimpl->clearRxROI(); }
|
||||
|
||||
Result<int> Detector::getRxBunchSize(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getRxBunchSize, pos);
|
||||
}
|
||||
|
||||
void Detector::setRxBunchSize(int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setRxBunchSize, pos, value);
|
||||
}
|
||||
|
||||
// File
|
||||
|
||||
Result<defs::fileFormat> Detector::getFileFormat(Positions pos) const {
|
||||
|
@ -1444,6 +1444,15 @@ void Module::setRxROIMetadata(const slsDetectorDefs::ROI arg) {
|
||||
sendToReceiver(F_RECEIVER_SET_RECEIVER_ROI_METADATA, arg, nullptr);
|
||||
}
|
||||
|
||||
int Module::getRxBunchSize() const {
|
||||
return sendToReceiver<int>(F_GET_RECEIVER_BUNCH_SIZE);
|
||||
}
|
||||
|
||||
void Module::setRxBunchSize(int value) {
|
||||
sendToReceiver<int>(F_SET_RECEIVER_BUNCH_SIZE, value);
|
||||
}
|
||||
|
||||
|
||||
// File
|
||||
slsDetectorDefs::fileFormat Module::getFileFormat() const {
|
||||
return sendToReceiver<fileFormat>(F_GET_RECEIVER_FILE_FORMAT);
|
||||
|
@ -294,6 +294,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
defs::ROI getRxROI() const;
|
||||
void setRxROI(const slsDetectorDefs::ROI arg);
|
||||
void setRxROIMetadata(const slsDetectorDefs::ROI arg);
|
||||
int getRxBunchSize() const;
|
||||
void setRxBunchSize(int value);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
@ -254,6 +254,7 @@ TEST_CASE("rx_fifodepth", "[.cmd][.rx]") {
|
||||
proxy.Call("rx_fifodepth", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "rx_fifodepth 100\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("rx_fifodepth", {"0"}, -1, PUT));
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setRxFifoDepth(prev_val[i], {i});
|
||||
}
|
||||
@ -513,6 +514,32 @@ TEST_CASE("rx_clearroi", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("rx_bunchsize", "[.cmd][.rx]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto prev_val = det.getRxBunchSize();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("rx_bunchsize", {"10"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "rx_bunchsize 10\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("rx_bunchsize", {"100"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "rx_bunchsize 100\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("rx_bunchsize", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "rx_bunchsize 100\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("rx_bunchsize", {"0"}, -1, PUT));
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setRxBunchSize(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
|
||||
/* File */
|
||||
|
||||
TEST_CASE("fformat", "[.cmd]") {
|
||||
|
Reference in New Issue
Block a user