mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 17:47:59 +02:00
Readoutflags (#61)
* WIP * eiger binary back wih versioning * fixed readout flag in ctbgui, added speedLevel enum * ctbgui: fixed a print out error * ctb readout bug fix * WIP * WIP * WIP
This commit is contained in:
@ -134,7 +134,6 @@ class BinaryFileStatic {
|
||||
"Period (ns) : %lld\n"
|
||||
"Gap Pixels Enable : %d\n"
|
||||
"Quad Enable : %d\n"
|
||||
"Parallel Flag : %d\n"
|
||||
"Analog Flag : %d\n"
|
||||
"Digital Flag : %d\n"
|
||||
"ADC Mask : %d\n"
|
||||
@ -174,7 +173,6 @@ class BinaryFileStatic {
|
||||
(long long int)attr.periodNs,
|
||||
attr.gapPixelsEnable,
|
||||
attr.quadEnable,
|
||||
attr.parallelFlag,
|
||||
attr.analogFlag,
|
||||
attr.digitalFlag,
|
||||
attr.adcmask,
|
||||
|
@ -200,7 +200,7 @@ public:
|
||||
* @param f readout flags
|
||||
* @returns analog data bytes
|
||||
*/
|
||||
virtual int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
virtual int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode) {
|
||||
FILE_LOG(logERROR) << "setImageSize is a generic function that should be overloaded by a derived class";
|
||||
return 0;
|
||||
};
|
||||
@ -576,37 +576,36 @@ public:
|
||||
* @param f readout flags
|
||||
* @returns analog data bytes
|
||||
*/
|
||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode f) {
|
||||
int nachans = 0, ndchans = 0;
|
||||
int adatabytes = 0, ddatabytes = 0;
|
||||
|
||||
if (f != slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
// analog channels (normal, analog/digital readout)
|
||||
if (f == slsDetectorDefs::NORMAL_READOUT ||
|
||||
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
if (a == BIT32_MASK) {
|
||||
nachans = 32;
|
||||
} else {
|
||||
for (int ich = 0; ich < 32; ++ich) {
|
||||
if (a & (1 << ich))
|
||||
++nachans;
|
||||
}
|
||||
}
|
||||
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
||||
FILE_LOG(logDEBUG1) << " Number of Analog Channels:" << nachans
|
||||
<< " Databytes: " << adatabytes;
|
||||
}
|
||||
// digital channels
|
||||
if (f & slsDetectorDefs::DIGITAL_ONLY ||
|
||||
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
ndchans = NCHAN_DIGITAL;
|
||||
ddatabytes = (sizeof(uint64_t) * ds);
|
||||
FILE_LOG(logDEBUG1) << "Number of Digital Channels:" << ndchans
|
||||
<< " Databytes: " << ddatabytes;
|
||||
}
|
||||
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans + ndchans
|
||||
<< " Databytes: " << adatabytes + ddatabytes;
|
||||
}
|
||||
// analog channels (normal, analog/digital readout)
|
||||
if (f == slsDetectorDefs::ANALOG_ONLY ||
|
||||
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
if (a == BIT32_MASK) {
|
||||
nachans = 32;
|
||||
} else {
|
||||
for (int ich = 0; ich < 32; ++ich) {
|
||||
if (a & (1 << ich))
|
||||
++nachans;
|
||||
}
|
||||
}
|
||||
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
||||
FILE_LOG(logDEBUG1) << " Number of Analog Channels:" << nachans
|
||||
<< " Databytes: " << adatabytes;
|
||||
}
|
||||
// digital channels
|
||||
if (f == slsDetectorDefs::DIGITAL_ONLY ||
|
||||
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
ndchans = NCHAN_DIGITAL;
|
||||
ddatabytes = (sizeof(uint64_t) * ds);
|
||||
FILE_LOG(logDEBUG1) << "Number of Digital Channels:" << ndchans
|
||||
<< " Databytes: " << ddatabytes;
|
||||
}
|
||||
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans + ndchans
|
||||
<< " Databytes: " << adatabytes + ddatabytes;
|
||||
|
||||
nPixelsX = nachans + ndchans;
|
||||
nPixelsY = 1;
|
||||
// 10G
|
||||
@ -692,7 +691,7 @@ public:
|
||||
* @param f readout flags
|
||||
* @returns analog data bytes
|
||||
*/
|
||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode) {
|
||||
int nachans = 0;
|
||||
int adatabytes = 0;
|
||||
|
||||
|
@ -407,10 +407,6 @@ public:
|
||||
dataset = group5.createDataSet ( "quad enable", PredType::NATIVE_INT, dataspace );
|
||||
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
||||
|
||||
//Parallel Flag
|
||||
dataset = group5.createDataSet ( "parallel flag", PredType::NATIVE_INT, dataspace );
|
||||
dataset.write ( &(attr.gapPixelsEnable), PredType::NATIVE_INT);
|
||||
|
||||
//Analog Flag
|
||||
dataset = group5.createDataSet ( "analog flag", PredType::NATIVE_INT, dataspace );
|
||||
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
||||
|
@ -65,7 +65,6 @@ struct masterAttributes {
|
||||
uint64_t periodNs;
|
||||
uint32_t gapPixelsEnable;
|
||||
uint32_t quadEnable;
|
||||
uint32_t parallelFlag;
|
||||
uint32_t analogFlag;
|
||||
uint32_t digitalFlag;
|
||||
uint32_t adcmask;
|
||||
|
@ -88,10 +88,10 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
int getReadNLines() const;
|
||||
|
||||
/**
|
||||
* Get readout flags (Eiger, chiptestboard, moench)
|
||||
* @return readout flags
|
||||
* Get readout mode (chiptestboard)
|
||||
* @return readout mode
|
||||
*/
|
||||
readOutFlags getReadOutFlags() const;
|
||||
readoutMode getReadoutMode() const;
|
||||
|
||||
//***file parameters***
|
||||
/**
|
||||
@ -417,11 +417,11 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
void setReadNLines(const int value);
|
||||
|
||||
/**
|
||||
* Set readout flags (eiger, chiptestboard, moench)
|
||||
* @param f readout flag
|
||||
* Set readout mode (chiptestboard)
|
||||
* @param f readout mode
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setReadOutFlags(const readOutFlags f);
|
||||
int setReadoutMode(const readoutMode f);
|
||||
|
||||
//***file parameters***
|
||||
/**
|
||||
@ -902,8 +902,8 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
bool quadEnable;
|
||||
/** num lines readout */
|
||||
int numLinesReadout;
|
||||
/** readout flags*/
|
||||
readOutFlags readoutFlags;
|
||||
/** readout mode*/
|
||||
readoutMode readoutType;
|
||||
|
||||
//*** receiver parameters ***
|
||||
/** Number of Threads */
|
||||
|
@ -279,8 +279,8 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
|
||||
/** set deactivated receiver padding enable */
|
||||
int set_deactivated_padding_enable(sls::ServerInterface2 &socket);
|
||||
|
||||
/** set readout flags */
|
||||
int set_readout_flags(sls::ServerInterface2 &socket);
|
||||
/** set readout mode */
|
||||
int set_readout_mode(sls::ServerInterface2 &socket);
|
||||
|
||||
/** set adc mask */
|
||||
int set_adc_mask(sls::ServerInterface2 &socket);
|
||||
|
Reference in New Issue
Block a user