formattin
All checks were successful
Build on RHEL9 / build (push) Successful in 2m53s
Build on RHEL8 / build (push) Successful in 4m57s

This commit is contained in:
2025-07-02 19:44:44 +02:00
parent 313fc75950
commit 94a9476550
5 changed files with 24 additions and 15 deletions

View File

@ -208,8 +208,11 @@ defs::xy Detector::getPortPerModuleGeometry() const {
Result<defs::xy> Detector::getPortSize(Positions pos) const { Result<defs::xy> Detector::getPortSize(Positions pos) const {
Result<defs::xy> res = pimpl->Parallel(&Module::getNumberOfChannels, pos); Result<defs::xy> res = pimpl->Parallel(&Module::getNumberOfChannels, pos);
defs::xy portGeometry = getPortPerModuleGeometry(); defs::xy portGeometry = getPortPerModuleGeometry();
if ((portGeometry.x != 1 && portGeometry.x != 2) || (portGeometry.y != 1 && portGeometry.y != 2)) { if ((portGeometry.x != 1 && portGeometry.x != 2) ||
throw RuntimeError("Port size is not 1 or 2 in either dimension. Port geometry:" + ToString(portGeometry)); (portGeometry.y != 1 && portGeometry.y != 2)) {
throw RuntimeError(
"Port size is not 1 or 2 in either dimension. Port geometry:" +
ToString(portGeometry));
} }
for (auto &it : res) { for (auto &it : res) {
it.x /= portGeometry.x; it.x /= portGeometry.x;

View File

@ -1783,9 +1783,10 @@ void DetectorImpl::convertGlobalRoiToPortLevel(
throw RuntimeError("Only up to 2 ports per module supported."); throw RuntimeError("Only up to 2 ports per module supported.");
} }
if (numPortsPerModule != (int)portRois.size()) { if (numPortsPerModule != (int)portRois.size()) {
throw RuntimeError("Number of port ROIs does not match number of ports in module. Expected: " + throw RuntimeError("Number of port ROIs does not match number of ports "
std::to_string(numPortsPerModule) + ", got: " + "in module. Expected: " +
std::to_string(portRois.size())); std::to_string(numPortsPerModule) +
", got: " + std::to_string(portRois.size()));
} }
for (int port = 0; port != numPortsPerModule; ++port) { for (int port = 0; port != numPortsPerModule; ++port) {
@ -1818,7 +1819,8 @@ void DetectorImpl::convertGlobalRoiToPortLevel(
std::min(userRoi.ymax, portRoi.ymax) - portRoi.ymin; std::min(userRoi.ymax, portRoi.ymax) - portRoi.ymin;
} }
// Check if port ROI already exists for this port (from another user roi) // Check if port ROI already exists for this port (from another user
// roi)
if (!portRois[port].completeRoi() && !portRois[port].noRoi()) { if (!portRois[port].completeRoi() && !portRois[port].noRoi()) {
throw RuntimeError( throw RuntimeError(
"Multiple ROIs specified for the same port " + "Multiple ROIs specified for the same port " +

View File

@ -414,7 +414,6 @@ void Implementation::ResetRois() {
setMultiROIMetadata(multiRoi); setMultiROIMetadata(multiRoi);
} }
void Implementation::setPortROIs(const std::vector<defs::ROI> &args) { void Implementation::setPortROIs(const std::vector<defs::ROI> &args) {
int nx = static_cast<int>(generalData->nPixelsX); int nx = static_cast<int>(generalData->nPixelsX);
int ny = static_cast<int>(generalData->nPixelsY); int ny = static_cast<int>(generalData->nPixelsY);
@ -996,12 +995,17 @@ void Implementation::StartMasterWriter() {
// create virtual and master file // create virtual and master file
if (fileFormatType == HDF5) { if (fileFormatType == HDF5) {
bool gotthard25um = ((generalData->detType == GOTTHARD || generalData->detType == GOTTHARD2) && (numPorts.x * numPorts.y) == 2); bool gotthard25um = ((generalData->detType == GOTTHARD ||
generalData->detType == GOTTHARD2) &&
(numPorts.x * numPorts.y) == 2);
// virtual hdf5 not allowed with roi for the following cases in hdf5 // virtual hdf5 not allowed with roi for the following cases in hdf5
if (multiRoiMetadata.size() > 1 || (!multiRoiMetadata[0].completeRoi())) { if (multiRoiMetadata.size() > 1 ||
(!multiRoiMetadata[0].completeRoi())) {
if (generalData->dynamicRange == 4) { if (generalData->dynamicRange == 4) {
throw std::runtime_error("Skipping virtual hdf5 file since rx_roi is enabled and it is in 4 bit mode."); throw std::runtime_error(
"Skipping virtual hdf5 file since rx_roi is enabled "
"and it is in 4 bit mode.");
} }
if (gotthard25um && (numPorts.x * numPorts.y) == 2) { if (gotthard25um && (numPorts.x * numPorts.y) == 2) {
throw std::runtime_error( throw std::runtime_error(
@ -1016,7 +1020,8 @@ void Implementation::StartMasterWriter() {
(numPorts.x * numPorts.y) > 1) { (numPorts.x * numPorts.y) > 1) {
virtualFileName = dataProcessor[0]->CreateVirtualFile( virtualFileName = dataProcessor[0]->CreateVirtualFile(
filePath, fileName, fileIndex, overwriteEnable, silentMode, filePath, fileName, fileIndex, overwriteEnable, silentMode,
modulePos, numPorts.x, numPorts.y, &hdf5LibMutex, gotthard25um); modulePos, numPorts.x, numPorts.y, &hdf5LibMutex,
gotthard25um);
} }
// link file in master // link file in master
if (masterFileWriteEnable) { if (masterFileWriteEnable) {

View File

@ -78,8 +78,7 @@ class MasterAttributes {
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
void GetFinalBinaryAttributes( void GetFinalBinaryAttributes(
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w); rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
void GetBinaryRois( void GetBinaryRois(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::Group *group); void WriteFinalHDF5Attributes(H5::Group *group);