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

common statements for all instrument kinds

parent b123ce5d
No related branches found
No related tags found
1 merge request!2264InstrumentLibraryDialog (ex ...Editor) now w/o parameter editor
......@@ -126,34 +126,23 @@ void InstrumentView::createWidgetsForCurrentInstrument()
//... All remaining content depends on instrument type
IComponentEditor* editor;
auto* ec = gDoc->multiNotifier();
if (auto* ii = dynamic_cast<SpecularInstrumentItem*>(currentInstrument)) {
auto* editor = new SpecularInstrumentEditor(ii, ec);
connect(editor, &SpecularInstrumentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
layout->addWidget(editor);
} else if (auto* ii = dynamic_cast<OffspecInstrumentItem*>(currentInstrument)) {
auto* editor = new OffspecInstrumentEditor(ii, ec);
connect(editor, &OffspecInstrumentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
layout->addWidget(editor);
} else if (auto* ii = dynamic_cast<GISASInstrumentItem*>(currentInstrument)) {
auto* editor = new GISASInstrumentEditor(ii);
connect(editor, &GISASInstrumentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
layout->addWidget(editor);
} else if (auto* ii = dynamic_cast<DepthprobeInstrumentItem*>(currentInstrument)) {
auto* editor = new DepthprobeInstrumentEditor(ii, ec);
connect(editor, &DepthprobeInstrumentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
layout->addWidget(editor);
} else
if (auto* ii = dynamic_cast<SpecularInstrumentItem*>(currentInstrument))
editor = new SpecularInstrumentEditor(ii, ec);
else if (auto* ii = dynamic_cast<OffspecInstrumentItem*>(currentInstrument))
editor = new OffspecInstrumentEditor(ii, ec);
else if (auto* ii = dynamic_cast<GISASInstrumentItem*>(currentInstrument))
editor = new GISASInstrumentEditor(ii);
else if (auto* ii = dynamic_cast<DepthprobeInstrumentItem*>(currentInstrument))
editor = new DepthprobeInstrumentEditor(ii, ec);
else
ASSERT_NEVER;
layout->addWidget(editor);
connect(editor, &IComponentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
m_scrollArea->setWidget(w);
}
......
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