#1321 Update Flow Characteristics plot when new timesteps arrives.

Added a updateCurrentTimeStepInPlots method
Deleted obsolete ifdeffed code from main plot collection
This commit is contained in:
Jacob Støren
2017-03-29 14:02:32 +02:00
parent e998f09250
commit a97b851b6e
5 changed files with 41 additions and 190 deletions

View File

@@ -104,6 +104,22 @@ void RimFlowCharacteristicsPlot::deleteViewWidget()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFlowCharacteristicsPlot::updateCurrentTimeStep()
{
if (m_timeStepSelectionType() != ALL_AVAILABLE) return;
if (!m_flowDiagSolution()) return;
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps();
if (m_currentlyPlottedTimeSteps == calculatedTimesteps) return;
this->loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -199,7 +215,8 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* cha
if ( &m_case == changedField )
{
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
m_currentlyPlottedTimeSteps.clear();
}
// All fields update plot
@@ -251,6 +268,8 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate()
if (calculatedTimeStepsSet.count(tsIdx)) calculatedTimesteps.push_back(tsIdx);
}
}
m_currentlyPlottedTimeSteps = calculatedTimesteps;
std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
std::vector<double> lorenzVals(timeStepDates.size(), HUGE_VAL);