diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index 2d1cd73be44b59f4300caa5b05af06438dc73066..14a398c9d170c34e4aea85e37a06f925fc256c1c 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -13,38 +13,31 @@ // ************************************************************************************************ #include "GUI/Model/Detector/DetectorItem.h" -#include "Device/Detector/IDetector.h" +#include "Base/Const/Units.h" +#include "Device/Detector/Detector2D.h" #include "Device/Mask/IShape2D.h" #include "Device/Resolution/ResolutionFunction2DGaussian.h" #include "GUI/Model/Detector/ResolutionFunctionItems.h" +using Units::deg; + namespace { namespace Tag { -const QString Alignment("Alignment"); -const QString DirectionVector("DirectionVector"); -const QString Distance("Distance"); const QString ExpandResolutionFuncGroupbox("ExpandResolutionFuncGroupbox"); -const QString Height("Height"); -const QString NormalVector("NormalVector"); +const QString PhiMin("PhiMin"); +const QString PhiMax("PhiMax"); +const QString AlphaMin("AlphaMin"); +const QString AlphaMax("AlphaMax"); +const QString nPhi("nPhi"); +const QString nAlpha("nAlpha"); const QString ResolutionFunction("ResolutionFunction"); -const QString Width("Width"); -const QString XSize("XSize"); -const QString YSize("YSize"); -const QString u0("u0"); -const QString v0("v0"); } // namespace Tag -const double default_detector_width = 20.0; -const double default_detector_height = 20.0; -const double default_detector_distance = 1000.0; - -//! Holds the alignments as expected on the UI (map is sorted by keys) -const QMap<FlatDetector::NominalNormal, QString> alignment_names_map = { - {FlatDetector::X, "Perpendicular to sample x-axis"}, - {FlatDetector::T, "Perpendicular to direct beam"}, - {FlatDetector::R, "Perpendicular to reflected beam"}}; +const int default_n = 100; +const double default_phi_minmax = 2 * deg; +const double default_alpha_max = 3 * deg; } // namespace @@ -52,40 +45,20 @@ DetectorItem::DetectorItem() { m_resolutionFunction.init("Resolution function", "Detector resolution function"); - m_xSize = 100; - m_ySize = 100; - m_width.init("Width (mm)", "Width of the detector", default_detector_width, 3, - RealLimits::positive(), "width"); - m_height.init("Height (mm)", "Height of the detector", default_detector_height, 3, - RealLimits::positive(), "height"); - - m_normalVector.init( - "Normal vector", - "Normal of the detector plane with length equal to the sample detector distance", - "normalVector"); - m_normalVector.setX(default_detector_distance); - m_directionVector.init("GisasDirection vector", - "Detector axis direction vector w.r.t. the sample coordinate system", - "directionVector"); - m_directionVector.setY(-1.0); - - m_u0.init("u0 (mm)", "", default_detector_width / 2., 3, RealLimits::limitless(), "u0"); - m_v0.init("v0 (mm)", "", 0.0, 3, RealLimits::limitless(), "v0"); - m_distance.init("Distance (mm)", "Distance from the sample origin to the detector plane", - default_detector_distance, "distance"); - - m_detectorAlignment = ComboProperty::fromList(alignment_names_map.values(), - alignment_names_map.value(FlatDetector::T)); - - updateTooltips(); + m_n_phi = default_n; + m_n_alpha = default_n; + + m_phi_min.init("phiMin (rad)", "phi_min", -default_phi_minmax, "phiMin"); + m_phi_max.init("phiMax (rad)", "phi_max", +default_phi_minmax, "phiMax"); + m_alpha_min.init("alphaMin (rad)", "alpha_min", 0, "alphaMin"); + m_alpha_max.init("alphaMax (rad)", "alpha_max", default_alpha_max, "alphaMax"); } DetectorItem::~DetectorItem() = default; -std::unique_ptr<IDetector> DetectorItem::createDetector(const Beam& beam) const +std::unique_ptr<IDetector> DetectorItem::createDetector() const { - auto* det = new FlatDetector(xSize(), ySize(), width(), height(), beam, detectorAlignment(), - m_distance, m_u0 - width() / 2, m_v0 - height() / 2, 0, 0, 0); + auto* det = new Detector2D(m_n_phi, m_phi_min, m_phi_max, m_n_alpha, m_alpha_min, m_alpha_max); addMasksToCore(det); @@ -149,54 +122,26 @@ void DetectorItem::writeTo(QXmlStreamWriter* w) const XML::writeAttribute(w, XML::Attrib::value, expandResolutionFunc); w->writeEndElement(); - // x size - w->writeStartElement(Tag::XSize); - XML::writeAttribute(w, XML::Attrib::value, m_xSize); - w->writeEndElement(); - - // y size - w->writeStartElement(Tag::YSize); - XML::writeAttribute(w, XML::Attrib::value, m_ySize); - w->writeEndElement(); - - // width - w->writeStartElement(Tag::Width); - m_width.writeTo(w); - w->writeEndElement(); - - // height - w->writeStartElement(Tag::Height); - m_height.writeTo(w); + // phi axis + w->writeStartElement(Tag::nPhi); + XML::writeAttribute(w, XML::Attrib::value, m_n_phi); w->writeEndElement(); - - // alignment - w->writeStartElement(Tag::Alignment); - m_detectorAlignment.writeTo(w); + w->writeStartElement(Tag::PhiMin); + m_phi_min.writeTo(w); w->writeEndElement(); - - // normal vector - w->writeStartElement(Tag::NormalVector); - m_normalVector.writeTo(w); + w->writeStartElement(Tag::PhiMax); + m_phi_max.writeTo(w); w->writeEndElement(); - // direction vector - w->writeStartElement(Tag::DirectionVector); - m_directionVector.writeTo(w); + // alpha axis + w->writeStartElement(Tag::nAlpha); + XML::writeAttribute(w, XML::Attrib::value, m_n_alpha); w->writeEndElement(); - - // u0 - w->writeStartElement(Tag::u0); - m_u0.writeTo(w); + w->writeStartElement(Tag::AlphaMin); + m_alpha_min.writeTo(w); w->writeEndElement(); - - // v0 - w->writeStartElement(Tag::v0); - m_v0.writeTo(w); - w->writeEndElement(); - - // distance - w->writeStartElement(Tag::Distance); - m_distance.writeTo(w); + w->writeStartElement(Tag::AlphaMax); + m_alpha_max.writeTo(w); w->writeEndElement(); } @@ -219,92 +164,34 @@ void DetectorItem::readFrom(QXmlStreamReader* r) XML::gotoEndElementOfTag(r, tag); // x size - } else if (tag == Tag::XSize) { - XML::readAttribute(r, XML::Attrib::value, &m_xSize); - XML::gotoEndElementOfTag(r, tag); - - // y size - } else if (tag == Tag::YSize) { - XML::readAttribute(r, XML::Attrib::value, &m_ySize); - XML::gotoEndElementOfTag(r, tag); - // width - } else if (tag == Tag::Width) { - m_width.readFrom(r); + // phi axis + } else if (tag == Tag::nPhi) { + XML::readAttribute(r, XML::Attrib::value, &m_n_phi); XML::gotoEndElementOfTag(r, tag); - // height - } else if (tag == Tag::Height) { - m_height.readFrom(r); + } else if (tag == Tag::PhiMin) { + m_phi_min.readFrom(r); XML::gotoEndElementOfTag(r, tag); - // alignment - } else if (tag == Tag::Alignment) { - m_detectorAlignment.readFrom(r); + } else if (tag == Tag::PhiMax) { + m_phi_max.readFrom(r); XML::gotoEndElementOfTag(r, tag); - // normal vector - } else if (tag == Tag::NormalVector) { - m_normalVector.readFrom(r); + // alpha axis + } else if (tag == Tag::nAlpha) { + XML::readAttribute(r, XML::Attrib::value, &m_n_alpha); XML::gotoEndElementOfTag(r, tag); - // direction vector - } else if (tag == Tag::DirectionVector) { - m_directionVector.readFrom(r); + } else if (tag == Tag::AlphaMin) { + m_alpha_min.readFrom(r); XML::gotoEndElementOfTag(r, tag); - // u0 - } else if (tag == Tag::u0) { - m_u0.readFrom(r); - XML::gotoEndElementOfTag(r, tag); - - // v0 - } else if (tag == Tag::v0) { - m_v0.readFrom(r); - XML::gotoEndElementOfTag(r, tag); - - // distance - } else if (tag == Tag::Distance) { - m_distance.readFrom(r); + } else if (tag == Tag::AlphaMax) { + m_alpha_max.readFrom(r); XML::gotoEndElementOfTag(r, tag); } else r->skipCurrentElement(); } } - -void DetectorItem::setDetectorAlignment(const QString& alignment) -{ - ASSERT(alignment_names_map.values().contains(alignment)); - setDetectorAlignment(alignment_names_map.key(alignment)); -} - -void DetectorItem::setDetectorAlignment(FlatDetector::NominalNormal alignment) -{ - m_detectorAlignment.setCurrentValue(alignment_names_map.value(alignment)); - updateTooltips(); -} - -FlatDetector::NominalNormal DetectorItem::detectorAlignment() const -{ - ASSERT(alignment_names_map.values().contains(m_detectorAlignment.currentValue())); - return alignment_names_map.key(m_detectorAlignment.currentValue()); -} - -void DetectorItem::updateTooltips() -{ - switch (detectorAlignment()) { - case FlatDetector::X: - m_u0.setTooltip("u-coordinate of point where sample x-axis crosses the detector"); - m_v0.setTooltip("v-coordinate of point where sample x-axis crosses the detector"); - break; - case FlatDetector::R: - m_u0.setTooltip("u-coordinate of point where reflected beam hits the detector"); - m_v0.setTooltip("v-coordinate of point where reflected beam hits the detector"); - break; - case FlatDetector::T: - m_u0.setTooltip("u-coordinate of point where direct beam hits the detector"); - m_v0.setTooltip("v-coordinate of point where direct beam hits the detector"); - break; - } -} diff --git a/GUI/Model/Detector/DetectorItem.h b/GUI/Model/Detector/DetectorItem.h index 8342453e7a85bcd9dce17ffdaaf200ee19f2cdf2..10a7214b5e07ebb206c2b4abc7c4b6ad1211008c 100644 --- a/GUI/Model/Detector/DetectorItem.h +++ b/GUI/Model/Detector/DetectorItem.h @@ -16,11 +16,9 @@ #define BORNAGAIN_GUI_MODEL_DETECTOR_DETECTORITEM_H #include "Device/Detector/FlatDetector.h" -#include "GUI/Model/Descriptor/SelectionProperty.h" -#include "GUI/Model/Descriptor/VectorProperty.h" +#include "GUI/Model/Descriptor/DoubleProperty.h" #include "GUI/Model/Detector/ResolutionFunctionItemCatalog.h" #include "GUI/Model/Mask/MaskItems.h" -#include "GUI/Support/Data/ComboProperty.h" class Beam; class IDetector; @@ -33,7 +31,7 @@ public: DetectorItem(); ~DetectorItem(); - std::unique_ptr<IDetector> createDetector(const Beam& beam) const; + std::unique_ptr<IDetector> createDetector() const; void importMasks(const MaskContainerItem* maskContainer); MaskContainerItem& maskItems(); @@ -49,44 +47,23 @@ public: void writeTo(QXmlStreamWriter* w) const; void readFrom(QXmlStreamReader* r); - int xSize() const { return m_xSize; } - void setXSize(size_t nx) { m_xSize = static_cast<int>(nx); } + int nPhi() const { return m_n_phi; } + void setNPhi(size_t n) { m_n_phi = static_cast<int>(n); } - int ySize() const { return m_ySize; } - void setYSize(size_t ny) { m_ySize = static_cast<int>(ny); } + int nAlpha() const { return m_n_alpha; } + void setNAlpha(size_t n) { m_n_alpha = static_cast<int>(n); } - DoubleProperty& width() { return m_width; } - const DoubleProperty& width() const { return m_width; } - void setWidth(double v) { m_width.setValue(v); } + DoubleProperty& phiMin() { return m_phi_min; } + const DoubleProperty& phiMin() const { return m_phi_min; } - DoubleProperty& height() { return m_height; } - const DoubleProperty& height() const { return m_height; } - void setHeight(double v) { m_height.setValue(v); } + DoubleProperty& phiMax() { return m_phi_max; } + const DoubleProperty& phiMax() const { return m_phi_max; } - const ComboProperty& detectorAlignmentCombo() const { return m_detectorAlignment; } - FlatDetector::NominalNormal detectorAlignment() const; - void setDetectorAlignment(const QString& alignment); - void setDetectorAlignment(FlatDetector::NominalNormal alignment); + DoubleProperty& alphaMin() { return m_alpha_min; } + const DoubleProperty& alphaMin() const { return m_alpha_min; } - VectorProperty& normalVector() { return m_normalVector; } - const VectorProperty& normalVector() const { return m_normalVector; } - void setNormalVector(const R3& v) { m_normalVector.setR3(v); } - - VectorProperty& directionVector() { return m_directionVector; } - const VectorProperty& directionVector() const { return m_directionVector; } - void setDirectionVector(const R3& v) { m_directionVector.setR3(v); } - - DoubleProperty& u0() { return m_u0; } - const DoubleProperty& u0() const { return m_u0; } - void setU0(double v) { m_u0.setValue(v); } - - DoubleProperty& v0() { return m_v0; } - const DoubleProperty& v0() const { return m_v0; } - void setV0(double v) { m_v0.setValue(v); } - - DoubleProperty& distance() { return m_distance; } - const DoubleProperty& distance() const { return m_distance; } - void setDistance(double v) { m_distance.setValue(v); } + DoubleProperty& alphaMax() { return m_alpha_max; } + const DoubleProperty& alphaMax() const { return m_alpha_max; } bool expandResolutionFunc = true; @@ -99,20 +76,13 @@ private: MaskContainerItem m_maskContainerItem; // without serializtion SelectionProperty<ResolutionFunctionItemCatalog> m_resolutionFunction; - void updateTooltips(); - - ComboProperty m_detectorAlignment; - int m_xSize; - int m_ySize; - - VectorProperty m_normalVector; - VectorProperty m_directionVector; + int m_n_phi; + int m_n_alpha; - DoubleProperty m_width; - DoubleProperty m_height; - DoubleProperty m_u0; - DoubleProperty m_v0; - DoubleProperty m_distance; + DoubleProperty m_phi_min; + DoubleProperty m_phi_max; + DoubleProperty m_alpha_min; + DoubleProperty m_alpha_max; }; template <typename T> diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp index e3a964a9f22963b8eeaf6d1099782a101c2648f6..a60c097902311ed727b74d08bc1828ca1a27fd7d 100644 --- a/GUI/Model/Device/InstrumentItems.cpp +++ b/GUI/Model/Device/InstrumentItems.cpp @@ -681,7 +681,7 @@ GISASInstrumentItem::GISASInstrumentItem() std::vector<int> GISASInstrumentItem::shape() const { ASSERT(detectorItem()); - return {detectorItem()->xSize(), detectorItem()->ySize()}; + return {detectorItem()->nPhi(), detectorItem()->nAlpha()}; } void GISASInstrumentItem::updateToRealData(const RealItem* item) @@ -693,8 +693,8 @@ void GISASInstrumentItem::updateToRealData(const RealItem* item) if (shape().size() != data_shape.size()) throw std::runtime_error("GISAS instrument type is incompatible with passed data shape."); ASSERT(detectorItem()); - detectorItem()->setXSize(data_shape[0]); - detectorItem()->setYSize(data_shape[1]); + detectorItem()->setNPhi(data_shape[0]); + detectorItem()->setNAlpha(data_shape[1]); } Frame GISASInstrumentItem::makeFrame() const @@ -707,7 +707,7 @@ ISimulation* GISASInstrumentItem::createSimulation(const MultiLayer& sample) con const auto beam = beamItem()->createBeam(); if (withPolarizer()) beam->setPolarization(m_polarizerBlochVector); - const auto detector = detectorItem()->createDetector(*beam); + const auto detector = detectorItem()->createDetector(); if (withAnalyzer()) detector->setAnalyzer(m_analyzerBlochVector); auto* result = new ScatteringSimulation(*beam, sample, *detector); @@ -774,8 +774,7 @@ void GISASInstrumentItem::readFrom(QXmlStreamReader* r) std::unique_ptr<IDetector> GISASInstrumentItem::normalDetector() const { - const auto beam = beamItem()->createBeam(); - return detectorItem()->createDetector(*beam); + return detectorItem()->createDetector(); } void GISASInstrumentItem::importMasks(const MaskContainerItem* maskContainer) diff --git a/GUI/Model/Model/ParameterTreeUtil.cpp b/GUI/Model/Model/ParameterTreeUtil.cpp index 8ccbc095484adfd005520553a03c8208f8756467..80fdbbf2d7d9e4526d821732ac09b40eb8d34ce0 100644 --- a/GUI/Model/Model/ParameterTreeUtil.cpp +++ b/GUI/Model/Model/ParameterTreeUtil.cpp @@ -377,12 +377,13 @@ void ParameterTreeBuilder::addDetector(ParameterLabelItem* parentLabel, Detector }; auto* label = new ParameterLabelItem("Detector", parentLabel); - addParameterItem(label, detector->width()); - addParameterItem(label, detector->height()); + auto* phiLabel = new ParameterLabelItem("Phi axis", label); + addParameterItem(phiLabel, detector->phiMin()); + addParameterItem(phiLabel, detector->phiMax()); + auto* alphaLabel = new ParameterLabelItem("Alpha axis", label); + addParameterItem(alphaLabel, detector->alphaMin()); + addParameterItem(alphaLabel, detector->alphaMax()); addResolutionFunction(label); - addParameterItem(label, detector->u0()); - addParameterItem(label, detector->v0()); - addParameterItem(label, detector->distance()); } void ParameterTreeBuilder::addOffspecDetector(ParameterLabelItem* parentLabel, diff --git a/GUI/View/Instrument/DetectorEditor.cpp b/GUI/View/Instrument/DetectorEditor.cpp index e942cca0d6182aa3e234a11caddf6880de3bdf7e..f3054ed0020c333eb9bf1a4fada7260ecb3913a9 100644 --- a/GUI/View/Instrument/DetectorEditor.cpp +++ b/GUI/View/Instrument/DetectorEditor.cpp @@ -22,29 +22,6 @@ #include "GUI/View/Numeric/SafeSpinBox.h" #include <QFormLayout> -namespace { - -const std::map<FlatDetector::NominalNormal, QString> alignmentDescription = { - {FlatDetector::X, "Intersection of sample x-axis and detector"}, - {FlatDetector::T, "Intersection of direct beam and detector"}, - {FlatDetector::R, "Intersection of reflected beam and detector"}}; - -DoubleSpinBox* createSpinBox(QFormLayout* parentFormLayout, DoubleProperty& d, - DetectorEditor* parent) -{ - auto* sb = GUI::Util::createDoubleSpinBoxRow(parentFormLayout, d); - parent->connect(sb, &DoubleSpinBox::baseValueChanged, [parent, &d](double v) { - if (d.value() != v) { - d.setValue(v); - emit parent->dataChanged(); - } - }); - return sb; -} - -} // namespace - - DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) : CollapsibleGroupBox("Detector parameters", parent, instrItem->expandDetector) { @@ -59,7 +36,7 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) //... x-axis controls - auto* xAxisGroupBox = new StaticGroupBox("X axis", this); + auto* xAxisGroupBox = new StaticGroupBox("Phi axis", this); xyrow->addWidget(xAxisGroupBox); auto* xAxisFormLayout = new QFormLayout; @@ -68,25 +45,29 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) auto* xAxisNbinsSpinBox = new SafeSpinBox; xAxisFormLayout->addRow("# bins:", xAxisNbinsSpinBox); xAxisNbinsSpinBox->setRange(1, 65536); - xAxisNbinsSpinBox->setValue(detectorItem->xSize()); + xAxisNbinsSpinBox->setValue(detectorItem->nPhi()); connect(xAxisNbinsSpinBox, &QSpinBox::valueChanged, [this, detectorItem](int newValue) { - detectorItem->setXSize(newValue); + detectorItem->setNPhi(newValue); emit dataChanged(); }); - auto* widthSpinBox = new DoubleSpinBox(detectorItem->width()); - - connect(widthSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { - detectorItem->setWidth(newValue); + auto* phiMinSpinBox = new DoubleSpinBox(detectorItem->phiMin()); + xAxisFormLayout->addRow("Phi min (deg):", phiMinSpinBox); + connect(phiMinSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { + detectorItem->phiMin().setValue(newValue); emit dataChanged(); }); - xAxisFormLayout->addRow("Width (mm):", widthSpinBox); - ::createSpinBox(xAxisFormLayout, detectorItem->u0(), this); + auto* phiMaxSpinBox = new DoubleSpinBox(detectorItem->phiMax()); + xAxisFormLayout->addRow("Phi max (deg):", phiMaxSpinBox); + connect(phiMaxSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { + detectorItem->phiMax().setValue(newValue); + emit dataChanged(); + }); //... y-axis controls - auto* yAxisGroupBox = new StaticGroupBox("Y axis", this); + auto* yAxisGroupBox = new StaticGroupBox("Alpha axis", this); xyrow->addWidget(yAxisGroupBox); auto* yAxisFormLayout = new QFormLayout; @@ -95,20 +76,25 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) auto* yAxisNbinsSpinBox = new SafeSpinBox; yAxisFormLayout->addRow("# bins:", yAxisNbinsSpinBox); yAxisNbinsSpinBox->setRange(1, 65536); - yAxisNbinsSpinBox->setValue(detectorItem->ySize()); + yAxisNbinsSpinBox->setValue(detectorItem->nAlpha()); connect(yAxisNbinsSpinBox, &QSpinBox::valueChanged, [this, detectorItem](int newValue) { - detectorItem->setYSize(newValue); + detectorItem->setNAlpha(newValue); emit dataChanged(); }); - auto* heightSpinBox = new DoubleSpinBox(detectorItem->height()); - yAxisFormLayout->addRow("Height (mm):", heightSpinBox); - connect(heightSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { - detectorItem->setHeight(newValue); + auto* alphaMinSpinBox = new DoubleSpinBox(detectorItem->alphaMin()); + xAxisFormLayout->addRow("Alpha min (deg):", alphaMinSpinBox); + connect(alphaMinSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { + detectorItem->alphaMin().setValue(newValue); emit dataChanged(); }); - ::createSpinBox(yAxisFormLayout, detectorItem->v0(), this); + auto* alphaMaxSpinBox = new DoubleSpinBox(detectorItem->alphaMax()); + xAxisFormLayout->addRow("Alpha max (deg):", alphaMaxSpinBox); + connect(alphaMaxSpinBox, &DoubleSpinBox::baseValueChanged, [this, detectorItem](double newValue) { + detectorItem->alphaMax().setValue(newValue); + emit dataChanged(); + }); //... resolution controls @@ -151,26 +137,4 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) resolutionLayout->addRow("Type:", typeCombo); updateResolutionForm(); - - //... detector alignment controls - - auto* aliLine = new QHBoxLayout; - layout->addLayout(aliLine); - - auto* aliForm = new QFormLayout; - aliLine->addLayout(aliForm); - - auto* aliCombo = - GUI::Util::createComboBox([detectorItem] { return detectorItem->detectorAlignmentCombo(); }, - [this, detectorItem](const QString& t) { - detectorItem->setDetectorAlignment(t); - emit dataChanged(); - }, - true); - aliForm->addRow("Alignment:", aliCombo); - - auto* detposLayout = new QFormLayout; - aliLine->addLayout(detposLayout); - - ::createSpinBox(detposLayout, detectorItem->distance(), this); } diff --git a/Tests/Unit/GUI/TestLinkInstrument.cpp b/Tests/Unit/GUI/TestLinkInstrument.cpp index 303e04b265be12ef711287c62c0992cb2b36b4ae..2954d60cff91ae20f06d0512d835bd33260d8c31 100644 --- a/Tests/Unit/GUI/TestLinkInstrument.cpp +++ b/Tests/Unit/GUI/TestLinkInstrument.cpp @@ -52,7 +52,7 @@ TEST(TestLinkInstrument, canLinkToGisas) // changing detector binning and checking that link is destroyed auto* detectorItem = instrument->detectorItem(); - detectorItem->setXSize(10); + detectorItem->setNPhi(10); document.multiNotifier()->notifyInstrumentChanged(instrument); EXPECT_EQ(linkedRealDataItems(*document.realModel(), instrument), QList<RealItem*>());