mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-07 17:42:03 +02:00
Pass file properties to writing thread
This commit is contained in:
@@ -16,7 +16,10 @@ class H5WriteModule {
|
||||
std::thread writing_thread_;
|
||||
|
||||
protected:
|
||||
void write_thread();
|
||||
void write_thread(
|
||||
const std::string& output_file,
|
||||
const int n_frames,
|
||||
const int user_id);
|
||||
|
||||
public:
|
||||
H5WriteModule(
|
||||
@@ -24,7 +27,11 @@ public:
|
||||
const header_map& header_values,
|
||||
const H5Format& format);
|
||||
|
||||
void start_writing();
|
||||
void start_writing(
|
||||
const std::string& output_file,
|
||||
const int n_frames = 0,
|
||||
const int user_id = -1
|
||||
);
|
||||
void stop_writing();
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,10 @@ H5WriteModule::H5WriteModule(
|
||||
{
|
||||
}
|
||||
|
||||
void H5WriteModule::start_writing()
|
||||
void H5WriteModule::start_writing(
|
||||
const string& output_file,
|
||||
const int n_frames,
|
||||
const int user_id)
|
||||
{
|
||||
if (is_writing_ == true) {
|
||||
stringstream err_msg;
|
||||
@@ -33,11 +36,20 @@ void H5WriteModule::start_writing()
|
||||
using namespace chrono;
|
||||
cout << "[" << system_clock::now() << "]";
|
||||
cout << "[H5WriteModule::start_writing]";
|
||||
cout << " Start writing." << endl;
|
||||
cout << " Start writing with parameters:" << endl;
|
||||
cout << "\toutput_file: " << output_file;
|
||||
cout << "\tn_frames: " << n_frames;
|
||||
cout << "\tuser_id: " << user_id;
|
||||
cout << endl;
|
||||
#endif
|
||||
|
||||
is_writing_ = true;
|
||||
writing_thread_ = thread(&H5WriteModule::write_thread, this);
|
||||
|
||||
writing_thread_ = thread(
|
||||
&H5WriteModule::write_thread, this,
|
||||
output_file,
|
||||
n_frames,
|
||||
user_id);
|
||||
}
|
||||
|
||||
void H5WriteModule::stop_writing()
|
||||
|
||||
Reference in New Issue
Block a user