rois shoudl work. left to implement tests for individual rois, create multiple datasets (1 for each roi) in the virutal data file. currently virutal dataset with roi is not implemented and a warning is given instead. wonder why since the inviduviaual roi files are clipped

This commit is contained in:
2025-06-20 17:20:19 +02:00
parent aac3f8904b
commit 24f878a17b
15 changed files with 314 additions and 364 deletions

View File

@ -722,13 +722,19 @@ std::string Caller::rx_zmqip(int action) {
std::string Caller::rx_roi(int action) { std::string Caller::rx_roi(int action) {
std::ostringstream os; std::ostringstream os;
std::string helpMessage = std::string("[xmin] [xmax] [ymin] [ymax]\n\tRegion of interest in receiver.\n\t") std::string helpMessage =
+ "For a list of rois, use '[' and ']; ' to distinguish between " std::string("[xmin] [xmax] [ymin] [ymax]\n\tRegion of interest in "
"rois and use comma inside the square brackets.\n\t If one fails to use space after semicolon, please use quotes" "receiver.\n\t") +
+ "For example: [0,100,0,100]; [200,300,0,100] will set two " "For a list of rois, use '[' and ']; ' to distinguish between "
"rois.or '[0,100,0,100];[200,300,0,100]' when the vector is a single string\n\t" "rois and use comma inside the square brackets.\n\t If one fails to "
+ "Only allowed at multi module level and without gap " "use space after semicolon, please use quotes" +
"pixels.\n"; "For example: [0,100,0,100]; [200,300,0,100] will set two "
"rois.or '[0,100,0,100];[200,300,0,100]' when the vector is a single "
"string\n\n\t" +
"Only allowed to set at multi module level and without gap "
"ixels.\n\n\t" +
"One can get rx_roi also at port level, by specifying the module id "
"and it will return the roi for each port.\n";
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << helpMessage; os << helpMessage;
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
@ -736,7 +742,8 @@ std::string Caller::rx_roi(int action) {
WrongNumberOfParameters(0); WrongNumberOfParameters(0);
} }
if (det_id != -1) { if (det_id != -1) {
throw RuntimeError("Cannot execute receiver ROI at module level"); auto t = det->getRxROI(det_id);
os << ToString(t) << '\n';
} else { } else {
auto t = det->getRxROI(); auto t = det->getRxROI();
os << ToString(t) << '\n'; os << ToString(t) << '\n';

View File

@ -1766,6 +1766,7 @@ defs::xy DetectorImpl::getPortGeometry() const {
case MOENCH: case MOENCH:
portGeometry.y = modules[0]->getNumberofUDPInterfacesFromShm(); portGeometry.y = modules[0]->getNumberofUDPInterfacesFromShm();
break; break;
case GOTTHARD2: // 2nd port if used is for veto, not data
default: default:
break; break;
} }

View File

@ -1525,22 +1525,22 @@ std::array<defs::ROI, 2> Module::getRxROI() const {
return sendToReceiver<std::array<slsDetectorDefs::ROI, 2>>(F_RECEIVER_GET_RECEIVER_ROI); return sendToReceiver<std::array<slsDetectorDefs::ROI, 2>>(F_RECEIVER_GET_RECEIVER_ROI);
} }
void Module::setRxROI(std::array<defs::ROI, 2> portRois) { void Module::setRxROI(const std::array<defs::ROI, 2> &portRois) {
/*LOG(logDEBUG) << "Sending to receiver " << moduleIndex << " [rx roi: " << ToString(portRois)
<< ']';
auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
receiver.Send(F_RECEIVER_SET_RECEIVER_ROI);
receiver.setFnum(F_RECEIVER_SET_RECEIVER_ROI);
receiver.Send(portRois);
if (receiver.Receive<int>() == FAIL) {
throw ReceiverError("Receiver " + std::to_string(moduleIndex) +
" returned error: " + receiver.readErrorMessage());
}*/
sendToReceiver(F_RECEIVER_SET_RECEIVER_ROI, portRois, nullptr); sendToReceiver(F_RECEIVER_SET_RECEIVER_ROI, portRois, nullptr);
} }
void Module::setRxROIMetadata(const std::vector<slsDetectorDefs::ROI> &arg) { void Module::setRxROIMetadata(const std::vector<slsDetectorDefs::ROI> &args) {
sendToReceiver(F_RECEIVER_SET_RECEIVER_ROI_METADATA, arg, nullptr); LOG(logDEBUG) << "Sending to receiver " << moduleIndex
<< " [roi metadata: " << ToString(args) << ']';
auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
receiver.Send(F_RECEIVER_SET_RECEIVER_ROI_METADATA);
receiver.setFnum(F_RECEIVER_SET_RECEIVER_ROI_METADATA);
receiver.Send(static_cast<int>(args.size()));
receiver.Send(args);
if (receiver.Receive<int>() == FAIL) {
throw ReceiverError("Receiver " + std::to_string(moduleIndex) +
" returned error: " + receiver.readErrorMessage());
}
} }
// File // File

View File

@ -302,7 +302,7 @@ class Module : public virtual slsDetectorDefs {
bool getRxArping() const; bool getRxArping() const;
void setRxArping(bool enable); void setRxArping(bool enable);
std::array<defs::ROI, 2> getRxROI() const; std::array<defs::ROI, 2> getRxROI() const;
void setRxROI(const std::array<slsDetectorDefs::ROI, 2> portRois); void setRxROI(const std::array<slsDetectorDefs::ROI, 2> &portRois);
void setRxROIMetadata(const std::vector<slsDetectorDefs::ROI> &args); void setRxROIMetadata(const std::vector<slsDetectorDefs::ROI> &args);
/************************************************** /**************************************************

View File

@ -1693,19 +1693,19 @@ int ClientInterface::set_arping(Interface &socket) {
} }
int ClientInterface::get_receiver_roi(Interface &socket) { int ClientInterface::get_receiver_roi(Interface &socket) {
auto retval = impl()->getReceiverROI(); auto retvals = impl()->getPortROIs();
LOG(logDEBUG1) << "Receiver roi retval:" << ToString(retval); LOG(logDEBUG1) << "Receiver roi retval:" << ToString(retvals);
return socket.sendResult(retval); return socket.sendResult(retvals);
} }
int ClientInterface::set_receiver_roi(Interface &socket) { int ClientInterface::set_receiver_roi(Interface &socket) {
auto arg = socket.Receive<ROI>(); auto args = socket.Receive<std::array<ROI, 2>>();
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD) if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD)
functionNotImplemented(); functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(arg); LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(args);
verifyIdle(socket); verifyIdle(socket);
try { try {
impl()->setReceiverROI(arg); impl()->setPortROIs(args);
} catch (const std::exception &e) { } catch (const std::exception &e) {
throw RuntimeError("Could not set Receiver ROI [" + throw RuntimeError("Could not set Receiver ROI [" +
std::string(e.what()) + ']'); std::string(e.what()) + ']');
@ -1715,18 +1715,24 @@ int ClientInterface::set_receiver_roi(Interface &socket) {
} }
int ClientInterface::set_receiver_roi_metadata(Interface &socket) { int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
auto arg = socket.Receive<ROI>(); auto roiSize = socket.Receive<int>();
if (roiSize <= 0) {
throw RuntimeError("Invalid number of ReceiverROI metadata: " +
std::to_string(roiSize));
}
LOG(logDEBUG) << "Number of ReceiverROI metadata: " << roiSize;
std::vector<ROI> rois(roiSize);
socket.Receive(rois);
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD) if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD)
functionNotImplemented(); functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI Metadata: " << ToString(arg);
verifyIdle(socket); verifyIdle(socket);
LOG(logINFO) << "Setting ReceiverROI metadata[" << roiSize << ']';
try { try {
impl()->setReceiverROIMetadata(arg); impl()->setMultiROIMetadata(rois);
} catch (const std::exception &e) { } catch (const std::exception &e) {
throw RuntimeError("Could not set ReceiverROI metadata [" + throw RuntimeError("Could not set ReceiverROI metadata [" +
std::string(e.what()) + ']'); std::string(e.what()) + ']');
} }
return socket.Send(OK); return socket.Send(OK);
} }

View File

@ -48,10 +48,10 @@ void DataProcessor::SetUdpPortNumber(const uint16_t portNumber) {
void DataProcessor::SetActivate(bool enable) { activated = enable; } void DataProcessor::SetActivate(bool enable) { activated = enable; }
void DataProcessor::SetReceiverROI(ROI roi) { void DataProcessor::SetPortROI(ROI roi) {
receiverRoi = roi; portRoi = roi;
receiverRoiEnabled = receiverRoi.completeRoi() ? false : true; isPartiallyInRoi = portRoi.completeRoi() ? false : true;
receiverNoRoi = receiverRoi.noRoi(); isOutsideRoi = portRoi.noRoi();
} }
void DataProcessor::SetDataStreamEnable(bool enable) { void DataProcessor::SetDataStreamEnable(bool enable) {
@ -154,17 +154,17 @@ void DataProcessor::CreateFirstFiles(const std::string &fileNamePrefix,
CloseFiles(); CloseFiles();
// deactivated (half module/ single port or no roi), dont write file // deactivated (half module/ single port or no roi), dont write file
if (!activated || !detectorDataStream || receiverNoRoi) { if (!activated || !detectorDataStream || isOutsideRoi) {
return; return;
} }
#ifdef HDF5C #ifdef HDF5C
int nx = generalData->nPixelsX; int nx = generalData->nPixelsX;
int ny = generalData->nPixelsY; int ny = generalData->nPixelsY;
if (receiverRoiEnabled) { if (isPartiallyInRoi) {
nx = receiverRoi.xmax - receiverRoi.xmin + 1; nx = portRoi.xmax - portRoi.xmin + 1;
ny = receiverRoi.ymax - receiverRoi.ymin + 1; ny = portRoi.ymax - portRoi.ymin + 1;
if (receiverRoi.ymax == -1 || receiverRoi.ymin == -1) { if (portRoi.ymax == -1 || portRoi.ymin == -1) {
ny = 1; ny = 1;
} }
} }
@ -203,7 +203,7 @@ std::string DataProcessor::CreateVirtualFile(
const int modulePos, const int numModX, const int numModY, const int modulePos, const int numModX, const int numModY,
std::mutex *hdf5LibMutex) { std::mutex *hdf5LibMutex) {
if (receiverRoiEnabled) { if (isPartiallyInRoi) {
throw std::runtime_error( throw std::runtime_error(
"Skipping virtual hdf5 file since rx_roi is enabled."); "Skipping virtual hdf5 file since rx_roi is enabled.");
} }
@ -235,7 +235,7 @@ void DataProcessor::LinkFileInMaster(const std::string &masterFileName,
const bool silentMode, const bool silentMode,
std::mutex *hdf5LibMutex) { std::mutex *hdf5LibMutex) {
if (receiverRoiEnabled) { if (isPartiallyInRoi) {
throw std::runtime_error( throw std::runtime_error(
"Should not be here, roi with hdf5 virtual should throw."); "Should not be here, roi with hdf5 virtual should throw.");
} }
@ -301,7 +301,7 @@ void DataProcessor::ThreadExecution() {
// stream (if time/freq to stream) or free // stream (if time/freq to stream) or free
if (streamCurrentFrame) { if (streamCurrentFrame) {
// copy the complete image back if roi enabled // copy the complete image back if roi enabled
if (receiverRoiEnabled) { if (isPartiallyInRoi) {
memImage->size = generalData->imageSize; memImage->size = generalData->imageSize;
memcpy(memImage->data, &completeImageToStreamBeforeCropping[0], memcpy(memImage->data, &completeImageToStreamBeforeCropping[0],
generalData->imageSize); generalData->imageSize);
@ -381,7 +381,7 @@ void DataProcessor::ProcessAnImage(sls_receiver_header &header, size_t &size,
streamCurrentFrame = false; streamCurrentFrame = false;
} }
if (receiverRoiEnabled) { if (isPartiallyInRoi) {
// copy the complete image to stream before cropping // copy the complete image to stream before cropping
if (streamCurrentFrame) { if (streamCurrentFrame) {
memcpy(&completeImageToStreamBeforeCropping[0], data, memcpy(&completeImageToStreamBeforeCropping[0], data,
@ -687,12 +687,12 @@ void DataProcessor::ArrangeDbitData(size_t &size, char *data) {
} }
void DataProcessor::CropImage(size_t &size, char *data) { void DataProcessor::CropImage(size_t &size, char *data) {
LOG(logDEBUG) << "Cropping Image to ROI " << ToString(receiverRoi); LOG(logDEBUG) << "Cropping Image to ROI " << ToString(portRoi);
int nPixelsX = generalData->nPixelsX; int nPixelsX = generalData->nPixelsX;
int xmin = receiverRoi.xmin; int xmin = portRoi.xmin;
int xmax = receiverRoi.xmax; int xmax = portRoi.xmax;
int ymin = receiverRoi.ymin; int ymin = portRoi.ymin;
int ymax = receiverRoi.ymax; int ymax = portRoi.ymax;
int xwidth = xmax - xmin + 1; int xwidth = xmax - xmin + 1;
int ywidth = ymax - ymin + 1; int ywidth = ymax - ymin + 1;
if (ymin == -1 || ymax == -1) { if (ymin == -1 || ymax == -1) {

View File

@ -39,7 +39,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
void SetUdpPortNumber(const uint16_t portNumber); void SetUdpPortNumber(const uint16_t portNumber);
void SetActivate(bool enable); void SetActivate(bool enable);
void SetReceiverROI(ROI roi); void SetPortROI(const ROI arg);
void SetDataStreamEnable(bool enable); void SetDataStreamEnable(bool enable);
void SetStreamingFrequency(uint32_t value); void SetStreamingFrequency(uint32_t value);
void SetStreamingTimerInMs(uint32_t value); void SetStreamingTimerInMs(uint32_t value);
@ -159,9 +159,9 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
uint16_t udpPortNumber{0}; uint16_t udpPortNumber{0};
bool dataStreamEnable; bool dataStreamEnable;
bool activated{false}; bool activated{false};
ROI receiverRoi{}; ROI portRoi{};
bool receiverRoiEnabled{false}; bool isPartiallyInRoi{false};
bool receiverNoRoi{false}; bool isOutsideRoi{false};
std::unique_ptr<char[]> completeImageToStreamBeforeCropping; std::unique_ptr<char[]> completeImageToStreamBeforeCropping;
/** if 0, sending random images with a timer */ /** if 0, sending random images with a timer */
uint32_t streamingFrequency; uint32_t streamingFrequency;

View File

@ -53,7 +53,14 @@ void DataStreamer::SetAdditionalJsonHeader(
isAdditionalJsonUpdated = true; isAdditionalJsonUpdated = true;
} }
void DataStreamer::SetReceiverROI(ROI roi) { receiverRoi = roi; } void DataStreamer::SetPortROI(ROI roi) {
if (roi.completeRoi()) {
portRoi =
ROI(0, generalData->nPixelsX - 1, 0, generalData->nPixelsY - 1);
} else {
portRoi = roi;
}
}
void DataStreamer::ResetParametersforNewAcquisition(const std::string &fname) { void DataStreamer::ResetParametersforNewAcquisition(const std::string &fname) {
StopRunning(); StopRunning();
@ -210,7 +217,7 @@ int DataStreamer::SendDataHeader(sls_detector_header header, uint32_t size,
isAdditionalJsonUpdated = false; isAdditionalJsonUpdated = false;
} }
zHeader.addJsonHeader = localAdditionalJsonHeader; zHeader.addJsonHeader = localAdditionalJsonHeader;
zHeader.rx_roi = receiverRoi.getIntArray(); zHeader.rx_roi = portRoi.getIntArray();
return zmqSocket->SendHeader(index, zHeader); return zmqSocket->SendHeader(index, zHeader);
} }

View File

@ -38,7 +38,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
void SetNumberofTotalFrames(uint64_t value); void SetNumberofTotalFrames(uint64_t value);
void void
SetAdditionalJsonHeader(const std::map<std::string, std::string> &json); SetAdditionalJsonHeader(const std::map<std::string, std::string> &json);
void SetReceiverROI(ROI roi); void SetPortROI(ROI roi);
void ResetParametersforNewAcquisition(const std::string &fname); void ResetParametersforNewAcquisition(const std::string &fname);
/** /**
@ -91,7 +91,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
uint64_t fileIndex{0}; uint64_t fileIndex{0};
bool flipRows{false}; bool flipRows{false};
std::map<std::string, std::string> additionalJsonHeader; std::map<std::string, std::string> additionalJsonHeader;
ROI receiverRoi{}; ROI portRoi{};
/** Used by streamer thread to update local copy (reduce number of locks /** Used by streamer thread to update local copy (reduce number of locks
* during streaming) */ * during streaming) */

