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() ...@@ -126,34 +126,23 @@ void InstrumentView::createWidgetsForCurrentInstrument()
//... All remaining content depends on instrument type //... All remaining content depends on instrument type
IComponentEditor* editor;
auto* ec = gDoc->multiNotifier(); auto* ec = gDoc->multiNotifier();
if (auto* ii = dynamic_cast<SpecularInstrumentItem*>(currentInstrument)) { if (auto* ii = dynamic_cast<SpecularInstrumentItem*>(currentInstrument))
auto* editor = new SpecularInstrumentEditor(ii, ec); editor = new SpecularInstrumentEditor(ii, ec);
connect(editor, &SpecularInstrumentEditor::dataChanged, this, else if (auto* ii = dynamic_cast<OffspecInstrumentItem*>(currentInstrument))
&InstrumentView::onInstrumentChangedByEditor); editor = new OffspecInstrumentEditor(ii, ec);
layout->addWidget(editor); else if (auto* ii = dynamic_cast<GISASInstrumentItem*>(currentInstrument))
editor = new GISASInstrumentEditor(ii);
} else if (auto* ii = dynamic_cast<OffspecInstrumentItem*>(currentInstrument)) { else if (auto* ii = dynamic_cast<DepthprobeInstrumentItem*>(currentInstrument))
auto* editor = new OffspecInstrumentEditor(ii, ec); editor = new DepthprobeInstrumentEditor(ii, ec);
connect(editor, &OffspecInstrumentEditor::dataChanged, this, else
&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
ASSERT_NEVER; ASSERT_NEVER;
layout->addWidget(editor);
connect(editor, &IComponentEditor::dataChanged, this,
&InstrumentView::onInstrumentChangedByEditor);
m_scrollArea->setWidget(w); 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