Use constexpr based definitions instead of macros
This commit is contained in:
@@ -47,7 +47,7 @@ DetectorSetup::DetectorSetup(std::shared_ptr<DetectorGeometry> in_geometry,
|
||||
detector_type(in_detector_type),
|
||||
read_out_time(0),
|
||||
min_frame_time(std::chrono::milliseconds(1)),
|
||||
min_count_time(std::chrono::microseconds(MIN_COUNT_TIME_IN_US)) {
|
||||
min_count_time(std::chrono::duration_cast<std::chrono::microseconds>(MIN_COUNT_TIME)) {
|
||||
|
||||
if (description.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
@@ -279,11 +279,11 @@ std::chrono::nanoseconds DetectorSetup::GetReadOutTime() const {
|
||||
std::chrono::microseconds DetectorSetup::GetMinFrameTime() const {
|
||||
switch (GetDetectorType()) {
|
||||
case DetectorType::EIGER:
|
||||
return std::chrono::microseconds(MIN_FRAME_TIME_EIGER_IN_US);
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(MIN_FRAME_TIME_EIGER);
|
||||
case DetectorType::JUNGFRAU:
|
||||
if (GetUDPInterfaceCount() == 1)
|
||||
return std::chrono::microseconds(MIN_FRAME_TIME_JUNGFRAU_HALF_SPEED_IN_US);
|
||||
return std::chrono::microseconds(MIN_FRAME_TIME_JUNGFRAU_FULL_SPEED_IN_US);
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(MIN_FRAME_TIME_JUNGFRAU_HALF_SPEED);
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(MIN_FRAME_TIME_JUNGFRAU_FULL_SPEED);
|
||||
case DetectorType::DECTRIS:
|
||||
return min_frame_time;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user