mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 01:02:42 +02:00
Change n_frames to size_t
This commit is contained in:
@@ -18,7 +18,7 @@ class H5WriteModule {
|
||||
protected:
|
||||
void write_thread(
|
||||
const std::string& output_file,
|
||||
const int n_frames,
|
||||
const size_t n_frames,
|
||||
const int user_id);
|
||||
|
||||
public:
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
void start_writing(
|
||||
const std::string& output_file,
|
||||
const int n_frames = 0,
|
||||
const size_t n_frames = 0,
|
||||
const int user_id = -1
|
||||
);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ H5WriteModule::H5WriteModule(
|
||||
|
||||
void H5WriteModule::start_writing(
|
||||
const string& output_file,
|
||||
const int n_frames,
|
||||
const size_t n_frames,
|
||||
const int user_id)
|
||||
{
|
||||
if (is_writing_ == true) {
|
||||
@@ -74,7 +74,7 @@ void H5WriteModule::stop_writing()
|
||||
|
||||
void H5WriteModule::write_thread(
|
||||
const std::string& output_file,
|
||||
const int n_frames,
|
||||
const size_t n_frames,
|
||||
const int user_id)
|
||||
{
|
||||
if (user_id != -1) {
|
||||
@@ -85,11 +85,10 @@ void H5WriteModule::write_thread(
|
||||
|
||||
MetadataBuffer metadata_buffer(n_frames, header_values_);
|
||||
BufferedWriter writer(output_file, n_frames, metadata_buffer);
|
||||
writer.create_file();
|
||||
|
||||
auto raw_frames_dataset_name = config::raw_image_dataset_name;
|
||||
|
||||
writer.create_file();
|
||||
uint64_t last_pulse_id = 0;
|
||||
size_t n_written_frames = 0;
|
||||
|
||||
while(is_writing_.load(memory_order_relaxed)) {
|
||||
|
||||
@@ -173,6 +172,21 @@ void H5WriteModule::write_thread(
|
||||
value.get());
|
||||
}
|
||||
|
||||
n_written_frames++;
|
||||
if (n_written_frames == n_frames) {
|
||||
is_writing_ = false;
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
|
||||
cout << "[" << system_clock::now() << "]";
|
||||
cout << "[H5WriteModule::write_thread]";
|
||||
cout << " Written all n_frames " << n_written_frames;
|
||||
cout << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PERF_OUTPUT
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
|
||||
Reference in New Issue
Block a user