flippeddatax for jungfrau server

This commit is contained in:
2021-08-05 12:39:04 +02:00
parent acd12bf2fa
commit c5d6dd0dd4
15 changed files with 174 additions and 60 deletions

View File

@ -769,6 +769,7 @@ class CmdProxy {
{"trimval", &CmdProxy::trimval},
{"trimen", &CmdProxy::TrimEnergies},
{"gappixels", &CmdProxy::GapPixels},
{"flippeddatax", &CmdProxy::flippeddatax},
/* acquisition parameters */
{"acquire", &CmdProxy::Acquire},
@ -906,7 +907,6 @@ class CmdProxy {
{"subexptime", &CmdProxy::subexptime},
{"subdeadtime", &CmdProxy::subdeadtime},
{"overflow", &CmdProxy::overflow},
{"flippeddatax", &CmdProxy::flippeddatax},
{"ratecorr", &CmdProxy::RateCorrection},
{"readnlines", &CmdProxy::readnlines},
{"interruptsubframe", &CmdProxy::interruptsubframe},
@ -1233,6 +1233,16 @@ class CmdProxy {
"[n_trimval]\n\t[Eiger][Mythen3] All trimbits set to this "
"value. Returns -1 if all trimbits are different values.");
INTEGER_COMMAND_VEC_ID(
flippeddatax, getFlippedDataAcrossXAxis, setFlippedDataAcrossXAxis,
StringTo<int>,
"[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 "
"is top. Used to let Gui (via zmq from receiver) know to flip the "
"bottom image over the x axis. Files are not written without the flip "
"however.\n\t[Jungfrau] If enabled, the bottom is flipped across the x "
"axis from the detector. The slsReceiver nor the Gui handles this "
"parameter.");
/* acquisition parameters */
INTEGER_COMMAND_SET_NOID_GET_ID(
@ -1778,13 +1788,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(
flippeddatax, getBottom, setBottom, StringTo<int>,
"[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 "
"is top. Used to let Gui (via zmq from receiver) know to flip the "
"bottom image over the x axis. Files are not written without the flip "
"however.");
INTEGER_COMMAND_VEC_ID(
readnlines, getPartialReadout, setPartialReadout, StringTo<int>,
"[1 - 256]\n\t[Eiger] Number of rows to readout per half module "

View File

@ -279,6 +279,14 @@ void Detector::setGapPixelsinCallback(bool enable) {
pimpl->setGapPixelsinCallback(enable);
}
Result<bool> Detector::getFlippedDataAcrossXAxis(Positions pos) const {
return pimpl->Parallel(&Module::getFlippedDataAcrossXAxis, pos);
}
void Detector::setFlippedDataAcrossXAxis(bool value, Positions pos) {
pimpl->Parallel(&Module::setFlippedDataAcrossXAxis, pos, value);
}
Result<bool> Detector::isVirtualDetectorServer(Positions pos) const {
return pimpl->Parallel(&Module::isVirtualDetectorServer, pos);
}
@ -1304,14 +1312,6 @@ void Detector::setOverFlowMode(bool value, Positions pos) {
pimpl->Parallel(&Module::setOverFlowMode, pos, value);
}
Result<bool> Detector::getBottom(Positions pos) const {
return pimpl->Parallel(&Module::getFlippedDataX, pos);
}
void Detector::setBottom(bool value, Positions pos) {
pimpl->Parallel(&Module::setFlippedDataX, pos, value);
}
Result<ns> Detector::getRateCorrection(Positions pos) const {
return pimpl->Parallel(&Module::getRateCorrection, pos);
}

View File

@ -458,6 +458,22 @@ int Module::setTrimEn(const std::vector<int> &energies) {
return shm()->trimEnergies.size();
}
bool Module::getFlippedDataAcrossXAxis() const {
if (shm()->myDetectorType == EIGER) {
return sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, GET_FLAG);
}
return sendToDetector<int>(F_GET_FLIPPED_DATA_X);
}
void Module::setFlippedDataAcrossXAxis(bool value) {
if (shm()->myDetectorType == EIGER) {
sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER,
static_cast<int>(value));
} else {
sendToDetector(F_SET_FLIPPED_DATA_X, static_cast<int>(value), nullptr);
}
}
bool Module::isVirtualDetectorServer() const {
return sendToDetector<int>(F_IS_VIRTUAL);
}
@ -1398,14 +1414,6 @@ void Module::setOverFlowMode(const bool enable) {
sendToDetector(F_SET_OVERFLOW_MODE, static_cast<int>(enable), nullptr);
}
bool Module::getFlippedDataX() const {
return sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, GET_FLAG);
}
void Module::setFlippedDataX(bool value) {
sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, static_cast<int>(value));
}
int64_t Module::getRateCorrection() const {
return sendToDetector<int64_t>(F_GET_RATE_CORRECT);
}

View File

@ -114,6 +114,8 @@ class Module : public virtual slsDetectorDefs {
void setAllTrimbits(int val);
std::vector<int> getTrimEn() const;
int setTrimEn(const std::vector<int> &energies = {});
bool getFlippedDataAcrossXAxis() const;
void setFlippedDataAcrossXAxis(bool value);
bool isVirtualDetectorServer() const;
/**************************************************
@ -323,8 +325,6 @@ class Module : public virtual slsDetectorDefs {
void setSubDeadTime(int64_t value);
bool getOverFlowMode() const;
void setOverFlowMode(const bool enable);
bool getFlippedDataX() const;
void setFlippedDataX(bool value);
int64_t getRateCorrection() const;
void setDefaultRateCorrection();
void setRateCorrection(int64_t t = 0);