Skip to content
Snippets Groups Projects
Commit 02ccc681 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

JobItem: rm save/load DiffItem

parent d9a34b12
No related branches found
No related tags found
1 merge request!1293GUI: simplify save/load machinery
......@@ -56,7 +56,6 @@ const QString Status("Status");
const QString Progress("Progress");
const QString RealItem("RealItem");
const QString SimulatedData("SimulatedData");
const QString DiffData("DiffData");
const QString FitSuite("FitSuite");
} // namespace Tag
......@@ -354,7 +353,7 @@ DataItem* JobItem::simulatedDataItem()
return m_simulatedDataItem.get();
}
void JobItem::createDiffDataItem()
DataItem* JobItem::createDiffDataItem()
{
ASSERT(!diffDataItem());
m_diffDataItem.reset(createNewDataItem());
......@@ -365,6 +364,8 @@ void JobItem::createDiffDataItem()
if (isSpecularJob())
dynamic_cast<SpecularDataItem*>(diffDataItem())->setDiffPlotStyle();
return m_diffDataItem.get();
}
DataItem* JobItem::diffDataItem()
......@@ -520,13 +521,6 @@ void JobItem::writeTo(QXmlStreamWriter* w) const
w->writeEndElement();
}
// diff data
if (m_diffDataItem) {
w->writeStartElement(Tag::DiffData);
XML::writeItemAndChildItems(w, m_diffDataItem.get());
w->writeEndElement();
}
// fit suite
if (m_fitSuiteItem) {
w->writeStartElement(Tag::FitSuite);
......@@ -629,8 +623,7 @@ void JobItem::readFrom(QXmlStreamReader* r, const QString& projectDir,
// real item
} else if (tag == Tag::RealItem) {
realError = createRealItem()->readFrom(r, projectDir, messageService);
// jobItem and its realItem have to reference the same instrument
m_realItem->linkToInstrument(instrumentItem());
createDiffDataItem()->copyXYRangesFromItem(m_realItem->dataItem());
XML::gotoEndElementOfTag(r, tag);
// simulated data
......@@ -638,10 +631,6 @@ void JobItem::readFrom(QXmlStreamReader* r, const QString& projectDir,
m_simulatedDataItem.reset(readItemToEnd<DataItem>(r, this, Tag::SimulatedData));
simError = m_simulatedDataItem->loadDatafield(projectDir, messageService);
// diff data
} else if (tag == Tag::DiffData) {
m_diffDataItem.reset(readItemToEnd<DataItem>(r, this, Tag::DiffData));
// fit suite
} else if (tag == Tag::FitSuite) {
createFitSuiteItem()->readFrom(r);
......
......@@ -122,7 +122,7 @@ public:
IntensityDataItem* intensityDataItem();
DataItem* simulatedDataItem();
void createDiffDataItem();
DataItem *createDiffDataItem();
DataItem* diffDataItem();
RealItem* createRealItem();
......
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