mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2158 Curve Address Selection : Select first case as default
This commit is contained in:
parent
a07205c047
commit
1918a70d21
@ -298,10 +298,16 @@ void RiuSummaryCurveDefSelection::setSelectedCurveDefinitions(const std::vector<
|
|||||||
RimSummaryCase* summaryCase = caseAddressPair.summaryCase();
|
RimSummaryCase* summaryCase = caseAddressPair.summaryCase();
|
||||||
if (!summaryCase) continue;
|
if (!summaryCase) continue;
|
||||||
|
|
||||||
const RifEclipseSummaryAddress& summaryAddress = caseAddressPair.summaryAddress();
|
RifEclipseSummaryAddress summaryAddress = caseAddressPair.summaryAddress();
|
||||||
|
if (summaryAddress.category() == RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||||
|
{
|
||||||
|
// If we have an invalid address, set the default adress to Field
|
||||||
|
summaryAddress = RifEclipseSummaryAddress::fieldVarAddress(summaryAddress.quantityName());
|
||||||
|
}
|
||||||
|
|
||||||
// Select summary category if not already selected
|
// Select summary category if not already selected
|
||||||
auto& selectedCategories = m_selectedSummaryCategories();
|
auto& selectedCategories = m_selectedSummaryCategories();
|
||||||
|
|
||||||
if (std::find(selectedCategories.begin(), selectedCategories.end(),
|
if (std::find(selectedCategories.begin(), selectedCategories.end(),
|
||||||
summaryAddress.category()) == selectedCategories.end())
|
summaryAddress.category()) == selectedCategories.end())
|
||||||
{
|
{
|
||||||
@ -310,7 +316,7 @@ void RiuSummaryCurveDefSelection::setSelectedCurveDefinitions(const std::vector<
|
|||||||
|
|
||||||
if (curveDefinitions.size() == 1)
|
if (curveDefinitions.size() == 1)
|
||||||
{
|
{
|
||||||
m_currentSummaryCategory = curveDefinitions[0].summaryAddress().category();
|
m_currentSummaryCategory = summaryAddress.category();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select case if not already selected
|
// Select case if not already selected
|
||||||
|
@ -74,7 +74,7 @@ RiuSummaryCurveDefSelectionDialog::~RiuSummaryCurveDefSelectionDialog()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuSummaryCurveDefSelectionDialog::setCaseAndAddress(RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& address)
|
void RiuSummaryCurveDefSelectionDialog::setCaseAndAddress(RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& address)
|
||||||
{
|
{
|
||||||
if (summaryCase && address.isValid())
|
if (summaryCase)
|
||||||
{
|
{
|
||||||
std::vector<RiaSummaryCurveDefinition> sumCasePairs;
|
std::vector<RiaSummaryCurveDefinition> sumCasePairs;
|
||||||
sumCasePairs.push_back(RiaSummaryCurveDefinition(summaryCase, address));
|
sumCasePairs.push_back(RiaSummaryCurveDefinition(summaryCase, address));
|
||||||
|
Loading…
Reference in New Issue
Block a user