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

test new diffItem location

parent c6a70734
......@@ -173,6 +173,7 @@ T* JobItem::setDataType()
{
static_assert(std::is_base_of<DataItem, T>::value, "Class must be derived from DataItem");
qInfo() <<
model()->insertItem<T>(this, -1, T_DIFF);
return model()->insertItem<T>(this, -1, T_OUTPUT);
}
......
......@@ -123,10 +123,10 @@ void FitComparisonController2D::clear()
DiffItemController::DiffItemController(const QString& data_type, QObject* parent)
: QObject(parent)
, m_current_item(nullptr)
, m_tempIntensityDataModel(new SessionModel("TempIntensityDataModel", this))
, m_diff_item(dynamic_cast<DataItem*>(m_tempIntensityDataModel->insertNewItem(data_type)))
// , m_tempIntensityDataModel(new SessionModel("TempIntensityDataModel", this))
// , m_diff_item(dynamic_cast<DataItem*>(m_tempIntensityDataModel->insertNewItem(data_type)))
{
ASSERT(m_diff_item);
// ASSERT(m_diff_item);
}
DiffItemController::~DiffItemController()
......@@ -137,9 +137,13 @@ DiffItemController::~DiffItemController()
void DiffItemController::setItem(JobItem* job_item)
{
ASSERT(job_item);
ASSERT(job_item->diffDataItem());
if (m_current_item)
unsubscribe();
m_current_item = job_item;
m_diff_item = job_item->diffDataItem();
subscribe();
updateDiffData();
}
......
......@@ -114,10 +114,10 @@ void FitComparison1DViewController::deleteDiffViewItem()
DiffItemController::DiffItemController(const QString& data_type, QObject* parent)
: QObject(parent)
, m_current_item(nullptr)
, m_private_model(new SessionModel("TempIntensityDataModel", this))
, m_diff_item(dynamic_cast<DataItem*>(m_private_model->insertNewItem(data_type)))
// , m_private_model(new SessionModel("TempIntensityDataModel", this))
// , m_diff_item(dynamic_cast<DataItem*>(m_private_model->insertNewItem(data_type)))
{
ASSERT(m_diff_item);
// ASSERT(m_diff_item);
}
DiffItemController::~DiffItemController()
......@@ -128,9 +128,13 @@ DiffItemController::~DiffItemController()
void DiffItemController::setJobItem(JobItem* job_item)
{
ASSERT(job_item);
ASSERT(job_item->diffDataItem());
if (m_current_item)
unsubscribe();
m_current_item = job_item;
m_diff_item = job_item->diffDataItem();
subscribe();
updateDiffData();
}
......
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