Commit c6a70734 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

add diffDataItem to JobItem

parent 18aca57d
...@@ -59,6 +59,7 @@ JobItem::JobItem() ...@@ -59,6 +59,7 @@ JobItem::JobItem()
addProperty(P_PRESENTATION_TYPE, QVariant::Type::Invalid); addProperty(P_PRESENTATION_TYPE, QVariant::Type::Invalid);
registerTag(T_OUTPUT, 1, 1, {IntensityDataItem::M_TYPE, SpecularDataItem::M_TYPE}); registerTag(T_OUTPUT, 1, 1, {IntensityDataItem::M_TYPE, SpecularDataItem::M_TYPE});
registerTag(T_DIFF, 1, 1, {IntensityDataItem::M_TYPE, SpecularDataItem::M_TYPE});
registerTag(T_REALDATA, 1, 1, {RealDataItem::M_TYPE}); registerTag(T_REALDATA, 1, 1, {RealDataItem::M_TYPE});
registerTag(T_DATAVIEW, 1, 1, {Data1DViewItem::M_TYPE}); registerTag(T_DATAVIEW, 1, 1, {Data1DViewItem::M_TYPE});
...@@ -100,7 +101,7 @@ IntensityDataItem* JobItem::intensityDataItem() ...@@ -100,7 +101,7 @@ IntensityDataItem* JobItem::intensityDataItem()
DataItem* JobItem::dataItem() DataItem* JobItem::dataItem()
{ {
return dynamic_cast<DataItem*>(getItem(T_OUTPUT)); return dynamic_cast<DataItem*>(intensityDataItem());
} }
JobStatus JobItem::getStatus() const JobStatus JobItem::getStatus() const
...@@ -302,14 +303,14 @@ RealDataItem* JobItem::createRealDataItem() ...@@ -302,14 +303,14 @@ RealDataItem* JobItem::createRealDataItem()
return model()->insertItem<RealDataItem>(this, -1, T_REALDATA); return model()->insertItem<RealDataItem>(this, -1, T_REALDATA);
} }
Data1DViewItem* JobItem::dataItemView() DataItem* JobItem::diffDataItem()
{ {
return dynamic_cast<Data1DViewItem*>(getItem(JobItem::T_DATAVIEW)); return dynamic_cast<DataItem*>(getItem(T_DIFF));
} }
void JobItem::addDataViewItem(Data1DViewItem* data_view) Data1DViewItem* JobItem::dataItemView()
{ {
insertChild(-1, data_view, T_DATAVIEW); return dynamic_cast<Data1DViewItem*>(getItem(JobItem::T_DATAVIEW));
} }
Data1DViewItem* JobItem::createDataViewItem() Data1DViewItem* JobItem::createDataViewItem()
......
...@@ -54,6 +54,7 @@ private: ...@@ -54,6 +54,7 @@ private:
static constexpr auto P_PRESENTATION_TYPE{"Presentation type"}; static constexpr auto P_PRESENTATION_TYPE{"Presentation type"};
static constexpr auto T_MATERIAL_CONTAINER{"Material container tag"}; static constexpr auto T_MATERIAL_CONTAINER{"Material container tag"};
static constexpr auto T_OUTPUT{"Output tag"}; static constexpr auto T_OUTPUT{"Output tag"};
static constexpr auto T_DIFF{"Diff tag"};
static constexpr auto T_REALDATA{"Real Data tag"}; static constexpr auto T_REALDATA{"Real Data tag"};
static constexpr auto T_DATAVIEW{"Data View tag"}; static constexpr auto T_DATAVIEW{"Data View tag"};
static constexpr auto T_FIT_SUITE{"Fit suite tag"}; static constexpr auto T_FIT_SUITE{"Fit suite tag"};
...@@ -127,8 +128,8 @@ public: ...@@ -127,8 +128,8 @@ public:
RealDataItem* copyRealDataIntoJob(const RealDataItem* real_data); RealDataItem* copyRealDataIntoJob(const RealDataItem* real_data);
RealDataItem* createRealDataItem(); RealDataItem* createRealDataItem();
DataItem* diffDataItem();
Data1DViewItem* dataItemView(); Data1DViewItem* dataItemView();
void addDataViewItem(Data1DViewItem* data_view);
Data1DViewItem* createDataViewItem(); Data1DViewItem* createDataViewItem();
QString sampleName() const; QString sampleName() const;
...@@ -172,6 +173,7 @@ T* JobItem::setDataType() ...@@ -172,6 +173,7 @@ T* JobItem::setDataType()
{ {
static_assert(std::is_base_of<DataItem, T>::value, "Class must be derived from DataItem"); static_assert(std::is_base_of<DataItem, T>::value, "Class must be derived from DataItem");
model()->insertItem<T>(this, -1, T_DIFF);
return model()->insertItem<T>(this, -1, T_OUTPUT); return model()->insertItem<T>(this, -1, T_OUTPUT);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment