v1.0.0-rc.31
This commit is contained in:
@@ -8,10 +8,9 @@
|
||||
#include "../compression/JFJochCompressor.h"
|
||||
|
||||
#include "HDF5DataFilePluginAzInt.h"
|
||||
#include "HDF5DataFilePluginBkg.h"
|
||||
#include "HDF5DataFilePluginMX.h"
|
||||
#include "HDF5DataFilePluginXFEL.h"
|
||||
#include "HDF5DataFilePluginJUNGFRAU.h"
|
||||
#include "HDF5DataFilePluginDetector.h"
|
||||
#include "HDF5DataFilePluginROI.h"
|
||||
#include "../include/spdlog/fmt/fmt.h"
|
||||
#include "HDF5NXmx.h"
|
||||
@@ -19,6 +18,9 @@
|
||||
HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) {
|
||||
file_number = in_file_number;
|
||||
|
||||
if (msg.overwrite.has_value())
|
||||
overwrite = msg.overwrite.value();
|
||||
|
||||
xpixel = 0;
|
||||
ypixel = 0;
|
||||
max_image_number = 0;
|
||||
@@ -27,9 +29,8 @@ HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) {
|
||||
image_low = file_number * msg.images_per_file;
|
||||
|
||||
tmp_filename = fmt::format("{}.{:x}.tmp", filename, std::chrono::system_clock::now().time_since_epoch().count());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginBkg>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginROI>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginJUNGFRAU>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginDetector>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginAzInt>(msg.az_int_bin_to_q));
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginXFEL>());
|
||||
plugins.emplace_back(std::make_unique<HDF5DataFilePluginMX>(msg.max_spot_count));
|
||||
@@ -57,7 +58,7 @@ std::optional<HDF5DataFileStatistics> HDF5DataFile::Close() {
|
||||
}
|
||||
data_file.reset();
|
||||
|
||||
if (!std::filesystem::exists(filename.c_str()))
|
||||
if (!std::filesystem::exists(filename.c_str()) || overwrite)
|
||||
std::rename(tmp_filename.c_str(), filename.c_str());
|
||||
|
||||
closed = true;
|
||||
|
||||
Reference in New Issue
Block a user