From c6fcfab643c1929205322117853ee653d57e8dbc Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 27 Jul 2021 14:40:02 +0200 Subject: [PATCH] throw -> ASSERT --- Device/Coord/CoordSystem1D.cpp | 5 +++-- Device/Instrument/CoordSystem2D.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Device/Coord/CoordSystem1D.cpp b/Device/Coord/CoordSystem1D.cpp index a24f1de6a47..9b132a32e92 100644 --- a/Device/Coord/CoordSystem1D.cpp +++ b/Device/Coord/CoordSystem1D.cpp @@ -16,6 +16,7 @@ #include "Base/Axis/PointwiseAxis.h" #include "Base/Const/Units.h" #include "Base/Math/Constants.h" +#include "Base/Utils/Assert.h" #include "Device/Coord/AxisNames.h" #include "Device/Data/OutputData.h" @@ -194,7 +195,7 @@ AngularReflectometryCoordinates::getTraslatorTo(Axes::Coords units) const case Axes::Coords::RQ4: return [wl = m_wavelength](double value) { return getQ(wl, value); }; default: - throwUnitsError("AngularReflectometryCoordinates::getTraslatorTo", availableUnits()); + ASSERT(0); } } @@ -244,6 +245,6 @@ WavenumberReflectometryCoordinates::getTraslatorTo(Axes::Coords units) const case Axes::Coords::RQ4: return [](double value) { return value; }; default: - throwUnitsError("WavenumberReflectometryCoordinates::getTraslatorTo", availableUnits()); + ASSERT(0); } } diff --git a/Device/Instrument/CoordSystem2D.cpp b/Device/Instrument/CoordSystem2D.cpp index 0ea1468379e..032be4ac44b 100644 --- a/Device/Instrument/CoordSystem2D.cpp +++ b/Device/Instrument/CoordSystem2D.cpp @@ -152,23 +152,23 @@ double SphericalCoords::calculateValue(size_t i_axis, Axes::Coords units, double case Axes::Coords::DEGREES: return Units::rad2deg(value); case Axes::Coords::QSPACE: { - const auto k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i); + const kvector_t k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i); if (i_axis == 0) { - const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value); + const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value); return (k_i - k_f).y(); } else if (i_axis == 1) { - const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); + const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); return (k_f - k_i).z(); } ASSERT(0); } case Axes::Coords::QXQY: { - const auto k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i); + const kvector_t k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i); if (i_axis == 0) { - const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value); + const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value); return (k_i - k_f).y(); } else if (i_axis == 1) { - const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); + const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); return (k_f - k_i).x(); } ASSERT(0); -- GitLab