mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-02 19:00:05 +02:00
WIP
This commit is contained in:
parent
e635ff035c
commit
947252c852
@ -80,8 +80,9 @@ void qDrawPlot::SetupPlots() {
|
|||||||
setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||||
|
|
||||||
// default image size
|
// default image size
|
||||||
nPixelsX = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::X);
|
slsDetectorDefs::xy res = myDet->getNumberOfChannels();
|
||||||
nPixelsY = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::Y);
|
nPixelsX = res.x;
|
||||||
|
nPixelsY = res.y;
|
||||||
switch(detType) {
|
switch(detType) {
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES, -1) * 2)/25;// for moench 03
|
npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES, -1) * 2)/25;// for moench 03
|
||||||
|
@ -2181,11 +2181,6 @@ int send_update(int file_des) {
|
|||||||
n = sendData(file_des,&i32,sizeof(i32),INT32);
|
n = sendData(file_des,&i32,sizeof(i32),INT32);
|
||||||
if (n < 0) return printSocketReadError();
|
if (n < 0) return printSocketReadError();
|
||||||
|
|
||||||
// databytes
|
|
||||||
i32 = calculateDataBytes();
|
|
||||||
n = sendData(file_des,&i32,sizeof(i32),INT32);
|
|
||||||
if (n < 0) return printSocketReadError();
|
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
#if defined(EIGERD) || defined(JUNGFRAUD) || defined(GOTTHARDD)
|
#if defined(EIGERD) || defined(JUNGFRAUD) || defined(GOTTHARDD)
|
||||||
i32 = (int)getSettings();
|
i32 = (int)getSettings();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -57,17 +57,10 @@ struct sharedMultiSlsDetector {
|
|||||||
int numberOfDetector[2];
|
int numberOfDetector[2];
|
||||||
|
|
||||||
/** total number of channels for all detectors */
|
/** total number of channels for all detectors */
|
||||||
int numberOfChannels;
|
int numberOfChannels[2];
|
||||||
|
|
||||||
/** total number of channels for all detectors in one dimension*/
|
/** max number of channels for complete detector*/
|
||||||
int numberOfChannel[2];
|
int maxNumberOfChannels[2];
|
||||||
|
|
||||||
/** total number of channels including gap pixels in one dimension */
|
|
||||||
int numberOfChannelInclGapPixels[2];
|
|
||||||
|
|
||||||
/** max number of channels allowed for the complete set of detectors in
|
|
||||||
* one dimension */
|
|
||||||
int maxNumberOfChannelsPerDetector[2];
|
|
||||||
|
|
||||||
/** flag for acquiring */
|
/** flag for acquiring */
|
||||||
bool acquiringFlag;
|
bool acquiringFlag;
|
||||||
@ -367,91 +360,32 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
size_t size() const;//
|
size_t size() const;//
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns number of detectors in dimension d
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns number of detectors in dimension d
|
|
||||||
*/
|
|
||||||
int getNumberOfDetectors(dimension d) const;//
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of detectors in each direction
|
* Returns the number of detectors in each direction
|
||||||
@param nx number of detectors in x direction
|
|
||||||
@param ny number of detectors in y direction
|
|
||||||
*/
|
*/
|
||||||
void getNumberOfDetectors(int &nx, int &ny) const;//
|
slsDetectorDefs::xy getNumberOfDetectors() const;//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of channels of all sls detectors from shared
|
* Returns the total number of channels of all sls detectors including gap pixels
|
||||||
* memory
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns the total number of channels of all sls detectors
|
|
||||||
*/
|
|
||||||
int getTotalNumberOfChannels(int detPos = -1);//
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels of all sls detectors in dimension d
|
|
||||||
* from shared memory
|
|
||||||
* @param d dimension d
|
* @param d dimension d
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns the total number of channels of all sls detectors in dimension d
|
* @returns the total number of channels of all sls detectors including gap pixels
|
||||||
*/
|
*/
|
||||||
int getTotalNumberOfChannels(dimension d, int detPos = -1);//
|
slsDetectorDefs::xy getNumberOfChannels(int detPos = -1);//
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels from shared memory in each dimension
|
|
||||||
* @returns the total number of channels in each dimension
|
|
||||||
*/
|
|
||||||
slsDetectorDefs::coordinates getNumberOfChannels() const; //
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels of all sls detectors in dimension d
|
|
||||||
* including gap pixels from shared memory
|
|
||||||
* @param d dimension d
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns the total number of channels of all sls detectors in dimension d
|
|
||||||
* including gap pixels
|
|
||||||
*/
|
|
||||||
int getTotalNumberOfChannelsInclGapPixels(dimension d, int detPos = -1);//
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels including gap pixels
|
|
||||||
* @returns the total number of channels including gap pixels
|
|
||||||
*/
|
|
||||||
slsDetectorDefs::coordinates getTotalNumberOfChannelsInclGapPixels() const; //
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the maximum number of channels of all sls detectors in each
|
|
||||||
* dimension d from shared memory.
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns the maximum number of channels of all sls detectors in dimension
|
|
||||||
* d
|
|
||||||
*/
|
|
||||||
int getMaxNumberOfChannelsPerDetector(dimension d);//
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the maximum number of channels of all sls detectors in each
|
|
||||||
* dimension d from shared memory
|
|
||||||
* @param d dimension d
|
|
||||||
* @param i maximum number of channels for multi structure in dimension d
|
|
||||||
* @returns the maximum number of channels of all sls detectors in dimension
|
|
||||||
* d
|
|
||||||
*/
|
|
||||||
int setMaxNumberOfChannelsPerDetector(dimension d, int i);//
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns maximum number of channels of all sls detectors in each
|
* Returns maximum number of channels of all sls detectors in each
|
||||||
* dimension d from shared memory
|
* dimension d from shared memory
|
||||||
* @returns maximum number of channels of all sls detectors
|
* @returns maximum number of channels of all sls detectors
|
||||||
*/
|
*/
|
||||||
slsDetectorDefs::coordinates getMaxNumberOfChannels() const; //
|
slsDetectorDefs::xy getMaxNumberOfChannels() const; //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets maximum number of channels of all sls detectors in each
|
* Sets maximum number of channels of all sls detectors in each
|
||||||
* dimension d from shared memory
|
* dimension d from shared memory
|
||||||
* @param c maximum number of channels of all sls detectors
|
* @param c maximum number of channels of all sls detectors
|
||||||
*/
|
*/
|
||||||
void setMaxNumberOfChannels(const slsDetectorDefs::coordinates c); //
|
void setMaxNumberOfChannels(const slsDetectorDefs::xy c); //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Quad Type (Only for Eiger Quad detector hardware)
|
* Get Quad Type (Only for Eiger Quad detector hardware)
|
||||||
@ -935,6 +869,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
std::string getDetectorMAC2(int detPos = -1); //
|
std::string getDetectorMAC2(int detPos = -1); //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* //TODO: custom ip (eiger 10G and other detectors), use 0.0.0.0 and test
|
||||||
* Validates the format of the detector IP address and sets it
|
* Validates the format of the detector IP address and sets it
|
||||||
* @param detectorIP detector IP address
|
* @param detectorIP detector IP address
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
@ -985,6 +920,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
std::string getReceiverHostname(int detPos = -1) const; //
|
std::string getReceiverHostname(int detPos = -1) const; //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* TODO: replace this with setEthernetInterface
|
||||||
* Validates the format of the receiver UDP IP address and sets it
|
* Validates the format of the receiver UDP IP address and sets it
|
||||||
* @param udpip receiver UDP IP address
|
* @param udpip receiver UDP IP address
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
class ServerInterface;
|
class ServerInterface;
|
||||||
|
|
||||||
#define SLS_SHMAPIVERSION 0x190726
|
#define SLS_SHMAPIVERSION 0x190726
|
||||||
#define SLS_SHMVERSION 0x190813
|
#define SLS_SHMVERSION 0x190815
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @short structure allocated in shared memory to store detector settings for
|
* @short structure allocated in shared memory to store detector settings for
|
||||||
@ -68,9 +68,6 @@ struct sharedSlsDetector {
|
|||||||
/** dynamic range of the detector data */
|
/** dynamic range of the detector data */
|
||||||
int dynamicRange;
|
int dynamicRange;
|
||||||
|
|
||||||
/** size of the data that are transfered from the detector */
|
|
||||||
int dataBytes;
|
|
||||||
|
|
||||||
/** roi */
|
/** roi */
|
||||||
slsDetectorDefs::ROI roi;
|
slsDetectorDefs::ROI roi;
|
||||||
|
|
||||||
@ -171,9 +168,6 @@ struct sharedSlsDetector {
|
|||||||
/** gap pixels in each direction */
|
/** gap pixels in each direction */
|
||||||
int nGappixels[2];
|
int nGappixels[2];
|
||||||
|
|
||||||
/** data bytes including gap pixels */
|
|
||||||
int dataBytesInclGapPixels;
|
|
||||||
|
|
||||||
/** additional json header */
|
/** additional json header */
|
||||||
char rxAdditionalJsonHeader[MAX_STR_LENGTH];
|
char rxAdditionalJsonHeader[MAX_STR_LENGTH];
|
||||||
|
|
||||||
@ -324,73 +318,17 @@ class slsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
int setDetectorType(detectorType type = GET_DETECTOR_TYPE);
|
int setDetectorType(detectorType type = GET_DETECTOR_TYPE);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels from shared memory
|
|
||||||
* @returns the total number of channels
|
|
||||||
*/
|
|
||||||
int getTotalNumberOfChannels() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update total number of channels (chiptestboard or moench)
|
* Update total number of channels (chiptestboard or moench)
|
||||||
* depending on the number of samples, adenablemask, readout flags(ctb)
|
* depending on the number of samples, adenablemask, readout flags(ctb)
|
||||||
*/
|
*/
|
||||||
void updateTotalNumberOfChannels();
|
void updateNumberOfChannels();
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels in dimension d from shared memory
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns the total number of channels in dimension d
|
|
||||||
*/
|
|
||||||
int getTotalNumberOfChannels(dimension d) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels from shared memory in each dimension
|
|
||||||
* @returns the total number of channels in each dimension
|
|
||||||
*/
|
|
||||||
slsDetectorDefs::coordinates getNumberOfChannels() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of channels of in dimension d including gap
|
|
||||||
* pixels from shared memory
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns the total number of channels including gap pixels in dimension d
|
|
||||||
* including gap pixels
|
|
||||||
*/
|
|
||||||
int getTotalNumberOfChannelsInclGapPixels(dimension d) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of channels including gap pixels
|
* Returns the total number of channels including gap pixels
|
||||||
* @returns the total number of channels including gap pixels
|
* @returns the total number of channels including gap pixels
|
||||||
*/
|
*/
|
||||||
slsDetectorDefs::coordinates getNumberOfChannelsInclGapPixels() const;
|
slsDetectorDefs::xy getNumberOfChannels() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the number of channels per chip from shared memory (Mythen)
|
|
||||||
* @returns number of channels per chip
|
|
||||||
*/
|
|
||||||
int getNChans() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the number of channels per chip in dimension d from shared memory
|
|
||||||
* (Mythen)
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns number of channels per chip in dimension d
|
|
||||||
*/
|
|
||||||
int getNChans(dimension d) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the number of chips per module from shared memory (Mythen)
|
|
||||||
* @returns number of chips per module
|
|
||||||
*/
|
|
||||||
int getNChips() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the number of chips per module in dimension d from shared memory
|
|
||||||
* (Mythen)
|
|
||||||
* @param d dimension d
|
|
||||||
* @returns number of chips per module in dimension d
|
|
||||||
*/
|
|
||||||
int getNChips(dimension d) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Quad Type (Only for Eiger Quad detector hardware)
|
* Get Quad Type (Only for Eiger Quad detector hardware)
|
||||||
@ -654,7 +592,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
|||||||
int setSpeed(speedVariable sp, int value = -1, int mode = 0);
|
int setSpeed(speedVariable sp, int value = -1, int mode = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get dynamic range and updates the number of dataBytes
|
* Set/get dynamic range
|
||||||
* (Eiger: If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
* (Eiger: If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
||||||
* 1)
|
* 1)
|
||||||
* @param i dynamic range (-1 get)
|
* @param i dynamic range (-1 get)
|
||||||
@ -665,18 +603,6 @@ class slsDetector : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
int getDynamicRangeFromShm();
|
int getDynamicRangeFromShm();
|
||||||
|
|
||||||
/**
|
|
||||||
* Recalculated number of data bytes
|
|
||||||
* @returns tota number of data bytes
|
|
||||||
*/
|
|
||||||
int getDataBytes();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recalculated number of data bytes including gap pixels
|
|
||||||
* @returns tota number of data bytes including gap pixels
|
|
||||||
*/
|
|
||||||
int getDataBytesInclGapPixels();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get dacs value
|
* Set/get dacs value
|
||||||
* @param val value (in V)
|
* @param val value (in V)
|
||||||
|
@ -8,14 +8,14 @@ namespace sls {
|
|||||||
|
|
||||||
using defs = slsDetectorDefs;
|
using defs = slsDetectorDefs;
|
||||||
|
|
||||||
Detector::Detector(int multi_id)
|
Detector::Detector(int shm_id)
|
||||||
: pimpl(sls::make_unique<multiSlsDetector>(multi_id)) {}
|
: pimpl(sls::make_unique<multiSlsDetector>(shm_id)) {}
|
||||||
Detector::~Detector() = default;
|
Detector::~Detector() = default;
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
void Detector::freeSharedMemory() { pimpl->freeSharedMemory(); }
|
void Detector::freeSharedMemory() { pimpl->freeSharedMemory(); }
|
||||||
|
|
||||||
void Detector::setConfig(const std::string &fname) {
|
void Detector::loadConfig(const std::string &fname) {
|
||||||
pimpl->readConfigurationFile(fname);
|
pimpl->readConfigurationFile(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,17 +27,9 @@ void Detector::setHostname(const std::vector<std::string> &value) {
|
|||||||
pimpl->setHostname(value);
|
pimpl->setHostname(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Detector::getMultiId() const { return pimpl->getMultiId(); }
|
int Detector::getShmId() const { return pimpl->getMultiId(); }
|
||||||
|
|
||||||
void Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
Result<int64_t> Detector::getFirmwareVersion(Positions pos) const {
|
||||||
pimpl->Parallel(&slsDetector::checkDetectorVersionCompatibility, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::checkReceiverVersionCompatibility(Positions pos) const {
|
|
||||||
pimpl->Parallel(&slsDetector::checkReceiverVersionCompatibility, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<int64_t> Detector::getDetectorFirmwareVersion(Positions pos) const {
|
|
||||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||||
defs::DETECTOR_FIRMWARE_VERSION);
|
defs::DETECTOR_FIRMWARE_VERSION);
|
||||||
}
|
}
|
||||||
@ -47,40 +39,33 @@ Result<int64_t> Detector::getDetectorServerVersion(Positions pos) const {
|
|||||||
defs::DETECTOR_SOFTWARE_VERSION);
|
defs::DETECTOR_SOFTWARE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int64_t> Detector::getDetectorSerialNumber(Positions pos) const {
|
Result<int64_t> Detector::getSerialNumber(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||||
defs::DETECTOR_SERIAL_NUMBER);
|
defs::DETECTOR_SERIAL_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Detector::getClientSoftwareVersion() const {
|
int64_t Detector::getClientVersion() const {
|
||||||
return pimpl->getClientSoftwareVersion();
|
return pimpl->getClientSoftwareVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int64_t> Detector::getReceiverSoftwareVersion(Positions pos) const {
|
Result<int64_t> Detector::getReceiverVersion(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Detector::getUserDetailsFromSharedMemory() const { return pimpl->getUserDetails(); }
|
std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); }
|
||||||
|
|
||||||
Result<defs::detectorType>
|
Result<defs::detectorType>
|
||||||
Detector::getDetectorType(Positions pos) const {
|
Detector::getDetectorType(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
|
||||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
int Detector::size() const { return pimpl->size(); }
|
int Detector::size() const { return pimpl->size(); }
|
||||||
|
|
||||||
defs::coordinates Detector::getNumberOfDetectors() const {
|
defs::xy Detector::getModuleGeometry() const {
|
||||||
defs::coordinates coord;
|
return pimpl->getNumberOfDetectors();
|
||||||
coord.x = pimpl->getNumberOfDetectors(defs::X);
|
|
||||||
coord.y = pimpl->getNumberOfDetectors(defs::Y);
|
|
||||||
return coord;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<defs::coordinates> Detector::getNumberOfChannels(Positions pos) const {
|
Result<defs::xy> Detector::getModuleSize(Positions pos) const {
|
||||||
if (pos.empty() ||
|
if (pos.empty() ||
|
||||||
(pos.size() == 1 &&
|
(pos.size() == 1 &&
|
||||||
pos[0] == -1)) { // TODO: also check condition that pos.size ==
|
pos[0] == -1)) { // TODO: also check condition that pos.size ==
|
||||||
@ -90,19 +75,11 @@ Result<defs::coordinates> Detector::getNumberOfChannels(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getNumberOfChannels, pos);
|
return pimpl->Parallel(&slsDetector::getNumberOfChannels, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<defs::coordinates>
|
defs::xy Detector::getDetectorSize() const {
|
||||||
Detector::getNumberOfChannelsInclGapPixels(Positions pos) const {
|
|
||||||
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
|
|
||||||
return {pimpl->getTotalNumberOfChannelsInclGapPixels()};
|
|
||||||
}
|
|
||||||
return pimpl->Parallel(&slsDetector::getNumberOfChannelsInclGapPixels, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
defs::coordinates Detector::getMaxNumberOfChannels() const {
|
|
||||||
return pimpl->getMaxNumberOfChannels();
|
return pimpl->getMaxNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setMaxNumberOfChannels(const defs::coordinates value) {
|
void Detector::setDetectorSize(const defs::xy value) {
|
||||||
pimpl->setMaxNumberOfChannels(value);
|
pimpl->setMaxNumberOfChannels(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,16 +87,16 @@ Result<bool> Detector::getQuad(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getQuad, pos);
|
return pimpl->Parallel(&slsDetector::getQuad, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setQuad(const bool value, Positions pos) {
|
void Detector::setQuad(const bool value) {
|
||||||
pimpl->setQuad(value, 0);
|
pimpl->setQuad(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getReadNLines(Positions pos) const {
|
Result<int> Detector::getPartialReadout(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getReadNLines, pos);
|
return pimpl->Parallel(&slsDetector::getReadNLines, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setReadNLines(const int value, Positions pos) {
|
void Detector::setPartialReadout(const int lines, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setReadNLines, pos, value);
|
pimpl->Parallel(&slsDetector::setReadNLines, pos, lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getControlPort(Positions pos) const {
|
Result<int> Detector::getControlPort(Positions pos) const {
|
||||||
@ -138,30 +115,22 @@ void Detector::setStopPort(int value, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setStopPort, pos, value);
|
pimpl->Parallel(&slsDetector::setStopPort, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<bool> Detector::getLockServer(Positions pos) const {
|
Result<bool> Detector::getDetectorLock(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::lockServer, pos, -1);
|
return pimpl->Parallel(&slsDetector::lockServer, pos, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setLockServer(bool value, Positions pos) {
|
void Detector::setDetectorLock(bool lock, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::lockServer, pos, static_cast<int>(value));
|
pimpl->Parallel(&slsDetector::lockServer, pos, static_cast<int>(lock));
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<std::string> Detector::getLastClientIP(Positions pos) const {
|
Result<std::string> Detector::getLastClientIP(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getLastClientIP, pos);
|
return pimpl->Parallel(&slsDetector::getLastClientIP, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::exitServer(Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::exitServer, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::execCommand(const std::string &value, Positions pos) {
|
void Detector::execCommand(const std::string &value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::execCommand, pos, value);
|
pimpl->Parallel(&slsDetector::execCommand, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::writeConfigurationFile(const std::string &value) {
|
|
||||||
pimpl->writeConfigurationFile(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<defs::detectorSettings> Detector::getSettings(Positions pos) const {
|
Result<defs::detectorSettings> Detector::getSettings(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getSettings, pos);
|
return pimpl->Parallel(&slsDetector::getSettings, pos);
|
||||||
}
|
}
|
||||||
@ -174,9 +143,9 @@ Result<int> Detector::getThresholdEnergy(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getThresholdEnergy, pos);
|
return pimpl->Parallel(&slsDetector::getThresholdEnergy, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setThresholdEnergy(int value, defs::detectorSettings sett,
|
void Detector::setThresholdEnergy(int threshold_ev, defs::detectorSettings settings,
|
||||||
int tb, Positions pos) {
|
bool trimbits, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setThresholdEnergy, pos, value, sett, tb);
|
pimpl->Parallel(&slsDetector::setThresholdEnergy, pos, threshold_ev, settings, static_cast<int>(trimbits));
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<std::string> Detector::getSettingsDir(Positions pos) const {
|
Result<std::string> Detector::getSettingsDir(Positions pos) const {
|
||||||
@ -187,14 +156,10 @@ void Detector::setSettingsDir(const std::string &value, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setSettingsDir, pos, value);
|
pimpl->Parallel(&slsDetector::setSettingsDir, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::loadSettingsFile(const std::string &value, Positions pos) {
|
void Detector::loadTrimbits(const std::string &value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::loadSettingsFile, pos, value);
|
pimpl->Parallel(&slsDetector::loadSettingsFile, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::saveSettingsFile(const std::string &value, Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::saveSettingsFile, pos, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::configureMAC(Positions pos) {
|
void Detector::configureMAC(Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::configureMAC, pos);
|
pimpl->Parallel(&slsDetector::configureMAC, pos);
|
||||||
}
|
}
|
||||||
@ -207,11 +172,11 @@ void Detector::setNumberOfFrames(int64_t value) {
|
|||||||
pimpl->Parallel(&slsDetector::setTimer, {}, defs::FRAME_NUMBER, value);
|
pimpl->Parallel(&slsDetector::setTimer, {}, defs::FRAME_NUMBER, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int64_t> Detector::getNumberOfCycles() const {
|
Result<int64_t> Detector::getNumberOfTriggers() const {
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, {}, defs::CYCLES_NUMBER, -1);
|
return pimpl->Parallel(&slsDetector::setTimer, {}, defs::CYCLES_NUMBER, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setNumberOfCycles(int64_t value) {
|
void Detector::setNumberOfTriggers(int64_t value) {
|
||||||
pimpl->Parallel(&slsDetector::setTimer, {}, defs::CYCLES_NUMBER, value);
|
pimpl->Parallel(&slsDetector::setTimer, {}, defs::CYCLES_NUMBER, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +185,7 @@ Result<int64_t> Detector::getNumberOfAdditionalStorageCells() const {
|
|||||||
defs::STORAGE_CELL_NUMBER, -1);
|
defs::STORAGE_CELL_NUMBER, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setNumberOfStorageCells(int64_t value) {
|
void Detector::setNumberOfAdditionalStorageCells(int64_t value) {
|
||||||
pimpl->Parallel(&slsDetector::setTimer, {}, defs::STORAGE_CELL_NUMBER,
|
pimpl->Parallel(&slsDetector::setTimer, {}, defs::STORAGE_CELL_NUMBER,
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
@ -695,10 +660,10 @@ void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr);
|
pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<MacAddr> Detector::getDetectorMAC(Positions pos) const {
|
Result<MacAddr> Detector::getSourceUDPMAC(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getDetectorMAC, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorMAC, pos);
|
||||||
}
|
}
|
||||||
void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos) {
|
void Detector::setSourceUDPMAC(const std::string &detectorMAC, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC);
|
pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,11 +674,11 @@ void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC);
|
pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<IpAddr> Detector::getDetectorIP(Positions pos) const {
|
Result<IpAddr> Detector::getSourceUDPIP(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getDetectorIP, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorIP, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDetectorIP(const std::string &detectorIP, Positions pos) {
|
void Detector::setSourceUDPIP(const std::string &detectorIP, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP);
|
pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,11 +698,11 @@ void Detector::setReceiverHostname(const std::string &receiver, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver);
|
pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<IpAddr> Detector::getReceiverUDPIP(Positions pos) const {
|
Result<IpAddr> Detector::getDestinationUDPIP(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getReceiverUDPIP, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverUDPIP, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setReceiverUDPIP(const std::string &udpip, Positions pos) {
|
void Detector::setDestinationUDPIP(const std::string &udpip, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip);
|
pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,11 +714,11 @@ void Detector::setReceiverUDPIP2(const std::string &udpip, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setReceiverUDPIP2, pos, udpip);
|
pimpl->Parallel(&slsDetector::setReceiverUDPIP2, pos, udpip);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<MacAddr> Detector::getReceiverUDPMAC(Positions pos) const {
|
Result<MacAddr> Detector::getDestinationUDPMAC(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setReceiverUDPMAC(const std::string &udpmac, Positions pos) {
|
void Detector::setDestinationUDPMAC(const std::string &udpmac, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setReceiverUDPMAC, pos, udpmac);
|
pimpl->Parallel(&slsDetector::setReceiverUDPMAC, pos, udpmac);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1379,14 +1344,6 @@ Result<std::string> Detector::getReceiverLastClientIP(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::exitReceiver(Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::exitReceiver, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::execReceiverCommand(const std::string &cmd, Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::execReceiverCommand, pos, cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<int> Detector::getReceiverStreamingFrequency(Positions pos) const {
|
Result<int> Detector::getReceiverStreamingFrequency(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1);
|
return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1);
|
||||||
}
|
}
|
||||||
@ -1484,36 +1441,33 @@ Detector::getReceiverRealUDPSocketBufferSize(Positions pos) const {
|
|||||||
// Acquisition
|
// Acquisition
|
||||||
void Detector::acquire() { pimpl->acquire(); }
|
void Detector::acquire() { pimpl->acquire(); }
|
||||||
|
|
||||||
bool Detector::getAcquiringFlag() const { return pimpl->getAcquiringFlag(); }
|
void Detector::clearAcquiringFlag() { pimpl->setAcquiringFlag(0); }
|
||||||
|
|
||||||
void Detector::setAcquiringFlag(bool value) { pimpl->setAcquiringFlag(value); }
|
Result<defs::runStatus> Detector::getDetectorStatus(Positions pos) const{
|
||||||
|
|
||||||
Result<defs::runStatus> Detector::getRunStatus(Positions pos) {
|
|
||||||
return pimpl->Parallel(&slsDetector::getRunStatus, pos);
|
return pimpl->Parallel(&slsDetector::getRunStatus, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::startAcquisition() {
|
void Detector::startAcquisition() {
|
||||||
pimpl->startAcquisition();
|
if (getUseReceiverFlag({}).squash())
|
||||||
|
pimpl->Parallel(&slsDetector::startReceiver, {});
|
||||||
|
pimpl->Parallel(&slsDetector::startAcquisition, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::stopAcquisition() { pimpl->stopAcquisition(); }
|
void Detector::stopAcquisition() {
|
||||||
|
pimpl->Parallel(&slsDetector::stopAcquisition, {});
|
||||||
|
if (getUseReceiverFlag({}).squash()) //TODO: problem for acquire()
|
||||||
|
pimpl->Parallel(&slsDetector::stopReceiver, {});
|
||||||
|
}
|
||||||
|
|
||||||
void Detector::sendSoftwareTrigger(Positions pos) {
|
void Detector::sendSoftwareTrigger(Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos);
|
pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::startReceiver(Positions pos) {
|
Result<defs::runStatus> Detector::getReceiverStatus(Positions pos) const {
|
||||||
pimpl->Parallel(&slsDetector::startReceiver, pos);
|
|
||||||
}
|
|
||||||
void Detector::stopReceiver(Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::stopReceiver, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<defs::runStatus> Detector::getReceiverStatus(Positions pos) {
|
|
||||||
return pimpl->Parallel(&slsDetector::getReceiverStatus, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverStatus, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
|
Result<int> Detector::getFramesCaught(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
|
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1521,10 +1475,6 @@ Result<uint64_t> Detector::getReceiverCurrentFrameIndex(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getReceiverCurrentFrameIndex, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverCurrentFrameIndex, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::resetFramesCaught(Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::resetFramesCaught, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
// pattern
|
// pattern
|
||||||
|
|
||||||
void Detector::setPattern(const std::string &fname, Positions pos) {
|
void Detector::setPattern(const std::string &fname, Positions pos) {
|
||||||
|
@ -278,13 +278,10 @@ void multiSlsDetector::initializeDetectorStructure() {
|
|||||||
multi_shm()->multiDetectorType = GENERIC;
|
multi_shm()->multiDetectorType = GENERIC;
|
||||||
multi_shm()->numberOfDetector[X] = 0;
|
multi_shm()->numberOfDetector[X] = 0;
|
||||||
multi_shm()->numberOfDetector[Y] = 0;
|
multi_shm()->numberOfDetector[Y] = 0;
|
||||||
multi_shm()->numberOfChannels = 0;
|
multi_shm()->numberOfChannels[X] = 0;
|
||||||
multi_shm()->numberOfChannel[X] = 0;
|
multi_shm()->numberOfChannels[Y] = 0;
|
||||||
multi_shm()->numberOfChannel[Y] = 0;
|
multi_shm()->maxNumberOfChannels[X] = 0;
|
||||||
multi_shm()->numberOfChannelInclGapPixels[X] = 0;
|
multi_shm()->maxNumberOfChannels[Y] = 0;
|
||||||
multi_shm()->numberOfChannelInclGapPixels[Y] = 0;
|
|
||||||
multi_shm()->maxNumberOfChannelsPerDetector[X] = -1;
|
|
||||||
multi_shm()->maxNumberOfChannelsPerDetector[Y] = -1;
|
|
||||||
multi_shm()->acquiringFlag = false;
|
multi_shm()->acquiringFlag = false;
|
||||||
multi_shm()->receiver_upstream = false;
|
multi_shm()->receiver_upstream = false;
|
||||||
}
|
}
|
||||||
@ -425,7 +422,6 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
|
|||||||
detectors.push_back(
|
detectors.push_back(
|
||||||
sls::make_unique<slsDetector>(type, multiId, pos, false));
|
sls::make_unique<slsDetector>(type, multiId, pos, false));
|
||||||
multi_shm()->numberOfDetectors = detectors.size();
|
multi_shm()->numberOfDetectors = detectors.size();
|
||||||
multi_shm()->numberOfChannels += detectors[pos]->getTotalNumberOfChannels();
|
|
||||||
detectors[pos]->setHostname(hostname);
|
detectors[pos]->setHostname(hostname);
|
||||||
multi_shm()->multiDetectorType = getDetectorTypeAsEnum(-1);// -1 needed here
|
multi_shm()->multiDetectorType = getDetectorTypeAsEnum(-1);// -1 needed here
|
||||||
}
|
}
|
||||||
@ -433,17 +429,12 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
|
|||||||
void multiSlsDetector::updateDetectorSize() {
|
void multiSlsDetector::updateDetectorSize() {
|
||||||
FILE_LOG(logDEBUG) << "Updating Multi-Detector Size: " << size();
|
FILE_LOG(logDEBUG) << "Updating Multi-Detector Size: " << size();
|
||||||
|
|
||||||
int my = detectors[0]->getTotalNumberOfChannels(Y);
|
slsDetectorDefs::xy res = detectors[0]->getNumberOfChannels();
|
||||||
int mx = detectors[0]->getTotalNumberOfChannels(X);
|
int my = res.x;
|
||||||
int mgy = detectors[0]->getTotalNumberOfChannelsInclGapPixels(Y);
|
int mx = res.y;
|
||||||
int mgx = detectors[0]->getTotalNumberOfChannelsInclGapPixels(X);
|
|
||||||
if (mgy == 0) {
|
|
||||||
mgy = my;
|
|
||||||
mgx = mx;
|
|
||||||
}
|
|
||||||
|
|
||||||
int maxy = multi_shm()->maxNumberOfChannelsPerDetector[Y];
|
int maxy = multi_shm()->maxNumberOfChannels[Y];
|
||||||
if (maxy == -1) {
|
if (maxy == 0) {
|
||||||
maxy = my * size();
|
maxy = my * size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,10 +446,8 @@ void multiSlsDetector::updateDetectorSize() {
|
|||||||
|
|
||||||
multi_shm()->numberOfDetector[X] = ndetx;
|
multi_shm()->numberOfDetector[X] = ndetx;
|
||||||
multi_shm()->numberOfDetector[Y] = ndety;
|
multi_shm()->numberOfDetector[Y] = ndety;
|
||||||
multi_shm()->numberOfChannel[X] = mx * ndetx;
|
multi_shm()->numberOfChannels[X] = mx * ndetx;
|
||||||
multi_shm()->numberOfChannel[Y] = my * ndety;
|
multi_shm()->numberOfChannels[Y] = my * ndety;
|
||||||
multi_shm()->numberOfChannelInclGapPixels[X] = mgx * ndetx;
|
|
||||||
multi_shm()->numberOfChannelInclGapPixels[Y] = mgy * ndety;
|
|
||||||
|
|
||||||
FILE_LOG(logDEBUG)
|
FILE_LOG(logDEBUG)
|
||||||
<< "\n\tNumber of Detectors in X direction:"
|
<< "\n\tNumber of Detectors in X direction:"
|
||||||
@ -466,22 +455,19 @@ void multiSlsDetector::updateDetectorSize() {
|
|||||||
<< "\n\tNumber of Detectors in Y direction:"
|
<< "\n\tNumber of Detectors in Y direction:"
|
||||||
<< multi_shm()->numberOfDetector[Y]
|
<< multi_shm()->numberOfDetector[Y]
|
||||||
<< "\n\tNumber of Channels in X direction:"
|
<< "\n\tNumber of Channels in X direction:"
|
||||||
<< multi_shm()->numberOfChannel[X]
|
<< multi_shm()->numberOfChannels[X]
|
||||||
<< "\n\tNumber of Channels in Y direction:"
|
<< "\n\tNumber of Channels in Y direction:"
|
||||||
<< multi_shm()->numberOfChannel[Y]
|
<< multi_shm()->numberOfChannels[Y];
|
||||||
<< "\n\tNumber of Channels in X direction with Gap Pixels:"
|
|
||||||
<< multi_shm()->numberOfChannelInclGapPixels[X]
|
|
||||||
<< "\n\tNumber of Channels in Y direction with Gap Pixels:"
|
|
||||||
<< multi_shm()->numberOfChannelInclGapPixels[Y];
|
|
||||||
|
|
||||||
multi_shm()->numberOfChannels =
|
|
||||||
multi_shm()->numberOfChannel[0] * multi_shm()->numberOfChannel[1];
|
|
||||||
|
|
||||||
for (auto &d : detectors) {
|
for (auto &d : detectors) {
|
||||||
d->updateMultiSize(multi_shm()->numberOfDetector[0],
|
d->updateMultiSize(multi_shm()->numberOfDetector[0],
|
||||||
multi_shm()->numberOfDetector[1]);
|
multi_shm()->numberOfDetector[1]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
multi_shm()->maxNumberOfChannels[X] = multi_shm()->numberOfChannels[X];
|
||||||
|
multi_shm()->maxNumberOfChannels[Y] = multi_shm()->numberOfChannels[Y];
|
||||||
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum() const {
|
||||||
return multi_shm()->multiDetectorType;
|
return multi_shm()->multiDetectorType;
|
||||||
@ -512,86 +498,43 @@ std::string multiSlsDetector::getDetectorTypeAsString(int detPos) {
|
|||||||
|
|
||||||
size_t multiSlsDetector::size() const { return detectors.size(); }
|
size_t multiSlsDetector::size() const { return detectors.size(); }
|
||||||
|
|
||||||
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
|
slsDetectorDefs::xy multiSlsDetector::getNumberOfDetectors() const {
|
||||||
return multi_shm()->numberOfDetector[d];
|
slsDetectorDefs::xy res;
|
||||||
|
res.x = multi_shm()->numberOfDetector[X];
|
||||||
|
res.y = multi_shm()->numberOfDetector[Y];
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::getNumberOfDetectors(int &nx, int &ny) const {
|
slsDetectorDefs::xy multiSlsDetector::getNumberOfChannels(int detPos) {
|
||||||
nx = multi_shm()->numberOfDetector[X];
|
|
||||||
ny = multi_shm()->numberOfDetector[Y];
|
|
||||||
}
|
|
||||||
|
|
||||||
int multiSlsDetector::getTotalNumberOfChannels(int detPos) {
|
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->getTotalNumberOfChannels();
|
return detectors[detPos]->getNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
return multi_shm()->numberOfChannels;
|
slsDetectorDefs::xy coord;
|
||||||
}
|
coord.x = multi_shm()->numberOfChannels[X];
|
||||||
|
coord.y = multi_shm()->numberOfChannels[Y];
|
||||||
int multiSlsDetector::getTotalNumberOfChannels(dimension d, int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->getTotalNumberOfChannels(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
return multi_shm()->numberOfChannel[d];
|
|
||||||
}
|
|
||||||
|
|
||||||
slsDetectorDefs::coordinates multiSlsDetector::getNumberOfChannels() const {
|
|
||||||
slsDetectorDefs::coordinates coord;
|
|
||||||
coord.x = multi_shm()->numberOfChannel[X];
|
|
||||||
coord.y = multi_shm()->numberOfChannel[Y];
|
|
||||||
return coord;
|
return coord;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d,
|
slsDetectorDefs::xy multiSlsDetector::getMaxNumberOfChannels() const {
|
||||||
int detPos) {
|
slsDetectorDefs::xy coord;
|
||||||
// single
|
coord.x = multi_shm()->maxNumberOfChannels[X];
|
||||||
if (detPos >= 0) {
|
coord.y = multi_shm()->maxNumberOfChannels[Y];
|
||||||
return detectors[detPos]->getTotalNumberOfChannelsInclGapPixels(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
return multi_shm()->numberOfChannelInclGapPixels[d];
|
|
||||||
}
|
|
||||||
|
|
||||||
slsDetectorDefs::coordinates multiSlsDetector::getTotalNumberOfChannelsInclGapPixels() const {
|
|
||||||
slsDetectorDefs::coordinates coord;
|
|
||||||
coord.x = multi_shm()->numberOfChannelInclGapPixels[X];
|
|
||||||
coord.y = multi_shm()->numberOfChannelInclGapPixels[Y];
|
|
||||||
return coord;
|
return coord;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getMaxNumberOfChannelsPerDetector(dimension d) {
|
void multiSlsDetector::setMaxNumberOfChannels(const slsDetectorDefs::xy c) {
|
||||||
return multi_shm()->maxNumberOfChannelsPerDetector[d];
|
multi_shm()->maxNumberOfChannels[X] = c.x;
|
||||||
}
|
multi_shm()->maxNumberOfChannels[Y] = c.y;
|
||||||
|
|
||||||
int multiSlsDetector::setMaxNumberOfChannelsPerDetector(dimension d, int i) {
|
|
||||||
multi_shm()->maxNumberOfChannelsPerDetector[d] = i;
|
|
||||||
return multi_shm()->maxNumberOfChannelsPerDetector[d];
|
|
||||||
}
|
|
||||||
|
|
||||||
slsDetectorDefs::coordinates multiSlsDetector::getMaxNumberOfChannels() const {
|
|
||||||
slsDetectorDefs::coordinates coord;
|
|
||||||
coord.x = multi_shm()->maxNumberOfChannelsPerDetector[X];
|
|
||||||
coord.y = multi_shm()->maxNumberOfChannelsPerDetector[Y];
|
|
||||||
return coord;
|
|
||||||
}
|
|
||||||
|
|
||||||
void multiSlsDetector::setMaxNumberOfChannels(const slsDetectorDefs::coordinates c) {
|
|
||||||
multi_shm()->maxNumberOfChannelsPerDetector[X] = c.x;
|
|
||||||
multi_shm()->maxNumberOfChannelsPerDetector[Y] = c.y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getQuad(int detPos) {
|
int multiSlsDetector::getQuad(int detPos) {
|
||||||
int retval = detectors[0]->getQuad();
|
int retval = detectors[0]->getQuad();
|
||||||
if (retval && size() > 1) {
|
if (retval && size() > 1) {
|
||||||
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
||||||
"module, but it Quad is enabled for 1st readout");
|
"module, but Quad is enabled for 1st readout");
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -1959,7 +1902,7 @@ void multiSlsDetector::loadImageToDetector(imageType index,
|
|||||||
// multi
|
// multi
|
||||||
|
|
||||||
// read image for all
|
// read image for all
|
||||||
int nch = multi_shm()->numberOfChannels;
|
int nch = getNumberOfChannels().x;
|
||||||
short int imageVals[nch];
|
short int imageVals[nch];
|
||||||
if (readDataFile(fname, imageVals, nch) < nch * (int)sizeof(short int)) {
|
if (readDataFile(fname, imageVals, nch) < nch * (int)sizeof(short int)) {
|
||||||
throw RuntimeError("Could not open file or not enough data in file to "
|
throw RuntimeError("Could not open file or not enough data in file to "
|
||||||
@ -1968,7 +1911,7 @@ void multiSlsDetector::loadImageToDetector(imageType index,
|
|||||||
|
|
||||||
// send image to all
|
// send image to all
|
||||||
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
||||||
detectors[idet]->sendImageToDetector(index, imageVals + idet * detectors[idet]->getTotalNumberOfChannels());
|
detectors[idet]->sendImageToDetector(index, imageVals + idet * detectors[idet]->getNumberOfChannels().x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1980,11 +1923,11 @@ void multiSlsDetector::writeCounterBlockFile(const std::string &fname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
int nch = multi_shm()->numberOfChannels;
|
int nch = getNumberOfChannels().x;
|
||||||
short int imageVals[nch];
|
short int imageVals[nch];
|
||||||
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
||||||
detectors[idet]->getCounterBlock(
|
detectors[idet]->getCounterBlock(
|
||||||
imageVals + idet * detectors[idet]->getTotalNumberOfChannels(),
|
imageVals + idet * detectors[idet]->getNumberOfChannels().x,
|
||||||
startACQ);
|
startACQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2255,16 +2198,27 @@ int multiSlsDetector::enableGapPixels(int val, int detPos) {
|
|||||||
int ret = sls::minusOneIfDifferent(r);
|
int ret = sls::minusOneIfDifferent(r);
|
||||||
|
|
||||||
if (val != -1) {
|
if (val != -1) {
|
||||||
multi_shm()->numberOfChannelInclGapPixels[X] = sls::sum(parallelCall(&slsDetector::getTotalNumberOfChannelsInclGapPixels, X));
|
Parallel(&slsDetector::enableGapPixels, {}, val);
|
||||||
multi_shm()->numberOfChannelInclGapPixels[Y] = sls::sum(parallelCall(&slsDetector::getTotalNumberOfChannelsInclGapPixels, Y));
|
Result<slsDetectorDefs::xy> res = Parallel(&slsDetector::getNumberOfChannels, {});
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::setGapPixelsEnable(bool enable, Positions pos){
|
void multiSlsDetector::setGapPixelsEnable(bool enable, Positions pos){
|
||||||
Parallel(&slsDetector::enableGapPixels, pos, static_cast<int>(enable));
|
Parallel(&slsDetector::enableGapPixels, pos, static_cast<int>(enable));
|
||||||
multi_shm()->numberOfChannelInclGapPixels[X] = sls::sum(parallelCall(&slsDetector::getTotalNumberOfChannelsInclGapPixels, X));
|
Result<slsDetectorDefs::xy> res = Parallel(&slsDetector::getNumberOfChannels, {});
|
||||||
multi_shm()->numberOfChannelInclGapPixels[Y] = sls::sum(parallelCall(&slsDetector::getTotalNumberOfChannelsInclGapPixels, Y));
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setTrimEn(std::vector<int> energies, int detPos) {
|
int multiSlsDetector::setTrimEn(std::vector<int> energies, int detPos) {
|
||||||
|
@ -414,17 +414,9 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
shm()->nChans = shm()->nChan[X] * shm()->nChan[Y];
|
shm()->nChans = shm()->nChan[X] * shm()->nChan[Y];
|
||||||
shm()->nChips = shm()->nChip[X] * shm()->nChip[Y];
|
shm()->nChips = shm()->nChip[X] * shm()->nChip[Y];
|
||||||
|
|
||||||
// calculating databytes
|
// update #nchans, as it depends on #samples, adcmask,
|
||||||
shm()->dataBytes = shm()->nChips * shm()->nChans * shm()->dynamicRange / 8;
|
|
||||||
shm()->dataBytesInclGapPixels = (shm()->nChip[X] * shm()->nChan[X] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[X]) *
|
|
||||||
(shm()->nChip[Y] * shm()->nChan[Y] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[Y]) *
|
|
||||||
shm()->dynamicRange / 8;
|
|
||||||
|
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
|
||||||
// readoutflags (ctb only)
|
// readoutflags (ctb only)
|
||||||
updateTotalNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::sendModule(sls_detector_module *myMod,
|
int slsDetector::sendModule(sls_detector_module *myMod,
|
||||||
@ -574,16 +566,11 @@ std::string slsDetector::getDetectorTypeAsString() const {
|
|||||||
return slsDetectorDefs::detectorTypeToString(getDetectorTypeAsEnum());
|
return slsDetectorDefs::detectorTypeToString(getDetectorTypeAsEnum());
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::getTotalNumberOfChannels() const {
|
void slsDetector::updateNumberOfChannels() {
|
||||||
return shm()->nChans * shm()->nChips;
|
|
||||||
}
|
|
||||||
|
|
||||||
void slsDetector::updateTotalNumberOfChannels() {
|
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
||||||
shm()->myDetectorType == MOENCH) {
|
shm()->myDetectorType == MOENCH) {
|
||||||
|
|
||||||
int nachans = 0, ndchans = 0;
|
int nachans = 0, ndchans = 0;
|
||||||
int adatabytes = 0, ddatabytes = 0;
|
|
||||||
// analog channels (normal, analog/digital readout)
|
// analog channels (normal, analog/digital readout)
|
||||||
if (shm()->roFlags == slsDetectorDefs::NORMAL_READOUT ||
|
if (shm()->roFlags == slsDetectorDefs::NORMAL_READOUT ||
|
||||||
((shm()->roFlags & slsDetectorDefs::ANALOG_AND_DIGITAL) != 0)) {
|
((shm()->roFlags & slsDetectorDefs::ANALOG_AND_DIGITAL) != 0)) {
|
||||||
@ -596,10 +583,7 @@ void slsDetector::updateTotalNumberOfChannels() {
|
|||||||
++nachans;
|
++nachans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adatabytes = nachans * (shm()->dynamicRange / 8) *
|
FILE_LOG(logDEBUG1) << "#Analog Channels:" << nachans;
|
||||||
shm()->timerValue[ANALOG_SAMPLES];
|
|
||||||
FILE_LOG(logDEBUG1) << "#Analog Channels:" << nachans
|
|
||||||
<< " Databytes: " << adatabytes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// digital channels (ctb only, digital, analog/digital readout)
|
// digital channels (ctb only, digital, analog/digital readout)
|
||||||
@ -607,50 +591,20 @@ void slsDetector::updateTotalNumberOfChannels() {
|
|||||||
(((shm()->roFlags & DIGITAL_ONLY) != 0) ||
|
(((shm()->roFlags & DIGITAL_ONLY) != 0) ||
|
||||||
((shm()->roFlags & ANALOG_AND_DIGITAL) != 0))) {
|
((shm()->roFlags & ANALOG_AND_DIGITAL) != 0))) {
|
||||||
ndchans = 64;
|
ndchans = 64;
|
||||||
ddatabytes =
|
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans;
|
||||||
(sizeof(uint64_t) * shm()->timerValue[DIGITAL_SAMPLES]);
|
|
||||||
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans
|
|
||||||
<< " Databytes: " << ddatabytes;
|
|
||||||
}
|
}
|
||||||
shm()->nChans = nachans + ndchans;
|
shm()->nChans = nachans + ndchans;
|
||||||
shm()->dataBytes = adatabytes + ddatabytes;
|
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChans;
|
||||||
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChans
|
|
||||||
<< " Databytes: " << shm()->dataBytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::getTotalNumberOfChannels(dimension d) const {
|
slsDetectorDefs::xy slsDetector::getNumberOfChannels() const {
|
||||||
return shm()->nChan[d] * shm()->nChip[d];
|
slsDetectorDefs::xy coord;
|
||||||
}
|
|
||||||
|
|
||||||
slsDetectorDefs::coordinates slsDetector::getNumberOfChannels() const {
|
|
||||||
slsDetectorDefs::coordinates coord;
|
|
||||||
coord.x = shm()->nChan[X] * shm()->nChip[X];
|
|
||||||
coord.y = shm()->nChan[Y] * shm()->nChip[Y];
|
|
||||||
return coord;
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d) const {
|
|
||||||
return (shm()->nChan[d] * shm()->nChip[d] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[d]);
|
|
||||||
}
|
|
||||||
|
|
||||||
slsDetectorDefs::coordinates slsDetector::getNumberOfChannelsInclGapPixels() const {
|
|
||||||
slsDetectorDefs::coordinates coord;
|
|
||||||
coord.x = (shm()->nChan[X] * shm()->nChip[X] + shm()->gappixels * shm()->nGappixels[X]);
|
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.y = (shm()->nChan[Y] * shm()->nChip[Y] + shm()->gappixels * shm()->nGappixels[Y]);
|
||||||
return coord;
|
return coord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::getNChans() const { return shm()->nChans; }
|
|
||||||
|
|
||||||
int slsDetector::getNChans(dimension d) const { return shm()->nChan[d]; }
|
|
||||||
|
|
||||||
int slsDetector::getNChips() const { return shm()->nChips; }
|
|
||||||
|
|
||||||
int slsDetector::getNChips(dimension d) const { return shm()->nChip[d]; }
|
|
||||||
|
|
||||||
bool slsDetector::getQuad() {
|
bool slsDetector::getQuad() {
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
FILE_LOG(logDEBUG1) << "Getting Quad Type";
|
FILE_LOG(logDEBUG1) << "Getting Quad Type";
|
||||||
@ -785,11 +739,7 @@ void slsDetector::updateCachedDetectorVariables() {
|
|||||||
|
|
||||||
// dr
|
// dr
|
||||||
n += client.Receive(&i32, sizeof(i32));
|
n += client.Receive(&i32, sizeof(i32));
|
||||||
shm()->dynamicRange = i32;
|
shm()->dynamicRange = i32;
|
||||||
|
|
||||||
// databytes
|
|
||||||
n += client.Receive(&i32, sizeof(i32));
|
|
||||||
shm()->dataBytes = i32;
|
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
if ((shm()->myDetectorType != CHIPTESTBOARD) &&
|
if ((shm()->myDetectorType != CHIPTESTBOARD) &&
|
||||||
@ -881,9 +831,9 @@ void slsDetector::updateCachedDetectorVariables() {
|
|||||||
if (shm()->myDetectorType == MOENCH)
|
if (shm()->myDetectorType == MOENCH)
|
||||||
setAdditionalJsonParameter("adcmask", std::to_string(u32));
|
setAdditionalJsonParameter("adcmask", std::to_string(u32));
|
||||||
|
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
// readoutflags
|
||||||
updateTotalNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
@ -1390,10 +1340,10 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
|||||||
sendToDetector(F_SET_TIMER, args, retval);
|
sendToDetector(F_SET_TIMER, args, retval);
|
||||||
FILE_LOG(logDEBUG1) << getTimerType(index) << ": " << retval;
|
FILE_LOG(logDEBUG1) << getTimerType(index) << ": " << retval;
|
||||||
shm()->timerValue[index] = retval;
|
shm()->timerValue[index] = retval;
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
// readoutflags
|
||||||
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
||||||
updateTotalNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
// setting timers consequences (eiger (ratecorr) )
|
// setting timers consequences (eiger (ratecorr) )
|
||||||
@ -1477,27 +1427,10 @@ int slsDetector::setDynamicRange(int n) {
|
|||||||
// TODO! Properly handle fail
|
// TODO! Properly handle fail
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
FILE_LOG(logDEBUG1) << "Setting dynamic range to " << n;
|
FILE_LOG(logDEBUG1) << "Setting dynamic range to " << n;
|
||||||
int olddr = shm()->dynamicRange;
|
|
||||||
sendToDetector(F_SET_DYNAMIC_RANGE, n, retval);
|
sendToDetector(F_SET_DYNAMIC_RANGE, n, retval);
|
||||||
FILE_LOG(logDEBUG1) << "Dynamic Range: " << retval;
|
FILE_LOG(logDEBUG1) << "Dynamic Range: " << retval;
|
||||||
shm()->dynamicRange = retval;
|
shm()->dynamicRange = retval;
|
||||||
|
|
||||||
// only for eiger
|
|
||||||
// setting dr consequences on databytes shm
|
|
||||||
// (a get can also change timer value, hence check difference)
|
|
||||||
if (olddr != shm()->dynamicRange) {
|
|
||||||
shm()->dataBytes = shm()->nChips * shm()->nChans * retval / 8;
|
|
||||||
shm()->dataBytesInclGapPixels =
|
|
||||||
(shm()->nChip[X] * shm()->nChan[X] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[X]) *
|
|
||||||
(shm()->nChip[Y] * shm()->nChan[Y] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[Y]) *
|
|
||||||
retval / 8;
|
|
||||||
FILE_LOG(logDEBUG1) << "Data bytes " << shm()->dataBytes;
|
|
||||||
FILE_LOG(logDEBUG1) << "Data bytes including gap pixels"
|
|
||||||
<< shm()->dataBytesInclGapPixels;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
n = shm()->dynamicRange;
|
n = shm()->dynamicRange;
|
||||||
retval = -1;
|
retval = -1;
|
||||||
@ -1512,12 +1445,6 @@ int slsDetector::getDynamicRangeFromShm() {
|
|||||||
return shm()->dynamicRange;
|
return shm()->dynamicRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::getDataBytes() { return shm()->dataBytes; }
|
|
||||||
|
|
||||||
int slsDetector::getDataBytesInclGapPixels() {
|
|
||||||
return shm()->dataBytesInclGapPixels;
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
||||||
int args[]{static_cast<int>(index), mV, val};
|
int args[]{static_cast<int>(index), mV, val};
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
@ -1565,10 +1492,10 @@ int slsDetector::setReadOutFlags(readOutFlags flag) {
|
|||||||
sendToDetector(F_SET_READOUT_FLAGS, arg, retval);
|
sendToDetector(F_SET_READOUT_FLAGS, arg, retval);
|
||||||
FILE_LOG(logDEBUG1) << "Readout flag: " << retval;
|
FILE_LOG(logDEBUG1) << "Readout flag: " << retval;
|
||||||
shm()->roFlags = retval;
|
shm()->roFlags = retval;
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
// readoutflags
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
||||||
updateTotalNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
FILE_LOG(logDEBUG1) << "Setting receiver readout flags to " << arg;
|
FILE_LOG(logDEBUG1) << "Setting receiver readout flags to " << arg;
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
@ -2246,7 +2173,7 @@ int slsDetector::digitalTest(digitalTestMode mode, int ival) {
|
|||||||
|
|
||||||
void slsDetector::loadImageToDetector(imageType index,
|
void slsDetector::loadImageToDetector(imageType index,
|
||||||
const std::string &fname) {
|
const std::string &fname) {
|
||||||
int nChan = getTotalNumberOfChannels();
|
int nChan = getNumberOfChannels().x;
|
||||||
int16_t args[nChan];
|
int16_t args[nChan];
|
||||||
FILE_LOG(logDEBUG1) << "Loading " << (index == 0u ? "Dark" : "Gain")
|
FILE_LOG(logDEBUG1) << "Loading " << (index == 0u ? "Dark" : "Gain")
|
||||||
<< "image from file " << fname;
|
<< "image from file " << fname;
|
||||||
@ -2261,7 +2188,7 @@ void slsDetector::loadImageToDetector(imageType index,
|
|||||||
|
|
||||||
void slsDetector::sendImageToDetector(imageType index, int16_t imageVals[]) {
|
void slsDetector::sendImageToDetector(imageType index, int16_t imageVals[]) {
|
||||||
int fnum = F_LOAD_IMAGE;
|
int fnum = F_LOAD_IMAGE;
|
||||||
int nChan = getTotalNumberOfChannels();
|
int nChan = getNumberOfChannels().x;
|
||||||
int args[]{static_cast<int>(index), nChan};
|
int args[]{static_cast<int>(index), nChan};
|
||||||
FILE_LOG(logDEBUG1) << "Sending image to detector";
|
FILE_LOG(logDEBUG1) << "Sending image to detector";
|
||||||
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
|
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
|
||||||
@ -2281,7 +2208,7 @@ void slsDetector::sendImageToDetector(imageType index, int16_t imageVals[]) {
|
|||||||
|
|
||||||
void slsDetector::writeCounterBlockFile(const std::string &fname,
|
void slsDetector::writeCounterBlockFile(const std::string &fname,
|
||||||
int startACQ) {
|
int startACQ) {
|
||||||
int nChan = getTotalNumberOfChannels();
|
int nChan = getNumberOfChannels().x;
|
||||||
int16_t retvals[nChan];
|
int16_t retvals[nChan];
|
||||||
FILE_LOG(logDEBUG1) << "Reading Counter to " << fname
|
FILE_LOG(logDEBUG1) << "Reading Counter to " << fname
|
||||||
<< (startACQ != 0 ? " and Restarting Acquisition"
|
<< (startACQ != 0 ? " and Restarting Acquisition"
|
||||||
@ -2292,7 +2219,7 @@ void slsDetector::writeCounterBlockFile(const std::string &fname,
|
|||||||
|
|
||||||
void slsDetector::getCounterBlock(int16_t image[], int startACQ) {
|
void slsDetector::getCounterBlock(int16_t image[], int startACQ) {
|
||||||
int fnum = F_READ_COUNTER_BLOCK;
|
int fnum = F_READ_COUNTER_BLOCK;
|
||||||
int nChan = getTotalNumberOfChannels();
|
int nChan = getNumberOfChannels().x;
|
||||||
int args[] = {startACQ, nChan};
|
int args[] = {startACQ, nChan};
|
||||||
FILE_LOG(logDEBUG1) << "Reading Counter block with startacq: " << startACQ;
|
FILE_LOG(logDEBUG1) << "Reading Counter block with startacq: " << startACQ;
|
||||||
sendToDetector(fnum, args, sizeof(args), image, nChan * sizeof(int16_t));
|
sendToDetector(fnum, args, sizeof(args), image, nChan * sizeof(int16_t));
|
||||||
@ -2322,7 +2249,7 @@ void slsDetector::clearROI() {
|
|||||||
void slsDetector::setROI(slsDetectorDefs::ROI arg) {
|
void slsDetector::setROI(slsDetectorDefs::ROI arg) {
|
||||||
int fnum = F_SET_ROI;
|
int fnum = F_SET_ROI;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
if (arg.xmin < 0 || arg.xmax >= getTotalNumberOfChannels()) {
|
if (arg.xmin < 0 || arg.xmax >= getNumberOfChannels().x) {
|
||||||
arg.xmin = -1;
|
arg.xmin = -1;
|
||||||
arg.xmax = -1;
|
arg.xmax = -1;
|
||||||
}
|
}
|
||||||
@ -2403,9 +2330,9 @@ void slsDetector::setADCEnableMask(uint32_t mask) {
|
|||||||
sendToDetector(F_SET_ADC_ENABLE_MASK, &arg, sizeof(arg), nullptr, 0);
|
sendToDetector(F_SET_ADC_ENABLE_MASK, &arg, sizeof(arg), nullptr, 0);
|
||||||
shm()->adcEnableMask = mask;
|
shm()->adcEnableMask = mask;
|
||||||
|
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
// readoutflags
|
||||||
updateTotalNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
|
|
||||||
// send to processor
|
// send to processor
|
||||||
if (shm()->myDetectorType == MOENCH)
|
if (shm()->myDetectorType == MOENCH)
|
||||||
@ -2592,16 +2519,6 @@ int slsDetector::enableGapPixels(int val) {
|
|||||||
sendToReceiver(fnum, &val, sizeof(val), &retval, sizeof(retval));
|
sendToReceiver(fnum, &val, sizeof(val), &retval, sizeof(retval));
|
||||||
FILE_LOG(logDEBUG1) << "Gap pixels enable to receiver:" << retval;
|
FILE_LOG(logDEBUG1) << "Gap pixels enable to receiver:" << retval;
|
||||||
shm()->gappixels = retval;
|
shm()->gappixels = retval;
|
||||||
// update databytes
|
|
||||||
shm()->dataBytesInclGapPixels = 0;
|
|
||||||
if (shm()->dynamicRange != 4) {
|
|
||||||
shm()->dataBytesInclGapPixels =
|
|
||||||
(shm()->nChip[X] * shm()->nChan[X] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[X]) *
|
|
||||||
(shm()->nChip[Y] * shm()->nChan[Y] +
|
|
||||||
shm()->gappixels * shm()->nGappixels[Y]) *
|
|
||||||
shm()->dynamicRange / 8;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return shm()->gappixels;
|
return shm()->gappixels;
|
||||||
|
@ -322,7 +322,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page config
|
/*! \page config
|
||||||
- <b>detsizechan [xmax] [ymax]</b> sets the maximum number of channels in each dimension for complete detector set; -1 is no limit. Use for multi-detector system as first command in config file. \c Returns \c ("int int")
|
- <b>detsizechan [xmax] [ymax]</b> sets the maximum number of channels in each dimension for complete detector set; 0 is no limit. Use for multi-detector system as first command in config file. \c Returns \c ("int int")
|
||||||
*/
|
*/
|
||||||
descrToFuncMap[i].m_pFuncName = "detsizechan";
|
descrToFuncMap[i].m_pFuncName = "detsizechan";
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize;
|
||||||
@ -3284,10 +3284,14 @@ std::string slsDetectorCommand::cmdDetectorSize(int narg, const char * const arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cmd == "detsizechan") {
|
if (cmd == "detsizechan") {
|
||||||
if ((sscanf(args[1], "%d", &val)) && (val > 0))
|
int val2 = 0;
|
||||||
myDet->setMaxNumberOfChannelsPerDetector(X, val);
|
if ((!sscanf(args[1], "%d", &val)) || (narg <= 2) || (!sscanf(args[2], "%d", &val2))) {
|
||||||
if ((narg > 2) && (sscanf(args[2], "%d", &val)) && (val > 0))
|
return std::string("Could not scan det size chan values");
|
||||||
myDet->setMaxNumberOfChannelsPerDetector(Y, val);
|
}
|
||||||
|
slsDetectorDefs::xy res;
|
||||||
|
res.x = val;
|
||||||
|
res.y = val2;
|
||||||
|
myDet->setMaxNumberOfChannels(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cmd=="quad"){
|
if(cmd=="quad"){
|
||||||
@ -3331,7 +3335,8 @@ std::string slsDetectorCommand::cmdDetectorSize(int narg, const char * const arg
|
|||||||
ROI roi = myDet->getROI(detPos);
|
ROI roi = myDet->getROI(detPos);
|
||||||
return (std::string("[") + std::to_string(roi.xmin) + std::string(",") + std::to_string(roi.xmax) + std::string("]"));
|
return (std::string("[") + std::to_string(roi.xmin) + std::string(",") + std::to_string(roi.xmax) + std::string("]"));
|
||||||
} else if (cmd == "detsizechan") {
|
} else if (cmd == "detsizechan") {
|
||||||
sprintf(ans, "%d %d", myDet->getMaxNumberOfChannelsPerDetector(X), myDet->getMaxNumberOfChannelsPerDetector(Y));
|
slsDetectorDefs::xy res = myDet->getMaxNumberOfChannels();
|
||||||
|
sprintf(ans, "%d %d", res.x, res.y);
|
||||||
return std::string(ans);
|
return std::string(ans);
|
||||||
} else if (cmd=="quad") {
|
} else if (cmd=="quad") {
|
||||||
return std::to_string(myDet->getQuad());
|
return std::to_string(myDet->getQuad());
|
||||||
@ -3362,7 +3367,7 @@ std::string slsDetectorCommand::helpDetectorSize(int action) {
|
|||||||
os << "dr i \n sets the dynamic range of the detector" << std::endl;
|
os << "dr i \n sets the dynamic range of the detector" << std::endl;
|
||||||
os << "clearroi \n resets region of interest" << std::endl;
|
os << "clearroi \n resets region of interest" << std::endl;
|
||||||
os << "roi xmin xmax \n sets region of interest " << std::endl;
|
os << "roi xmin xmax \n sets region of interest " << std::endl;
|
||||||
os << "detsizechan x y \n sets the maximum number of channels for complete detector set in both directions; -1 is no limit" << std::endl;
|
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 << "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 << "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 << "flippeddatay y \n sets if the data should be flipped on the y axis" << std::endl;
|
||||||
@ -3371,7 +3376,7 @@ std::string slsDetectorCommand::helpDetectorSize(int action) {
|
|||||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||||
os << "dr \n gets the dynamic range of the detector" << std::endl;
|
os << "dr \n gets the dynamic range of the detector" << std::endl;
|
||||||
os << "roi \n gets region of interest" << std::endl;
|
os << "roi \n gets region of interest" << std::endl;
|
||||||
os << "detsizechan \n gets the maximum number of channels for complete detector set in both directions; -1 is no limit" << std::endl;
|
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 << "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 << "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 << "flippeddatay\n gets if the data will be flipped on the y axis" << std::endl;
|
||||||
|
@ -9,14 +9,16 @@ int slsDetectorUsers::size() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||||
nx=detector.getMaxNumberOfChannelsPerDetector(slsDetectorDefs::X);
|
slsDetectorDefs::xy res = detector.getMaxNumberOfChannels();
|
||||||
ny=detector.getMaxNumberOfChannelsPerDetector(slsDetectorDefs::Y);
|
nx=res.x;
|
||||||
|
ny=res.y;
|
||||||
return nx*ny;
|
return nx*ny;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getDetectorSize(int &nx, int &ny, int detPos){
|
int slsDetectorUsers::getDetectorSize(int &nx, int &ny, int detPos){
|
||||||
nx=detector.getTotalNumberOfChannels(slsDetectorDefs::X, detPos);
|
slsDetectorDefs::xy res = detector.getNumberOfChannels();
|
||||||
ny=detector.getTotalNumberOfChannels(slsDetectorDefs::Y, detPos);
|
nx=res.x;
|
||||||
|
ny=res.y;
|
||||||
return nx*ny;
|
return nx*ny;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ format
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
struct coordinates {
|
struct xy {
|
||||||
int x{0};
|
int x{0};
|
||||||
int y{0};
|
int y{0};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user