DetectorSettings: Properly handle optional input
This commit is contained in:
@@ -163,8 +163,10 @@ std::optional<float> DetectorSettings::GetEigerThreshold_keV() const {
|
||||
}
|
||||
|
||||
DetectorSettings &DetectorSettings::EigerThreshold_keV(const std::optional<float> &input) {
|
||||
check_min("EIGER Threshold (keV)", input, 1.0);
|
||||
check_max("EIGER Threshold (keV)", input, 100.0);
|
||||
if (input.has_value()) {
|
||||
check_min("EIGER Threshold (keV)", input.value(), 1.0);
|
||||
check_max("EIGER Threshold (keV)", input.value(), 100.0);
|
||||
}
|
||||
eiger_threshold_keV = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user