flippeddataoverxaxis changed to flipRows

This commit is contained in:
2021-08-05 14:44:25 +02:00
parent c5d6dd0dd4
commit 619f3b71c1
22 changed files with 143 additions and 126 deletions

View File

@ -584,6 +584,7 @@ class CmdProxy {
{"detsizechan", "detsize"},
{"trimdir", "settingspath"},
{"settingsdir", "settingspath"},
{"flippeddatax", "fliprows"},
/* acquisition parameters */
{"cycles", "triggers"},
@ -769,7 +770,7 @@ class CmdProxy {
{"trimval", &CmdProxy::trimval},
{"trimen", &CmdProxy::TrimEnergies},
{"gappixels", &CmdProxy::GapPixels},
{"flippeddatax", &CmdProxy::flippeddatax},
{"fliprows", &CmdProxy::fliprows},
/* acquisition parameters */
{"acquire", &CmdProxy::Acquire},
@ -1234,14 +1235,12 @@ class CmdProxy {
"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.");
fliprows, getFlipRows, setFlipRows, StringTo<int>,
"[0, 1]\n\t[Eiger] flips rows paramater sent to slsreceiver "
"to stream as json parameter to flip rows in gui \n\t[Jungfrau] flips "
"rows in the detector itself. For bottom module and number of "
"interfaces must be set to 2. slsReceiver and slsDetectorGui "
"does not handle.");
/* acquisition parameters */

View File

@ -279,12 +279,12 @@ void Detector::setGapPixelsinCallback(bool enable) {
pimpl->setGapPixelsinCallback(enable);
}
Result<bool> Detector::getFlippedDataAcrossXAxis(Positions pos) const {
return pimpl->Parallel(&Module::getFlippedDataAcrossXAxis, pos);
Result<bool> Detector::getFlipRows(Positions pos) const {
return pimpl->Parallel(&Module::getFlipRows, pos);
}
void Detector::setFlippedDataAcrossXAxis(bool value, Positions pos) {
pimpl->Parallel(&Module::setFlippedDataAcrossXAxis, pos, value);
void Detector::setFlipRows(bool value, Positions pos) {
pimpl->Parallel(&Module::setFlipRows, pos, value);
}
Result<bool> Detector::isVirtualDetectorServer(Positions pos) const {

View File

@ -490,8 +490,7 @@ void DetectorImpl::readFrameFromReceiver() {
uint64_t currentAcquisitionIndex = -1, currentFrameIndex = -1,
currentFileIndex = -1;
double currentProgress = 0.00;
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
flippedDataX = -1;
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1, flipRows = -1;
while (numZmqRunning != 0) {
// reset data
@ -571,7 +570,7 @@ void DetectorImpl::readFrameFromReceiver() {
if (eiger) {
coordY = (nY - 1) - coordY;
}
flippedDataX = zHeader.flippedDataX;
flipRows = zHeader.flipRows;
if (zHeader.completeImage == 0) {
completeImage = false;
}
@ -585,7 +584,7 @@ void DetectorImpl::readFrameFromReceiver() {
<< "\n\tcurrentSubFrameIndex: " << currentSubFrameIndex
<< "\n\tcurrentProgress: " << currentProgress
<< "\n\tcoordX: " << coordX << "\n\tcoordY: " << coordY
<< "\n\tflippedDataX: " << flippedDataX
<< "\n\tflipRows: " << flipRows
<< "\n\tcompleteImage: " << completeImage;
}
@ -609,7 +608,7 @@ void DetectorImpl::readFrameFromReceiver() {
<< "\n\tsingledetrowoffset: " << singledetrowoffset
<< "\n\trowoffset: " << rowoffset;
if (eiger && (flippedDataX != 0U)) {
if (eiger && (flipRows != 0U)) {
for (uint32_t i = 0; i < nPixelsY; ++i) {
memcpy((multiframe.get()) +
((yoffset + (nPixelsY - 1 - i)) *

View File

@ -458,19 +458,18 @@ int Module::setTrimEn(const std::vector<int> &energies) {
return shm()->trimEnergies.size();
}
bool Module::getFlippedDataAcrossXAxis() const {
bool Module::getFlipRows() const {
if (shm()->myDetectorType == EIGER) {
return sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, GET_FLAG);
return sendToReceiver<int>(F_GET_FLIP_ROWS_RECEIVER);
}
return sendToDetector<int>(F_GET_FLIPPED_DATA_X);
return sendToDetector<int>(F_GET_FLIP_ROWS);
}
void Module::setFlippedDataAcrossXAxis(bool value) {
void Module::setFlipRows(bool value) {
if (shm()->myDetectorType == EIGER) {
sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER,
static_cast<int>(value));
sendToReceiver<int>(F_SET_FLIP_ROWS_RECEIVER, static_cast<int>(value));
} else {
sendToDetector(F_SET_FLIPPED_DATA_X, static_cast<int>(value), nullptr);
sendToDetector(F_SET_FLIP_ROWS, static_cast<int>(value), nullptr);
}
}

View File

@ -114,8 +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 getFlipRows() const;
void setFlipRows(bool value);
bool isVirtualDetectorServer() const;
/**************************************************