diff --git a/GUI/Models/JobItem.cpp b/GUI/Models/JobItem.cpp index db9fa90c4375a33f8427c1367454d5eb682dee60..be9cdeaf0435e55ef07a03a75f5de552ffe9d737 100644 --- a/GUI/Models/JobItem.cpp +++ b/GUI/Models/JobItem.cpp @@ -273,6 +273,11 @@ void JobItem::setSampleName(const QString& name) getItem(P_SAMPLE_NAME)->setValue(name); } +void JobItem::setInstrumentName(const QString& name) +{ + getItem(P_INSTRUMENT_NAME)->setValue(name); +} + //! Updates the name of file to store intensity data. void JobItem::updateIntensityDataFileName() diff --git a/GUI/Models/JobItem.h b/GUI/Models/JobItem.h index 38a594b6b02864c5aa36ad6942579431573e6c4d..878e3b3506a4cf326b56de2d82a512602f00552c 100644 --- a/GUI/Models/JobItem.h +++ b/GUI/Models/JobItem.h @@ -35,9 +35,9 @@ class BA_CORE_API_ JobItem : public SessionItem { private: static const QString P_IDENTIFIER; static const QString P_SAMPLE_NAME; + static const QString P_INSTRUMENT_NAME; public: - static const QString P_INSTRUMENT_NAME; static const QString P_WITH_FITTING; static const QString P_STATUS; static const QString P_BEGIN_TIME; @@ -110,6 +110,8 @@ public: void setSampleName(const QString& name); + void setInstrumentName(const QString& name); + private: void updateIntensityDataFileName(); const SimulationOptionsItem* simulationOptionsItem() const; diff --git a/GUI/Models/JobModelFunctions.cpp b/GUI/Models/JobModelFunctions.cpp index c18fd6ad0c868c69bd0e791079fefaf66d2eb843..f8a1591742f7663ce25c5d08416e890a542715d6 100644 --- a/GUI/Models/JobModelFunctions.cpp +++ b/GUI/Models/JobModelFunctions.cpp @@ -115,7 +115,7 @@ void JobModelFunctions::setupJobItemInstrument(JobItem* jobItem, const Instrumen auto copiedInstrument = model->copyItem(from, jobItem, JobItem::T_INSTRUMENT); copiedInstrument->setItemName(from->modelType()); copiedInstrument->setId(GUIHelpers::createUuid()); - jobItem->getItem(JobItem::P_INSTRUMENT_NAME)->setValue(from->itemName()); + jobItem->setInstrumentName(from->itemName()); auto spec_to = dynamic_cast<SpecularInstrumentItem*>(copiedInstrument); if (!spec_to)