Skip to content
Snippets Groups Projects
Commit c6f3a4f0 authored by Mohammad Mahadi Hasan's avatar Mohammad Mahadi Hasan
Browse files

Removed runSimulation() method and replaced the call with onCurrentLinkChanged

parent fa56d39f
No related branches found
No related tags found
No related merge requests found
......@@ -295,8 +295,7 @@ void ModelTuningWidget::updateTreeView(const QString &instrument, const QString
m_treeView->setColumnWidth(0,170);
m_treeView->expandAll();
startSimulation();
onCurrentLinkChanged(ItemLink());
}
}
......@@ -354,33 +353,18 @@ void ModelTuningWidget::onCurrentLinkChanged(ItemLink link)
return;
m_update_in_progress = true;
qDebug() << "SampleTuningWidget::onCurrentLinkChanged() -> Starting to tune model" << link.getItem()->modelType() << link.getPropertyName() << link.getValue();
link.getItem()->setRegisteredProperty(link.getPropertyName(), link.getValue());
Simulation *simulation = QuickSimulationHelper::getSimulation(m_sampleModel, m_sample_name, m_instrumentModel, m_instrument_name);
qDebug() << "SampleTuningWidget::onCurrentLinkChanged() -> Ready to run simulation";
m_simulationRunner->runSimulation(simulation);
m_update_in_progress = false;
}
void ModelTuningWidget::startSimulation()
{
Q_ASSERT(m_simulationRunner);
qDebug() << "ModelTuningWidget::startSimulation()";
if(m_simulationRunner->isSimulationInProgress())
return;
if(link.getItem())
{
qDebug() << "SampleTuningWidget::onCurrentLinkChanged() -> Starting to tune model" << link.getItem()->modelType() << link.getPropertyName() << link.getValue();
if(m_update_in_progress)
return;
link.getItem()->setRegisteredProperty(link.getPropertyName(), link.getValue());
}
m_update_in_progress = true;
Simulation *simulation = QuickSimulationHelper::getSimulation(m_sampleModel, m_sample_name, m_instrumentModel, m_instrument_name);
qDebug() << "SampleTuningWidget::onCurrentLinkChanged() -> Ready to run simulation";
m_simulationRunner->runSimulation(simulation);
......
......@@ -32,7 +32,6 @@ public:
void setQuickSimulationRunner(QuickSimulationRunner * simulationRunner);
void startSimulation();
public slots:
void onModelChanged(const QModelIndex &first, const QModelIndex &second);
......
......@@ -52,7 +52,6 @@ QuickSimulationWidget::QuickSimulationWidget(SampleModel *sampleModel, Instrumen
void QuickSimulationWidget::updateViews(const QString &instrument, const QString &sample)
{
m_modelTuningWidget->updateTreeView(instrument, sample);
m_modelTuningWidget->startSimulation();
}
......
......@@ -50,6 +50,6 @@ void SimulationView::onChangeTabWidget(int index)
}
else if(index == QuickSimulationTab)
{
//m_quickSimulationWidget->updateViews(m_simulationSetupWidget->getInstrumentSelection(), m_simulationSetupWidget->getSampleSelection());
m_quickSimulationWidget->updateViews(m_simulationSetupWidget->getInstrumentSelection(), m_simulationSetupWidget->getSampleSelection());
}
}
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