mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
1. Ctb transceiver ro (#773)
* transceiverenable, tsamples, romode for tranceiver and digital_transceiver * 202 spec instr only for transceiver mode * removed check for empty in trans readout and clean memory before reading from fifo * ctb read fifo strobe for all after reading all channels, adding 1us after selecting channel, changing fw date * updated 10gb transceiver enable ---- * added transceiver (tsamples, romode(transceiver, digital_transceiver), transceiverenable (mask) * clean memory before reading from fifo (for analog and digital as well) * read fifo then read strobe (also corresp fw) fixes number of reads (also for analg and digital)-> increases all pipelines by 1 * fixed bug in rearranging digital data in receiver * fixed bug in streaming size of data after rearranging * fixed bug in setbit, clearbit,and getbit * status checks fifo before returning idle (transmitting if data in fifo if transceiver more enabled) * soem matterhorn specifics that will need to be put into pattern in a month or two. this is temporary. * NOTE: breaking api. rxParameters struct has transceiverenabel and tsamples given from det to receiver
This commit is contained in:
@ -220,6 +220,8 @@ int ClientInterface::functionTable(){
|
||||
flist[F_RECEIVER_GET_RECEIVER_ROI] = &ClientInterface::get_receiver_roi;
|
||||
flist[F_RECEIVER_SET_RECEIVER_ROI] = &ClientInterface::set_receiver_roi;
|
||||
flist[F_RECEIVER_SET_RECEIVER_ROI_METADATA] = &ClientInterface::set_receiver_roi_metadata;
|
||||
flist[F_RECEIVER_SET_NUM_TRANSCEIVER_SAMPLES] = &ClientInterface::set_num_transceiver_samples;
|
||||
flist[F_RECEIVER_SET_TRANSCEIVER_MASK] = &ClientInterface::set_transceiver_mask;
|
||||
|
||||
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
|
||||
LOG(logDEBUG1) << "function fnum: " << i << " (" <<
|
||||
@ -370,9 +372,8 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
|
||||
if (detType == CHIPTESTBOARD) {
|
||||
impl()->setNumberofAnalogSamples(arg.analogSamples);
|
||||
}
|
||||
if (detType == CHIPTESTBOARD) {
|
||||
impl()->setNumberofDigitalSamples(arg.digitalSamples);
|
||||
impl()->setNumberofTransceiverSamples(arg.transceiverSamples);
|
||||
}
|
||||
if (detType != MYTHEN3) {
|
||||
impl()->setAcquisitionTime(std::chrono::nanoseconds(arg.expTimeNs));
|
||||
@ -410,6 +411,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
impl()->setReadoutMode(arg.roMode);
|
||||
impl()->setADCEnableMask(arg.adcMask);
|
||||
impl()->setTenGigaADCEnableMask(arg.adc10gMask);
|
||||
impl()->setTransceiverEnableMask(arg.transceiverMask);
|
||||
}
|
||||
if (detType == GOTTHARD) {
|
||||
impl()->setDetectorROI(arg.roi);
|
||||
@ -1758,4 +1760,43 @@ int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
int ClientInterface::set_num_transceiver_samples(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
LOG(logDEBUG1) << "Setting num transceiver samples to " << value;
|
||||
if (detType != CHIPTESTBOARD) {
|
||||
functionNotImplemented();
|
||||
}
|
||||
try {
|
||||
impl()->setNumberofTransceiverSamples(value);
|
||||
} catch (const std::exception &e) {
|
||||
throw RuntimeError("Could not set number of transceiver samples to " +
|
||||
std::to_string(value) + " [" +
|
||||
std::string(e.what()) + ']');
|
||||
}
|
||||
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
int ClientInterface::set_transceiver_mask(Interface &socket) {
|
||||
auto arg = socket.Receive<uint32_t>();
|
||||
verifyIdle(socket);
|
||||
LOG(logDEBUG1) << "Setting Transceiver enable mask: " << arg;
|
||||
try {
|
||||
impl()->setTransceiverEnableMask(arg);
|
||||
} catch (const std::exception &e) {
|
||||
throw RuntimeError("Could not set transceiver enable mask [" +
|
||||
std::string(e.what()) + ']');
|
||||
}
|
||||
|
||||
auto retval = impl()->getTransceiverEnableMask();
|
||||
if (retval != arg) {
|
||||
std::ostringstream os;
|
||||
os << "Could not set Transceiver enable mask. Set 0x" << std::hex << arg
|
||||
<< " but read 0x" << std::hex << retval;
|
||||
throw RuntimeError(os.str());
|
||||
}
|
||||
LOG(logDEBUG1) << "Transceiver enable mask retval: " << retval;
|
||||
return socket.sendResult(retval);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -170,6 +170,8 @@ class ClientInterface : private virtual slsDetectorDefs {
|
||||
int get_receiver_roi(ServerInterface &socket);
|
||||
int set_receiver_roi(ServerInterface &socket);
|
||||
int set_receiver_roi_metadata(ServerInterface &socket);
|
||||
int set_num_transceiver_samples(ServerInterface &socket);
|
||||
int set_transceiver_mask(ServerInterface &socket);
|
||||
|
||||
Implementation *impl() {
|
||||
if (receiver != nullptr) {
|
||||
|
@ -496,8 +496,10 @@ void DataProcessor::PadMissingPackets(sls_receiver_header header, char *data) {
|
||||
/** ctb specific */
|
||||
void DataProcessor::RearrangeDbitData(size_t &size, char *data) {
|
||||
int nAnalogDataBytes = generalData->GetNumberOfAnalogDatabytes();
|
||||
int nDigitalDataBytes = generalData->GetNumberOfDigitalDatabytes();
|
||||
int nTransceiverDataBytes = generalData->GetNumberOfTransceiverDatabytes();
|
||||
// TODO! (Erik) Refactor and add tests
|
||||
int ctbDigitalDataBytes = size - nAnalogDataBytes - ctbDbitOffset;
|
||||
int ctbDigitalDataBytes = nDigitalDataBytes - ctbDbitOffset;
|
||||
|
||||
// no digital data
|
||||
if (ctbDigitalDataBytes == 0) {
|
||||
@ -506,11 +508,15 @@ void DataProcessor::RearrangeDbitData(size_t &size, char *data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int numSamples = (ctbDigitalDataBytes / sizeof(uint64_t));
|
||||
const int numDigitalSamples = (ctbDigitalDataBytes / sizeof(uint64_t));
|
||||
|
||||
// ceil as numResult8Bits could be decimal
|
||||
const int numResult8Bits = ceil((numSamples * ctbDbitList.size()) / 8.00);
|
||||
std::vector<uint8_t> result(numResult8Bits);
|
||||
// const int numResult8Bits = ceil((numDigitalSamples * ctbDbitList.size())
|
||||
// / 8.00);
|
||||
int numBitsPerDbit = numDigitalSamples;
|
||||
if ((numBitsPerDbit % 8) != 0)
|
||||
numBitsPerDbit += (8 - (numDigitalSamples % 8));
|
||||
const int totalNumBytes = (numBitsPerDbit / 8) * ctbDbitList.size();
|
||||
std::vector<uint8_t> result(totalNumBytes);
|
||||
uint8_t *dest = &result[0];
|
||||
|
||||
auto *source = (uint64_t *)(data + nAnalogDataBytes + ctbDbitOffset);
|
||||
@ -518,14 +524,14 @@ void DataProcessor::RearrangeDbitData(size_t &size, char *data) {
|
||||
// loop through digital bit enable vector
|
||||
int bitoffset = 0;
|
||||
for (auto bi : ctbDbitList) {
|
||||
// where numbits * numsamples is not a multiple of 8
|
||||
// where numbits * numDigitalSamples is not a multiple of 8
|
||||
if (bitoffset != 0) {
|
||||
bitoffset = 0;
|
||||
++dest;
|
||||
}
|
||||
|
||||
// loop through the frame digital data
|
||||
for (auto *ptr = source; ptr < (source + numSamples);) {
|
||||
for (auto *ptr = source; ptr < (source + numDigitalSamples);) {
|
||||
// get selected bit from each 8 bit
|
||||
uint8_t bit = (*ptr++ >> bi) & 1;
|
||||
*dest |= bit << bitoffset;
|
||||
@ -540,8 +546,14 @@ void DataProcessor::RearrangeDbitData(size_t &size, char *data) {
|
||||
|
||||
// copy back to memory and update size
|
||||
memcpy(data + nAnalogDataBytes, result.data(),
|
||||
numResult8Bits * sizeof(uint8_t));
|
||||
size = numResult8Bits * sizeof(uint8_t) + nAnalogDataBytes + ctbDbitOffset;
|
||||
totalNumBytes * sizeof(uint8_t));
|
||||
size = totalNumBytes * sizeof(uint8_t) + nAnalogDataBytes + ctbDbitOffset +
|
||||
nTransceiverDataBytes;
|
||||
LOG(logDEBUG1) << "totalNumBytes: " << totalNumBytes
|
||||
<< " nAnalogDataBytes:" << nAnalogDataBytes
|
||||
<< " ctbDbitOffset:" << ctbDbitOffset
|
||||
<< " nTransceiverDataBytes:" << nTransceiverDataBytes
|
||||
<< " size:" << size;
|
||||
}
|
||||
|
||||
void DataProcessor::CropImage(size_t &size, char *data) {
|
||||
|
@ -58,11 +58,13 @@ class GeneralData {
|
||||
bool tengigaEnable{false};
|
||||
uint32_t nAnalogSamples{0};
|
||||
uint32_t nDigitalSamples{0};
|
||||
uint32_t nTransceiverSamples{0};
|
||||
slsDetectorDefs::readoutMode readoutType{slsDetectorDefs::ANALOG_ONLY};
|
||||
uint32_t adcEnableMaskOneGiga{BIT32_MASK};
|
||||
uint32_t adcEnableMaskTenGiga{BIT32_MASK};
|
||||
slsDetectorDefs::ROI detectorRoi{};
|
||||
uint32_t counterMask{0};
|
||||
uint32_t transceiverMask{0};
|
||||
|
||||
GeneralData(){};
|
||||
virtual ~GeneralData(){};
|
||||
@ -132,6 +134,16 @@ class GeneralData {
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual int GetNumberOfDigitalDatabytes() {
|
||||
ThrowGenericError("GetNumberOfDigitalDatabytes");
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual int GetNumberOfTransceiverDatabytes() {
|
||||
ThrowGenericError("GetNumberOfTransceiverDatabytes");
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual void SetNumberOfAnalogSamples(int n) {
|
||||
ThrowGenericError("SetNumberOfAnalogSamples");
|
||||
};
|
||||
@ -140,6 +152,10 @@ class GeneralData {
|
||||
ThrowGenericError("SetNumberOfDigitalSamples");
|
||||
};
|
||||
|
||||
virtual void SetNumberOfTransceiverSamples(int n) {
|
||||
ThrowGenericError("SetNumberOfTransceiverSamples");
|
||||
};
|
||||
|
||||
virtual void SetOneGigaAdcEnableMask(int n) {
|
||||
ThrowGenericError("SetOneGigaAdcEnableMask");
|
||||
};
|
||||
@ -151,6 +167,10 @@ class GeneralData {
|
||||
virtual void SetReadoutMode(slsDetectorDefs::readoutMode r) {
|
||||
ThrowGenericError("SetReadoutMode");
|
||||
};
|
||||
|
||||
virtual void SetTransceiverEnableMask(int n) {
|
||||
ThrowGenericError("SetTransceiverEnableMask");
|
||||
};
|
||||
};
|
||||
|
||||
class GotthardData : public GeneralData {
|
||||
@ -507,7 +527,10 @@ class ChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
const int NCHAN_DIGITAL = 64;
|
||||
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
|
||||
const int NUM_BYTES_PER_TRANSCEIVER_CHANNEL = 8;
|
||||
int nAnalogBytes = 0;
|
||||
int nDigitalBytes = 0;
|
||||
int nTransceiverBytes = 0;
|
||||
|
||||
public:
|
||||
/** Constructor */
|
||||
@ -527,6 +550,10 @@ class ChipTestBoardData : public GeneralData {
|
||||
public:
|
||||
int GetNumberOfAnalogDatabytes() { return nAnalogBytes; };
|
||||
|
||||
int GetNumberOfDigitalDatabytes() { return nDigitalBytes; };
|
||||
|
||||
int GetNumberOfTransceiverDatabytes() { return nTransceiverBytes; };
|
||||
|
||||
void SetNumberOfAnalogSamples(int n) {
|
||||
nAnalogSamples = n;
|
||||
UpdateImageSize();
|
||||
@ -537,6 +564,11 @@ class ChipTestBoardData : public GeneralData {
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetNumberOfTransceiverSamples(int n) {
|
||||
nTransceiverSamples = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetOneGigaAdcEnableMask(int n) {
|
||||
adcEnableMaskOneGiga = n;
|
||||
UpdateImageSize();
|
||||
@ -547,6 +579,11 @@ class ChipTestBoardData : public GeneralData {
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetTransceiverEnableMask(int n) {
|
||||
transceiverMask = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetReadoutMode(slsDetectorDefs::readoutMode r) {
|
||||
readoutType = r;
|
||||
UpdateImageSize();
|
||||
@ -560,8 +597,9 @@ class ChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
void UpdateImageSize() {
|
||||
nAnalogBytes = 0;
|
||||
int nDigitalBytes = 0;
|
||||
int nAnalogChans = 0, nDigitalChans = 0;
|
||||
nDigitalBytes = 0;
|
||||
nTransceiverBytes = 0;
|
||||
int nAnalogChans = 0, nDigitalChans = 0, nTransceiverChans = 0;
|
||||
|
||||
// analog channels (normal, analog/digital readout)
|
||||
if (readoutType == slsDetectorDefs::ANALOG_ONLY ||
|
||||
@ -577,17 +615,29 @@ class ChipTestBoardData : public GeneralData {
|
||||
}
|
||||
// digital channels
|
||||
if (readoutType == slsDetectorDefs::DIGITAL_ONLY ||
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nDigitalChans = NCHAN_DIGITAL;
|
||||
nDigitalBytes = (sizeof(uint64_t) * nDigitalSamples);
|
||||
LOG(logDEBUG1) << "Number of Digital Channels:" << nDigitalChans
|
||||
<< " Databytes: " << nDigitalBytes;
|
||||
}
|
||||
|
||||
nPixelsX = nAnalogChans + nDigitalChans;
|
||||
// transceiver channels
|
||||
if (readoutType == slsDetectorDefs::TRANSCEIVER_ONLY ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nTransceiverChans = __builtin_popcount(transceiverMask);
|
||||
;
|
||||
nTransceiverBytes = nTransceiverChans *
|
||||
NUM_BYTES_PER_TRANSCEIVER_CHANNEL *
|
||||
nTransceiverSamples;
|
||||
LOG(logDEBUG1) << "Number of Transceiver Channels:"
|
||||
<< nTransceiverChans
|
||||
<< " Databytes: " << nTransceiverBytes;
|
||||
}
|
||||
nPixelsX = nAnalogChans + nDigitalChans + nTransceiverChans;
|
||||
dataSize = tengigaEnable ? 8144 : UDP_PACKET_DATA_BYTES;
|
||||
packetSize = headerSizeinPacket + dataSize;
|
||||
imageSize = nAnalogBytes + nDigitalBytes;
|
||||
imageSize = nAnalogBytes + nDigitalBytes + nTransceiverBytes;
|
||||
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||
|
||||
LOG(logDEBUG1) << "Total Number of Channels:" << nPixelsX
|
||||
|
@ -946,7 +946,8 @@ void Implementation::StartMasterWriter() {
|
||||
masterAttributes.analogSamples = generalData->nAnalogSamples;
|
||||
masterAttributes.digital =
|
||||
(generalData->readoutType == DIGITAL_ONLY ||
|
||||
generalData->readoutType == ANALOG_AND_DIGITAL)
|
||||
generalData->readoutType == ANALOG_AND_DIGITAL ||
|
||||
generalData->readoutType == DIGITAL_AND_TRANSCEIVER)
|
||||
? 1
|
||||
: 0;
|
||||
masterAttributes.digitalSamples = generalData->nDigitalSamples;
|
||||
@ -955,6 +956,14 @@ void Implementation::StartMasterWriter() {
|
||||
for (auto &i : ctbDbitList) {
|
||||
masterAttributes.dbitlist |= (1 << i);
|
||||
}
|
||||
masterAttributes.transceiverSamples =
|
||||
generalData->nTransceiverSamples;
|
||||
masterAttributes.transceiverMask = generalData->transceiverMask;
|
||||
masterAttributes.transceiver =
|
||||
(generalData->readoutType == TRANSCEIVER_ONLY ||
|
||||
generalData->readoutType == DIGITAL_AND_TRANSCEIVER)
|
||||
? 1
|
||||
: 0;
|
||||
masterAttributes.detectorRoi = generalData->detectorRoi;
|
||||
masterAttributes.counterMask = generalData->counterMask;
|
||||
masterAttributes.exptimeArray[0] = acquisitionTime1;
|
||||
@ -1509,6 +1518,20 @@ void Implementation::setNumberofDigitalSamples(const uint32_t i) {
|
||||
LOG(logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||
}
|
||||
|
||||
uint32_t Implementation::getNumberofTransceiverSamples() const {
|
||||
return generalData->nTransceiverSamples;
|
||||
}
|
||||
|
||||
void Implementation::setNumberofTransceiverSamples(const uint32_t i) {
|
||||
if (generalData->nTransceiverSamples != i) {
|
||||
generalData->SetNumberOfTransceiverSamples(i);
|
||||
SetupFifoStructure();
|
||||
}
|
||||
LOG(logINFO) << "Number of Transceiver Samples: "
|
||||
<< generalData->nTransceiverSamples;
|
||||
LOG(logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||
}
|
||||
|
||||
uint32_t Implementation::getCounterMask() const {
|
||||
return generalData->counterMask;
|
||||
}
|
||||
@ -1718,6 +1741,20 @@ void Implementation::setDbitOffset(const int s) {
|
||||
LOG(logINFO) << "Dbit offset: " << ctbDbitOffset;
|
||||
}
|
||||
|
||||
uint32_t Implementation::getTransceiverEnableMask() const {
|
||||
return generalData->transceiverMask;
|
||||
}
|
||||
|
||||
void Implementation::setTransceiverEnableMask(uint32_t mask) {
|
||||
if (generalData->transceiverMask != mask) {
|
||||
generalData->SetTransceiverEnableMask(mask);
|
||||
SetupFifoStructure();
|
||||
}
|
||||
LOG(logINFO) << "Transceiver Enable Mask: 0x" << std::hex
|
||||
<< generalData->transceiverMask << std::dec;
|
||||
LOG(logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Callbacks *
|
||||
|
@ -108,17 +108,17 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
* *
|
||||
* ************************************************/
|
||||
int getNumberofUDPInterfaces() const;
|
||||
/* [Jungfrau] */
|
||||
/* [Jungfrau][Moench] */
|
||||
void setNumberofUDPInterfaces(const int n);
|
||||
std::string getEthernetInterface() const;
|
||||
void setEthernetInterface(const std::string &c);
|
||||
std::string getEthernetInterface2() const;
|
||||
/* [Jungfrau] */
|
||||
/* [Jungfrau][Moench] */
|
||||
void setEthernetInterface2(const std::string &c);
|
||||
uint32_t getUDPPortNumber() const;
|
||||
void setUDPPortNumber(const uint32_t i);
|
||||
uint32_t getUDPPortNumber2() const;
|
||||
/* [Eiger][Jungfrau] */
|
||||
/* [Eiger][Jungfrau][Moench] */
|
||||
void setUDPPortNumber2(const uint32_t i);
|
||||
int getUDPSocketBufferSize() const;
|
||||
void setUDPSocketBufferSize(const int s);
|
||||
@ -198,11 +198,14 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
/* [Eiger] */
|
||||
void setSubPeriod(const ns i);
|
||||
uint32_t getNumberofAnalogSamples() const;
|
||||
/**[Ctb][Moench] */
|
||||
/**[Ctb] */
|
||||
void setNumberofAnalogSamples(const uint32_t i);
|
||||
uint32_t getNumberofDigitalSamples() const;
|
||||
/**[Ctb] */
|
||||
void setNumberofDigitalSamples(const uint32_t i);
|
||||
uint32_t getNumberofTransceiverSamples() const;
|
||||
/**[Ctb] */
|
||||
void setNumberofTransceiverSamples(const uint32_t i);
|
||||
uint32_t getCounterMask() const;
|
||||
/** [Mythen3] */
|
||||
void setCounterMask(const uint32_t i);
|
||||
@ -230,7 +233,7 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
* detector) */
|
||||
void setDetectorDataStream(const portPosition port, const bool enable);
|
||||
int getReadNRows() const;
|
||||
/* [Eiger][Jungfrau] */
|
||||
/* [Eiger][Jungfrau][Moench] */
|
||||
void setReadNRows(const int value);
|
||||
/** [Eiger] */
|
||||
void setThresholdEnergy(const int value);
|
||||
@ -241,10 +244,10 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
/* [Ctb] */
|
||||
void setReadoutMode(const readoutMode f);
|
||||
uint32_t getADCEnableMask() const;
|
||||
/* [Ctb][Moench] */
|
||||
/* [Ctb] */
|
||||
void setADCEnableMask(const uint32_t mask);
|
||||
uint32_t getTenGigaADCEnableMask() const;
|
||||
/* [Ctb][Moench] */
|
||||
/* [Ctb] */
|
||||
void setTenGigaADCEnableMask(const uint32_t mask);
|
||||
std::vector<int> getDbitList() const;
|
||||
/* [Ctb] */
|
||||
@ -252,6 +255,9 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
int getDbitOffset() const;
|
||||
/* [Ctb] */
|
||||
void setDbitOffset(const int s);
|
||||
uint32_t getTransceiverEnableMask() const;
|
||||
/* [Ctb] */
|
||||
void setTransceiverEnableMask(const uint32_t mask);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
@ -574,6 +574,30 @@ void MasterAttributes::WriteHDF5DbitList(H5::H5File *fd, H5::Group *group) {
|
||||
"Dbit Bitset List", H5::PredType::STD_U64LE, dataspace);
|
||||
dataset.write(&dbitlist, H5::PredType::STD_U64LE);
|
||||
}
|
||||
|
||||
void MasterAttributes::WriteHDF5TransceiverMask(H5::H5File *fd,
|
||||
H5::Group *group) {
|
||||
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
|
||||
H5::DataSet dataset = group->createDataSet(
|
||||
"Transceiver Mask", H5::PredType::NATIVE_INT, dataspace);
|
||||
dataset.write(&transceiverMask, H5::PredType::NATIVE_INT);
|
||||
}
|
||||
|
||||
void MasterAttributes::WriteHDF5TransceiverFlag(H5::H5File *fd,
|
||||
H5::Group *group) {
|
||||
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
|
||||
H5::DataSet dataset = group->createDataSet(
|
||||
"Transceiver Flag", H5::PredType::NATIVE_INT, dataspace);
|
||||
dataset.write(&transceiver, H5::PredType::NATIVE_INT);
|
||||
}
|
||||
|
||||
void MasterAttributes::WriteHDF5TransceiverSamples(H5::H5File *fd,
|
||||
H5::Group *group) {
|
||||
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
|
||||
H5::DataSet dataset = group->createDataSet(
|
||||
"Transceiver Samples", H5::PredType::NATIVE_INT, dataspace);
|
||||
dataset.write(&transceiverSamples, H5::PredType::NATIVE_INT);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MasterAttributes::GetGotthardBinaryAttributes(
|
||||
@ -763,6 +787,12 @@ void MasterAttributes::GetCtbBinaryAttributes(
|
||||
w->Uint(dbitoffset);
|
||||
w->Key("Dbit Bitset");
|
||||
w->Uint64(dbitlist);
|
||||
w->Key("Transceiver Mask");
|
||||
w->String(ToStringHex(transceiverMask).c_str());
|
||||
w->Key("Transceiver Flag");
|
||||
w->Uint(transceiver);
|
||||
w->Key("Transceiver Samples");
|
||||
w->Uint(transceiverSamples);
|
||||
}
|
||||
|
||||
#ifdef HDF5C
|
||||
@ -778,6 +808,9 @@ void MasterAttributes::WriteCtbHDF5Attributes(H5::H5File *fd,
|
||||
MasterAttributes::WriteHDF5DigitalSamples(fd, group);
|
||||
MasterAttributes::WriteHDF5DbitOffset(fd, group);
|
||||
MasterAttributes::WriteHDF5DbitList(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverMask(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverFlag(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverSamples(fd, group);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -53,6 +53,9 @@ class MasterAttributes {
|
||||
uint32_t digitalSamples{0};
|
||||
uint32_t dbitoffset{0};
|
||||
uint64_t dbitlist{0};
|
||||
uint32_t transceiverMask{0};
|
||||
uint32_t transceiver{0};
|
||||
uint32_t transceiverSamples{0};
|
||||
slsDetectorDefs::ROI detectorRoi{};
|
||||
slsDetectorDefs::ROI receiverRoi{};
|
||||
uint32_t counterMask{0};
|
||||
@ -103,6 +106,9 @@ class MasterAttributes {
|
||||
void WriteHDF5DigitalSamples(H5::H5File *fd, H5::Group *group);
|
||||
void WriteHDF5DbitOffset(H5::H5File *fd, H5::Group *group);
|
||||
void WriteHDF5DbitList(H5::H5File *fd, H5::Group *group);
|
||||
void WriteHDF5TransceiverMask(H5::H5File *fd, H5::Group *group);
|
||||
void WriteHDF5TransceiverFlag(H5::H5File *fd, H5::Group *group);
|
||||
void WriteHDF5TransceiverSamples(H5::H5File *fd, H5::Group *group);
|
||||
#endif
|
||||
|
||||
void GetGotthardBinaryAttributes(
|
||||
|
Reference in New Issue
Block a user