mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 07:47:12 +02:00
WIP
This commit is contained in:
@ -1094,11 +1094,11 @@ void Detector::setActive(bool active, Positions pos) {
|
||||
}
|
||||
|
||||
Result<bool> Detector::getBottom(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getFlippedData, pos, defs::X);
|
||||
return pimpl->Parallel(&slsDetector::getFlippedDataX, pos);
|
||||
}
|
||||
|
||||
void Detector::setBottom(bool value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setFlippedData, pos, defs::X, static_cast<int>(value));
|
||||
pimpl->Parallel(&slsDetector::setFlippedDataX, pos, static_cast<int>(value));
|
||||
}
|
||||
|
||||
Result<int> Detector::getAllTrimbits(Positions pos) const {
|
||||
|
@ -276,12 +276,12 @@ void multiSlsDetector::initializeDetectorStructure() {
|
||||
multi_shm()->shmversion = MULTI_SHMVERSION;
|
||||
multi_shm()->numberOfDetectors = 0;
|
||||
multi_shm()->multiDetectorType = GENERIC;
|
||||
multi_shm()->numberOfDetector[X] = 0;
|
||||
multi_shm()->numberOfDetector[Y] = 0;
|
||||
multi_shm()->numberOfChannels[X] = 0;
|
||||
multi_shm()->numberOfChannels[Y] = 0;
|
||||
multi_shm()->maxNumberOfChannels[X] = 0;
|
||||
multi_shm()->maxNumberOfChannels[Y] = 0;
|
||||
multi_shm()->numberOfDetector.x = 0;
|
||||
multi_shm()->numberOfDetector.y = 0;
|
||||
multi_shm()->numberOfChannels.x = 0;
|
||||
multi_shm()->numberOfChannels.y = 0;
|
||||
multi_shm()->maxNumberOfChannels.x = 0;
|
||||
multi_shm()->maxNumberOfChannels.y = 0;
|
||||
multi_shm()->acquiringFlag = false;
|
||||
multi_shm()->receiver_upstream = false;
|
||||
}
|
||||
@ -431,7 +431,7 @@ void multiSlsDetector::updateDetectorSize() {
|
||||
|
||||
const slsDetectorDefs::xy det_size = detectors[0]->getNumberOfChannels();
|
||||
|
||||
int maxy = multi_shm()->maxNumberOfChannels[Y];
|
||||
int maxy = multi_shm()->maxNumberOfChannels.y;
|
||||
if (maxy == 0) {
|
||||
maxy = det_size.y * size();
|
||||
}
|
||||
@ -442,29 +442,26 @@ void multiSlsDetector::updateDetectorSize() {
|
||||
++ndetx;
|
||||
}
|
||||
|
||||
multi_shm()->numberOfDetector[X] = ndetx;
|
||||
multi_shm()->numberOfDetector[Y] = ndety;
|
||||
multi_shm()->numberOfChannels[X] = det_size.x * ndetx;
|
||||
multi_shm()->numberOfChannels[Y] = det_size.y * ndety;
|
||||
multi_shm()->numberOfDetector.x = ndetx;
|
||||
multi_shm()->numberOfDetector.y = ndety;
|
||||
multi_shm()->numberOfChannels.x = det_size.x * ndetx;
|
||||
multi_shm()->numberOfChannels.y = det_size.y * ndety;
|
||||
|
||||
FILE_LOG(logDEBUG)
|
||||
<< "\n\tNumber of Detectors in X direction:"
|
||||
<< multi_shm()->numberOfDetector[X]
|
||||
<< multi_shm()->numberOfDetector.x
|
||||
<< "\n\tNumber of Detectors in Y direction:"
|
||||
<< multi_shm()->numberOfDetector[Y]
|
||||
<< multi_shm()->numberOfDetector.y
|
||||
<< "\n\tNumber of Channels in X direction:"
|
||||
<< multi_shm()->numberOfChannels[X]
|
||||
<< multi_shm()->numberOfChannels.x
|
||||
<< "\n\tNumber of Channels in Y direction:"
|
||||
<< multi_shm()->numberOfChannels[Y];
|
||||
<< multi_shm()->numberOfChannels.y;
|
||||
|
||||
|
||||
for (auto &d : detectors) {
|
||||
d->updateMultiSize(multi_shm()->numberOfDetector[0],
|
||||
multi_shm()->numberOfDetector[1]);
|
||||
d->updateMultiSize(multi_shm()->numberOfDetector);
|
||||
}
|
||||
|
||||
multi_shm()->maxNumberOfChannels[X] = multi_shm()->numberOfChannels[X];
|
||||
multi_shm()->maxNumberOfChannels[Y] = multi_shm()->numberOfChannels[Y];
|
||||
multi_shm()->maxNumberOfChannels = multi_shm()->numberOfChannels;
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
||||
@ -497,10 +494,7 @@ std::string multiSlsDetector::getDetectorTypeAsString(int detPos) {
|
||||
size_t multiSlsDetector::size() const { return detectors.size(); }
|
||||
|
||||
slsDetectorDefs::xy multiSlsDetector::getNumberOfDetectors() const {
|
||||
slsDetectorDefs::xy res;
|
||||
res.x = multi_shm()->numberOfDetector[X];
|
||||
res.y = multi_shm()->numberOfDetector[Y];
|
||||
return res;
|
||||
return multi_shm()->numberOfDetector;
|
||||
}
|
||||
|
||||
slsDetectorDefs::xy multiSlsDetector::getNumberOfChannels(int detPos) {
|
||||
@ -510,22 +504,15 @@ slsDetectorDefs::xy multiSlsDetector::getNumberOfChannels(int detPos) {
|
||||
}
|
||||
|
||||
// multi
|
||||
slsDetectorDefs::xy coord;
|
||||
coord.x = multi_shm()->numberOfChannels[X];
|
||||
coord.y = multi_shm()->numberOfChannels[Y];
|
||||
return coord;
|
||||
return multi_shm()->numberOfChannels;
|
||||
}
|
||||
|
||||
slsDetectorDefs::xy multiSlsDetector::getMaxNumberOfChannels() const {
|
||||
slsDetectorDefs::xy coord;
|
||||
coord.x = multi_shm()->maxNumberOfChannels[X];
|
||||
coord.y = multi_shm()->maxNumberOfChannels[Y];
|
||||
return coord;
|
||||
return multi_shm()->maxNumberOfChannels;
|
||||
}
|
||||
|
||||
void multiSlsDetector::setMaxNumberOfChannels(const slsDetectorDefs::xy c) {
|
||||
multi_shm()->maxNumberOfChannels[X] = c.x;
|
||||
multi_shm()->maxNumberOfChannels[Y] = c.y;
|
||||
multi_shm()->maxNumberOfChannels = c;
|
||||
}
|
||||
|
||||
int multiSlsDetector::getQuad(int detPos) {
|
||||
@ -2140,25 +2127,25 @@ int multiSlsDetector::setDeactivatedRxrPaddingMode(int padding, int detPos) {
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::getFlippedData(dimension d, int detPos) {
|
||||
int multiSlsDetector::getFlippedDataX(int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->getFlippedData(d);
|
||||
return detectors[detPos]->getFlippedDataX();
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = serialCall(&slsDetector::getFlippedData, d);
|
||||
auto r = serialCall(&slsDetector::getFlippedDataX);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::setFlippedData(dimension d, int value, int detPos) {
|
||||
int multiSlsDetector::setFlippedDataX(int value, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setFlippedData(d, value);
|
||||
return detectors[detPos]->setFlippedDataX(value);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setFlippedData, d, value);
|
||||
auto r = parallelCall(&slsDetector::setFlippedDataX, value);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
@ -2198,11 +2185,11 @@ int multiSlsDetector::enableGapPixels(int val, int detPos) {
|
||||
if (val != -1) {
|
||||
Parallel(&slsDetector::enableGapPixels, {}, val);
|
||||
Result<slsDetectorDefs::xy> res = Parallel(&slsDetector::getNumberOfChannels, {});
|
||||
multi_shm()->numberOfChannels[X] = 0;
|
||||
multi_shm()->numberOfChannels[Y] = 0;
|
||||
multi_shm()->numberOfChannels.x = 0;
|
||||
multi_shm()->numberOfChannels.y = 0;
|
||||
for (auto &it : res) {
|
||||
multi_shm()->numberOfChannels[X] += it.x;
|
||||
multi_shm()->numberOfChannels[Y] += it.y;
|
||||
multi_shm()->numberOfChannels.x += it.x;
|
||||
multi_shm()->numberOfChannels.y += it.y;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -2211,11 +2198,11 @@ int multiSlsDetector::enableGapPixels(int val, int detPos) {
|
||||
void multiSlsDetector::setGapPixelsEnable(bool enable, Positions pos){
|
||||
Parallel(&slsDetector::enableGapPixels, pos, static_cast<int>(enable));
|
||||
Result<slsDetectorDefs::xy> res = Parallel(&slsDetector::getNumberOfChannels, {});
|
||||
multi_shm()->numberOfChannels[X] = 0;
|
||||
multi_shm()->numberOfChannels[Y] = 0;
|
||||
multi_shm()->numberOfChannels.x = 0;
|
||||
multi_shm()->numberOfChannels.y = 0;
|
||||
for (auto &it : res) {
|
||||
multi_shm()->numberOfChannels[X] += it.x;
|
||||
multi_shm()->numberOfChannels[Y] += it.y;
|
||||
multi_shm()->numberOfChannels.x += it.x;
|
||||
multi_shm()->numberOfChannels.y += it.y;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3046,14 +3033,14 @@ void multiSlsDetector::readFrameFromReceiver() {
|
||||
|
||||
int multiSlsDetector::processImageWithGapPixels(char *image, char *&gpImage, bool quadEnable) {
|
||||
// eiger 4 bit mode
|
||||
int nxb = multi_shm()->numberOfDetector[X] * (512 + 3); //(divided by 2 already)
|
||||
int nyb = multi_shm()->numberOfDetector[Y] * (256 + 1);
|
||||
int nxb = multi_shm()->numberOfDetector.x * (512 + 3); //(divided by 2 already)
|
||||
int nyb = multi_shm()->numberOfDetector.y * (256 + 1);
|
||||
int nchipInRow = 4;
|
||||
int nxchip = multi_shm()->numberOfDetector[X] * 4;
|
||||
int nychip = multi_shm()->numberOfDetector[Y] * 1;
|
||||
int nxchip = multi_shm()->numberOfDetector.x * 4;
|
||||
int nychip = multi_shm()->numberOfDetector.y * 1;
|
||||
if (quadEnable) {
|
||||
nxb = multi_shm()->numberOfDetector[X] * (256 + 1); //(divided by 2 already)
|
||||
nyb = multi_shm()->numberOfDetector[Y] * (512 + 2);
|
||||
nxb = multi_shm()->numberOfDetector.x * (256 + 1); //(divided by 2 already)
|
||||
nyb = multi_shm()->numberOfDetector.y * (512 + 2);
|
||||
nxchip /= 2;
|
||||
nychip *= 2;
|
||||
nchipInRow /= 2;
|
||||
|
@ -308,8 +308,8 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
||||
shm()->controlPort = DEFAULT_PORTNO;
|
||||
sls::strcpy_safe(shm()->hostname, DEFAULT_HOSTNAME);
|
||||
shm()->myDetectorType = type;
|
||||
shm()->multiSize[X] = 0;
|
||||
shm()->multiSize[Y] = 0;
|
||||
shm()->multiSize.x = 0;
|
||||
shm()->multiSize.y = 0;
|
||||
shm()->controlPort = DEFAULT_PORTNO;
|
||||
shm()->stopPort = DEFAULT_PORTNO + 1;
|
||||
sls::strcpy_safe(shm()->settingsDir, getenv("HOME"));
|
||||
@ -354,8 +354,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
||||
shm()->selectedUDPInterface = 0;
|
||||
shm()->useReceiverFlag = false;
|
||||
shm()->tenGigaEnable = 0;
|
||||
shm()->flippedData[X] = 0;
|
||||
shm()->flippedData[Y] = 0;
|
||||
shm()->flippedDataX = 0;
|
||||
shm()->zmqport = DEFAULT_ZMQ_CL_PORTNO +
|
||||
(detId * ((shm()->myDetectorType == EIGER) ? 2 : 1));
|
||||
shm()->rxZmqport = DEFAULT_ZMQ_RX_PORTNO +
|
||||
@ -401,20 +400,16 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
||||
|
||||
// get the detector parameters based on type
|
||||
detParameters parameters{type};
|
||||
shm()->nChan[X] = parameters.nChanX;
|
||||
shm()->nChan[Y] = parameters.nChanY;
|
||||
shm()->nChip[X] = parameters.nChipX;
|
||||
shm()->nChip[Y] = parameters.nChipY;
|
||||
shm()->nChan.x = parameters.nChanX;
|
||||
shm()->nChan.y = parameters.nChanY;
|
||||
shm()->nChip.x = parameters.nChipX;
|
||||
shm()->nChip.y = parameters.nChipY;
|
||||
shm()->nDacs = parameters.nDacs;
|
||||
shm()->dynamicRange = parameters.dynamicRange;
|
||||
shm()->nGappixels[X] = parameters.nGappixelsX;
|
||||
shm()->nGappixels[Y] = parameters.nGappixelsY;
|
||||
shm()->nGappixels.x = parameters.nGappixelsX;
|
||||
shm()->nGappixels.y = parameters.nGappixelsY;
|
||||
|
||||
// derived parameters
|
||||
shm()->nChans = shm()->nChan[X] * shm()->nChan[Y];
|
||||
shm()->nChips = shm()->nChip[X] * shm()->nChip[Y];
|
||||
|
||||
// update #nchans, as it depends on #samples, adcmask,
|
||||
// update #nchan, as it depends on #samples, adcmask,
|
||||
// readoutflags (ctb only)
|
||||
updateNumberOfChannels();
|
||||
}
|
||||
@ -491,8 +486,7 @@ int slsDetector::receiveModule(sls_detector_module *myMod,
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
ts += client.Receive(myMod->chanregs, sizeof(int) * (myMod->nchan));
|
||||
FILE_LOG(logDEBUG1)
|
||||
<< "nchans= " << shm()->nChans << " nchips= " << shm()->nChips
|
||||
<< "mod - nchans= " << myMod->nchan << " nchips= " << myMod->nchip
|
||||
<< " nchan= " << myMod->nchan << " nchip= " << myMod->nchip
|
||||
<< "received chans of size " << ts;
|
||||
}
|
||||
FILE_LOG(logDEBUG1) << "received module of size " << ts << " register "
|
||||
@ -593,15 +587,15 @@ void slsDetector::updateNumberOfChannels() {
|
||||
ndchans = 64;
|
||||
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans;
|
||||
}
|
||||
shm()->nChans = nachans + ndchans;
|
||||
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChans;
|
||||
shm()->nChan.x = nachans + ndchans;
|
||||
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChan.x;
|
||||
}
|
||||
}
|
||||
|
||||
slsDetectorDefs::xy slsDetector::getNumberOfChannels() const {
|
||||
slsDetectorDefs::xy coord;
|
||||
coord.x = (shm()->nChan[X] * shm()->nChip[X] + shm()->gappixels * shm()->nGappixels[X]);
|
||||
coord.y = (shm()->nChan[Y] * shm()->nChip[Y] + shm()->gappixels * shm()->nGappixels[Y]);
|
||||
coord.x = (shm()->nChan.x * shm()->nChip.x + shm()->gappixels * shm()->nGappixels.x);
|
||||
coord.y = (shm()->nChan.y * shm()->nChip.y + shm()->gappixels * shm()->nGappixels.y);
|
||||
return coord;
|
||||
}
|
||||
|
||||
@ -641,9 +635,8 @@ int slsDetector::getReadNLines() {
|
||||
return retval;
|
||||
}
|
||||
|
||||
void slsDetector::updateMultiSize(int detx, int dety) {
|
||||
shm()->multiSize[0] = detx;
|
||||
shm()->multiSize[1] = dety;
|
||||
void slsDetector::updateMultiSize(slsDetectorDefs::xy det) {
|
||||
shm()->multiSize = det;
|
||||
}
|
||||
|
||||
|
||||
@ -831,7 +824,7 @@ void slsDetector::updateCachedDetectorVariables() {
|
||||
if (shm()->myDetectorType == MOENCH)
|
||||
setAdditionalJsonParameter("adcmask", std::to_string(u32));
|
||||
|
||||
// update #nchans, as it depends on #samples, adcmask,
|
||||
// update #nchan, as it depends on #samples, adcmask,
|
||||
// readoutflags
|
||||
updateNumberOfChannels();
|
||||
}
|
||||
@ -1259,7 +1252,7 @@ void slsDetector::configureMAC() {
|
||||
// 2d positions to detector to put into udp header
|
||||
{
|
||||
int pos[2] = {0, 0};
|
||||
int max = shm()->multiSize[Y] * (shm()->numUDPInterfaces);
|
||||
int max = shm()->multiSize.y * (shm()->numUDPInterfaces);
|
||||
// row
|
||||
pos[0] = (detId % max);
|
||||
// col for horiz. udp ports
|
||||
@ -1340,7 +1333,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
||||
sendToDetector(F_SET_TIMER, args, retval);
|
||||
FILE_LOG(logDEBUG1) << getTimerType(index) << ": " << retval;
|
||||
shm()->timerValue[index] = retval;
|
||||
// update #nchans, as it depends on #samples, adcmask,
|
||||
// update #nchan, as it depends on #samples, adcmask,
|
||||
// readoutflags
|
||||
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
||||
updateNumberOfChannels();
|
||||
@ -1492,7 +1485,7 @@ int slsDetector::setReadOutFlags(readOutFlags flag) {
|
||||
sendToDetector(F_SET_READOUT_FLAGS, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Readout flag: " << retval;
|
||||
shm()->roFlags = retval;
|
||||
// update #nchans, as it depends on #samples, adcmask,
|
||||
// update #nchan, as it depends on #samples, adcmask,
|
||||
// readoutflags
|
||||
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
||||
updateNumberOfChannels();
|
||||
@ -1677,7 +1670,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
||||
<< "\nasamples:" << (shm()->timerValue[ANALOG_SAMPLES])
|
||||
<< "\ndsamples:" << (shm()->timerValue[DIGITAL_SAMPLES])
|
||||
<< "\ndynamic range:" << shm()->dynamicRange
|
||||
<< "\nflippeddatax:" << (shm()->flippedData[X])
|
||||
<< "\nflippeddatax:" << (shm()->flippedDataX)
|
||||
<< "\nactivated: " << shm()->activated
|
||||
<< "\nreceiver deactivated padding: " << shm()->rxPadDeactivatedModules
|
||||
<< "\nsilent Mode:" << shm()->rxSilentMode
|
||||
@ -1719,7 +1712,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
||||
shm()->timerValue[SUBFRAME_ACQUISITION_TIME]);
|
||||
setTimer(SUBFRAME_DEADTIME, shm()->timerValue[SUBFRAME_DEADTIME]);
|
||||
setDynamicRange(shm()->dynamicRange);
|
||||
setFlippedData(X, -1);
|
||||
setFlippedDataX(-1);
|
||||
activate(-1);
|
||||
setDeactivatedRxrPaddingMode(
|
||||
static_cast<int>(shm()->rxPadDeactivatedModules));
|
||||
@ -2330,7 +2323,7 @@ void slsDetector::setADCEnableMask(uint32_t mask) {
|
||||
sendToDetector(F_SET_ADC_ENABLE_MASK, &arg, sizeof(arg), nullptr, 0);
|
||||
shm()->adcEnableMask = mask;
|
||||
|
||||
// update #nchans, as it depends on #samples, adcmask,
|
||||
// update #nchan, as it depends on #samples, adcmask,
|
||||
// readoutflags
|
||||
updateNumberOfChannels();
|
||||
|
||||
@ -2477,29 +2470,24 @@ bool slsDetector::setDeactivatedRxrPaddingMode(int padding) {
|
||||
return shm()->rxPadDeactivatedModules;
|
||||
}
|
||||
|
||||
int slsDetector::getFlippedData(dimension d) const {
|
||||
return shm()->flippedData[d];
|
||||
int slsDetector::getFlippedDataX() const {
|
||||
return shm()->flippedDataX;
|
||||
}
|
||||
|
||||
int slsDetector::setFlippedData(dimension d, int value) {
|
||||
if (d == Y) {
|
||||
throw RuntimeError("Flipped across Y axis is not implemented");
|
||||
}
|
||||
int slsDetector::setFlippedDataX(int value) {
|
||||
// replace get with shm value (write to shm right away as it is a det value,
|
||||
// not rx value)
|
||||
if (value > -1) {
|
||||
shm()->flippedData[d] = (value > 0) ? 1 : 0;
|
||||
shm()->flippedDataX = (value > 0) ? 1 : 0;
|
||||
}
|
||||
int args[]{static_cast<int>(d), value};
|
||||
int retval = -1;
|
||||
args[1] = shm()->flippedData[d];
|
||||
FILE_LOG(logDEBUG1) << "Setting flipped data across axis " << d
|
||||
<< " with value: " << value;
|
||||
int arg = shm()->flippedDataX;
|
||||
FILE_LOG(logDEBUG1) << "Setting flipped data across x axis with value: " << arg;
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SET_FLIPPED_DATA_RECEIVER, args, retval);
|
||||
sendToReceiver(F_SET_FLIPPED_DATA_RECEIVER, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Flipped data:" << retval;
|
||||
}
|
||||
return shm()->flippedData[d];
|
||||
return shm()->flippedDataX;
|
||||
}
|
||||
|
||||
int slsDetector::setAllTrimbits(int val) {
|
||||
@ -2978,10 +2966,10 @@ void slsDetector::updateCachedReceiverVariables() const {
|
||||
}
|
||||
|
||||
void slsDetector::sendMultiDetectorSize() {
|
||||
int args[]{shm()->multiSize[0], shm()->multiSize[1]};
|
||||
int args[]{shm()->multiSize.x, shm()->multiSize.y};
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Sending multi detector size to receiver: ("
|
||||
<< shm()->multiSize[0] << "," << shm()->multiSize[1]
|
||||
<< shm()->multiSize.x << "," << shm()->multiSize.y
|
||||
<< ")";
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SEND_RECEIVER_MULTIDETSIZE, args, retval);
|
||||
|
@ -122,13 +122,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdExitServer;
|
||||
++i;
|
||||
|
||||
/*! \page test
|
||||
- <b>flippeddatay [i]</b> enables/disables data being flipped across y axis. 1 enables, 0 disables. Not implemented.
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName = "flippeddatay";
|
||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize;
|
||||
++i;
|
||||
|
||||
/* digital test and debugging */
|
||||
|
||||
/*! \page test
|
||||
@ -3304,15 +3297,7 @@ std::string slsDetectorCommand::cmdDetectorSize(int narg, const char * const arg
|
||||
if ((!sscanf(args[1], "%d", &val)) || (val != 0 && val != 1))
|
||||
return std::string("cannot scan flippeddata x mode: must be 0 or 1");
|
||||
|
||||
myDet->setFlippedData(X, val, detPos);
|
||||
}
|
||||
|
||||
if (cmd == "flippeddatay") {
|
||||
return std::string("Not required for this detector\n");
|
||||
if ((!sscanf(args[1], "%d", &val)) || (val != 0 && val != 1))
|
||||
return std::string("cannot scan flippeddata y mode: must be 0 or 1");
|
||||
|
||||
myDet->setFlippedData(Y, val, detPos);
|
||||
myDet->setFlippedDataX(val, detPos);
|
||||
}
|
||||
|
||||
if (cmd == "gappixels") {
|
||||
@ -3341,10 +3326,7 @@ std::string slsDetectorCommand::cmdDetectorSize(int narg, const char * const arg
|
||||
} else if (cmd=="quad") {
|
||||
return std::to_string(myDet->getQuad());
|
||||
} else if (cmd == "flippeddatax") {
|
||||
ret = myDet->getFlippedData(X, detPos);
|
||||
} else if (cmd == "flippeddatay") {
|
||||
return std::string("Not required for this detector\n");
|
||||
ret = myDet->getFlippedData(Y, detPos);
|
||||
ret = myDet->getFlippedDataX(detPos);
|
||||
} else if (cmd == "gappixels") {
|
||||
if (detPos >= 0) // only in multi detector level to update number of channels etc.
|
||||
return std::string("Cannot execute this command from slsDetector level. Please use multiSlsDetector level.\n");
|
||||
@ -3370,7 +3352,6 @@ std::string slsDetectorCommand::helpDetectorSize(int action) {
|
||||
os << "detsizechan x y \n sets the maximum number of channels for complete detector set in both directions; 0 is no limit" << std::endl;
|
||||
os << "quad i \n if i = 1, sets the detector size to a quad (Specific to an EIGER quad hardware). 0 by default."<< std::endl;
|
||||
os << "flippeddatax x \n sets if the data should be flipped on the x axis" << std::endl;
|
||||
os << "flippeddatay y \n sets if the data should be flipped on the y axis" << std::endl;
|
||||
os << "gappixels i \n enables/disables gap pixels in system (detector & receiver). 1 sets, 0 unsets. Used in EIGER only and multidetector level." << std::endl;
|
||||
}
|
||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||
@ -3379,7 +3360,6 @@ std::string slsDetectorCommand::helpDetectorSize(int action) {
|
||||
os << "detsizechan \n gets the maximum number of channels for complete detector set in both directions; 0 is no limit" << std::endl;
|
||||
os << "quad \n returns 1 if the detector size is a quad (Specific to an EIGER quad hardware). 0 by default."<< std::endl;
|
||||
os << "flippeddatax\n gets if the data will be flipped on the x axis" << std::endl;
|
||||
os << "flippeddatay\n gets if the data will be flipped on the y axis" << std::endl;
|
||||
os << "gappixels\n gets if gap pixels is enabled in system. Used in EIGER only and multidetector level." << std::endl;
|
||||
}
|
||||
return os.str();
|
||||
|
Reference in New Issue
Block a user