#2009 RFT Plot. Remove time step selections for untoggled sources

This commit is contained in:
Bjørn Erik Jensen
2017-10-17 13:35:12 +02:00
parent b937bc53d8
commit 339c46d39c
2 changed files with 36 additions and 2 deletions

View File

@@ -219,6 +219,33 @@ void RimWellRftPlot::applyCurveAppearance(RimWellLogCurve* newCurve)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellRftPlot::updateSelectedTimeStepsFromSelectedSources()
{
std::vector<QDateTime> selectedTimeSteps = m_selectedTimeSteps;
std::vector<QDateTime> newTimeStepsSelections;
std::vector<RimWellRftAddress> selectedSourcesVector = m_selectedSources;
auto selectedSources = std::set<RimWellRftAddress>(selectedSourcesVector.begin(), selectedSourcesVector.end());
for (const auto& timeStep : m_selectedTimeSteps())
{
if(m_timeStepsToAddresses.count(timeStep) > 0)
{
std::vector<RimWellRftAddress> intersectVector;
const auto& addresses = m_timeStepsToAddresses[timeStep];
std::set_intersection(selectedSources.begin(), selectedSources.end(),
addresses.begin(), addresses.end(), std::inserter(intersectVector, intersectVector.end()));
if(intersectVector.size() > 0)
{
newTimeStepsSelections.push_back(timeStep);
}
}
}
m_selectedTimeSteps = newTimeStepsSelections;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellRftPlot::applyInitialSelections()
{
std::vector<std::tuple<RimEclipseResultCase*, bool, bool>> eclCaseTuples = eclipseCasesForWell(m_wellName);
@@ -1022,8 +1049,14 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
m_timeStepsToAddresses.clear();
updateEditorsFromCurves();
}
else if (changedField == &m_selectedSources ||
changedField == &m_selectedTimeSteps)
else if (changedField == &m_selectedSources)
{
// Update time steps selections based on source selections
updateSelectedTimeStepsFromSelectedSources();
}
if (changedField == &m_selectedSources ||
changedField == &m_selectedTimeSteps)
{
syncCurvesFromUiSelection();
}

View File

@@ -142,6 +142,7 @@ private:
virtual void deleteViewWidget() override;
void applyCurveAppearance(RimWellLogCurve* newCurve);
void updateSelectedTimeStepsFromSelectedSources();
private:
caf::PdmField<bool> m_showPlotTitle;