mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added support for asyncronous commands
Implemented command to issue a recompute of statistics for a statistics case on project loading p4#: 22417
This commit is contained in:
@@ -461,6 +461,7 @@ void RimStatisticsCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
else
|
||||
{
|
||||
computeStatistics();
|
||||
updateConnectedEditorsAndReservoirViews();
|
||||
}
|
||||
m_calculateEditCommand = false;
|
||||
}
|
||||
@@ -642,6 +643,28 @@ bool RimStatisticsCase::hasComputedStatistics() const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStatisticsCase::updateConnectedEditorsAndReservoirViews()
|
||||
{
|
||||
for (size_t i = 0; i < reservoirViews.size(); ++i)
|
||||
{
|
||||
if (reservoirViews[i])
|
||||
{
|
||||
// As new result might have been introduced, update all editors connected
|
||||
reservoirViews[i]->cellResult->updateConnectedEditors();
|
||||
|
||||
// It is usually not needed to create new display model, but if any derived geometry based on generated data (from Octave)
|
||||
// a full display model rebuild is required
|
||||
reservoirViews[i]->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -650,16 +673,7 @@ void RimStatisticsCase::clearComputedStatistics()
|
||||
reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->clearAllResults();
|
||||
reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS)->clearAllResults();
|
||||
|
||||
for (size_t i = 0; i < reservoirViews().size(); i++)
|
||||
{
|
||||
RimReservoirView* reservoirView = reservoirViews()[i];
|
||||
CVF_ASSERT(reservoirView);
|
||||
|
||||
reservoirView->scheduleGeometryRegen(RivReservoirViewPartMgr::ACTIVE);
|
||||
reservoirView->createDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
this->updateConnectedEditors();
|
||||
updateConnectedEditorsAndReservoirViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user