mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-07-11 18:31:51 +02:00
formattin
This commit is contained in:
@ -208,8 +208,11 @@ defs::xy Detector::getPortPerModuleGeometry() const {
|
||||
Result<defs::xy> Detector::getPortSize(Positions pos) const {
|
||||
Result<defs::xy> 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;
|
||||
|
@ -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 " +
|
||||
|
@ -414,7 +414,6 @@ void Implementation::ResetRois() {
|
||||
setMultiROIMetadata(multiRoi);
|
||||
}
|
||||
|
||||
|
||||
void Implementation::setPortROIs(const std::vector<defs::ROI> &args) {
|
||||
int nx = static_cast<int>(generalData->nPixelsX);
|
||||
int ny = static_cast<int>(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(
|
||||
@ -1016,7 +1020,8 @@ void Implementation::StartMasterWriter() {
|
||||
(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) {
|
||||
|
@ -78,8 +78,7 @@ class MasterAttributes {
|
||||
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
|
||||
void GetFinalBinaryAttributes(
|
||||
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
|
||||
void GetBinaryRois(
|
||||
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
|
||||
void GetBinaryRois(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
|
||||
#ifdef HDF5C
|
||||
void WriteCommonHDF5Attributes(H5::H5File *fd, H5::Group *group);
|
||||
void WriteFinalHDF5Attributes(H5::Group *group);
|
||||
|
Reference in New Issue
Block a user