diff --git a/GUI/Model/Model/JobModel.cpp b/GUI/Model/Model/JobModel.cpp index d5b85d4389aef76e71cd04cdbac54c9363e2ecfc..608f13d0213881336e1f89a01d5e7eef57522d95 100644 --- a/GUI/Model/Model/JobModel.cpp +++ b/GUI/Model/Model/JobModel.cpp @@ -58,7 +58,7 @@ JobItem* JobModel::createJobItem() } //! Main method to add a job -JobItem* JobModel::addJob(const SampleItem* sampleItem, const InstrumentItem* instrumentItem, +JobItem* JobModel::addJobItem(const SampleItem* sampleItem, const InstrumentItem* instrumentItem, const RealItem* realItem, const SimulationOptionsItem& optionItem) { ASSERT(sampleItem); diff --git a/GUI/Model/Model/JobModel.h b/GUI/Model/Model/JobModel.h index 18d2384f82273f21103d74a3b9b3b442afb0cd95..99b23d5cfaba60680b3241876e63059430856572 100644 --- a/GUI/Model/Model/JobModel.h +++ b/GUI/Model/Model/JobModel.h @@ -35,7 +35,7 @@ public: JobItem* getJobItemForIdentifier(const QString& identifier); JobItem* createJobItem(); - JobItem* addJob(const SampleItem* sampleItem, const InstrumentItem* instrumentItem, + JobItem* addJobItem(const SampleItem* sampleItem, const InstrumentItem* instrumentItem, const RealItem* realItem, const SimulationOptionsItem& optionItem); QVector<JobItem*> jobItems() const; diff --git a/GUI/Model/Model/ParameterTreeUtils.cpp b/GUI/Model/Model/ParameterTreeUtils.cpp index a59ceb46c0d243c7712d690c3ca231012733b019..a8470dbe7409dd6eddc3a1f68aa2d3d3a8bd57bc 100644 --- a/GUI/Model/Model/ParameterTreeUtils.cpp +++ b/GUI/Model/Model/ParameterTreeUtils.cpp @@ -90,7 +90,7 @@ void ParameterTreeBuilder::build() void ParameterTreeBuilder::addMaterials() { auto* materialTopLabel = - new ParameterLabelItem("Materials", parameterContainer()->parameterTreeRoot()); + new ParameterLabelItem("Materials", parameterContainerItem()->parameterTreeRoot()); for (auto* item : m_jobItem->sampleItem()->materialModel().materialItems()) { auto* label = new ParameterLabelItem(item->matItemName(), materialTopLabel); if (item->hasRefractiveIndex()) { @@ -108,7 +108,7 @@ void ParameterTreeBuilder::addMaterials() void ParameterTreeBuilder::addSample() { - auto* label = new ParameterLabelItem("Sample", parameterContainer()->parameterTreeRoot()); + auto* label = new ParameterLabelItem("Sample", parameterContainerItem()->parameterTreeRoot()); addParameterItem(label, m_jobItem->sampleItem()->crossCorrLength()); if (allowMagneticFields()) addParameterItem(label, m_jobItem->sampleItem()->externalField()); @@ -157,7 +157,7 @@ void ParameterTreeBuilder::addParameterItem(ParameterLabelItem* parent, VectorPr addParameterItem(label, d.z()); } -ParameterContainerItem* ParameterTreeBuilder::parameterContainer() +ParameterContainerItem* ParameterTreeBuilder::parameterContainerItem() { return m_jobItem->parameterContainerItem(); } @@ -308,7 +308,7 @@ void ParameterTreeBuilder::addInstrument() { auto* instrument = m_jobItem->instrumentItem(); auto* label = new ParameterLabelItem(instrument->instrumentType() + " instrument", - parameterContainer()->parameterTreeRoot()); + parameterContainerItem()->parameterTreeRoot()); auto* beamItem = instrument->beamItem(); if (auto* gisas = dynamic_cast<const GISASInstrumentItem*>(instrument)) { diff --git a/GUI/Model/Model/ParameterTreeUtils.h b/GUI/Model/Model/ParameterTreeUtils.h index 461b315f076497deadaaa3b87f02ebf3b3d4a0d6..1f1a76f097024cf117335e8082e7d9e6ba6647b9 100644 --- a/GUI/Model/Model/ParameterTreeUtils.h +++ b/GUI/Model/Model/ParameterTreeUtils.h @@ -55,7 +55,7 @@ private: void addParameterItem(ParameterLabelItem* parent, DoubleProperty& d, const QString& label = QString()); void addParameterItem(ParameterLabelItem* parent, VectorProperty& d); - ParameterContainerItem* parameterContainer(); + ParameterContainerItem* parameterContainerItem(); bool allowMagneticFields() const; void addInterference(ParameterLabelItem* layoutLabel, const ParticleLayoutItem* layout); diff --git a/GUI/Model/Project/ProjectDocument.cpp b/GUI/Model/Project/ProjectDocument.cpp index 460431cfe1e1fc80b2968c66b269669ccb820a6b..d4d253d982f249595dabd894c01fd186cf1dfa97 100644 --- a/GUI/Model/Project/ProjectDocument.cpp +++ b/GUI/Model/Project/ProjectDocument.cpp @@ -125,7 +125,7 @@ InstrumentCollection* ProjectDocument::collectedItems() const return const_cast<InstrumentCollection*>(&m_instruments); } -SampleModel* ProjectDocument::sampleItems() +SampleModel* ProjectDocument::sampleModel() { return &m_sampleItems; } diff --git a/GUI/Model/Project/ProjectDocument.h b/GUI/Model/Project/ProjectDocument.h index 0bc28d58c4b5b955665662f6e0282be7ee5e82c5..e035c8466982cb48ea9dee542edf4f7f991bff18 100644 --- a/GUI/Model/Project/ProjectDocument.h +++ b/GUI/Model/Project/ProjectDocument.h @@ -71,7 +71,7 @@ public: void setProjectFileName(const QString& projectFileName); InstrumentCollection* collectedItems() const; - SampleModel* sampleItems(); + SampleModel* sampleModel(); RealModel* realModel() const; JobModel* jobModel() const; SimulationOptionsItem* simulationOptionsItem(); diff --git a/GUI/View/SampleDesigner/SampleListView.cpp b/GUI/View/SampleDesigner/SampleListView.cpp index 913b0ca5e8471e4009f102f03bb6c1502b709785..8542b4cb493df9f72aedefa13f3da946c6075de7 100644 --- a/GUI/View/SampleDesigner/SampleListView.cpp +++ b/GUI/View/SampleDesigner/SampleListView.cpp @@ -65,7 +65,7 @@ SampleListView::SampleListView(QWidget* parent, ProjectDocument* document) : QListView(parent) , m_document(document) { - m_model = new SampleListModel(this, document->sampleItems()); + m_model = new SampleListModel(this, document->sampleModel()); setContextMenuPolicy(Qt::CustomContextMenu); setModel(m_model); @@ -139,9 +139,9 @@ SampleItem* SampleListView::currentSample() void SampleListView::selectFirstSample() { - if (m_document->sampleItems()->sampleItems().isEmpty()) + if (m_document->sampleModel()->sampleItems().isEmpty()) return; - setCurrentSample(m_document->sampleItems()->sampleItems()[0]); + setCurrentSample(m_document->sampleModel()->sampleItems()[0]); } QAction* SampleListView::newSampleAction() diff --git a/GUI/View/Toplevel/ProjectSettingsView.cpp b/GUI/View/Toplevel/ProjectSettingsView.cpp index 5763ba0cd252f52e81f2373fb6c77bfe9bb9d5ef..5846b1214a672f015d81c855895ade0ef2f26432 100644 --- a/GUI/View/Toplevel/ProjectSettingsView.cpp +++ b/GUI/View/Toplevel/ProjectSettingsView.cpp @@ -136,7 +136,7 @@ void ProjectSettingsView::onSingleInstrumentRadioToggled(bool newState) void ProjectSettingsView::onSingleSampleRadioToggled(bool newState) { if (newState) { - if (m_document->sampleItems()->sampleItems().size() > 1) { + if (m_document->sampleModel()->sampleItems().size() > 1) { QMessageBox::warning(this, "Select single sample mode", "This project already contains more than one sample. Changing " "this setting is not possible."); diff --git a/GUI/View/Toplevel/SimulationView.cpp b/GUI/View/Toplevel/SimulationView.cpp index 77d9655ef582f73bc95605ad0d52d95b0b8f8eea..f6fc3e30355970e4f6c2293b5d9615efe68e7683 100644 --- a/GUI/View/Toplevel/SimulationView.cpp +++ b/GUI/View/Toplevel/SimulationView.cpp @@ -107,7 +107,7 @@ void SimulationView::writeOptionsToUI() // -- selection group updateSelection(m_ui->instrumentCombo, m_document->collectedItems()->instrumentNames()); - updateSelection(m_ui->sampleCombo, m_document->sampleItems()->sampleNames()); + updateSelection(m_ui->sampleCombo, m_document->sampleModel()->sampleNames()); updateSelection(m_ui->realDataCombo, m_document->realModel()->realItemNames(), true); // -- options group @@ -150,7 +150,7 @@ void SimulationView::simulate() return; } JobModel* jobModel = m_document->jobModel(); - JobItem* jobItem = jobModel->addJob(selectedSample(), selectedInstrument(), selectedRealData(), + JobItem* jobItem = jobModel->addJobItem(selectedSample(), selectedInstrument(), selectedRealData(), *optionsItem()); jobModel->runJob(jobItem); } @@ -239,7 +239,7 @@ void SimulationView::updateFunctionalityNarrowing() QVector<SampleItem*> SimulationView::sampleItems() const { - return m_document->sampleItems()->sampleItems(); + return m_document->sampleModel()->sampleItems(); } QVector<InstrumentItem*> SimulationView::collectedItems() const