diff --git a/GUI/View/Instrument/InstrumentLibraryEditor.cpp b/GUI/View/Instrument/InstrumentLibraryEditor.cpp index 9854fd28793014d0d70e4027276c4032ccf4e070..abda0e01b990d0095e4dd0401a4cc005269c49e6 100644 --- a/GUI/View/Instrument/InstrumentLibraryEditor.cpp +++ b/GUI/View/Instrument/InstrumentLibraryEditor.cpp @@ -221,7 +221,7 @@ void InstrumentLibraryEditor::createWidgetsForCurrentInstrument() &InstrumentLibraryEditor::onInstrumentChangedByEditor); layout->addWidget(editor); } else if (auto* os = dynamic_cast<OffspecInstrumentItem*>(currentInstrument)) { - auto* editor = new OffspecInstrumentEditor(m_ui->scrollArea, os); + auto* editor = new OffspecInstrumentEditor(m_ui->scrollArea, os, ec); connect(editor, &OffspecInstrumentEditor::dataChanged, this, &InstrumentLibraryEditor::onInstrumentChangedByEditor); layout->addWidget(editor); diff --git a/GUI/View/Instrument/InstrumentView.cpp b/GUI/View/Instrument/InstrumentView.cpp index dead4a27ec579e7fcc672040982856afcabe0bf3..f7b0ea1f226d4c76bce8fc6cd92e84ee3651e96e 100644 --- a/GUI/View/Instrument/InstrumentView.cpp +++ b/GUI/View/Instrument/InstrumentView.cpp @@ -130,7 +130,7 @@ void InstrumentView::createWidgetsForCurrentInstrument() &InstrumentView::onInstrumentChangedByEditor); layout->addWidget(editor); } else if (auto* os = dynamic_cast<OffspecInstrumentItem*>(currentInstrument)) { - auto* editor = new OffspecInstrumentEditor(m_scrollArea, os); + auto* editor = new OffspecInstrumentEditor(m_scrollArea, os, ec); connect(editor, &OffspecInstrumentEditor::dataChanged, this, &InstrumentView::onInstrumentChangedByEditor); layout->addWidget(editor); diff --git a/GUI/View/Instrument/OffspecInstrumentEditor.cpp b/GUI/View/Instrument/OffspecInstrumentEditor.cpp index 9ffb526a28670dbd6b3ab08245bca43039156801..3a672d6e1534a650cc581faecf0e6420502af2c3 100644 --- a/GUI/View/Instrument/OffspecInstrumentEditor.cpp +++ b/GUI/View/Instrument/OffspecInstrumentEditor.cpp @@ -19,8 +19,11 @@ #include "GUI/View/Instrument/PolarizationAnalysisEditor.h" -OffspecInstrumentEditor::OffspecInstrumentEditor(QWidget* parent, OffspecInstrumentItem* instrument) +OffspecInstrumentEditor::OffspecInstrumentEditor(QWidget* parent, OffspecInstrumentItem* instrument, + MultiInstrumentNotifier* ec) + : QWidget(parent) + , m_ec(ec, instrument) { ASSERT(instrument); auto* layout = new QVBoxLayout(this); diff --git a/GUI/View/Instrument/OffspecInstrumentEditor.h b/GUI/View/Instrument/OffspecInstrumentEditor.h index dda3efdcdbf83ec3b8e54752df37eddbc4335929..394aefa58d7d4aaa124a8faa3ffcb66eb7d08346 100644 --- a/GUI/View/Instrument/OffspecInstrumentEditor.h +++ b/GUI/View/Instrument/OffspecInstrumentEditor.h @@ -15,18 +15,24 @@ #ifndef BORNAGAIN_GUI_VIEW_INSTRUMENT_OFFSPECINSTRUMENTEDITOR_H #define BORNAGAIN_GUI_VIEW_INSTRUMENT_OFFSPECINSTRUMENTEDITOR_H +#include "GUI/Model/Device/InstrumentNotifier.h" #include <QWidget> +class MultiInstrumentNotifier; class OffspecInstrumentItem; class OffspecInstrumentEditor : public QWidget { Q_OBJECT public: - OffspecInstrumentEditor(QWidget* parent, OffspecInstrumentItem* instrument); + OffspecInstrumentEditor(QWidget* parent, OffspecInstrumentItem* instrument, + MultiInstrumentNotifier* ec); signals: void dataChanged(); + +private: + InstrumentNotifier m_ec; }; #endif // BORNAGAIN_GUI_VIEW_INSTRUMENT_OFFSPECINSTRUMENTEDITOR_H