diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 9d5a5f0a0..8c95fbf63 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -208,8 +208,11 @@ defs::xy Detector::getPortPerModuleGeometry() const { Result Detector::getPortSize(Positions pos) const { Result res = pimpl->Parallel(&Module::getNumberOfChannels, pos); defs::xy portGeometry = getPortPerModuleGeometry(); - if ((portGeometry.x != 1 && portGeometry.x != 2) || (portGeometry.y != 1 && portGeometry.y != 2)) { - throw RuntimeError("Port size is not 1 or 2 in either dimension. Port geometry:" + ToString(portGeometry)); + if ((portGeometry.x != 1 && portGeometry.x != 2) || + (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) { it.x /= portGeometry.x; diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 99dd3e5ce..d51c3d802 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1783,9 +1783,10 @@ void DetectorImpl::convertGlobalRoiToPortLevel( throw RuntimeError("Only up to 2 ports per module supported."); } if (numPortsPerModule != (int)portRois.size()) { - throw RuntimeError("Number of port ROIs does not match number of ports in module. Expected: " + - std::to_string(numPortsPerModule) + ", got: " + - std::to_string(portRois.size())); + throw RuntimeError("Number of port ROIs does not match number of ports " + "in module. Expected: " + + std::to_string(numPortsPerModule) + + ", got: " + std::to_string(portRois.size())); } for (int port = 0; port != numPortsPerModule; ++port) { @@ -1818,7 +1819,8 @@ void DetectorImpl::convertGlobalRoiToPortLevel( 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()) { throw RuntimeError( "Multiple ROIs specified for the same port " + diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 7947e509e..7c033f498 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -414,7 +414,6 @@ void Implementation::ResetRois() { setMultiROIMetadata(multiRoi); } - void Implementation::setPortROIs(const std::vector &args) { int nx = static_cast(generalData->nPixelsX); int ny = static_cast(generalData->nPixelsY); @@ -996,12 +995,17 @@ void Implementation::StartMasterWriter() { // create virtual and master file 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 - if (multiRoiMetadata.size() > 1 || (!multiRoiMetadata[0].completeRoi())) { + if (multiRoiMetadata.size() > 1 || + (!multiRoiMetadata[0].completeRoi())) { 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) { throw std::runtime_error( @@ -1009,14 +1013,15 @@ void Implementation::StartMasterWriter() { "enabled and there are 2 Gotthard 25um modules."); } } - + std::string virtualFileName; // create virtual hdf5 file (if multiple files) if (dataProcessor[0]->GetFilesInAcquisition() > 1 || (numPorts.x * numPorts.y) > 1) { virtualFileName = dataProcessor[0]->CreateVirtualFile( filePath, fileName, fileIndex, overwriteEnable, silentMode, - modulePos, numPorts.x, numPorts.y, &hdf5LibMutex, gotthard25um); + modulePos, numPorts.x, numPorts.y, &hdf5LibMutex, + gotthard25um); } // link file in master if (masterFileWriteEnable) { diff --git a/slsReceiverSoftware/src/MasterAttributes.cpp b/slsReceiverSoftware/src/MasterAttributes.cpp index e6ecd12e4..211b6f439 100644 --- a/slsReceiverSoftware/src/MasterAttributes.cpp +++ b/slsReceiverSoftware/src/MasterAttributes.cpp @@ -155,7 +155,7 @@ void MasterAttributes::GetFinalBinaryAttributes( } void MasterAttributes::GetBinaryRois( - rapidjson::PrettyWriter *w) { + rapidjson::PrettyWriter *w) { w->Key("Receiver Rois"); w->StartArray(); for (const slsDetectorDefs::ROI &roi : rois) { diff --git a/slsReceiverSoftware/src/MasterAttributes.h b/slsReceiverSoftware/src/MasterAttributes.h index 3d07b45a2..f195ee70a 100644 --- a/slsReceiverSoftware/src/MasterAttributes.h +++ b/slsReceiverSoftware/src/MasterAttributes.h @@ -78,8 +78,7 @@ class MasterAttributes { rapidjson::PrettyWriter *w); void GetFinalBinaryAttributes( rapidjson::PrettyWriter *w); - void GetBinaryRois( - rapidjson::PrettyWriter *w); + void GetBinaryRois(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteCommonHDF5Attributes(H5::H5File *fd, H5::Group *group); void WriteFinalHDF5Attributes(H5::Group *group);