mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 22:07:12 +02: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:
@ -2,6 +2,8 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "BinaryDataFile.h"
|
||||
|
||||
namespace sls {
|
||||
|
||||
BinaryDataFile::BinaryDataFile(const int index) : File(BINARY), index_(index) {}
|
||||
|
||||
BinaryDataFile::~BinaryDataFile() { CloseFile(); }
|
||||
@ -47,12 +49,12 @@ void BinaryDataFile::CreateFile() {
|
||||
if (!overWriteEnable_) {
|
||||
if (nullptr == (fd_ = fopen((const char *)fileName_.c_str(), "wx"))) {
|
||||
fd_ = nullptr;
|
||||
throw sls::RuntimeError("Could not create/overwrite file " +
|
||||
throw RuntimeError("Could not create/overwrite file " +
|
||||
fileName_);
|
||||
}
|
||||
} else if (nullptr == (fd_ = fopen((const char *)fileName_.c_str(), "w"))) {
|
||||
fd_ = nullptr;
|
||||
throw sls::RuntimeError("Could not create file " + fileName_);
|
||||
throw RuntimeError("Could not create file " + fileName_);
|
||||
}
|
||||
// setting to no file buffering
|
||||
setvbuf(fd_, nullptr, _IONBF, 0);
|
||||
@ -103,8 +105,10 @@ void BinaryDataFile::WriteToFile(char *buffer, const int buffersize,
|
||||
|
||||
// if write error
|
||||
if (ret != buffersize) {
|
||||
throw sls::RuntimeError(std::to_string(index_) +
|
||||
throw RuntimeError(std::to_string(index_) +
|
||||
" : Write to file failed for image number " +
|
||||
std::to_string(currentFrameNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user