mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4729 Ensemble RFT: Keep matching sources when switching well
This commit is contained in:
parent
4709bb1402
commit
e242304b4d
@ -287,6 +287,42 @@ void RimWellRftPlot::applyInitialSelections()
|
||||
syncCurvesFromUiSelection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::updateEditorsFromPreviousSelection()
|
||||
{
|
||||
std::set<RifDataSourceForRftPlt> previousSources( m_selectedSources().begin(), m_selectedSources().end() );
|
||||
std::set<QDateTime> previousTimeSteps( m_selectedTimeSteps().begin(), m_selectedTimeSteps().end() );
|
||||
|
||||
m_selectedSources.v().clear();
|
||||
m_selectedTimeSteps.v().clear();
|
||||
|
||||
bool dummy = false;
|
||||
auto dataSourceOptions = calculateValueOptions( &m_selectedSources, &dummy );
|
||||
for ( auto dataSourceOption : dataSourceOptions )
|
||||
{
|
||||
if ( dataSourceOption.level() == 1 )
|
||||
{
|
||||
RifDataSourceForRftPlt dataSource = dataSourceOption.value().value<RifDataSourceForRftPlt>();
|
||||
if ( previousSources.count( dataSource ) )
|
||||
{
|
||||
m_selectedSources.v().push_back( dataSource );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto timeStepOptions = calculateValueOptions( &m_selectedTimeSteps, &dummy );
|
||||
for ( auto timeStepOption : timeStepOptions )
|
||||
{
|
||||
QDateTime timeStep = timeStepOption.value().toDateTime();
|
||||
if ( previousTimeSteps.count( timeStep ) )
|
||||
{
|
||||
m_selectedTimeSteps.v().push_back( timeStep );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -785,8 +821,9 @@ void RimWellRftPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
plotTrack->deleteAllCurves();
|
||||
}
|
||||
|
||||
updateEditorsFromCurves();
|
||||
updateEditorsFromPreviousSelection();
|
||||
updateFormationsOnPlot();
|
||||
syncCurvesFromUiSelection();
|
||||
}
|
||||
else if ( changedField == &m_branchIndex || changedField == &m_branchDetection )
|
||||
{
|
||||
|
@ -102,6 +102,7 @@ protected:
|
||||
|
||||
private:
|
||||
std::map<QString, QStringList> findWellSources();
|
||||
void updateEditorsFromPreviousSelection();
|
||||
void updateEditorsFromCurves();
|
||||
void syncCurvesFromUiSelection();
|
||||
void assignWellPathToExtractionCurves();
|
||||
@ -140,8 +141,7 @@ private:
|
||||
caf::PdmField<bool> m_showErrorInObservedData;
|
||||
|
||||
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
|
||||
|
||||
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
|
||||
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
|
||||
|
||||
caf::PdmPtrField<RimWellPathCollection*> m_wellPathCollection;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user