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

[jw5] unproblematic changes anticipated from FlatDetector refactoring ()

Merging branch 'jw5'  into 'r22'.

See merge request !1856
parents 68f2d09a 37e641aa
No related branches found
No related tags found
1 merge request!1856unproblematic changes anticipated from FlatDetector refactoring
Pipeline #108318 canceled
......@@ -13,12 +13,12 @@
// ************************************************************************************************
#include "Device/Beam/Beam.h"
#include <numbers>
using std::numbers::pi;
#include "Base/Spin/SpinMatrix.h"
#include "Base/Util/Assert.h"
#include "Base/Vector/GisasDirection.h"
#include "Device/Beam/IFootprint.h"
#include <numbers>
using std::numbers::pi;
//... Constructors, destructors:
......
......@@ -14,6 +14,7 @@
#include "GUI/Model/Detector/FlatDetectorItem.h"
#include "GUI/Model/Detector/ResolutionFunctionItems.h"
namespace {
namespace Tag {
......
......@@ -43,7 +43,6 @@
#include "Sim/Scan/AlphaScan.h"
#include "Sim/Simulation/includeSimulations.h"
#include <numbers>
using std::numbers::pi;
namespace {
......
......@@ -244,26 +244,16 @@ void setFlatDetector(FlatDetectorItem* detectorItem, const FlatDetector& detecto
{
// Axes
detectorItem->setXSize(detector.xSize());
detectorItem->setWidth(detector.width());
detectorItem->setYSize(detector.ySize());
detectorItem->setDistance(detector.getDistance());
detectorItem->setWidth(detector.width());
detectorItem->setHeight(detector.height());
detectorItem->setU0(detector.getU0());
detectorItem->setV0(detector.getV0());
detectorItem->setDetectorAlignment(detector.getDetectorArrangment());
if (detector.getDetectorArrangment() == FlatDetector::X) {
detectorItem->setDistance(detector.getDistance());
detectorItem->setU0(detector.getU0());
detectorItem->setV0(detector.getV0());
} else if (detector.getDetectorArrangment() == FlatDetector::T) {
detectorItem->setDistance(detector.getDistance());
detectorItem->setU0(detector.getU0());
detectorItem->setV0(detector.getV0());
} else if (detector.getDetectorArrangment() == FlatDetector::R) {
detectorItem->setDistance(detector.getDistance());
detectorItem->setU0(detector.getU0());
detectorItem->setV0(detector.getV0());
} else
ASSERT(false);
}
void setDetectorGeometry(GISASInstrumentItem* instrument_item, const IDetector& detector)
......
......@@ -11,24 +11,6 @@
#include "GUI/Support/Type/Unit.h"
#include "Tests/GTestWrapper/google_test.h"
TEST(TestDetectorItems, resolutionFunction)
{
InstrumentModel model;
auto* instrument = model.addInstrumentItem<GISASInstrumentItem>();
DetectorItem* detectorItem = instrument->detectorItem();
detectorItem->setResolutionFunctionType<ResolutionFunction2DGaussianItem>();
auto detector = detectorItem->createDetector();
const auto* convol =
dynamic_cast<const ConvolutionDetectorResolution*>(detector->detectorResolution());
const auto* gaussian =
dynamic_cast<const ResolutionFunction2DGaussian*>(convol->getResolutionFunction2D());
EXPECT_EQ(Units::rad2deg(gaussian->sigmaX()), 0.02);
}
TEST(TestDetectorItems, resolutionFunctionUnit)
{
const auto asString = [](const std::variant<QString, Unit>& unit) {
......
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