View File

@ -184,7 +184,7 @@ void Implementation::SetupListener(int i) {
listener[i]->SetUdpPortNumber(udpPortNum[i]); listener[i]->SetUdpPortNumber(udpPortNum[i]);
listener[i]->SetEthernetInterface(eth[i]); listener[i]->SetEthernetInterface(eth[i]);
listener[i]->SetActivate(activated); listener[i]->SetActivate(activated);
listener[i]->SetNoRoi(portRois[i].noRoi()); listener[i]->SetIsOutsideRoi(portRois[i].noRoi());
listener[i]->SetDetectorDatastream(detectorDataStream[i]); listener[i]->SetDetectorDatastream(detectorDataStream[i]);
listener[i]->SetSilentMode(silentMode); listener[i]->SetSilentMode(silentMode);
} }
@ -194,7 +194,7 @@ void Implementation::SetupDataProcessor(int i) {
dataProcessor[i]->SetGeneralData(generalData); dataProcessor[i]->SetGeneralData(generalData);
dataProcessor[i]->SetUdpPortNumber(udpPortNum[i]); dataProcessor[i]->SetUdpPortNumber(udpPortNum[i]);
dataProcessor[i]->SetActivate(activated); dataProcessor[i]->SetActivate(activated);
dataProcessor[i]->SetReceiverROI(portRois[i]); dataProcessor[i]->SetPortROI(portRois[i]);
dataProcessor[i]->SetDataStreamEnable(dataStreamEnable); dataProcessor[i]->SetDataStreamEnable(dataStreamEnable);
dataProcessor[i]->SetStreamingFrequency(streamingFrequency); dataProcessor[i]->SetStreamingFrequency(streamingFrequency);
dataProcessor[i]->SetStreamingTimerInMs(streamingTimerInMs); dataProcessor[i]->SetStreamingTimerInMs(streamingTimerInMs);
@ -216,8 +216,7 @@ void Implementation::SetupDataStreamer(int i) {
dataStreamer[i]->SetFlipRows(flipRows); dataStreamer[i]->SetFlipRows(flipRows);
dataStreamer[i]->SetNumberofPorts(numPorts); dataStreamer[i]->SetNumberofPorts(numPorts);
dataStreamer[i]->SetNumberofTotalFrames(numberOfTotalFrames); dataStreamer[i]->SetNumberofTotalFrames(numberOfTotalFrames);
dataStreamer[i]->SetReceiverROI( dataStreamer[i]->SetPortROI(portRois[i]);
portRois[i].completeRoi() ? GetMaxROIPerPort() : portRois[i]);
} }
slsDetectorDefs::xy Implementation::getDetectorSize() const { slsDetectorDefs::xy Implementation::getDetectorSize() const {
@ -233,18 +232,13 @@ const slsDetectorDefs::xy Implementation::GetPortGeometry() const {
return portGeometry; return portGeometry;
} }
const slsDetectorDefs::ROI Implementation::GetMaxROIPerPort() const {
return slsDetectorDefs::ROI{0, (int)generalData->nPixelsX - 1, 0,
(int)generalData->nPixelsY - 1};
}
void Implementation::setDetectorSize(const slsDetectorDefs::xy size) { void Implementation::setDetectorSize(const slsDetectorDefs::xy size) {
xy portGeometry = GetPortGeometry(); xy portGeometry = GetPortGeometry();
std::string log_message = "Detector Size (ports): ("; std::string log_message = "Detector Size (ports): (";
numModules = size; numModules = size;
numPorts.x = portGeometry.x * size.x; numPorts.x = portGeometry.x * numModules.x;
numPorts.y = portGeometry.y * size.y; numPorts.y = portGeometry.y * numModules.y;
if (quadEnable) { if (quadEnable) {
numPorts.x = 1; numPorts.x = 1;
numPorts.y = 2; numPorts.y = 2;
@ -401,97 +395,27 @@ void Implementation::setArping(const bool i,
} }
} }
slsDetectorDefs::ROI Implementation::getReceiverROI() const { std::array<slsDetectorDefs::ROI, 2> Implementation::getPortROIs() const {
return receiverRoi; return portRois;
} }
void Implementation::setReceiverROI(const slsDetectorDefs::ROI arg) { void Implementation::setPortROIs(const std::array<defs::ROI, 2> &args) {
receiverRoi = arg; portRois = args;
if (generalData->numUDPInterfaces == 1 ||
generalData->detType == slsDetectorDefs::GOTTHARD2) {
portRois[0] = arg;
} else {
slsDetectorDefs::xy nPortDim(generalData->nPixelsX,
generalData->nPixelsY);
for (int iPort = 0; iPort != generalData->numUDPInterfaces; ++iPort) {
// default init = complete roi
slsDetectorDefs::ROI portRoi{};
// no roi
if (arg.noRoi()) {
portRoi.setNoRoi();
}
// incomplete roi
else if (!arg.completeRoi()) {
// get port limits
slsDetectorDefs::ROI portFullRoi{0, nPortDim.x - 1, 0,
nPortDim.y - 1};
if (iPort == 1) {
// left right (eiger)
if (GetPortGeometry().x == 2) {
portFullRoi.xmin += nPortDim.x;
portFullRoi.xmax += nPortDim.x;
}
// top bottom (jungfrau or moench)
else {
portFullRoi.ymin += nPortDim.y;
portFullRoi.ymax += nPortDim.y;
}
}
LOG(logDEBUG)
<< iPort << ": portfullroi:" << ToString(portFullRoi);
// no roi
if (arg.xmin > portFullRoi.xmax ||
arg.xmax < portFullRoi.xmin ||
arg.ymin > portFullRoi.ymax ||
arg.ymax < portFullRoi.ymin) {
portRoi.setNoRoi();
}
// incomplete module roi
else if (arg.xmin > portFullRoi.xmin ||
arg.xmax < portFullRoi.xmax ||
arg.ymin > portFullRoi.ymin ||
arg.ymax < portFullRoi.ymax) {
portRoi.xmin = (arg.xmin <= portFullRoi.xmin)
? 0
: (arg.xmin % nPortDim.x);
portRoi.xmax = (arg.xmax >= portFullRoi.xmax)
? nPortDim.x - 1
: (arg.xmax % nPortDim.x);
portRoi.ymin = (arg.ymin <= portFullRoi.ymin)
? 0
: (arg.ymin % nPortDim.y);
portRoi.ymax = (arg.ymax >= portFullRoi.ymax)
? nPortDim.y - 1
: (arg.ymax % nPortDim.y);
}
}
portRois[iPort] = portRoi;
}
}
for (size_t i = 0; i != listener.size(); ++i) for (size_t i = 0; i != listener.size(); ++i)
listener[i]->SetNoRoi(portRois[i].noRoi()); listener[i]->SetIsOutsideRoi(portRois[i].noRoi());
for (size_t i = 0; i != dataProcessor.size(); ++i) for (size_t i = 0; i != dataProcessor.size(); ++i)
dataProcessor[i]->SetReceiverROI(portRois[i]); dataProcessor[i]->SetPortROI(portRois[i]);
for (size_t i = 0; i != dataStreamer.size(); ++i) { for (size_t i = 0; i != dataStreamer.size(); ++i) {
dataStreamer[i]->SetReceiverROI( dataStreamer[i]->SetPortROI(portRois[i]);
portRois[i].completeRoi() ? GetMaxROIPerPort() : portRois[i]);
}
LOG(logINFO) << "receiver roi: " << ToString(receiverRoi);
if (generalData->numUDPInterfaces == 2 &&
generalData->detType != slsDetectorDefs::GOTTHARD2) {
LOG(logINFO) << "port rois: " << ToString(portRois);
} }
LOG(logINFOBLUE) << "Rois (per port): " << ToString(portRois);
} }
void Implementation::setReceiverROIMetadata(const ROI arg) { void Implementation::setMultiROIMetadata(
receiverRoiMetadata = arg; const std::vector<slsDetectorDefs::ROI> &args) {
LOG(logINFO) << "receiver roi Metadata: " << ToString(receiverRoiMetadata); multiRoiMetadata = args;
LOG(logINFOBLUE) << "Multi ROI Metadata: " << ToString(multiRoiMetadata);
} }
/************************************************** /**************************************************
@ -787,8 +711,7 @@ void Implementation::stopReceiver() {
summary = (i == 0 ? "\n\tDeactivated Left Port" summary = (i == 0 ? "\n\tDeactivated Left Port"
: "\n\tDeactivated Right Port"); : "\n\tDeactivated Right Port");
} else if (portRois[i].noRoi()) { } else if (portRois[i].noRoi()) {
summary = (i == 0 ? "\n\tNo Roi on Left Port" summary = "\n\tNo Roi on Port[" + std::to_string(i) + ']';
: "\n\tNo Roi on Right Port");
} else { } else {
std::ostringstream os; std::ostringstream os;
os << "\n\tMissing Packets\t\t: " << mpMessage os << "\n\tMissing Packets\t\t: " << mpMessage
@ -958,7 +881,19 @@ void Implementation::StartMasterWriter() {
masterAttributes.framePadding = framePadding; masterAttributes.framePadding = framePadding;
masterAttributes.scanParams = scanParams; masterAttributes.scanParams = scanParams;
masterAttributes.totalFrames = numberOfTotalFrames; masterAttributes.totalFrames = numberOfTotalFrames;
masterAttributes.receiverRoi = receiverRoiMetadata; // complete ROI
if (multiRoiMetadata.empty()) {
int nTotalPixelsX = (generalData->nPixelsX * numPorts.x);
int nTotalPixelsY = (generalData->nPixelsY * numPorts.y);
if (nTotalPixelsY == 1) {
masterAttributes.rois.push_back(ROI{0, nTotalPixelsX - 1});
} else {
masterAttributes.rois.push_back(
ROI{0, nTotalPixelsX - 1, 0, nTotalPixelsY - 1});
}
} else {
masterAttributes.rois = multiRoiMetadata;
}
masterAttributes.exptime = acquisitionTime; masterAttributes.exptime = acquisitionTime;
masterAttributes.period = acquisitionPeriod; masterAttributes.period = acquisitionPeriod;
masterAttributes.burstMode = burstMode; masterAttributes.burstMode = burstMode;
@ -1087,8 +1022,8 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
// fifo // fifo
SetupFifoStructure(); SetupFifoStructure();
// recalculate port rois // recalculate port rois booleans for listener, processor and streamer
setReceiverROI(receiverRoi); setPortROIs(portRois);
// create threads // create threads
for (int i = 0; i < generalData->numUDPInterfaces; ++i) { for (int i = 0; i < generalData->numUDPInterfaces; ++i) {

View File

@ -58,9 +58,9 @@ class Implementation : private virtual slsDetectorDefs {
bool getArping() const; bool getArping() const;
pid_t getArpingProcessId() const; pid_t getArpingProcessId() const;
void setArping(const bool i, const std::vector<std::string> ips); void setArping(const bool i, const std::vector<std::string> ips);
ROI getReceiverROI() const; std::array<defs::ROI, 2> getPortROIs() const;
void setReceiverROI(const ROI arg); void setPortROIs(const std::array<defs::ROI, 2> &args);
void setReceiverROIMetadata(const ROI arg); void setMultiROIMetadata(const std::vector<slsDetectorDefs::ROI> &args);
/************************************************** /**************************************************
* * * *
@ -283,7 +283,6 @@ class Implementation : private virtual slsDetectorDefs {
void SetupFifoStructure(); void SetupFifoStructure();
const xy GetPortGeometry() const; const xy GetPortGeometry() const;
const ROI GetMaxROIPerPort() const;
void ResetParametersforNewAcquisition(); void ResetParametersforNewAcquisition();
void CreateUDPSockets(); void CreateUDPSockets();
void SetupWriter(); void SetupWriter();
@ -308,10 +307,8 @@ class Implementation : private virtual slsDetectorDefs {
bool framePadding{true}; bool framePadding{true};
pid_t parentThreadId; pid_t parentThreadId;
pid_t tcpThreadId; pid_t tcpThreadId;
ROI receiverRoi{};
std::array<ROI, 2> portRois{}; std::array<ROI, 2> portRois{};
// receiver roi for complete detector for metadata std::vector<ROI> multiRoiMetadata{};
ROI receiverRoiMetadata{};
// file parameters // file parameters
fileFormat fileFormatType{BINARY}; fileFormat fileFormatType{BINARY};

View File

@ -85,17 +85,17 @@ void Listener::SetEthernetInterface(const std::string e) {
void Listener::SetActivate(bool enable) { void Listener::SetActivate(bool enable) {
activated = enable; activated = enable;
disabledPort = (!activated || !detectorDataStream || noRoi); disabledPort = (!activated || !detectorDataStream || isOutsideRoi);
} }
void Listener::SetDetectorDatastream(bool enable) { void Listener::SetDetectorDatastream(bool enable) {
detectorDataStream = enable; detectorDataStream = enable;
disabledPort = (!activated || !detectorDataStream || noRoi); disabledPort = (!activated || !detectorDataStream || isOutsideRoi);
} }
void Listener::SetNoRoi(bool enable) { void Listener::SetIsOutsideRoi(bool enable) {
noRoi = enable; isOutsideRoi = enable;
disabledPort = (!activated || !detectorDataStream || noRoi); disabledPort = (!activated || !detectorDataStream || isOutsideRoi);
} }
void Listener::SetSilentMode(bool enable) { silentMode = enable; } void Listener::SetSilentMode(bool enable) { silentMode = enable; }

View File

@ -43,7 +43,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
void SetEthernetInterface(const std::string e); void SetEthernetInterface(const std::string e);
void SetActivate(bool enable); void SetActivate(bool enable);
void SetDetectorDatastream(bool enable); void SetDetectorDatastream(bool enable);
void SetNoRoi(bool enable); void SetIsOutsideRoi(bool enable);
void SetSilentMode(bool enable); void SetSilentMode(bool enable);
void ResetParametersforNewAcquisition(); void ResetParametersforNewAcquisition();
@ -116,7 +116,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
std::string eth; std::string eth;
bool activated{false}; bool activated{false};
bool detectorDataStream{true}; bool detectorDataStream{true};
bool noRoi{false}; bool isOutsideRoi{false};
bool silentMode; bool silentMode;
bool disabledPort{false}; bool disabledPort{false};

View File

@ -43,30 +43,30 @@ void MasterAttributes::WriteHDF5Attributes(H5::H5File *fd, H5::Group *group) {
WriteCommonHDF5Attributes(fd, group); WriteCommonHDF5Attributes(fd, group);
switch (detType) { switch (detType) {
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
WriteJungfrauHDF5Attributes(fd, group); WriteJungfrauHDF5Attributes(group);
break; break;
case slsDetectorDefs::MOENCH: case slsDetectorDefs::MOENCH:
WriteMoenchHDF5Attributes(fd, group); WriteMoenchHDF5Attributes(group);
break; break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:
WriteEigerHDF5Attributes(fd, group); WriteEigerHDF5Attributes(group);
break; break;
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
WriteMythen3HDF5Attributes(fd, group); WriteMythen3HDF5Attributes(group);
break; break;
case slsDetectorDefs::GOTTHARD2: case slsDetectorDefs::GOTTHARD2:
WriteGotthard2HDF5Attributes(fd, group); WriteGotthard2HDF5Attributes(group);
break; break;
case slsDetectorDefs::CHIPTESTBOARD: case slsDetectorDefs::CHIPTESTBOARD:
WriteCtbHDF5Attributes(fd, group); WriteCtbHDF5Attributes(group);
break; break;
case slsDetectorDefs::XILINX_CHIPTESTBOARD: case slsDetectorDefs::XILINX_CHIPTESTBOARD:
WriteXilinxCtbHDF5Attributes(fd, group); WriteXilinxCtbHDF5Attributes(group);
break; break;
default: default:
throw RuntimeError("Unknown Detector type to get master attributes"); throw RuntimeError("Unknown Detector type to get master attributes");
} }
WriteFinalHDF5Attributes(fd, group); WriteFinalHDF5Attributes(group);
} }
#endif #endif
@ -110,17 +110,6 @@ void MasterAttributes::GetCommonBinaryAttributes(
w->String(ToString(scanParams).c_str()); w->String(ToString(scanParams).c_str());
w->Key("Total Frames"); w->Key("Total Frames");
w->Uint64(totalFrames); w->Uint64(totalFrames);
w->Key("Receiver Roi");
w->StartObject();
w->Key("xmin");
w->Uint(receiverRoi.xmin);
w->Key("xmax");
w->Uint(receiverRoi.xmax);
w->Key("ymin");
w->Uint(receiverRoi.ymin);
w->Key("ymax");
w->Uint(receiverRoi.ymax);
w->EndObject();
} }
void MasterAttributes::GetFinalBinaryAttributes( void MasterAttributes::GetFinalBinaryAttributes(
@ -287,38 +276,9 @@ void MasterAttributes::WriteCommonHDF5Attributes(H5::H5File *fd,
"Total Frames", H5::PredType::STD_U64LE, dataspace); "Total Frames", H5::PredType::STD_U64LE, dataspace);
dataset.write(&totalFrames, H5::PredType::STD_U64LE); dataset.write(&totalFrames, H5::PredType::STD_U64LE);
} }
// Receiver Roi xmin
{
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet(
"receiver roi xmin", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&receiverRoi.xmin, H5::PredType::NATIVE_INT);
}
// Receiver Roi xmax
{
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet(
"receiver roi xmax", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&receiverRoi.xmax, H5::PredType::NATIVE_INT);
}
// Receiver Roi ymin
{
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet(
"receiver roi ymin", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&receiverRoi.ymin, H5::PredType::NATIVE_INT);
}
// Receiver Roi ymax
{
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet(
"receiver roi ymax", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&receiverRoi.ymax, H5::PredType::NATIVE_INT);
}
} }
void MasterAttributes::WriteFinalHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteFinalHDF5Attributes(H5::Group *group) {
H5::Group *group) {
char c[1024]{}; char c[1024]{};
// Total Frames in file // Total Frames in file
{ {
@ -339,7 +299,20 @@ void MasterAttributes::WriteFinalHDF5Attributes(H5::H5File *fd,
} }
} }
void MasterAttributes::WriteHDF5Exptime(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5ROIs(H5::Group *group) {
hsize_t dims[1] = {rois.size()};
H5::DataSpace dataspace(1, dims);
H5::StrType strdatatype(H5::PredType::C_S1, 1024);
H5::DataSet dataset =
group->createDataSet("Receiver Rois", strdatatype, dataspace);
std::vector<char[1024]> cRois(rois.size());
for (size_t i = 0; i < rois.size(); ++i) {
strcpy_safe(cRois[i], ToString(rois[i]));
}
dataset.write(cRois.data(), strdatatype);
}
void MasterAttributes::WriteHDF5Exptime(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 256); H5::StrType strdatatype(H5::PredType::C_S1, 256);
H5::DataSet dataset = H5::DataSet dataset =
@ -349,7 +322,7 @@ void MasterAttributes::WriteHDF5Exptime(H5::H5File *fd, H5::Group *group) {
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5Period(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5Period(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 256); H5::StrType strdatatype(H5::PredType::C_S1, 256);
H5::DataSet dataset = H5::DataSet dataset =
@ -359,7 +332,7 @@ void MasterAttributes::WriteHDF5Period(H5::H5File *fd, H5::Group *group) {
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5DynamicRange(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5DynamicRange(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Dynamic Range", H5::PredType::NATIVE_INT, dataspace); "Dynamic Range", H5::PredType::NATIVE_INT, dataspace);
@ -372,30 +345,28 @@ void MasterAttributes::WriteHDF5DynamicRange(H5::H5File *fd, H5::Group *group) {
attribute.write(strdatatype, c); attribute.write(strdatatype, c);
} }
void MasterAttributes::WriteHDF5TenGiga(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5TenGiga(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Ten Giga Enable", H5::PredType::NATIVE_INT, dataspace); "Ten Giga Enable", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&tenGiga, H5::PredType::NATIVE_INT); dataset.write(&tenGiga, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5NumUDPInterfaces(H5::H5File *fd, void MasterAttributes::WriteHDF5NumUDPInterfaces(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Number of UDP Interfaces", H5::PredType::NATIVE_INT, dataspace); "Number of UDP Interfaces", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&numUDPInterfaces, H5::PredType::NATIVE_INT); dataset.write(&numUDPInterfaces, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5ReadNRows(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5ReadNRows(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Number of rows", H5::PredType::NATIVE_INT, dataspace); "Number of rows", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&readNRows, H5::PredType::NATIVE_INT); dataset.write(&readNRows, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5ThresholdEnergy(H5::H5File *fd, void MasterAttributes::WriteHDF5ThresholdEnergy(H5::Group *group) {
H5::Group *group) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
@ -409,8 +380,7 @@ void MasterAttributes::WriteHDF5ThresholdEnergy(H5::H5File *fd,
attribute.write(strdatatype, c); attribute.write(strdatatype, c);
} }
void MasterAttributes::WriteHDF5ThresholdEnergies(H5::H5File *fd, void MasterAttributes::WriteHDF5ThresholdEnergies(H5::Group *group) {
H5::Group *group) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 1024); H5::StrType strdatatype(H5::PredType::C_S1, 1024);
@ -420,7 +390,7 @@ void MasterAttributes::WriteHDF5ThresholdEnergies(H5::H5File *fd,
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5SubExpTime(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5SubExpTime(H5::Group *group) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 256); H5::StrType strdatatype(H5::PredType::C_S1, 256);
@ -430,7 +400,7 @@ void MasterAttributes::WriteHDF5SubExpTime(H5::H5File *fd, H5::Group *group) {
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5SubPeriod(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5SubPeriod(H5::Group *group) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 256); H5::StrType strdatatype(H5::PredType::C_S1, 256);
@ -440,15 +410,14 @@ void MasterAttributes::WriteHDF5SubPeriod(H5::H5File *fd, H5::Group *group) {
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5SubQuad(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5SubQuad(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = H5::DataSet dataset =
group->createDataSet("Quad", H5::PredType::NATIVE_INT, dataspace); group->createDataSet("Quad", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&quad, H5::PredType::NATIVE_INT); dataset.write(&quad, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5RateCorrections(H5::H5File *fd, void MasterAttributes::WriteHDF5RateCorrections(H5::Group *group) {
H5::Group *group) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 1024); H5::StrType strdatatype(H5::PredType::C_S1, 1024);
@ -458,14 +427,14 @@ void MasterAttributes::WriteHDF5RateCorrections(H5::H5File *fd,
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5CounterMask(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5CounterMask(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Counter Mask", H5::PredType::STD_U32LE, dataspace); "Counter Mask", H5::PredType::STD_U32LE, dataspace);
dataset.write(&counterMask, H5::PredType::STD_U32LE); dataset.write(&counterMask, H5::PredType::STD_U32LE);
} }
void MasterAttributes::WriteHDF5ExptimeArray(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5ExptimeArray(H5::Group *group) {
for (int i = 0; i != 3; ++i) { for (int i = 0; i != 3; ++i) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
@ -477,8 +446,7 @@ void MasterAttributes::WriteHDF5ExptimeArray(H5::H5File *fd, H5::Group *group) {
} }
} }
void MasterAttributes::WriteHDF5GateDelayArray(H5::H5File *fd, void MasterAttributes::WriteHDF5GateDelayArray(H5::Group *group) {
H5::Group *group) {
for (int i = 0; i != 3; ++i) { for (int i = 0; i != 3; ++i) {
char c[1024]{}; char c[1024]{};
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
@ -490,14 +458,14 @@ void MasterAttributes::WriteHDF5GateDelayArray(H5::H5File *fd,
} }
} }
void MasterAttributes::WriteHDF5Gates(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5Gates(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = H5::DataSet dataset =
group->createDataSet("Gates", H5::PredType::STD_U32LE, dataspace); group->createDataSet("Gates", H5::PredType::STD_U32LE, dataspace);
dataset.write(&gates, H5::PredType::STD_U32LE); dataset.write(&gates, H5::PredType::STD_U32LE);
} }
void MasterAttributes::WriteHDF5BurstMode(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5BurstMode(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::StrType strdatatype(H5::PredType::C_S1, 256); H5::StrType strdatatype(H5::PredType::C_S1, 256);
H5::DataSet dataset = H5::DataSet dataset =
@ -507,82 +475,77 @@ void MasterAttributes::WriteHDF5BurstMode(H5::H5File *fd, H5::Group *group) {
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
void MasterAttributes::WriteHDF5AdcMask(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5AdcMask(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = H5::DataSet dataset =
group->createDataSet("ADC Mask", H5::PredType::NATIVE_INT, dataspace); group->createDataSet("ADC Mask", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&adcmask, H5::PredType::NATIVE_INT); dataset.write(&adcmask, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5AnalogFlag(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5AnalogFlag(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Analog Flag", H5::PredType::NATIVE_INT, dataspace); "Analog Flag", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&analog, H5::PredType::NATIVE_INT); dataset.write(&analog, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5AnalogSamples(H5::H5File *fd, void MasterAttributes::WriteHDF5AnalogSamples(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Analog Samples", H5::PredType::NATIVE_INT, dataspace); "Analog Samples", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&analogSamples, H5::PredType::NATIVE_INT); dataset.write(&analogSamples, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5DigitalFlag(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5DigitalFlag(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Digital Flag", H5::PredType::NATIVE_INT, dataspace); "Digital Flag", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&digital, H5::PredType::NATIVE_INT); dataset.write(&digital, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5DigitalSamples(H5::H5File *fd, void MasterAttributes::WriteHDF5DigitalSamples(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Digital Samples", H5::PredType::NATIVE_INT, dataspace); "Digital Samples", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&digitalSamples, H5::PredType::NATIVE_INT); dataset.write(&digitalSamples, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5DbitOffset(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5DbitOffset(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Dbit Offset", H5::PredType::NATIVE_INT, dataspace); "Dbit Offset", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&dbitoffset, H5::PredType::NATIVE_INT); dataset.write(&dbitoffset, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5DbitReorder(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5DbitReorder(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Dbit Reorder", H5::PredType::NATIVE_INT, dataspace); "Dbit Reorder", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&dbitreorder, H5::PredType::NATIVE_INT); dataset.write(&dbitreorder, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5DbitList(H5::H5File *fd, H5::Group *group) { void MasterAttributes::WriteHDF5DbitList(H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Dbit Bitset List", H5::PredType::STD_U64LE, dataspace); "Dbit Bitset List", H5::PredType::STD_U64LE, dataspace);
dataset.write(&dbitlist, H5::PredType::STD_U64LE); dataset.write(&dbitlist, H5::PredType::STD_U64LE);
} }
void MasterAttributes::WriteHDF5TransceiverMask(H5::H5File *fd, void MasterAttributes::WriteHDF5TransceiverMask(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Transceiver Mask", H5::PredType::NATIVE_INT, dataspace); "Transceiver Mask", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&transceiverMask, H5::PredType::NATIVE_INT); dataset.write(&transceiverMask, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5TransceiverFlag(H5::H5File *fd, void MasterAttributes::WriteHDF5TransceiverFlag(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Transceiver Flag", H5::PredType::NATIVE_INT, dataspace); "Transceiver Flag", H5::PredType::NATIVE_INT, dataspace);
dataset.write(&transceiver, H5::PredType::NATIVE_INT); dataset.write(&transceiver, H5::PredType::NATIVE_INT);
} }
void MasterAttributes::WriteHDF5TransceiverSamples(H5::H5File *fd, void MasterAttributes::WriteHDF5TransceiverSamples(H5::Group *group) {
H5::Group *group) {
H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR);
H5::DataSet dataset = group->createDataSet( H5::DataSet dataset = group->createDataSet(
"Transceiver Samples", H5::PredType::NATIVE_INT, dataspace); "Transceiver Samples", H5::PredType::NATIVE_INT, dataspace);
@ -592,6 +555,13 @@ void MasterAttributes::WriteHDF5TransceiverSamples(H5::H5File *fd,
void MasterAttributes::GetJungfrauBinaryAttributes( void MasterAttributes::GetJungfrauBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Receiver Rois");
w->StartArray();
for (const slsDetectorDefs::ROI &roi : rois) {
std::string roi_str = ToString(roi);
w->String(roi_str.c_str());
}
w->EndArray();
w->Key("Exptime"); w->Key("Exptime");
w->String(ToString(exptime).c_str()); w->String(ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -603,17 +573,24 @@ void MasterAttributes::GetJungfrauBinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteJungfrauHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteJungfrauHDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5ROIs(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5NumUDPInterfaces(fd, group); MasterAttributes::WriteHDF5NumUDPInterfaces(group);
MasterAttributes::WriteHDF5ReadNRows(fd, group); MasterAttributes::WriteHDF5ReadNRows(group);
} }
#endif #endif
void MasterAttributes::GetMoenchBinaryAttributes( void MasterAttributes::GetMoenchBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Receiver Rois");
w->StartArray();
for (const slsDetectorDefs::ROI &roi : rois) {
std::string roi_str = ToString(roi);
w->String(roi_str.c_str());
}
w->EndArray();
w->Key("Exptime"); w->Key("Exptime");
w->String(ToString(exptime).c_str()); w->String(ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -625,17 +602,24 @@ void MasterAttributes::GetMoenchBinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteMoenchHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteMoenchHDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5ROIs(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5NumUDPInterfaces(fd, group); MasterAttributes::WriteHDF5NumUDPInterfaces(group);
MasterAttributes::WriteHDF5ReadNRows(fd, group); MasterAttributes::WriteHDF5ReadNRows(group);
} }
#endif #endif
void MasterAttributes::GetEigerBinaryAttributes( void MasterAttributes::GetEigerBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Receiver Rois");
w->StartArray();
for (const slsDetectorDefs::ROI &roi : rois) {
std::string roi_str = ToString(roi);
w->String(roi_str.c_str());
}
w->EndArray();
w->Key("Dynamic Range"); w->Key("Dynamic Range");
w->Uint(dynamicRange); w->Uint(dynamicRange);
w->Key("Ten Giga"); w->Key("Ten Giga");
@ -659,23 +643,30 @@ void MasterAttributes::GetEigerBinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteEigerHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteEigerHDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5ROIs(group);
MasterAttributes::WriteHDF5DynamicRange(fd, group); MasterAttributes::WriteHDF5DynamicRange(group);
MasterAttributes::WriteHDF5TenGiga(fd, group); MasterAttributes::WriteHDF5TenGiga(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5ThresholdEnergy(fd, group); MasterAttributes::WriteHDF5ThresholdEnergy(group);
MasterAttributes::WriteHDF5SubExpTime(fd, group); MasterAttributes::WriteHDF5SubExpTime(group);
MasterAttributes::WriteHDF5SubPeriod(fd, group); MasterAttributes::WriteHDF5SubPeriod(group);
MasterAttributes::WriteHDF5SubQuad(fd, group); MasterAttributes::WriteHDF5SubQuad(group);
MasterAttributes::WriteHDF5ReadNRows(fd, group); MasterAttributes::WriteHDF5ReadNRows(group);
MasterAttributes::WriteHDF5RateCorrections(fd, group); MasterAttributes::WriteHDF5RateCorrections(group);
} }
#endif #endif
void MasterAttributes::GetMythen3BinaryAttributes( void MasterAttributes::GetMythen3BinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Receiver Rois");
w->StartArray();
for (const slsDetectorDefs::ROI &roi : rois) {
std::string roi_str = ToString(roi);
w->String(roi_str.c_str());
}
w->EndArray();
w->Key("Dynamic Range"); w->Key("Dynamic Range");
w->Uint(dynamicRange); w->Uint(dynamicRange);
w->Key("Ten Giga"); w->Key("Ten Giga");
@ -699,21 +690,28 @@ void MasterAttributes::GetMythen3BinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteMythen3HDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteMythen3HDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5ROIs(group);
MasterAttributes::WriteHDF5DynamicRange(fd, group); MasterAttributes::WriteHDF5DynamicRange(group);
MasterAttributes::WriteHDF5TenGiga(fd, group); MasterAttributes::WriteHDF5TenGiga(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5CounterMask(fd, group); MasterAttributes::WriteHDF5CounterMask(group);
MasterAttributes::WriteHDF5ExptimeArray(fd, group); MasterAttributes::WriteHDF5ExptimeArray(group);
MasterAttributes::WriteHDF5GateDelayArray(fd, group); MasterAttributes::WriteHDF5GateDelayArray(group);
MasterAttributes::WriteHDF5Gates(fd, group); MasterAttributes::WriteHDF5Gates(group);
MasterAttributes::WriteHDF5ThresholdEnergies(fd, group); MasterAttributes::WriteHDF5ThresholdEnergies(group);
} }
#endif #endif
void MasterAttributes::GetGotthard2BinaryAttributes( void MasterAttributes::GetGotthard2BinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Receiver Rois");
w->StartArray();
for (const slsDetectorDefs::ROI &roi : rois) {
std::string roi_str = ToString(roi);
w->String(roi_str.c_str());
}
w->EndArray();
w->Key("Exptime"); w->Key("Exptime");
w->String(ToString(exptime).c_str()); w->String(ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -723,11 +721,11 @@ void MasterAttributes::GetGotthard2BinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteGotthard2HDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteGotthard2HDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5ROIs(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5BurstMode(fd, group); MasterAttributes::WriteHDF5BurstMode(group);
} }
#endif #endif
@ -764,22 +762,21 @@ void MasterAttributes::GetCtbBinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteCtbHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteCtbHDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5TenGiga(group);
MasterAttributes::WriteHDF5TenGiga(fd, group); MasterAttributes::WriteHDF5AdcMask(group);
MasterAttributes::WriteHDF5AdcMask(fd, group); MasterAttributes::WriteHDF5AnalogFlag(group);
MasterAttributes::WriteHDF5AnalogFlag(fd, group); MasterAttributes::WriteHDF5AnalogSamples(group);
MasterAttributes::WriteHDF5AnalogSamples(fd, group); MasterAttributes::WriteHDF5DigitalFlag(group);
MasterAttributes::WriteHDF5DigitalFlag(fd, group); MasterAttributes::WriteHDF5DigitalSamples(group);
MasterAttributes::WriteHDF5DigitalSamples(fd, group); MasterAttributes::WriteHDF5DbitOffset(group);
MasterAttributes::WriteHDF5DbitOffset(fd, group); MasterAttributes::WriteHDF5DbitReorder(group);
MasterAttributes::WriteHDF5DbitReorder(fd, group); MasterAttributes::WriteHDF5DbitList(group);
MasterAttributes::WriteHDF5DbitList(fd, group); MasterAttributes::WriteHDF5TransceiverMask(group);
MasterAttributes::WriteHDF5TransceiverMask(fd, group); MasterAttributes::WriteHDF5TransceiverFlag(group);
MasterAttributes::WriteHDF5TransceiverFlag(fd, group); MasterAttributes::WriteHDF5TransceiverSamples(group);
MasterAttributes::WriteHDF5TransceiverSamples(fd, group);
} }
#endif #endif
@ -814,21 +811,20 @@ void MasterAttributes::GetXilinxCtbBinaryAttributes(
} }
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteXilinxCtbHDF5Attributes(H5::H5File *fd, void MasterAttributes::WriteXilinxCtbHDF5Attributes(H5::Group *group) {
H5::Group *group) { MasterAttributes::WriteHDF5Exptime(group);
MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Period(group);
MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5AdcMask(group);
MasterAttributes::WriteHDF5AdcMask(fd, group); MasterAttributes::WriteHDF5AnalogFlag(group);
MasterAttributes::WriteHDF5AnalogFlag(fd, group); MasterAttributes::WriteHDF5AnalogSamples(group);
MasterAttributes::WriteHDF5AnalogSamples(fd, group); MasterAttributes::WriteHDF5DigitalFlag(group);
MasterAttributes::WriteHDF5DigitalFlag(fd, group); MasterAttributes::WriteHDF5DigitalSamples(group);
MasterAttributes::WriteHDF5DigitalSamples(fd, group); MasterAttributes::WriteHDF5DbitOffset(group);
MasterAttributes::WriteHDF5DbitOffset(fd, group); MasterAttributes::WriteHDF5DbitReorder(group);
MasterAttributes::WriteHDF5DbitReorder(fd, group); MasterAttributes::WriteHDF5DbitList(group);
MasterAttributes::WriteHDF5DbitList(fd, group); MasterAttributes::WriteHDF5TransceiverMask(group);
MasterAttributes::WriteHDF5TransceiverMask(fd, group); MasterAttributes::WriteHDF5TransceiverFlag(group);
MasterAttributes::WriteHDF5TransceiverFlag(fd, group); MasterAttributes::WriteHDF5TransceiverSamples(group);
MasterAttributes::WriteHDF5TransceiverSamples(fd, group);
} }
#endif #endif
} // namespace sls } // namespace sls

View File

@ -57,7 +57,7 @@ class MasterAttributes {
uint32_t transceiverMask{0}; uint32_t transceiverMask{0};
uint32_t transceiver{0}; uint32_t transceiver{0};
uint32_t transceiverSamples{0}; uint32_t transceiverSamples{0};
slsDetectorDefs::ROI receiverRoi{}; std::vector<slsDetectorDefs::ROI> rois{};
uint32_t counterMask{0}; uint32_t counterMask{0};
std::array<ns, 3> exptimeArray{}; std::array<ns, 3> exptimeArray{};
std::array<ns, 3> gateDelayArray{}; std::array<ns, 3> gateDelayArray{};
@ -80,77 +80,78 @@ class MasterAttributes {
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteCommonHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteCommonHDF5Attributes(H5::H5File *fd, H5::Group *group);
void WriteFinalHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteFinalHDF5Attributes(H5::Group *group);
void WriteHDF5Exptime(H5::H5File *fd, H5::Group *group); void WriteHDF5ROIs(H5::Group *group);
void WriteHDF5Period(H5::H5File *fd, H5::Group *group); void WriteHDF5Exptime(H5::Group *group);
void WriteHDF5DynamicRange(H5::H5File *fd, H5::Group *group); void WriteHDF5Period(H5::Group *group);
void WriteHDF5TenGiga(H5::H5File *fd, H5::Group *group); void WriteHDF5DynamicRange(H5::Group *group);
void WriteHDF5NumUDPInterfaces(H5::H5File *fd, H5::Group *group); void WriteHDF5TenGiga(H5::Group *group);
void WriteHDF5ReadNRows(H5::H5File *fd, H5::Group *group); void WriteHDF5NumUDPInterfaces(H5::Group *group);
void WriteHDF5ThresholdEnergy(H5::H5File *fd, H5::Group *group); void WriteHDF5ReadNRows(H5::Group *group);
void WriteHDF5ThresholdEnergies(H5::H5File *fd, H5::Group *group); void WriteHDF5ThresholdEnergy(H5::Group *group);
void WriteHDF5SubExpTime(H5::H5File *fd, H5::Group *group); void WriteHDF5ThresholdEnergies(H5::Group *group);
void WriteHDF5SubPeriod(H5::H5File *fd, H5::Group *group); void WriteHDF5SubExpTime(H5::Group *group);
void WriteHDF5SubQuad(H5::H5File *fd, H5::Group *group); void WriteHDF5SubPeriod(H5::Group *group);
void WriteHDF5RateCorrections(H5::H5File *fd, H5::Group *group); void WriteHDF5SubQuad(H5::Group *group);
void WriteHDF5CounterMask(H5::H5File *fd, H5::Group *group); void WriteHDF5RateCorrections(H5::Group *group);
void WriteHDF5ExptimeArray(H5::H5File *fd, H5::Group *group); void WriteHDF5CounterMask(H5::Group *group);
void WriteHDF5GateDelayArray(H5::H5File *fd, H5::Group *group); void WriteHDF5ExptimeArray(H5::Group *group);
void WriteHDF5Gates(H5::H5File *fd, H5::Group *group); void WriteHDF5GateDelayArray(H5::Group *group);
void WriteHDF5BurstMode(H5::H5File *fd, H5::Group *group); void WriteHDF5Gates(H5::Group *group);
void WriteHDF5AdcMask(H5::H5File *fd, H5::Group *group); void WriteHDF5BurstMode(H5::Group *group);
void WriteHDF5AnalogFlag(H5::H5File *fd, H5::Group *group); void WriteHDF5AdcMask(H5::Group *group);
void WriteHDF5AnalogSamples(H5::H5File *fd, H5::Group *group); void WriteHDF5AnalogFlag(H5::Group *group);
void WriteHDF5DigitalFlag(H5::H5File *fd, H5::Group *group); void WriteHDF5AnalogSamples(H5::Group *group);
void WriteHDF5DigitalSamples(H5::H5File *fd, H5::Group *group); void WriteHDF5DigitalFlag(H5::Group *group);
void WriteHDF5DbitOffset(H5::H5File *fd, H5::Group *group); void WriteHDF5DigitalSamples(H5::Group *group);
void WriteHDF5DbitList(H5::H5File *fd, H5::Group *group); void WriteHDF5DbitOffset(H5::Group *group);
void WriteHDF5DbitReorder(H5::H5File *fd, H5::Group *group); void WriteHDF5DbitList(H5::Group *group);
void WriteHDF5TransceiverMask(H5::H5File *fd, H5::Group *group); void WriteHDF5DbitReorder(H5::Group *group);
void WriteHDF5TransceiverFlag(H5::H5File *fd, H5::Group *group); void WriteHDF5TransceiverMask(H5::Group *group);
void WriteHDF5TransceiverSamples(H5::H5File *fd, H5::Group *group); void WriteHDF5TransceiverFlag(H5::Group *group);
void WriteHDF5TransceiverSamples(H5::Group *group);
#endif #endif
void GetJungfrauBinaryAttributes( void GetJungfrauBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteJungfrauHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteJungfrauHDF5Attributes(H5::Group *group);
#endif #endif
void GetEigerBinaryAttributes( void GetEigerBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteEigerHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteEigerHDF5Attributes(H5::Group *group);
#endif #endif
void GetMythen3BinaryAttributes( void GetMythen3BinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteMythen3HDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteMythen3HDF5Attributes(H5::Group *group);
#endif #endif
void GetGotthard2BinaryAttributes( void GetGotthard2BinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteGotthard2HDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteGotthard2HDF5Attributes(H5::Group *group);
#endif #endif
void GetMoenchBinaryAttributes( void GetMoenchBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteMoenchHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteMoenchHDF5Attributes(H5::Group *group);
#endif #endif
void void
GetCtbBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); GetCtbBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteCtbHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteCtbHDF5Attributes(H5::Group *group);
#endif #endif
void GetXilinxCtbBinaryAttributes( void GetXilinxCtbBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteXilinxCtbHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteXilinxCtbHDF5Attributes(H5::Group *group);
#endif #endif
}; };