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

use new c'tor in Py export

parent 567169f7
No related branches found
No related tags found
1 merge request!1859FlatDetector: long c'tor instead of setter fcts
......@@ -148,26 +148,12 @@ std::string defineDetector(const IDetector& detector)
result << ")\n";
} else if (const auto* const det = dynamic_cast<const FlatDetector*>(&detector)) {
result << "\n";
result << indent() << "detector = ba.FlatDetector(" << det->xSize() << ", "
<< Py::Fmt::printDouble(det->width()) << ", " << det->ySize() << ", "
<< Py::Fmt::printDouble(det->height()) << ")\n";
if (det->getDetectorArrangment() == FlatDetector::X) {
result << indent() << "detector.setPerpendicularToSampleX("
<< Py::Fmt::printDouble(det->getDistance()) << ", "
<< Py::Fmt::printDouble(det->getU0()) << ", "
<< Py::Fmt::printDouble(det->getV0()) << ")\n";
} else if (det->getDetectorArrangment() == FlatDetector::T) {
result << indent() << "detector.setPerpendicularToDirectBeam("
<< Py::Fmt::printDouble(det->getDistance()) << ", "
<< Py::Fmt::printDouble(det->getU0()) << ", "
<< Py::Fmt::printDouble(det->getV0()) << ")\n";
} else if (det->getDetectorArrangment() == FlatDetector::R) {
result << indent() << "detector.setPerpendicularToReflectedBeam("
<< Py::Fmt::printDouble(det->getDistance()) << ", "
<< Py::Fmt::printDouble(det->getU0()) << ", "
<< Py::Fmt::printDouble(det->getV0()) << ")\n";
} else
ASSERT_NEVER; // unknown alignment
result << indent() << "detector = ba.FlatDetector(" << det->xSize() << ", " << det->ySize()
<< ", " << Py::Fmt::printDouble(det->width()) << ", "
<< Py::Fmt::printDouble(det->height()) << ", beam, ba.FlatDetector."
<< det->normalName() << ", " << Py::Fmt::printDouble(det->getDistance()) << ", " << 0
<< ", " << 0 << ", " << 0 << ", " << det->getU0() - det->width() / 2 << ", "
<< det->getV0() - det->height() / 2 << ")\n";
} else
ASSERT_NEVER; // unknown detector
if (detector.hasExplicitRegionOfInterest()) {
......
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