DetectorSettings: remove optional fields

This commit is contained in:
2023-11-09 20:51:37 +01:00
parent 4bc61de084
commit 7993efb047
4 changed files with 108 additions and 113 deletions

View File

@@ -866,7 +866,7 @@ void DiffractionExperiment::LoadDatasetSettings(const JFJochProtoBuf::DatasetSet
void DiffractionExperiment::LoadDetectorSettings(const JFJochProtoBuf::DetectorSettings &settings) {
auto tmp = internal;
try {
if (settings.has_count_time_us())
if (settings.count_time_us() > 0)
FrameTime(std::chrono::microseconds(settings.frame_time_us()),
std::chrono::microseconds(settings.count_time_us()));
else
@@ -880,15 +880,12 @@ void DiffractionExperiment::LoadDetectorSettings(const JFJochProtoBuf::DetectorS
else
Mode(DetectorMode::Conversion);
if (settings.has_pedestal_g0_frames())
PedestalG0Frames(settings.pedestal_g0_frames());
PedestalG0Frames(settings.pedestal_g0_frames());
if (settings.has_pedestal_g1_frames())
PedestalG1Frames(settings.pedestal_g1_frames());
PedestalG1Frames(settings.pedestal_g1_frames());
if (settings.has_pedestal_g2_frames())
PedestalG2Frames(settings.pedestal_g2_frames());
if (settings.has_storage_cell_delay_ns())
PedestalG2Frames(settings.pedestal_g2_frames());
if (settings.storage_cell_delay_ns() > 0)
StorageCellDelay(std::chrono::nanoseconds(settings.storage_cell_delay_ns()));
} catch (...) {
internal = tmp;