Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled the warning messages about too many digits for TR numbers #84

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions include/hdf5libs/HDF5FileLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,31 +206,6 @@ class HDF5FileLayout
*/
std::map<std::string, daqdataformats::SourceID::Subsystem> m_detector_group_name_to_type_map;

// quick powers of ten lookup
constexpr static uint64_t m_powers_ten[] // NOLINT(build/unsigned)
= {
1, // 1e0
10, // 1e1
100, // 1e2
1000, // 1e3
10000, // 1e4
100000, // 1e5
1000000, // 1e6
10000000, // 1e7
100000000, // 1e8
1000000000, // 1e9
10000000000, // 1e10
100000000000, // 1e11
1000000000000, // 1e12
10000000000000, // 1e13
100000000000000, // 1e14
1000000000000000, // 1e15
10000000000000000, // 1e16
100000000000000000, // 1e17
1000000000000000000, // 1e18
10000000000000000000u // 1e19
};

/**
* @brief Fill path parameters maps from FileLayoutParams
*/
Expand Down
4 changes: 2 additions & 2 deletions schema/hdf5libs/hdf5filelayout.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ local types = {
s.field("record_name_prefix", self.hdf_string, "TriggerRecord",
doc="Prefix for the record name"),
s.field("digits_for_record_number", self.count, 6,
doc="Number of digits to use for the record number in the record name inside the HDF5 file"),
doc="Minimum number of digits to use for the record number in the record name inside the HDF5 file"),
s.field("digits_for_sequence_number", self.count, 4,
doc="Number of digits to use for the sequence number in the TriggerRecord name inside the HDF5 file"),
doc="Minimum number of digits to use for the sequence number in the TriggerRecord name inside the HDF5 file"),
s.field("record_header_dataset_name", self.hdf_string, "TriggerRecordHeader",
doc="Dataset name for the record header"),
s.field("raw_data_group_name", self.hdf_string, "RawData",
Expand Down
11 changes: 0 additions & 11 deletions src/HDF5FileLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,10 @@ HDF5FileLayout::get_record_number_string(uint64_t record_number, // NOLINT(build
std::ostringstream record_number_string;

int width = m_conf_params.digits_for_record_number;

if (record_number >= m_powers_ten[m_conf_params.digits_for_record_number]) {
ers::warning(FileLayoutNotEnoughDigitsForPath(ERS_HERE, record_number, m_conf_params.digits_for_record_number));
width = 0; // tells it to revert to normal width
}

record_number_string << m_conf_params.record_name_prefix << std::setw(width) << std::setfill('0') << record_number;

if (m_conf_params.digits_for_sequence_number > 0) {

width = m_conf_params.digits_for_sequence_number;
if (seq_num >= m_powers_ten[m_conf_params.digits_for_sequence_number]) {
ers::warning(FileLayoutNotEnoughDigitsForPath(ERS_HERE, seq_num, m_conf_params.digits_for_sequence_number));
width = 0; // tells it to revert to normal width
}
record_number_string << "." << std::setw(width) << std::setfill('0') << seq_num;
}

Expand Down