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:
Dhanya Thattil
2022-05-18 11:48:38 +02:00
committed by GitHub
parent fcc7f7aef8
commit 4259363169
88 changed files with 1200 additions and 923 deletions

View File

@ -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