Skip to content
Snippets Groups Projects
Commit d1fe1c23 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm fct ICoordSystem::throwUnitsError

parent d432284e
No related branches found
No related tags found
1 merge request!1556cleanup CoordSyst classes
......@@ -31,22 +31,6 @@ std::vector<const IAxis*> ICoordSystem::convertedAxes(Coords units) const
return result;
}
void ICoordSystem::throwUnitsError(std::string method, std::vector<Coords> available) const
{
static const std::map<Coords, const char*> axisUnitLabel = {
{Coords::UNDEFINED, "undefined"}, {Coords::NBINS, "bin"}, {Coords::RADIANS, "rad"},
{Coords::DEGREES, "deg"}, {Coords::MM, "mm"}, {Coords::QSPACE, "1/nm"},
{Coords::RQ4, "nm^-4?"}};
std::stringstream ss;
ss << "Unit type error in " << method
<< ": unknown or unsupported unit type. Available units "
"are:\n";
for (auto unit : available)
ss << axisUnitLabel.at(unit) << "\n";
throw std::runtime_error(ss.str());
}
Coords ICoordSystem::substituteDefaultUnits(Coords units) const
{
return units == Coords::UNDEFINED ? defaultUnits() : units;
......
......@@ -56,7 +56,6 @@ public:
protected:
Coords substituteDefaultUnits(Coords units) const;
[[noreturn]] void throwUnitsError(std::string method, std::vector<Coords> available) const;
};
#endif // BORNAGAIN_DEVICE_COORD_ICOORDSYSTEM_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment