Skip to content
Snippets Groups Projects
Commit 77f836bf authored by t.knopff's avatar t.knopff
Browse files

Make Instrument2DItem::P_DETECTOR private

parent 1b49416e
No related branches found
No related tags found
1 merge request!92Refactor model: instrument, footprint and background items
...@@ -274,6 +274,11 @@ std::unique_ptr<Instrument> Instrument2DItem::createInstrument() const ...@@ -274,6 +274,11 @@ std::unique_ptr<Instrument> Instrument2DItem::createInstrument() const
return result; return result;
} }
bool Instrument2DItem::isDetectorPropertyName(const QString& name)
{
return name == P_DETECTOR;
}
// ************************************************************************************************ // ************************************************************************************************
// class GISASInstrumentItem // class GISASInstrumentItem
......
...@@ -89,9 +89,11 @@ public: ...@@ -89,9 +89,11 @@ public:
class BA_CORE_API_ Instrument2DItem : public InstrumentItem { class BA_CORE_API_ Instrument2DItem : public InstrumentItem {
public: private:
static const QString P_DETECTOR; static const QString P_DETECTOR;
public:
~Instrument2DItem() override; ~Instrument2DItem() override;
DetectorItem* detectorItem() const; DetectorItem* detectorItem() const;
...@@ -104,6 +106,8 @@ public: ...@@ -104,6 +106,8 @@ public:
std::unique_ptr<Instrument> createInstrument() const override; std::unique_ptr<Instrument> createInstrument() const override;
static bool isDetectorPropertyName(const QString& name);
protected: protected:
explicit Instrument2DItem(const QString& modelType); explicit Instrument2DItem(const QString& modelType);
}; };
......
...@@ -37,7 +37,7 @@ void GISASDetectorEditor::subscribeToItem() ...@@ -37,7 +37,7 @@ void GISASDetectorEditor::subscribeToItem()
{ {
currentItem()->mapper()->setOnPropertyChange( currentItem()->mapper()->setOnPropertyChange(
[this](const QString& name) { [this](const QString& name) {
if (name == Instrument2DItem::P_DETECTOR) if (Instrument2DItem::isDetectorPropertyName(name))
updateDetectorPresenter(); updateDetectorPresenter();
}, },
this); this);
......
...@@ -59,7 +59,7 @@ void PolarizationAnalysisEditor::subscribeToItem() ...@@ -59,7 +59,7 @@ void PolarizationAnalysisEditor::subscribeToItem()
currentItem()->mapper()->setOnPropertyChange( currentItem()->mapper()->setOnPropertyChange(
[this](const QString& name) { [this](const QString& name) {
if (name == Instrument2DItem::P_DETECTOR) if (Instrument2DItem::isDetectorPropertyName(name))
updateAnalyserEditor(); updateAnalyserEditor();
}, },
this); this);
......
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