mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-04 06:28:41 +01:00
rxr sls namespace (#457)
* rxr src files and classes (detectordata, ZmqSocket) added to sls namespace * moving defines inside namespace * moving defines inside namespace, added helpdacs to namespace * added namespace to gui * gui also updated * removed unnecessary sls:: when already in sls namespace for slsDetectoSoftware, receverSoftware, slsDetectorGui and slsSupportlib
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
const std::string DataProcessor::typeName_ = "DataProcessor";
|
||||
|
||||
DataProcessor::DataProcessor(int index, detectorType detectorType, Fifo *fifo,
|
||||
@@ -65,7 +67,7 @@ void DataProcessor::ResetParametersforNewAcquisition() {
|
||||
currentFrameIndex_ = 0;
|
||||
firstStreamerFrame_ = true;
|
||||
streamCurrentFrame_ = false;
|
||||
completeImageToStreamBeforeCropping = sls::make_unique<char[]>(generalData_->imageSize);
|
||||
completeImageToStreamBeforeCropping = make_unique<char[]>(generalData_->imageSize);
|
||||
}
|
||||
|
||||
void DataProcessor::RecordFirstIndex(uint64_t fnum) {
|
||||
@@ -105,7 +107,7 @@ void DataProcessor::SetupFileWriter(const bool filewriteEnable,
|
||||
dataFile_ = new BinaryDataFile(index);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(
|
||||
throw RuntimeError(
|
||||
"Unknown file format (compile with hdf5 flags");
|
||||
}
|
||||
}
|
||||
@@ -119,7 +121,7 @@ void DataProcessor::CreateFirstFiles(
|
||||
const uint64_t numImages, const uint32_t dynamicRange,
|
||||
const bool detectorDataStream) {
|
||||
if (dataFile_ == nullptr) {
|
||||
throw sls::RuntimeError("file object not contstructed");
|
||||
throw RuntimeError("file object not contstructed");
|
||||
}
|
||||
CloseFiles();
|
||||
|
||||
@@ -154,14 +156,14 @@ void DataProcessor::CreateFirstFiles(
|
||||
modulePos, numUnitsPerReadout, udpPortNumber, maxFramesPerFile);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError("Unknown file format (compile with hdf5 flags");
|
||||
throw RuntimeError("Unknown file format (compile with hdf5 flags");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HDF5C
|
||||
uint32_t DataProcessor::GetFilesInAcquisition() const {
|
||||
if (dataFile_ == nullptr) {
|
||||
throw sls::RuntimeError("No data file object created to get number of "
|
||||
throw RuntimeError("No data file object created to get number of "
|
||||
"files in acquiistion");
|
||||
}
|
||||
return dataFile_->GetFilesInAcquisition();
|
||||
@@ -243,7 +245,7 @@ std::string DataProcessor::CreateMasterFile(
|
||||
filePath, fileNamePrefix, fileIndex, overWriteEnable, silentMode,
|
||||
attr);
|
||||
default:
|
||||
throw sls::RuntimeError("Unknown file format (compile with hdf5 flags");
|
||||
throw RuntimeError("Unknown file format (compile with hdf5 flags");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +375,7 @@ void DataProcessor::ProcessAnImage(char *buf) {
|
||||
(*((uint32_t *)buf)) = revsize;
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
throw sls::RuntimeError("Get Data Callback Error: " +
|
||||
throw RuntimeError("Get Data Callback Error: " +
|
||||
std::string(e.what()));
|
||||
}
|
||||
|
||||
@@ -386,7 +388,7 @@ void DataProcessor::ProcessAnImage(char *buf) {
|
||||
(uint32_t)(*((uint32_t *)buf)), //+ size of data (resizable
|
||||
// from previous call back
|
||||
fnum - firstIndex_, nump);
|
||||
} catch (const sls::RuntimeError &e) {
|
||||
} catch (const RuntimeError &e) {
|
||||
; // ignore write exception for now (TODO: send error message
|
||||
// via stopReceiver tcp)
|
||||
}
|
||||
@@ -559,7 +561,7 @@ void DataProcessor::RearrangeDbitData(char *buf) {
|
||||
}
|
||||
|
||||
void DataProcessor::CropImage(char *buf) {
|
||||
LOG(logDEBUG) << "Cropping Image to ROI " << sls::ToString(receiverRoi_);
|
||||
LOG(logDEBUG) << "Cropping Image to ROI " << ToString(receiverRoi_);
|
||||
int nPixelsX = generalData_->nPixelsX;
|
||||
int xmin = receiverRoi_.xmin;
|
||||
int xmax = receiverRoi_.xmax;
|
||||
@@ -598,3 +600,5 @@ void DataProcessor::CropImage(char *buf) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
||||
Reference in New Issue
Block a user