From 589ca3d4852c58d852d12ba57bee85e9718dc113 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 1 Nov 2025 10:24:43 +0100 Subject: [PATCH] jfjoch_writer: suffix is based on UTC start time in ms and consistent for all files belonging to one dataset --- writer/HDF5DataFile.cpp | 3 ++- writer/HDF5NXmx.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/writer/HDF5DataFile.cpp b/writer/HDF5DataFile.cpp index c38a54a0..8f0be2d7 100644 --- a/writer/HDF5DataFile.cpp +++ b/writer/HDF5DataFile.cpp @@ -16,6 +16,7 @@ #include "HDF5NXmx.h" #include "HDF5DataFilePluginImageStats.h" #include "HDF5DataFilePluginReflection.h" +#include "../common/time_utc.h" HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) { file_number = in_file_number; @@ -30,7 +31,7 @@ HDF5DataFile::HDF5DataFile(const StartMessage &msg, uint64_t in_file_number) { filename = HDF5Metadata::DataFileName(msg, 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()); + tmp_filename = fmt::format("{}.{:08x}.tmp", filename, parse_UTC_to_ms(msg.arm_date)); plugins.emplace_back(std::make_unique()); plugins.emplace_back(std::make_unique()); plugins.emplace_back(std::make_unique(msg)); diff --git a/writer/HDF5NXmx.cpp b/writer/HDF5NXmx.cpp index 4f726a76..f4281216 100644 --- a/writer/HDF5NXmx.cpp +++ b/writer/HDF5NXmx.cpp @@ -15,7 +15,7 @@ NXmx::NXmx(const StartMessage &start) : start_message(start), filename(start.file_prefix + "_master.h5") { - tmp_filename = fmt::format("{}.{:x}.tmp", filename, std::chrono::system_clock::now().time_since_epoch().count()); + tmp_filename = fmt::format("{}.{:08x}.tmp", filename, parse_UTC_to_ms(start.arm_date)); if (start.overwrite.has_value()) overwrite = start.overwrite.value();