DetectorSettings: remove optional fields
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -92,7 +92,7 @@ message DatasetSettings {
|
||||
Compression compression = 11;
|
||||
|
||||
string sample_name = 12;
|
||||
optional UnitCell unit_cell = 13;
|
||||
UnitCell unit_cell = 13;
|
||||
int64 space_group_number = 14;
|
||||
|
||||
bool rad_int_solid_angle_corr = 18;
|
||||
@@ -104,17 +104,17 @@ message DatasetSettings {
|
||||
|
||||
message DetectorSettings {
|
||||
int64 frame_time_us = 1;
|
||||
optional int64 count_time_us = 2;
|
||||
int64 count_time_us = 2;
|
||||
|
||||
int64 storage_cell_count = 3;
|
||||
bool use_internal_packet_generator = 4;
|
||||
bool collect_raw_data = 5;
|
||||
|
||||
optional int64 pedestal_g0_frames = 6;
|
||||
optional int64 pedestal_g1_frames = 7;
|
||||
optional int64 pedestal_g2_frames = 8;
|
||||
int64 pedestal_g0_frames = 6;
|
||||
int64 pedestal_g1_frames = 7;
|
||||
int64 pedestal_g2_frames = 8;
|
||||
|
||||
optional int64 storage_cell_delay_ns = 10;
|
||||
int64 storage_cell_delay_ns = 10;
|
||||
}
|
||||
|
||||
message DetectorModuleGeometry {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -756,6 +756,7 @@ TEST_CASE("DiffractionExperiment_LoadDetectorSettings", "[DiffractionExperiment]
|
||||
settings.set_pedestal_g0_frames(5000);
|
||||
settings.set_pedestal_g1_frames(100);
|
||||
settings.set_pedestal_g2_frames(150);
|
||||
|
||||
REQUIRE_NOTHROW(x.LoadDetectorSettings(settings));
|
||||
|
||||
REQUIRE(x.GetFrameTime().count() == 600);
|
||||
@@ -823,9 +824,6 @@ TEST_CASE("DiffractionExperiment_LoadDetectorSettings_inferred", "[DiffractionEx
|
||||
REQUIRE(!x.IsUsingInternalPacketGen());
|
||||
REQUIRE(x.GetStorageCellNumber() == 1);
|
||||
REQUIRE(x.GetDetectorMode() == DetectorMode::Conversion);
|
||||
REQUIRE(x.GetPedestalG0Frames() == 456);
|
||||
REQUIRE(x.GetPedestalG1Frames() == 1234);
|
||||
REQUIRE(x.GetPedestalG2Frames() == 123);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_DefaultDataProcessingSettings","[DiffractionExperiment]") {
|
||||
|
||||
Reference in New Issue
Block a user